summaryrefslogtreecommitdiff
path: root/local/bin/disable-fullscreen-lock
blob: b755ab245430191db1a3aa248fcc570427b0fb38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Periodically checks if the active window is a full screen one and if so,
# uses xdotool to simulate a keypress and unsets+sets DPMS to attempt to
# stop a screen locker from locking the screen.
# My primary use case is for watching youtube videos in full screen without
# needing to wriggle the mouse periodically

DELAY=300

while true; do
	activ_win_id=$(xprop -root _NET_ACTIVE_WINDOW)
	if result=$(xprop -id ${activ_win_id:40:9} | grep _NET_WM_STATE_FULLSCREEN); then
		xdotool key Print
		xset -dpms
		xset dpms
	fi
	sleep "$DELAY"
done