sisyphus/scripts/focus.sh
Tibo De Peuter 5f8bd21d87 Fixed focus shortcut
Fixed the right shortcut and added description
2022-06-29 17:43:09 +02:00

16 lines
411 B
Bash
Executable file

#!/usr/bin/env bash
# Script to toggle black background to focus on sway
# 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