summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/common/amount36
-rwxr-xr-xbin/common/wt7
-rwxr-xr-xbin/common/y2feed15
-rw-r--r--config/essentials/nvim/after/plugin/luasnip.lua11
-rw-r--r--config/essentials/zsh/aliases.zsh3
-rw-r--r--config/extra/tridactyl/tridactylrc9
6 files changed, 60 insertions, 21 deletions
diff --git a/bin/common/amount b/bin/common/amount
new file mode 100755
index 0000000..8d235e4
--- /dev/null
+++ b/bin/common/amount
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+tmp="$(mktemp)"
+
+die ()
+{
+ echo "$1" >&2
+}
+
+clear
+lsblk -o name,size,type,mountpoints
+die "───────────────────────────────────"
+lsblk --ascii -o name,mountpoint |
+ grep '^.-' |
+ while read line
+do
+ words="$(printf "$line" | wc -w)"
+ test $words -gt 1 && continue
+ i=$((${i:-0}+1))
+ printf "%s. %s\n" "$i" "$(printf "$line" | cut -f 2- -d '-')"
+done | tee "$tmp"
+
+read -p '>' choice
+
+dev="$(grep "^$choice\." "$tmp" | cut -f 2- -d ' ')"
+if test -n "$dev"
+then
+ die "mounting /dev/$dev on /media/$dev"
+ sudo mount --mkdir /dev/$dev /media/$dev > /dev/null 2>&1 &&
+ die 'Mounted succesfully.' ||
+ die 'Failed to mount.'
+ die 'Press [Enter] to continue.'
+ head -n 1 > /dev/null
+fi
+
+rm -f "$tmp"
diff --git a/bin/common/wt b/bin/common/wt
index 0568b99..d19539b 100755
--- a/bin/common/wt
+++ b/bin/common/wt
@@ -1,10 +1,7 @@
#!/bin/sh
-
-echo "$@" > /tmp/truewhile.tmp
while true
do
- sh /tmp/truewhile.tmp
- sleep 1
clear
+ $@
+ sleep 1
done
-rm /tmp/truewhile.tmp
diff --git a/bin/common/y2feed b/bin/common/y2feed
index 196ecb7..e30bccf 100755
--- a/bin/common/y2feed
+++ b/bin/common/y2feed
@@ -1,12 +1,5 @@
#!/bin/sh
-ua="$(yt-dlp --dump-user-agent)"
-
-test -z "${url:=$1}" &&
- url="$(cat /dev/stdin)"
-
-url="http://youtube.com/$(echo "$url" |
- awk -F '/' '{print $NF}')"
-echo "url: $url" >&2
-
-curl -L -s -H "$ua" "$url" |
- pup 'link[title=RSS] attr{href}'
+echo "url: $1" >&2
+curl -L -s "$1" |
+ pup 'link[title=RSS] attr{href}' |
+ tee /dev/stderr
diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua
index d1da9b3..d29b484 100644
--- a/config/essentials/nvim/after/plugin/luasnip.lua
+++ b/config/essentials/nvim/after/plugin/luasnip.lua
@@ -144,6 +144,17 @@ ls.add_snippets("java", {
ls.add_snippets("sh", {
s("TD", t "THISDIR=$(dirname $(readlink -f \"$0\"))"),
parse("fn", "$1 ()\n{\n\t$2\n}$0", {}),
+ -- Functions
+ parse("rchar",
+ [[
+ read_char ()
+ {
+ old_stty_cfg=$(stty -g)
+ stty raw -echo
+ dd ibs=1 count=1 2> /dev/null
+ stty \$old_stty_cfg
+ }
+ ]], {}),
parse("fdie",
[[
die ()
diff --git a/config/essentials/zsh/aliases.zsh b/config/essentials/zsh/aliases.zsh
index 99372d6..94d27e7 100644
--- a/config/essentials/zsh/aliases.zsh
+++ b/config/essentials/zsh/aliases.zsh
@@ -87,9 +87,10 @@ alias yrm='yay -Rns'
alias pkb='pkgfile -b'
# transmission
-alias tr='transmission-remote debuc.com'
+alias trr='transmission-remote debuc.com'
alias trls='transmission-remote debuc.com -t all -l'
alias tradd='transmission-remote debuc.com -a'
+alias trclipo='transmission-remote debuc.com -a "$(clipo)"'
alias grub-update='doas grub-mkconfig -o /boot/grub/grub.cfg'
diff --git a/config/extra/tridactyl/tridactylrc b/config/extra/tridactyl/tridactylrc
index fa6ed1d..2b98c9d 100644
--- a/config/extra/tridactyl/tridactylrc
+++ b/config/extra/tridactyl/tridactylrc
@@ -52,10 +52,11 @@ bind gwc winopen https://chat.openai.com/chat
bind gnp tabopen https://github.com/Siilwyn/awesome-pixel-art#tutorials
bind gop open https://github.com/Siilwyn/awesome-pixel-art#tutorials
bind gwp winopen https://github.com/Siilwyn/awesome-pixel-art#tutorials
-" deluge
-bind gnd tabopen http://192.168.178.52:8112/
-bind god open http://192.168.178.52:8112/
-bind gwd winopen http://192.168.178.52:8112/
+" transmission
+bind godb open http://debuc.com/
+bind godt open http://debuc.com:9091
+bind gods open http://debuc.com:5030
+bind godj open http://debuc.com:8096
" For syntax highlighting see https://github.com/tridactyl/vim-tridactyl
" vim: set filetype=tridactyl