diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2022-09-05 14:14:34 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2022-09-05 14:14:34 +0100 |
commit | 5f504660a8e7478fac3f5b14e8661399154b119c (patch) | |
tree | fd879e1617af74d644ef314a79d8df7dbd74b71c /fish/functions | |
parent | 7a77faf913cd9e51d520705de3e78d73b09b43a1 (diff) | |
parent | b1e86fd7e719ff243535751cf8bc3c75f8531f29 (diff) |
Merge branch 'master' of github.com:yulqen/openbsddotfiles
Diffstat (limited to 'fish/functions')
-rw-r--r-- | fish/functions/jtoday.fish | 3 | ||||
-rw-r--r-- | fish/functions/modlog.fish | 3 | ||||
-rw-r--r-- | fish/functions/mutt.fish | 3 | ||||
-rw-r--r-- | fish/functions/myupdateports.fish | 3 | ||||
-rw-r--r-- | fish/functions/myupdatesrc.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1m.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1w.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1w_small.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2m.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2w.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2w_small.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal3w.fish | 3 | ||||
-rw-r--r-- | fish/functions/snapdate.fish | 3 | ||||
-rw-r--r-- | fish/functions/tallproj.fish | 3 | ||||
-rw-r--r-- | fish/functions/taskstobunkerage.fish | 3 | ||||
-rw-r--r-- | fish/functions/tj.fish | 7 | ||||
-rw-r--r-- | fish/functions/tjclip.fish | 7 | ||||
-rw-r--r-- | fish/functions/todj.fish | 14 | ||||
-rw-r--r-- | fish/functions/ttoday.fish | 3 | ||||
-rw-r--r-- | fish/functions/venvact.fish | 3 | ||||
-rw-r--r-- | fish/functions/ytmp3.fish | 7 |
21 files changed, 86 insertions, 0 deletions
diff --git a/fish/functions/jtoday.fish b/fish/functions/jtoday.fish new file mode 100644 index 0000000..f5a2f7a --- /dev/null +++ b/fish/functions/jtoday.fish @@ -0,0 +1,3 @@ +function jtoday --wraps='vim ~/Notes/journal/$(date +%Y-%m-%d).md' --description 'alias jtoday=vim ~/Notes/journal/$(date +%Y-%m-%d).md' + vim ~/Notes/journal/$(date +%Y-%m-%d).md $argv; +end diff --git a/fish/functions/modlog.fish b/fish/functions/modlog.fish new file mode 100644 index 0000000..25460a2 --- /dev/null +++ b/fish/functions/modlog.fish @@ -0,0 +1,3 @@ +function modlog --wraps='grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6-' --description 'alias modlog=grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6-' + grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6- $argv; +end diff --git a/fish/functions/mutt.fish b/fish/functions/mutt.fish new file mode 100644 index 0000000..2e23366 --- /dev/null +++ b/fish/functions/mutt.fish @@ -0,0 +1,3 @@ +function mutt --wraps='neomutt -f Mail/fastmail/INBOX/' --description 'alias mutt=neomutt -f Mail/fastmail/INBOX/' + neomutt -f Mail/fastmail/INBOX/ $argv; +end diff --git a/fish/functions/myupdateports.fish b/fish/functions/myupdateports.fish new file mode 100644 index 0000000..9ad5921 --- /dev/null +++ b/fish/functions/myupdateports.fish @@ -0,0 +1,3 @@ +function myupdateports --wraps='cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return' --description 'alias myupdateports=cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return' + cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return $argv; +end diff --git a/fish/functions/myupdatesrc.fish b/fish/functions/myupdatesrc.fish new file mode 100644 index 0000000..5361550 --- /dev/null +++ b/fish/functions/myupdatesrc.fish @@ -0,0 +1,3 @@ +function myupdatesrc --wraps='cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return' --description 'alias myupdatesrc=cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return' + cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return $argv; +end diff --git a/fish/functions/rcal1m.fish b/fish/functions/rcal1m.fish new file mode 100644 index 0000000..005aac8 --- /dev/null +++ b/fish/functions/rcal1m.fish @@ -0,0 +1,3 @@ +function rcal1m --wraps='ssh bobbins rem -cca -w160 -m' --description 'alias rcal1m=ssh bobbins rem -cca -w160 -m' + ssh bobbins rem -cca -w160 -m $argv; +end diff --git a/fish/functions/rcal1w.fish b/fish/functions/rcal1w.fish new file mode 100644 index 0000000..bbda153 --- /dev/null +++ b/fish/functions/rcal1w.fish @@ -0,0 +1,3 @@ +function rcal1w --wraps='ssh bobbins rem -cc+a1 -w160 -m' --description 'alias rcal1w=ssh bobbins rem -cc+a1 -w160 -m' + ssh bobbins rem -cc+a1 -w160 -m $argv; +end diff --git a/fish/functions/rcal1w_small.fish b/fish/functions/rcal1w_small.fish new file mode 100644 index 0000000..1232b64 --- /dev/null +++ b/fish/functions/rcal1w_small.fish @@ -0,0 +1,3 @@ +function rcal1w_small --wraps='ssh bobbins rem -cca+1 -w140 -m' --description 'alias rcal1w_small=ssh bobbins rem -cca+1 -w140 -m' + ssh bobbins rem -cca+1 -w140 -m $argv; +end diff --git a/fish/functions/rcal2m.fish b/fish/functions/rcal2m.fish new file mode 100644 index 0000000..1dcf194 --- /dev/null +++ b/fish/functions/rcal2m.fish @@ -0,0 +1,3 @@ +function rcal2m --wraps='ssh bobbins rem -cca2 -w160 -m' --description 'alias rcal2m=ssh bobbins rem -cca2 -w160 -m' + ssh bobbins rem -cca2 -w160 -m $argv; +end diff --git a/fish/functions/rcal2w.fish b/fish/functions/rcal2w.fish new file mode 100644 index 0000000..9367062 --- /dev/null +++ b/fish/functions/rcal2w.fish @@ -0,0 +1,3 @@ +function rcal2w --wraps='ssh bobbins rem -cc+a2 -w160 -m' --description 'alias rcal2w=ssh bobbins rem -cc+a2 -w160 -m' + ssh bobbins rem -cc+a2 -w160 -m $argv; +end diff --git a/fish/functions/rcal2w_small.fish b/fish/functions/rcal2w_small.fish new file mode 100644 index 0000000..9f4490c --- /dev/null +++ b/fish/functions/rcal2w_small.fish @@ -0,0 +1,3 @@ +function rcal2w_small --wraps='ssh bobbins rem -cca+2 -w140 -m' --description 'alias rcal2w_small=ssh bobbins rem -cca+2 -w140 -m' + ssh bobbins rem -cca+2 -w140 -m $argv; +end diff --git a/fish/functions/rcal3w.fish b/fish/functions/rcal3w.fish new file mode 100644 index 0000000..7bc5fd9 --- /dev/null +++ b/fish/functions/rcal3w.fish @@ -0,0 +1,3 @@ +function rcal3w --wraps='ssh bobbins rem -cc+a3 -w160 -m' --description 'alias rcal3w=ssh bobbins rem -cc+a3 -w160 -m' + ssh bobbins rem -cc+a3 -w160 -m $argv; +end diff --git a/fish/functions/snapdate.fish b/fish/functions/snapdate.fish new file mode 100644 index 0000000..daaeb73 --- /dev/null +++ b/fish/functions/snapdate.fish @@ -0,0 +1,3 @@ +function snapdate --wraps=curl\ -s\ https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/\|grep\ INSTALL\|tr\ -d\ \'\ \'\|cut\ -d\'\>\'\ -f3\|cut\ -d\':\'\ -f1 --description alias\ snapdate=curl\ -s\ https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/\|grep\ INSTALL\|tr\ -d\ \'\ \'\|cut\ -d\'\>\'\ -f3\|cut\ -d\':\'\ -f1 + curl -s https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/|grep INSTALL|tr -d ' '|cut -d'>' -f3|cut -d':' -f1 $argv; +end diff --git a/fish/functions/tallproj.fish b/fish/functions/tallproj.fish new file mode 100644 index 0000000..13980d0 --- /dev/null +++ b/fish/functions/tallproj.fish @@ -0,0 +1,3 @@ +function tallproj --wraps='task rc.list.all.projects=1 projects' --description 'alias tallproj=task rc.list.all.projects=1 projects' + task rc.list.all.projects=1 projects $argv; +end diff --git a/fish/functions/taskstobunkerage.fish b/fish/functions/taskstobunkerage.fish new file mode 100644 index 0000000..d4ac2ca --- /dev/null +++ b/fish/functions/taskstobunkerage.fish @@ -0,0 +1,3 @@ +function taskstobunkerage --wraps=echo\ \"\#\#\#\ Tasks\\n\\n\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ task\ ml_basic\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/con\ \ \ \ tent/bunkerage/day.md\ \&\&\ echo\ \"\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ cd\ \~/code/html/yulqen.org.hugo/\ \&\&\ make\ push\ \&\&\ cd\ - --description alias\ taskstobunkerage=echo\ \"\#\#\#\ Tasks\\n\\n\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ task\ ml_basic\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/con\ \ \ \ tent/bunkerage/day.md\ \&\&\ echo\ \"\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ cd\ \~/code/html/yulqen.org.hugo/\ \&\&\ make\ push\ \&\&\ cd\ - + echo "### Tasks\n\n\`\`\`" >> /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md && task ml_basic >> /home/lemon/code/html/yulqen.org.hugo/con tent/bunkerage/day.md && echo "\`\`\`" >> /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md && cd ~/code/html/yulqen.org.hugo/ && make push && cd - $argv; +end diff --git a/fish/functions/tj.fish b/fish/functions/tj.fish new file mode 100644 index 0000000..8c1caad --- /dev/null +++ b/fish/functions/tj.fish @@ -0,0 +1,7 @@ +function tj -d "Log to the daily journal - wrapper round _tj script" --argument-names 'message' + if test -n "$message" + echo "$message" | _tj + else + echo "Please give me your message, wrapped in quotes." + end +end diff --git a/fish/functions/tjclip.fish b/fish/functions/tjclip.fish new file mode 100644 index 0000000..959c87a --- /dev/null +++ b/fish/functions/tjclip.fish @@ -0,0 +1,7 @@ +function tjclip --description 'Log contents of the clipboard to the daily journal, via the _tj script' --argument message + if test -n "$message" + echo "$message: $(xclip -o -clipboard clipboard)." | _tj + else + echo "Please give me your message, wrapped in quotes." + end +end diff --git a/fish/functions/todj.fish b/fish/functions/todj.fish new file mode 100644 index 0000000..7e54dfa --- /dev/null +++ b/fish/functions/todj.fish @@ -0,0 +1,14 @@ +function todj -d "Shows the current daily journal" --argument-names 'vimopt' + if test -n "$vimopt" + if test $vimopt = "-v" + set CMD vim + else + echo "Do not recognise $vimopt. Did you mean -v?" + return + end + else + set CMD cat + end + + $CMD $(find /home/lemon/Notes/journal -name "*$(date '+%Y-%m-%d')*") +end diff --git a/fish/functions/ttoday.fish b/fish/functions/ttoday.fish new file mode 100644 index 0000000..115f304 --- /dev/null +++ b/fish/functions/ttoday.fish @@ -0,0 +1,3 @@ +function ttoday --wraps='task ml_due_or_scheduled_today' --description 'alias ttoday=task ml_due_or_scheduled_today' + task ml_due_or_scheduled_today $argv; +end diff --git a/fish/functions/venvact.fish b/fish/functions/venvact.fish new file mode 100644 index 0000000..01bf050 --- /dev/null +++ b/fish/functions/venvact.fish @@ -0,0 +1,3 @@ +function venvact --wraps='. ./.venv/bin/activate' --description 'alias venvact=. ./.venv/bin/activate' + . ./.venv/bin/activate $argv; +end diff --git a/fish/functions/ytmp3.fish b/fish/functions/ytmp3.fish new file mode 100644 index 0000000..f66467e --- /dev/null +++ b/fish/functions/ytmp3.fish @@ -0,0 +1,7 @@ +function ytmp3 --description 'Download YouTube video or playlist as audio' --argument url + if test -n "$url" + cd ~/Downloads && yt-dlp -f 'ba' -x --audio-format mp3 "$url" -o '%(title)s.%(ext)s' && cd - || return + else + echo "Please give me a URL." + end +end |