aboutsummaryrefslogtreecommitdiff
path: root/bin/lock
diff options
context:
space:
mode:
Diffstat (limited to 'bin/lock')
-rwxr-xr-xbin/lock11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/lock b/bin/lock
index c776097..36f6ebe 100755
--- a/bin/lock
+++ b/bin/lock
@@ -1,11 +1,20 @@
#! /bin/bash
+refocus_fullscreen_nodes() {
+ while [ -e "$(pgrep -x permafocus)" ]; do sleep 1; done
+
+ for NODE in ${FULLSCREEN_NODES}; do
+ bspc node ${NODE} -t fullscreen
+ done
+}
+
if [ $(pgrep -x lock | wc -l) -gt 2 ]; then
# Starting multiple screen lock instances may cause unintended side effects
exit 0
fi
FOCUSED_MONITOR=$(bspc query -M -m)
+FULLSCREEN_NODES=$(bspc query -N -n any.fullscreen)
bspc monitor -f 1
~/.local/kitty.app/bin/kitty \
@@ -25,6 +34,8 @@ if [ -n "$(xrandr --listmonitors | grep 'DP-2')" ]; then
SECONDARY_WINDOW=$(bspc query -N -n)
fi
+refocus_fullscreen_nodes &
+
~/bin/permafocus ${PRIMARY_WINDOW} ${SECONDARY_WINDOW}
bspc node ${PRIMARY_WINDOW} -k