A lot of scripting

This commit is contained in:
Tibo De Peuter 2022-06-02 11:47:06 +02:00
parent 945c6cd41d
commit 427b776485
3 changed files with 59 additions and 9 deletions

20
scripts/dnd.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Script to toggle Do not disturb mode for mako
# Permanent memory
saved_state=0
# Toggle
if [ "${saved_state}" -eq 0 ] ; then
~/.scripts/notify.sh 'Hiding notifications'
sleep 2
makoctl set-mode do-not-disturb
else
makoctl set-mode default
~/.scripts/notify.sh 'Showing notifications'
fi
# Update status in file
new_state=$( bc "(${saved_state} + 1) % 2" )
sed -i "s/saved_state=[0|1]/saved_state=${new_state}/" ~/.scripts/dnd.sh

16
scripts/focus.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Script to toggle black background to focus
# Get instances of swaybg, except for the 'standard' one.
list=$( pgrep swaybg | head -n -1 )
if [ -z "${list}" ] ; then
swaybg --mode=solid_color --color=#000000 &
# Give the previous command some time to execute
sleep .1
swaymsg reload
else
# Clean up if already running
kill $( tr ' ' '\n' <<< ${list} )
fi