Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with xscreensaver #41

Open
gmar5 opened this issue Jun 1, 2016 · 3 comments
Open

Problem with xscreensaver #41

gmar5 opened this issue Jun 1, 2016 · 3 comments

Comments

@gmar5
Copy link

gmar5 commented Jun 1, 2016

Hi,

When I run logactivewin.sh in Xfce I get the following error: no saver status on root window., and only __LOCKEDSCREEN is logged.

I assume it is a problem of when it checks the screensaver (I had to install xscreensaver in the first place, as it wouldn't work otherwise; and I don't see why this should be required).

I have seen here a similar problem related to the gnome-screensaver: #24

I am not familiar with the language, so I'm not of much help. Does anybody know what needs to be fixed?
I assume it would be here?

do
    islocked=true
    # Try to figure out which Desktop Manager is running and set the
    # screensaver commands accordingly.
    if [[ $GDMSESSION == 'xfce' ]]; then
        # Assume XFCE folks use xscreensaver (the default).
        screensaverstate=$(xscreensaver-command -time | cut -f2 -d: | cut -f2-3 -d' ')
        if [[ $screensaverstate =~ "screen non-blanked" ]]; then islocked=false; fi
    elif [[ $GDMSESSION == 'ubuntu' || $GDMSESSION == 'ubuntu-2d' || $GDMSESSION == 'gnome-shell' || $GDMSESSION == 'gnome-classic' || $GDMSESSION == 'gnome-fallback' || $GDMSESSION == 'cinnamon' ]]; then
        # Assume the GNOME/Ubuntu/cinnamon folks are using gnome-screensaver.
        screensaverstate=$(gnome-screensaver-command -q 2>&1 /dev/null)
        if [[ $screensaverstate =~ .*inactive.* ]]; then islocked=false; fi
    elif [[ $XDG_SESSION_DESKTOP == 'KDE' ]]; then
        islocked=$(qdbus org.kde.screensaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive)
    else
        # If we can't find the screensaver, assume it's missing.
        islocked=false
    fi

    if [ $islocked = true ]; then
        curtitle="__LOCKEDSCREEN"
    else 
        id=$(xdotool getactivewindow)
        curtitle=$(wmctrl -lpG | while read -a a; do w=${a[0]}; if (($((16#${w:2}))==id)) ; then echo "${a[@]:8}"; break; fi; done)
    fi

    perform_write=false

Here is xscreensaver-command as possible reference: https://github.com/danfuzz/xscreensaver/blob/master/driver/xscreensaver-command.c

Thank you!

@gmar5
Copy link
Author

gmar5 commented Jun 9, 2016

I have found out that the script runs without that error only after I turn the screensaver on and I manually make it start once. Any ideas on how to avoid this?

@gmar5
Copy link
Author

gmar5 commented Jun 9, 2016

Related to this (I think), it does not perceive when the system is suspended, as if there's no change in active window. Instead of the locked screen flag, it just doesn't break the block for the window that was active before suspend.

Sorry to insist. It would look like the problem should be common to all those using Xfce.

@nPHYN1T3
Copy link

nPHYN1T3 commented Jul 24, 2020

Potential necrobump...just encountering this today. XFCE as well however I think this (for me) has to do with multi GPU and xscreensaver is confused. I've tried launching specifying a GPU but no dice, everything returns "no saver status on root window."

When I add it to the xfce session it seems to work but running it after the session gives the error. Not sure why this is given it should be run as/for the same user and I can't suss out any special launch args in how the session launches it but I'm also not going to dig deep. Just frustrating fix one thing expose another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants