summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmask
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-08 00:27:49 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-08 00:27:49 +0100
commite5bf705060f230750950571a04a259b8eac48459 (patch)
tree3388c308364550fa33e53d3685e7a58870a540cb /bin/guiscripts/dmask
parent4b65e832b57a00c2cfb3c80335c9087b536b2e6b (diff)
added more normalization and added auto size for dmask
Diffstat (limited to 'bin/guiscripts/dmask')
-rwxr-xr-xbin/guiscripts/dmask10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/guiscripts/dmask b/bin/guiscripts/dmask
index 067e311..6772854 100755
--- a/bin/guiscripts/dmask
+++ b/bin/guiscripts/dmask
@@ -4,6 +4,12 @@
which dmenu Xdialog ask > /dev/null ||
exit 1
-prompt="$(echo -n | dmenu -p "prompt:" | tr -d '\n')"
+prompt="$(echo -n | dmenu -p "prompt:" | tr '"' "'")"
+
test -z "$prompt" && exit 1
-Xdialog --wrap --msgbox "$(ask "$prompt")" 20 40
+answer="$(ask "$prompt" | tr '"' "'" | fold -w 80 -s)"
+
+if ! Xdialog --wrap --msgbox "${answer:1}" 0 0
+then
+ echo -n "$answer" | xclip -r -sel c
+fi