From e092f769c611cb03e2702202e96b3904d704290c Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Mon, 17 Feb 2025 10:45:51 -0800 Subject: [PATCH] Add bin/ scripts referenced in configs Still not 100% sure how I want to tokenize this up. For now if I reference a script in a config file, I should probably include it so the env is complete. --- bin/mic_mute | 3 +++ bin/notifylog | 3 +++ bin/screenshot | 13 +++++++++++++ 3 files changed, 19 insertions(+) create mode 100755 bin/mic_mute create mode 100755 bin/notifylog create mode 100755 bin/screenshot diff --git a/bin/mic_mute b/bin/mic_mute new file mode 100755 index 0000000..9035ef7 --- /dev/null +++ b/bin/mic_mute @@ -0,0 +1,3 @@ +# Toggle mic mute then tell waybar to update its mic display widget +wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +pkill -SIGRTMIN+1 waybar diff --git a/bin/notifylog b/bin/notifylog new file mode 100755 index 0000000..b839bfc --- /dev/null +++ b/bin/notifylog @@ -0,0 +1,3 @@ +# Called by dunst to blat a notification into a log in tmpfs, for perusal by my hud script +# There's a security concern here, logging notifications like this. Only do this on a system you have control over +(echo -e "`date '+%m-%dT%H:%M'`\0 $DUNST_APP_NAME\0 $DUNST_SUMMARY\0 $DUNST_BODY" | tr '\n' ' ' ; echo '') >> $XDG_RUNTIME_DIR/notifylog diff --git a/bin/screenshot b/bin/screenshot new file mode 100755 index 0000000..14787d6 --- /dev/null +++ b/bin/screenshot @@ -0,0 +1,13 @@ +# Make sure our dir is here +mkdir -p ${XDG_RUNTIME_DIR}/screenshots/ + +# Take a full screenshot of the focused display, display it +grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | swayimg -f - & +swayimg_pid=$! +sleep 0.5 + +# Activate slurp's rectangular select mode to snip a segment of the screenshot we took +grim -g "$(slurp -dc ff0000)" ${XDG_RUNTIME_DIR}/screenshots/shot_$(date +%s).png + +# Kill the full screen screenshot display +kill $swayimg_pid