summaryrefslogtreecommitdiffstats
path: root/fish2024/functions
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-02-15 10:21:33 +0000
committerMatthew Lemon <y@yulqen.org>2024-02-15 10:21:33 +0000
commit8debc9ec9caed3bad157a258583f20cafaaa8ac7 (patch)
treec71421d9c0acfc280561f7f2e966b9eff1963a3f /fish2024/functions
parent876d253f48fffdd89b984940abf79d4146d2d3f5 (diff)
Adds fish 2024 version config
Diffstat (limited to '')
-rw-r--r--fish2024/functions/_extract_description_from_task.fish5
-rw-r--r--fish2024/functions/_mealplan.fish20
-rw-r--r--fish2024/functions/annex-sync.fish4
-rw-r--r--fish2024/functions/blog.fish4
-rw-r--r--fish2024/functions/bud.fish4
-rw-r--r--fish2024/functions/forge-logins.fish3
-rw-r--r--fish2024/functions/gitrepos.fish5
-rw-r--r--fish2024/functions/gloga.fish4
-rw-r--r--fish2024/functions/khal.fish4
-rw-r--r--fish2024/functions/khard.fish4
-rw-r--r--fish2024/functions/lookforsyncerrors.fish4
-rw-r--r--fish2024/functions/notes.fish4
-rw-r--r--fish2024/functions/t.fish4
-rw-r--r--fish2024/functions/thomeprojects.fish4
-rw-r--r--fish2024/functions/tkilled.fish4
-rw-r--r--fish2024/functions/tprojects.fish4
-rw-r--r--fish2024/functions/ttagged.fish4
-rw-r--r--fish2024/functions/ttoday.fish4
-rw-r--r--fish2024/functions/tuntagged.fish4
-rw-r--r--fish2024/functions/tworkprojects.fish4
-rw-r--r--fish2024/functions/vdirsyncer.fish4
-rw-r--r--fish2024/functions/xclip.fish4
22 files changed, 105 insertions, 0 deletions
diff --git a/fish2024/functions/_extract_description_from_task.fish b/fish2024/functions/_extract_description_from_task.fish
new file mode 100644
index 0000000..0b82d9d
--- /dev/null
+++ b/fish2024/functions/_extract_description_from_task.fish
@@ -0,0 +1,5 @@
+function _extract_description_from_task --description 'Given a taskwarrior task ID, it returns the description of the task and adds it to clipboard'
+ set desc (task $argv[1] |grep Description |cut -d' ' -f4-)
+ echo $desc |xclip
+ echo $desc
+end
diff --git a/fish2024/functions/_mealplan.fish b/fish2024/functions/_mealplan.fish
new file mode 100644
index 0000000..30c8a20
--- /dev/null
+++ b/fish2024/functions/_mealplan.fish
@@ -0,0 +1,20 @@
+function _mealplan
+ #set -l cmd "grep Monday ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md|cut -d: -f3"
+ if test -z $argv[1]
+ echo "Usage: mealplan <day> <meal>"
+ echo " day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday"
+ echo " meal: b, l, t"
+ return
+ end
+
+ set -l day $argv[1]
+
+ if test $argv[2] = "b"
+ set -f meal "-f2"
+ else if test $argv[2] = "l"
+ set -f meal "-f3"
+ else if test $argv[2] = "t"
+ set -f meal "-f4"
+ end
+ echo (grep -i $day ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md|cut -d: $meal)
+end
diff --git a/fish2024/functions/annex-sync.fish b/fish2024/functions/annex-sync.fish
new file mode 100644
index 0000000..39ac15c
--- /dev/null
+++ b/fish2024/functions/annex-sync.fish
@@ -0,0 +1,4 @@
+function annex-sync --wraps='cd ~/annex/ && git annex sync && cd -' --description 'alias annex-sync=cd ~/annex/ && git annex sync && cd -'
+ cd ~/annex/ && git annex sync && cd - $argv
+
+end
diff --git a/fish2024/functions/blog.fish b/fish2024/functions/blog.fish
new file mode 100644
index 0000000..16f2061
--- /dev/null
+++ b/fish2024/functions/blog.fish
@@ -0,0 +1,4 @@
+function blog --wraps='cd ~/code/html/yulqen.org' --description 'alias blog=cd ~/code/html/yulqen.org'
+ cd ~/code/html/yulqen.org $argv
+
+end
diff --git a/fish2024/functions/bud.fish b/fish2024/functions/bud.fish
new file mode 100644
index 0000000..28c2f31
--- /dev/null
+++ b/fish2024/functions/bud.fish
@@ -0,0 +1,4 @@
+function bud --wraps='cd ~/Budget/hledger' --description 'alias bud=cd ~/Budget/hledger'
+ cd ~/Budget/hledger $argv
+
+end
diff --git a/fish2024/functions/forge-logins.fish b/fish2024/functions/forge-logins.fish
new file mode 100644
index 0000000..67f538f
--- /dev/null
+++ b/fish2024/functions/forge-logins.fish
@@ -0,0 +1,3 @@
+function forge-logins --description 'Get logins on forge server - provide data as 10Feb2024 as first arg.'
+ ssh minecraft "find ~/forge-server/logs -name \*.gz -print0|xargs -0 zgrep \"joined the game\"|grep \"$argv[1]\"|awk '{print \$1, \$2, \$6}'|cut -d\":\" -f2-|cut -d\" \" -f2-|sed 's/]//'"
+end
diff --git a/fish2024/functions/gitrepos.fish b/fish2024/functions/gitrepos.fish
new file mode 100644
index 0000000..bf009a4
--- /dev/null
+++ b/fish2024/functions/gitrepos.fish
@@ -0,0 +1,5 @@
+function gitrepos --wraps='ssh git@joannalemon.com "tree -L 2 repositories"' --wraps='ssh git@joannalemon.com "find repositories/ -maxdepth 2 -type d|cut -d/ -f2-"' --description 'alias gitrepos=ssh git@joannalemon.com "find repositories/ -maxdepth 2 -type d|cut -d/ -f2-"'
+ # ssh git@joannalemon.com "tree -L 2 repositories" $argv
+ ssh git@joannalemon.com "find repositories/ -maxdepth 2 -type d|cut -d/ -f2-"
+
+end
diff --git a/fish2024/functions/gloga.fish b/fish2024/functions/gloga.fish
new file mode 100644
index 0000000..98da2aa
--- /dev/null
+++ b/fish2024/functions/gloga.fish
@@ -0,0 +1,4 @@
+function gloga --wraps='git log --oneline --decorate --graph --all' --description 'alias gloga=git log --oneline --decorate --graph --all'
+ git log --oneline --decorate --graph --all $argv
+
+end
diff --git a/fish2024/functions/khal.fish b/fish2024/functions/khal.fish
new file mode 100644
index 0000000..6181c55
--- /dev/null
+++ b/fish2024/functions/khal.fish
@@ -0,0 +1,4 @@
+function khal --wraps=/home/lemon/src/virtualenvs/khal-venv/bin/khal --description 'alias khal=/home/lemon/src/virtualenvs/khal-venv/bin/khal'
+ /home/lemon/src/virtualenvs/khal-venv/bin/khal $argv
+
+end
diff --git a/fish2024/functions/khard.fish b/fish2024/functions/khard.fish
new file mode 100644
index 0000000..bae9702
--- /dev/null
+++ b/fish2024/functions/khard.fish
@@ -0,0 +1,4 @@
+function khard --wraps='~/src/virtualenvs/khal-venv/bin/khard' --description 'alias khard=~/src/virtualenvs/khal-venv/bin/khard'
+ ~/src/virtualenvs/khal-venv/bin/khard $argv
+
+end
diff --git a/fish2024/functions/lookforsyncerrors.fish b/fish2024/functions/lookforsyncerrors.fish
new file mode 100644
index 0000000..55131fc
--- /dev/null
+++ b/fish2024/functions/lookforsyncerrors.fish
@@ -0,0 +1,4 @@
+function lookforsyncerrors --wraps='find . -iname "*sync*"' --description 'alias lookforsyncerrors=find . -iname "*sync*"'
+ find . -iname "*sync-conflict*" $argv
+
+end
diff --git a/fish2024/functions/notes.fish b/fish2024/functions/notes.fish
new file mode 100644
index 0000000..9ded8d2
--- /dev/null
+++ b/fish2024/functions/notes.fish
@@ -0,0 +1,4 @@
+function notes --wraps='cd /home/lemon/Documents/Notes/' --description 'alias notes=cd /home/lemon/Documents/Notes/'
+ cd /home/lemon/Documents/Notes/ $argv
+
+end
diff --git a/fish2024/functions/t.fish b/fish2024/functions/t.fish
new file mode 100644
index 0000000..c23e31c
--- /dev/null
+++ b/fish2024/functions/t.fish
@@ -0,0 +1,4 @@
+function t --wraps=task --description 'alias t=task'
+ task $argv
+
+end
diff --git a/fish2024/functions/thomeprojects.fish b/fish2024/functions/thomeprojects.fish
new file mode 100644
index 0000000..f6f8d49
--- /dev/null
+++ b/fish2024/functions/thomeprojects.fish
@@ -0,0 +1,4 @@
+function thomeprojects --wraps=task\ _unique\ project\|grep\ \"h\\.\" --description alias\ thomeprojects=task\ _unique\ project\|grep\ \"h\\.\"
+ task _unique project|grep "h\." $argv
+
+end
diff --git a/fish2024/functions/tkilled.fish b/fish2024/functions/tkilled.fish
new file mode 100644
index 0000000..2d89ec6
--- /dev/null
+++ b/fish2024/functions/tkilled.fish
@@ -0,0 +1,4 @@
+function tkilled --wraps='task +killlist list' --description 'alias tkilled=task +killlist list'
+ task +killlist list $argv
+
+end
diff --git a/fish2024/functions/tprojects.fish b/fish2024/functions/tprojects.fish
new file mode 100644
index 0000000..e3eef8e
--- /dev/null
+++ b/fish2024/functions/tprojects.fish
@@ -0,0 +1,4 @@
+function tprojects --wraps='task rc.list.all.projects=1 projects' --description 'alias tprojects=task rc.list.all.projects=1 projects'
+ task rc.list.all.projects=1 projects $argv
+
+end
diff --git a/fish2024/functions/ttagged.fish b/fish2024/functions/ttagged.fish
new file mode 100644
index 0000000..5ee8596
--- /dev/null
+++ b/fish2024/functions/ttagged.fish
@@ -0,0 +1,4 @@
+function ttagged --wraps='task tags.any: list' --description 'alias ttagged=task tags.any: list'
+ task tags.any: list $argv
+
+end
diff --git a/fish2024/functions/ttoday.fish b/fish2024/functions/ttoday.fish
new file mode 100644
index 0000000..e9c62fc
--- /dev/null
+++ b/fish2024/functions/ttoday.fish
@@ -0,0 +1,4 @@
+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/fish2024/functions/tuntagged.fish b/fish2024/functions/tuntagged.fish
new file mode 100644
index 0000000..6569130
--- /dev/null
+++ b/fish2024/functions/tuntagged.fish
@@ -0,0 +1,4 @@
+function tuntagged --wraps='task tags.none: list' --description 'alias tuntagged=task tags.none: list'
+ task tags.none: list $argv
+
+end
diff --git a/fish2024/functions/tworkprojects.fish b/fish2024/functions/tworkprojects.fish
new file mode 100644
index 0000000..2890978
--- /dev/null
+++ b/fish2024/functions/tworkprojects.fish
@@ -0,0 +1,4 @@
+function tworkprojects --wraps=task\ _unique\ project\|grep\ \"w\\.\" --description alias\ tworkprojects=task\ _unique\ project\|grep\ \"w\\.\"
+ task _unique project|grep "w\." $argv
+
+end
diff --git a/fish2024/functions/vdirsyncer.fish b/fish2024/functions/vdirsyncer.fish
new file mode 100644
index 0000000..6f12d53
--- /dev/null
+++ b/fish2024/functions/vdirsyncer.fish
@@ -0,0 +1,4 @@
+function vdirsyncer --wraps=/home/lemon/src/virtualenvs/khal-venv/bin/vdirsyncer --description 'alias vdirsyncer=/home/lemon/src/virtualenvs/khal-venv/bin/vdirsyncer'
+ /home/lemon/src/virtualenvs/khal-venv/bin/vdirsyncer $argv
+
+end
diff --git a/fish2024/functions/xclip.fish b/fish2024/functions/xclip.fish
new file mode 100644
index 0000000..b552ec6
--- /dev/null
+++ b/fish2024/functions/xclip.fish
@@ -0,0 +1,4 @@
+function xclip --description 'alias xclip=xclip -selection c'
+ command xclip -selection c $argv
+
+end