aboutsummaryrefslogtreecommitdiff
path: root/bin/permafocus
blob: 3eca33c04b0bde813f313b3c66ebc3ad9589cef5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/bash

# THIS SCRIPT IS FOR SCREENSAVER USE ONLY

bspc node -f $2
bspc node $2 -t fullscreen
bspc node $2 -l above

bspc node -f $1
bspc node $1 -t fullscreen
bspc node $1 -l above

sleep 1

killall -q -9 su

while [ -n "$(bspc query -N -n $1)" ]; do
	while [[ "$(bspc query -N -n focused)" == "$1" ]]; do sleep 1; done
	sleep 2

	if [ -n "$(bspc query -N -n $1)" ]; then
		bspc node -f $2
		bspc node $2 -t fullscreen
		bspc node $2 -l above

		bspc node -f $1
		bspc node $1 -t fullscreen
		bspc node $1 -l above

		sleep 1

		killall -q -9 su
	fi
done