summaryrefslogtreecommitdiffstats
path: root/fish/functions
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-09-05 14:08:27 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-09-05 14:08:27 +0100
commitb1e86fd7e719ff243535751cf8bc3c75f8531f29 (patch)
tree94e9ff5e8220e628e17d84dcf135f3e806fb66d8 /fish/functions
parent1ad5e09cf4c9d82dbb13a30d5fdabfb11d5be12a (diff)
porting some ksh aliases and functions to fish
Diffstat (limited to 'fish/functions')
-rw-r--r--fish/functions/myupdateports.fish3
-rw-r--r--fish/functions/myupdatesrc.fish3
-rw-r--r--fish/functions/snapdate.fish3
-rw-r--r--fish/functions/tjclip.fish7
-rw-r--r--fish/functions/ytmp3.fish7
5 files changed, 23 insertions, 0 deletions
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/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/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/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