mv: fish functions
This commit is contained in:
1 parent
b3f3902737
commit
758b6886bd
17 files changed
+5
-3
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
@@ -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/
|
||||
@@ -0,0 +1,4 @@
|
||||
set dest "$(fzf)"
|
||||
if test $status -eq 0
|
||||
cd "$(realpath (dirname "$dest"))"
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
string match -qr '^(exit|ls$|clear)' -- $argv
|
||||
and history delete --exact --case-sensitive -- (string trim -r $argv)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
rename.sh "$argv"
|
||||
@@ -0,0 +1,5 @@
|
||||
if test -n "$argv"
|
||||
eval "nix-shell --run fish -p" (string join -- " -p " $argv)
|
||||
else
|
||||
nix-shell --run fish
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
set tempfile '/tmp/chosendir'
|
||||
command ranger --choosedir=$tempfile (pwd) $argv
|
||||
|
||||
if test -f $tempfile
|
||||
if [ (cat $tempfile) != (pwd) ]
|
||||
cd (cat $tempfile)
|
||||
end
|
||||
end
|
||||
|
||||
rm -f $tempfile
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
echo (cat -- "$argv")
|
||||
fish -c (cat -- "$argv")
|
||||
@@ -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
|
||||
@@ -0,0 +1,2 @@
|
||||
tr -dc A-Za-z0-9 </dev/urandom | head -c 32
|
||||
echo
|
||||
@@ -0,0 +1 @@
|
||||
perl -e 'foreach $a(@ARGV){print "\e[48:2::".join(":",unpack("C*",pack("H*",$a)))."m \e[49m "};print "\n"' "$argv"
|
||||
@@ -0,0 +1,6 @@
|
||||
if test "$argv" = !!
|
||||
echo sudo $history[1]
|
||||
eval command sudo $history[1]
|
||||
else
|
||||
command sudo $argv
|
||||
end
|
||||
@@ -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
|
||||
@@ -0,0 +1,10 @@
|
||||
set tempfile /tmp/chosendir
|
||||
command yazi cwd-file=$tempfile (pwd) $argv
|
||||
|
||||
if test -f $tempfile
|
||||
if [ (cat $tempfile) != (pwd) ]
|
||||
cd (cat $tempfile)
|
||||
end
|
||||
end
|
||||
|
||||
rm -f $tempfile
|
||||