You are not logged in.
Pages: 1
Hello everybody!
I suggest that you automatically add a small script to the startup when installing.
#!/bin/sh
trap "(xscreensaver -no-splash &); xset +dpms; exit;" 1 2 3 8 9 14 15;
function FULLSCREEN(){
SCRN_SVR_PID="$(ps aux | grep -P 'xscreensaver\ -no-splash' | awk '{print $2}')";
if xset -q | grep -Pq 'DPMS is Enabled'; then
if [[ "a$SCRN_SVR_PID" != "a" ]]; then kill -9 $SCRN_SVR_PID; fi
xset -dpms;
fi
}
function NOT_FULLSCREEN(){
if xset -q | grep -Pq 'DPMS is Disabled'; then
(xscreensaver -no-splash &);
xset +dpms;
fi
}
while true; do
FS_STATUS="false";
win_id_list=`xprop -root _NET_CLIENT_LIST | sed -e 's/.*\#//g' | sed 's/\,/ /g'`;
for win_id in $win_id_list; do
WinFullScreen=`DISPLAY=:0 xprop -id $win_id | grep _NET_WM_STATE_FULLSCREEN`;
if [[ "$WinFullScreen" = *NET_WM_STATE_FULLSCREEN* ]]; then FS_STATUS="true"; fi
done
if [[ "a$FS_STATUS" == "atrue" ]]; then
FULLSCREEN;
else
NOT_FULLSCREEN;
fi
sleep 5;
done
Please forgive for my bad English =)
Last edited by Vasiliy Pogoreliy (2020-11-14 12:24:39)
Offline
Can you please shortly describe what the script is supposed to do?
Offline
Can you please shortly describe what the script is supposed to do?
Thank you for your comment. This script disable screensaver (i use xscreensaver) when application opened in fullscreen mode and running screensaver when application opened in window mode.
Last edited by Vasiliy Pogoreliy (2020-11-16 17:44:31)
Offline
You should not kill xscreensaver by `kill -9`. Manual page of `xscreensaver-command` tells so: "Warning: never use kill -9 with xscreensaver while the screensaver is active. If you are using a virtual root window manager, that can leave things in an inconsistent state, and you may need to restart your window manager to repair the damage." Use `xscreensaver-command -exit`, instead. And you can test, if the daemon is running by `xscreensaver-command -version`.
Not everybody is using xscreensaver. I think it is better to use `xdg-screensaver suspend` and `xdg-screensaver resume` to control running screensaver.
Note also that latest versions of xscreensaver have `xscreensaver-systemd` that is able to inhibit screensaver in some cases:
https://www.jwz.org/xscreensaver/changelog.html
https://github.com/Zygo/xscreensaver/bl … -systemd.c
Offline
The topic is outdated, perhaps no longer relevant.
I have an offer to add this to the distribution. I own English badly, but I hope I managed to convey my idea with the code.
I hope you understand me =).
Offline
Pages: 1
[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 545.71 KiB (Peak: 546.55 KiB) ]