Update FZGO scripts
This commit is contained in:
parent
d600d01515
commit
d47afbf174
26
flake.lock
26
flake.lock
|
@ -99,11 +99,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726214280,
|
"lastModified": 1726308872,
|
||||||
"narHash": "sha256-LqeIwfMuvAXV3DPZpd6BgOk/YfcJJyu5eredE/tEsJE=",
|
"narHash": "sha256-d4vwO5N4RsLnCY7k5tY9xbdYDWQsY3RDMeUoIa4ms2A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "433e686675ba24176fe3383916a4bd1c9799c676",
|
"rev": "6c1a461a444e6ccb3f3e42bb627b510c3a722a57",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -153,11 +153,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726159284,
|
"lastModified": 1726246604,
|
||||||
"narHash": "sha256-6xatk6CPY1F6xHF1gLGz7QExftEhV8Q5fI4BqVBVF3U=",
|
"narHash": "sha256-cScS34F71HzhIUeMScfKrT7iSZA0tr8pGIjOqHF+ue8=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "118be4dea048df88fd21b84580fe62950c868c8f",
|
"rev": "d35e70a8c6599bb058cf86eb87c783ce1cf72471",
|
||||||
"revCount": 5215,
|
"revCount": 5218,
|
||||||
"submodules": true,
|
"submodules": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hyprwm/Hyprland"
|
"url": "https://github.com/hyprwm/Hyprland"
|
||||||
|
@ -339,11 +339,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725983898,
|
"lastModified": 1726062873,
|
||||||
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
|
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
|
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -355,11 +355,11 @@
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726217085,
|
"lastModified": 1726321580,
|
||||||
"narHash": "sha256-EsQyLlP5EYmNtqNKSqbaM5wsEbdwK0K1IIf1IzaEcgc=",
|
"narHash": "sha256-nJDp7hN8VAkO62b72d4PGEe9tIl9bn1dn8yIkr9FeCU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "1f7e95b366b101ffd752e196d18a313d05878dac",
|
"rev": "49761a5e726649905d015b3b41295ea7fe3d0d71",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -19,28 +19,31 @@ function find_local() {
|
||||||
|
|
||||||
function find_global() {
|
function find_global() {
|
||||||
file_type=$1
|
file_type=$1
|
||||||
FZY_CACHE=~/.cache/fzy_paths_$file_type
|
mkdir -p ~/.cache/fzgo_paths
|
||||||
if [ -f $FZY_CACHE ]; then
|
FZGO_CACHE=~/.cache/fzgo_paths/$file_type
|
||||||
if [ $(stat -c %Y $FZY_CACHE) -lt $(date +%s -d '-1 day') ]; then
|
FZGO_RECENTS=~/.cache/fzgo_paths/recents_$file_type
|
||||||
rm $FZY_CACHE
|
if [ -f $FZGO_CACHE ]; then
|
||||||
|
if [ $(stat -c %Y $FZGO_CACHE) -lt $(date +%s -d '-1 day') ]; then
|
||||||
|
rm $FZGO_CACHE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -f $FZY_CACHE ]; then
|
if [ ! -f $FZGO_CACHE ]; then
|
||||||
PATHS=""
|
PATHS=""
|
||||||
for i in "$LOCAL_SEARCH_DIRS[@]"; do
|
for i in "$LOCAL_SEARCH_DIRS[@]"; do
|
||||||
if [ -d $i ]; then
|
if [ -d "$i" ]; then
|
||||||
PATHS="$PATHS\n$i\n$(fd . $i -t $file_type)"
|
PATHS="$PATHS\n$i\n$(fd . $i -t $file_type)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
for i in "$REMOTE_SEARCH_DIRS[@]"; do
|
for i in "$REMOTE_SEARCH_DIRS[@]"; do
|
||||||
if [ -d $i ]; then
|
if [ -d "$i" ]; then
|
||||||
PATHS="$PATHS\n$i\n$(ssh mallorea fd . \"$i\" -t $file_type -d 8)"
|
PATHS="$PATHS\n$i\n$(ssh mallorea fd . \"$i\" -t $file_type -d 8)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "$PATHS" > $FZY_CACHE
|
echo "$PATHS" > $FZGO_CACHE
|
||||||
fi
|
fi
|
||||||
file="$(fzgo < $FZY_CACHE)"
|
touch $FZGO_RECENTS
|
||||||
echo "$file" | cat - $FZY_CACHE | awk '!x[$0]++' > /tmp/fzy_paths_$file_type && mv /tmp/fzy_paths_$file_type $FZY_CACHE
|
file="$(cat $FZGO_RECENTS $FZGO_CACHE | awk '!x[$0]++' | fzgo)"
|
||||||
|
echo "$file" | cat - $FZGO_RECENTS | awk '!x[$0]++' > /tmp/fzgo_paths_recents_$file_type && mv /tmp/fzgo_paths_recents_$file_type $FZGO_RECENTS
|
||||||
echo "$file"
|
echo "$file"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue