Locking the screen when the currently active window is on fullscreen is
generally undesired behaviour. While it is possibile that not everybody
has xdotool, I was unable to find a simpler way of detecting fullscreen
mode. I made sure to suppress any unnecessary output/singal.
---
 xsidle.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xsidle.sh b/xsidle.sh
index cc3b2a4..fe5aaf1 100755
--- a/xsidle.sh
+++ b/xsidle.sh
@@ -10,6 +10,16 @@ then
 fi
 cmd="$@"
 
+isFullscreen() {
+       if command -v xdotool >/dev/null && command -v xprop >/dev/null;
+       then
+               xprop -id $(xdotool getactivewindow) | grep 
"_NET_WM_STATE_FULLSCREEN" >/dev/null
+               return
+       else
+               return 1
+       fi
+}
+
 while true
 do
        if [ $(xssstate -s) != "disabled" ];
@@ -19,6 +29,7 @@ do
                then
                        $cmd
                else
+                       isFullscreen && xset s reset
                        sleep $tosleep
                fi
        else
-- 
2.27.0


Reply via email to