summaryrefslogtreecommitdiff
path: root/home/.selfconfigs/zsh/functions
diff options
context:
space:
mode:
Diffstat (limited to 'home/.selfconfigs/zsh/functions')
-rw-r--r--home/.selfconfigs/zsh/functions/cdl8
-rw-r--r--home/.selfconfigs/zsh/functions/timer9
-rw-r--r--home/.selfconfigs/zsh/functions/yt8
-rw-r--r--home/.selfconfigs/zsh/functions/yta8
4 files changed, 33 insertions, 0 deletions
diff --git a/home/.selfconfigs/zsh/functions/cdl b/home/.selfconfigs/zsh/functions/cdl
new file mode 100644
index 0000000..d11c086
--- /dev/null
+++ b/home/.selfconfigs/zsh/functions/cdl
@@ -0,0 +1,8 @@
+function cdl()
+{
+ if [ $# == 0 ] || [ ! -L $1 ]; then
+ echo usage: cdl \[LINK\]
+ else
+ cd $1(:A:h)
+ fi
+}
diff --git a/home/.selfconfigs/zsh/functions/timer b/home/.selfconfigs/zsh/functions/timer
new file mode 100644
index 0000000..4978d4f
--- /dev/null
+++ b/home/.selfconfigs/zsh/functions/timer
@@ -0,0 +1,9 @@
+function timer()
+{
+ if [ $# -lt 2 ]; then
+ echo usage: timer [SLEEP_TIME] [MESSAGE]
+ else
+ echo Timer set for $1: $2
+ $(sleep $1; notify-send "$2") > /dev/null & disown
+ fi
+}
diff --git a/home/.selfconfigs/zsh/functions/yt b/home/.selfconfigs/zsh/functions/yt
new file mode 100644
index 0000000..8d0ad2a
--- /dev/null
+++ b/home/.selfconfigs/zsh/functions/yt
@@ -0,0 +1,8 @@
+function yt()
+{
+ if [ $# == 0 ]; then
+ echo usage: yt \[SEARCH TERM\]
+ else
+ mpv ytdl://ytsearch:"$*"
+ fi
+}
diff --git a/home/.selfconfigs/zsh/functions/yta b/home/.selfconfigs/zsh/functions/yta
new file mode 100644
index 0000000..42cef33
--- /dev/null
+++ b/home/.selfconfigs/zsh/functions/yta
@@ -0,0 +1,8 @@
+function yta()
+{
+ if [ $# == 0 ]; then
+ echo usage: yta \[SEARCH TERM\]
+ else
+ mpv --ytdl-format=bestaudio ytdl://ytsearch:"$*"
+ fi
+}