diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-15 03:00:25 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-15 03:00:25 +0200 |
commit | 4914b43f642e2772a140a8f9b1f26b4e555ed88b (patch) | |
tree | fa665e469f8daa1f150d13411d0f8537a93e5355 /bin/extra | |
parent | ad05cb18f03f3a97a918e090c38ba760147a0bb6 (diff) | |
parent | 2a9d0908651ac236855fa515e14a83bada3ad7f9 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra')
-rwxr-xr-x | bin/extra/curszip | 12 | ||||
-rw-r--r-- | bin/extra/keyboards.txt | 2 | ||||
-rwxr-xr-x | bin/extra/qrclip | 12 | ||||
-rwxr-xr-x | bin/extra/udict | 12 |
4 files changed, 33 insertions, 5 deletions
diff --git a/bin/extra/curszip b/bin/extra/curszip index 64abdb6..0de772f 100755 --- a/bin/extra/curszip +++ b/bin/extra/curszip @@ -1,13 +1,17 @@ #!/bin/sh -list1() { find "$1" -mindepth 1 -maxdepth 1 -type "${2:-d}" -printf '%f\n'; } +# $1: dir +# $2: type +list1() { find "$1" -mindepth 1 -maxdepth 1 -type "$2" -printf '%f\n'; } -curs="$(list1 ~/docs/school/Vakken | commander -c)" +curs="$(list1 ~/docs/school/Vakken d | dmenu -c)" [ "$curs" ] || exit 1 -zip="$(list1 ~/dl f | fzf -f "$curs" | grep '\.zip$')" >&2 printf "curs: %s\n" "$curs" -[ "$zip" ] || exit 1 +dldir="$(which xdg-user-dir > /dev/null 2>&1 && xdg-user-dir 'DOWNLOAD' || echo '~/dl')" + +zip="$(list1 "$dldir" f | fzf -f "$curs" | grep '\.zip$')" +[ "$zip" ] || exit 1 >&2 printf "zip: %s\n" "$zip" cd -- ~/docs/school/Vakken/"$curs" || exit 1 diff --git a/bin/extra/keyboards.txt b/bin/extra/keyboards.txt index db004ce..d6e9b8a 100644 --- a/bin/extra/keyboards.txt +++ b/bin/extra/keyboards.txt @@ -1,2 +1,2 @@ us -us -option ctrl:swapcaps,altwin:menu_win -variant colemak +colemak -option ctrl:swapcaps,altwin:menu_win diff --git a/bin/extra/qrclip b/bin/extra/qrclip new file mode 100755 index 0000000..f9dc92e --- /dev/null +++ b/bin/extra/qrclip @@ -0,0 +1,12 @@ +#!/bin/sh +case $1 in + '-o') + qrencode -s 16 "$(clipo)" -o - | + imv -w "imv - $(clipo)" - ;; + '-s') + qrencode -s 16 "https://duckduckgo.com/$(clipo)" -o - | + imv -w "imv - search $(clipo)" - ;; + *) + >&2 printf 'qrclip [-s | -o]\n' + exit 1 +esac diff --git a/bin/extra/udict b/bin/extra/udict new file mode 100755 index 0000000..77f9747 --- /dev/null +++ b/bin/extra/udict @@ -0,0 +1,12 @@ +#!/bin/sh + +[ $# -eq 0 ] && printf '%s\n' "Usage: + udict some term" && exit 1 + +term="$@" + +term="$(printf '%s\n' "${term}" | sed 's/ /\\/g' )" + +curl -s "https://api.urbandictionary.com/v0/define?term=${term}" | + jq -r '.list[0] | .word, .definition' | + sed -e 's/\[/\o033[1m/g' -e 's/\]/\o033[0m/g' -e '1s/^.*$/\o033[1;4;34m&\o033[0m/' |