summaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-07-07 15:55:54 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-07-07 15:55:54 -0500
commit38ebf64b07f99de9464905ee5f8aaee1148b6a4f (patch)
tree1617ef65c4bd54db8f48cf70122ef7b923c623ab /keyboard
parent35a2dd3734f1d31060fe28837cf0e1d947c8d6f4 (diff)
downloadscripts-38ebf64b07f99de9464905ee5f8aaee1148b6a4f.tar.xz
scripts-38ebf64b07f99de9464905ee5f8aaee1148b6a4f.zip
tons of changes from when website was down
Diffstat (limited to 'keyboard')
-rwxr-xr-xkeyboard/mounter2
-rwxr-xr-xkeyboard/screenshot17
2 files changed, 13 insertions, 6 deletions
diff --git a/keyboard/mounter b/keyboard/mounter
index 90c6caf..e0a8fac 100755
--- a/keyboard/mounter
+++ b/keyboard/mounter
@@ -1,6 +1,6 @@
#!/bin/sh
# TODO: add support for mounting discs
-sudo=doas
+sudo=${SUDO:-sudo}
mps=/media/mnt # User should have ownership of this directory
notify='notify-send --urgency low'
diff --git a/keyboard/screenshot b/keyboard/screenshot
index f0d0fff..25e99cd 100755
--- a/keyboard/screenshot
+++ b/keyboard/screenshot
@@ -1,5 +1,13 @@
#!/bin/sh
-printusage() { echo "Usage: $(basename "$0") [-cx]\n\nOPTIONS:\n -c\tInteractively crop screenshot\n -x\tCopy screenshot to clipboard with xclip rather than saving it" && exit; }
+printusage() {
+cat << HELPDOC
+Usage: $(basename "$0") [-cx]
+
+OPTIONS:
+ -c\tInteractively crop screenshot
+ -x\tCopy screenshot to clipboard with xclip rather than saving it
+HELPDOC
+}
# Scrot and xclip opts
fmt=$(date '+%m-%d-%4Y_%I:%M:%S_%p.png')
@@ -29,11 +37,10 @@ while getopts "cxh" arg; do
case "$arg" in
c) opt=$cropopt ;;
x) path=$tmppath; exp=$xclipexp; summ=$xclipsumm; body=$xclipbody ;;
- h) printusage ;;
- *) printusage ;;
+ h|*) printusage && exit ;;
esac
done
scrot $opt $path --exec "$exp" \
-&& notify-send $notifyopts -i $path "$summ" "$body" \
-|| notify-send $notifyopts "Screenshot Failed!"
+ && notify-send $notifyopts -i $path "$summ" "$body" \
+ || notify-send $notifyopts "Screenshot Failed!"