1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-12-23 21:56:45 +00:00
dotfiles/bin/aliases

139 lines
5.1 KiB
Fish
Executable file

#!/usr/bin/fish
rm -r ~/.config/fish/*
ln -s ../../.dotfiles/fish/config.fish ~/.config/fish
curl -sL https://git.io/fisher | source
fisher install {jorgebucaran/replay,PatrickF1/fzf}.fish
set -U fish_features 3.{0,1,4}
fish_update_completions
alias a 'alias -s'
a acmus 'timeout (math 60 - (date +%M))m mpv --loop https://acmusicext.com/static/$argv/sunny/(date +%-I%P).ogg'
a aliases 'v (env which aliases); command aliases'
a all2jxl 'fd -e{png,jpg,ppm} -x cjxl -e 8 -d 0 {} {.}.jxl \; -x rm'
a ao3 'grep works/.\*/b $argv | cut -d/ -f3 | parallel curl -OJL ao3.org/downloads/{}/1.epub;:'
a awall 'xwinwrap -ni -fdt -fs -- mpv -wid WID ~/Pictures/Awall/$argv* --profile=wallpaper'
a base64d 'echo (echo $argv | base64 -d 2>/dev/null) | tee /dev/stderr 2>| clip;:'
a catbox 'curl https://catbox.moe/user/api.php -F reqtype=fileupload -F fileToUpload=@$argv;:'
a clip 'xclip -sel clip'
a cpugov 's cpupower frequency-set -g performance'
a dirdl 'wget -r -k -p -np -e robots=off'
a dl 'not test "$argv" && cd ~/Downloads || aria2c -c -{j,s,x}16'
a drivedl 'dl https://docs.google.com/uc?export=download&id=(echo $argv | cut -d/ -f6)&confirm=t'
a dot 'cd ~/.dotfiles'
a epubpack 'cd $argv && zip -0rX ../(basename $argv).epub mimetype *; cd ..;:'
a ff 'fd -HILi -Edosdevices -E.git'
a g git
a giveme 's chown $USER'
a gsopti 'fd -e pdf -x gs -sDEVICE=pdfwrite -dNOPAUSE -sOutputFile={}1 {} \; -x mv {}1 {}'
a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
a imgsum 'printf "$argv: " && identify -format "%#\n"'
a l ls
a la 'l -A'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
a listen 'pactl list | grep loop && set t un; pactl "$t"load-module module-loopback'
a nix 'replay . ~/.nix-profile/etc/profile.d/nix.sh; command nix'
a nsp 'netsurf (pandoc $argv -s -t html | psub -s .html);:'
a nsmd 'netsurf (md2html $argv | psub -s .html);:'
a off shutdown
a open xdg-open
a png2webp 'fd -e png -x cwebp -z 9 -mt {} -o {.}.webp \; -x rm'
a qutainer 'qutebrowser --temp-basedir'
a rmdirs 'ff -t d -x rmdir -p'
a rmlinks 'ff -t l -x rm'
a qb 'qutebrowser --target auto'
a re 'systemctl reboot -i'
a s 'sudo env "PATH=$PATH"'
a se 's eopkg'
a tar bsdtar
a tcsv 'curl -sL http://torrents-csv.ml/service/search?q=$argv | jq ".[]|.name,.infohash,.seeders";:'
a temp 'curl temp.sh -T'
a tldr 'curl -s https://raw.githubusercontent.com/tldr-pages/tldr/main/pages/{common,linux}/$argv.md;:'
a transfer 'curl https://transfer.sh/(basename $argv) -T'
a uneopkg 'parallel "unzip -op {} install.tar.xz | tar xf -" ::: *.eopkg'
a up 'se up --y'
a v vi
a venv 'python3 -m venv venv && source venv/bin/activate.fish && pip3 install -r requirements.txt'
a vi nvim
a wallp 'gsettings set org.gnome.desktop.background picture-uri file://(realpath $argv);:'
a wm 'startx (which $argv[1]) $argv[2..-1]'
a ydl 'yt-dlp'
a 7zstd '7z a -m0=zstd -mx22 -mmt=8 -mfb=273 -md=256m -ms=on (realpath $argv[1]).7z'
a compress '7z a -m0=flzma2 -mx9 -mmt=8 -mfb=273 -md=256m -ms=on (realpath $argv[1]).7z'
a dwarf 'mkdwarfs -i . -o $PWD.dwarfs -f'
a dwarfmount 'dwarfs -f $argv (mktemp -d | tee /dev/tty /dev/stderr 2>| clip);:'
a dwarfs 'dwarfs -o offset=auto -o tidy_strategy=swap'
a dwarfs2null 'dwarfsextract -o /dev/null -f gnutar -i'
a dwarfs2tar 'dwarfsextract -o dwarfs-root.tar -f gnutar -i'
a redwarf 'mkdwarfs -o redwarf.dwarfs --recompress -i'
a squash 'mksquashfs . $PWD.squashfs -comp zstd -b 1M -Xcompression-level 22'
a undwarfs 'mkdir dwarfs-root; dwarfsextract -o dwarfs-root -i'
a xcompress 'fxz -T0 -9 -k'
for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1)
a $i "qutebrowser / \":open $i\""
end
for i in deemix diffoscope encodec lightnovel-crawler mandown mathicsscript nsz ratarmount scdl soundscrape spleeter
a $i "pipx run $i"
end
a mathics 'pipx run --spec mathics-django mathicsserver'
function alpine
set url https://dl-cdn.alpinelinux.org/alpine/edge/releases/x86_64/
set file (curl $url | grep s-2 | tac | sed -n 3p | cut -d\" -f2)
mkdir alpine; curl $url/$file | tar xf - -Calpine
cp /etc/resolv.conf alpine/etc
proot -r alpine
end
funcsave alpine
function record
set recfile /tmp/fish_$fish_pid\_$(date +%s.%N)
set -g --append recfiles $recfile
set -g --append reclines "$argv"
set -g --append recfolds $PWD
if test (type -t $argv[1]) = file
script -efq $recfile -c "$argv"
else
script -efq $recfile -c "fish -c '$argv'"
end
zstdmt -c $recfile &| sponge $recfile
function rmrec_(basename $recfile) --on-event fish_exit -V recfile
rm $recfile
end
end
funcsave record
function listrecords
for i in (seq (count $recfiles))
echo $i: $recfiles[$i]
printf \t; date -d @(echo $recfiles[$i] | cut -d_ -f3)
echo \t$reclines[$i]
echo \t$recfolds[$i]
end
end
funcsave listrecords
function viewrecord
if test $argv
set num $argv
else
listrecords
echo Input the number of the desired recording:
set num (read)
end
if test $KITTY_PID
kitty @ launch --type=tab --hold zstdcat $recfiles[$num]
else
clear
zstdcat $recfiles[$num]
end
end
funcsave viewrecord