scripts reorganize

This commit is contained in:
2026-10-06 22:34:05 +02:00
parent a2a056a68d
commit 0734bee219
60 changed files with 824 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
case Hyprland
hyprctl dispatch 'hl.dsp.focus({ direction = "left" })'
for i in (ls | grep "$argv[1]")
sleep 0.05
copy "$i"
sleep 0.05
hyprctl dispatch 'hl.dsp.send_shortcut({ mods = "CTRL", key = "v" })'
end

View File

@@ -0,0 +1,6 @@
switch "$XDG_SESSION_TYPE"
case wayland
echo "file://$(realpath -- "$argv")" | wl-copy -t text/uri-list
case x11
echo "file://$(realpath -- "$argv")" | xclip -i -selection clipboard -t text/uri-list
end

View File

@@ -0,0 +1,9 @@
if test -z "$argv[1]"
set dir '.'
else
set dir "$argv[1]"
end
for i in (find "$dir" -maxdepth 1 -type d )
set b (find "$i" -type f| wc -l)
printf "%d/%s\n" $b (basename "$i")
end | sort -nr | column -ts/

View File

@@ -0,0 +1,4 @@
set dest "$(fzf)"
if test $status -eq 0
cd "$(realpath (dirname "$dest"))"
end

View File

@@ -0,0 +1,3 @@
string match -qr '^(exit|ls$|clear)' -- $argv
and history delete --exact --case-sensitive -- (string trim -r $argv)

View File

@@ -0,0 +1 @@
rename.sh "$argv"

View File

@@ -0,0 +1,5 @@
if test -n "$argv"
eval "nix-shell --run fish -p" (string join -- " -p " $argv)
else
nix-shell --run fish
end

View File

@@ -0,0 +1,2 @@
echo (cat -- "$argv")
fish -c (cat -- "$argv")

View File

@@ -0,0 +1,6 @@
if test -n "$argv[2]"
echo (cat -- "$argv[1]" | sed -n $argv[2]p)
fish -c (cat -- "$argv[1]" | sed -n $argv[2]p)
else
cat -n -- "$argv[1]"
end

View File

@@ -0,0 +1,2 @@
tr -dc A-Za-z0-9 </dev/urandom | head -c 32
echo

View File

@@ -0,0 +1 @@
perl -e 'foreach $a(@ARGV){print "\e[48:2::".join(":",unpack("C*",pack("H*",$a)))."m \e[49m "};print "\n"' "$argv"

View File

@@ -0,0 +1,6 @@
if test "$argv" = !!
echo sudo $history[1]
eval command sudo $history[1]
else
command sudo $argv
end

View File

@@ -0,0 +1,7 @@
if set -q TMUX
set -l name (tmux display -p '#{session_name}')
if test -n "$name"; and string match -qr '^[0-9]+' -- $name
set num (string match -rim 1 "[0-9]*" -- $name)
tmux rename-session "$num: cmd: $argv[1]" 2>/dev/null
end
end

View File

@@ -0,0 +1,7 @@
set tempfile (mktemp -t "yazi-cwd.XXX")
command yazi $argv --cwd-file=$tempfile
if read -z cwd < "$tempfile"; and [ "$cwd" != "$PWD" ]; and test -d "$cwd"
builtin cd -- "$cwd"
end
command rm -f -- "$tempfile"