1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-11-27 22:55:50 +00:00

Fish: move more functions/binaries to aliases

This commit is contained in:
Phantop 2021-08-09 20:46:26 -04:00
parent 5ba2e4fbf3
commit 2fcdc01842
11 changed files with 16 additions and 39 deletions

View file

@ -86,8 +86,3 @@ shopt -s cdable_vars
#aliases
eval alias $(fish -c alias | cut -d' ' -f2- | sed 's/ /=/')
#functions
dl(){
[[ "$#" -ge 1 ]] && aria2c -c -x16 -s16 $argv || cd ~/Downloads/
}

View file

@ -1,3 +0,0 @@
function dl -w aria2c
test "$argv" && aria2c -c -x16 -s16 $argv || cd ~/Downloads
end

View file

@ -1,3 +0,0 @@
function wm -w startx
startx (which $argv[1]) $argv[2..-1]
end

View file

@ -4,10 +4,11 @@ alias a 'alias -s'
a D 'cd $D'
a aliases 'v (which aliases); command aliases'
a bax 'source (which bax) && bax'
a clip 'xclip -sel clip'
a cpugov 's cpupower frequency-set -g performance'
a dirdl 'wget -r -k -p --no-parent --no-clobber -e robots=off'
a dl 'not test "$argv" && cd ~/Downloads || aria2c -c -x16 -s16'
a dot 'cd ~/.dotfiles'
a ex exit
a ff 'fd -HILi -Edosdevices -E.git'
a g git
a giveme 's chown $USER'
@ -15,21 +16,28 @@ 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 less 'eval $PAGER'
a off shutdown
a open rifle
a pagedl 'wget -H -k -p --no-clobber -e robots=off'
a png2webp 'fd -e png -x cwebp -z 9 -mt {} -o {.}.webp && fd -e png -x rm'
a qutainer 'qutebrowser -B /tmp'
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 spleet 'spleeter && command spleeter separate -o . -c flac'
a spleet 'spleeter separate -o . -c flac'
a up 'se up --y'
a v vi
a vi nvim
a wm 'startx (which $argv[1] && set -e argv[1])'
a ao3 'egrep works/[0-9]+ $argv -o | uniq | tr -d a-z | parallel aria2c "https://ao3.org/downloads{}/\*.epub" -d ao3; rm'
a invid 'tmux new -s 0 -d "cd ~/.invid; git pull; docker-compose up --build"'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
a listen 'pactl list short modules | grep loopback && pactl unload-module module-loopback || pactl load-module module-loopback'
a symlinks 'fd -td -d1 . $D -x sh -c "rm ~/{/}; rmdir ~/{/}; ln -s {} ~/{/}"'
a ydl 'youtube-dl -ciw --write-sub --write-auto-sub --embed-subs --sub-lang=en -o "%(title)s.%(ext)s"'
a compress '7z a -m0=flzma2 -mx9 -mmt=8 -mfb=273 -md=256m -ms=on (realpath $argv[1]).7z'
@ -42,6 +50,6 @@ for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1)
a $i "qb / \":quickmark-load $i\""
end
for i in getnative mcross spleeter thonny
for i in getnative mcross nsz scdl spleeter thonny
a $i "pipx run $i"
end

View file

@ -1,3 +0,0 @@
#!/bin/bash
list=$(grep works/[0-9]\* "$@" -o | uniq | grep -o [0-9]\* | tr '\n' , | sed s/.$//)
eval aria2c -Z https://download.archiveofourown.org/downloads/{$list}/\*.epub -d ao3

View file

@ -1,2 +0,0 @@
#!/bin/sh
[ $# -eq 0 ] && cat - | xclip -i -sel clip || echo $@ | xclip -i -sel clip

View file

@ -1,2 +0,0 @@
#!/bin/sh
tmux new -s 0 -d 'cd ~/.invid; git pull; docker-compose up --build'

View file

@ -1,2 +0,0 @@
#!/bin/sh
pactl list short modules | grep loopback && pactl unload-module module-loopback || pactl load-module module-loopback

View file

@ -1,2 +0,0 @@
#!/bin/sh
[ $# -eq 0 ] && qutebrowser -B /tmp || qutebrowser -B ~/.local/share/qutebrowser/containers/$@

View file

@ -1,6 +0,0 @@
#!/usr/bin/fish
for i in Documents Music Pictures Videos
rm ~/$i
rmdir ~/$i
ln -s $D/$i ~/$i
end

11
.setup
View file

@ -23,14 +23,11 @@ cd ~/.dotfiles
fd -E .git -t d -H -x mkdir -p ~/{}
stow .
mkdir -p ~/.config/mpv/shaders && cd ~/.config/mpv/shaders && rm *
curl https://api.github.com/repos/bloc97/Anime4K/releases/latest | grep -wo http.\*zip | aria2c -i-; unzip *; rm *zip
mkdir -p ~/.config/mpv/shaders ~/.local/share/qutebrowser/pdfjs ~/.config/nvim/autoload/
fish -c 'function un; unzip -o (curl https://api.github.com/repos/$argv[1]/releases | grep -om1 http.\*zip | wget -i- -O- | psub) -d $argv[2]; end
un bloc97/Anime4k ~/.config/mpv/shaders; un mozilla/pdf.js ~/.local/share/qutebrowser/pdfjs'
mkdir -p ~/.local/share/qutebrowser/pdfjs && cd ~/.local/share/qutebrowser/pdfjs && rm -r *
curl https://api.github.com/repos/mozilla/pdf.js/releases/latest | grep -wo http.\*zip | grep -v es5 | aria2c -i-; unzip *; rm *zip
rm ~/.config/nvim/autoload/plug.vim
aria2c https://github.com/junegunn/vim-plug/raw/master/plug.vim -d ~/.config/nvim/autoload
wget https://github.com/junegunn/vim-plug/raw/master/plug.vim -o ~/.config/nvim/autoload/plug.vim
nvim +PlugUpdate +q +q
sudo systemctl mask tracker-{store,miner-fs,miner-rss,extra,miner-apps,writeback}