diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-07 23:29:32 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-08 00:25:35 +0100 |
commit | 963a4a0b6710bd23008644a622a09577d42e96dd (patch) | |
tree | d2baf6d38dc08835aba5eeaed079fe1a439eec02 /bin | |
parent | ed264f6b7d8edb41f15000df881163e5e3d34b6f (diff) |
added dmask and dmcurs
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common/ask | 2 | ||||
-rwxr-xr-x | bin/guiscripts/dmask | 9 | ||||
-rwxr-xr-x | bin/guiscripts/dmcurs | 9 |
3 files changed, 19 insertions, 1 deletions
diff --git a/bin/common/ask b/bin/common/ask index 0f49a99..79899cf 100755 --- a/bin/common/ask +++ b/bin/common/ask @@ -12,7 +12,7 @@ else prompt="$@" fi -prompt="$(echo "$prompt" | tr "\n\t" ' ')" +prompt="$(echo "$prompt" | tr "\n\t" ' ' | tr '"' "'")" API_KEY="$(pass tokens/openai-api)" diff --git a/bin/guiscripts/dmask b/bin/guiscripts/dmask new file mode 100755 index 0000000..067e311 --- /dev/null +++ b/bin/guiscripts/dmask @@ -0,0 +1,9 @@ +#!/bin/sh + +# requirements +which dmenu Xdialog ask > /dev/null || + exit 1 + +prompt="$(echo -n | dmenu -p "prompt:" | tr -d '\n')" +test -z "$prompt" && exit 1 +Xdialog --wrap --msgbox "$(ask "$prompt")" 20 40 diff --git a/bin/guiscripts/dmcurs b/bin/guiscripts/dmcurs new file mode 100755 index 0000000..31b71fa --- /dev/null +++ b/bin/guiscripts/dmcurs @@ -0,0 +1,9 @@ +#!/bin/sh + +# requirements +which dmenu firefox > /dev/null || + exit 1 + +choice="$(find ${1:-$HOME/docs/school} | grep "Cursus/index.html" 2> /dev/null | sed "s;${HOME};~;" | dmenu -g 1 -l 10 -x -i)" +test -z "$choice" && exit 1 +firefox "$choice" |