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
gnome-flashback: add option to replace gnome-screensaver with xscreensaver #76540
Conversation
I'd really appreciate some help with how to structure this. Also, currently it works because gnome launches the dbus service for |
Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/troubleshooting-a-custom-gdm-session/5230/7 |
install_requires=['pygobject'], | ||
entry_points=''' | ||
[console_scripts] | ||
gnome-screensaver=gnomexscreensaver:main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gnome-screensaver=gnomexscreensaver:main | |
gnome-xscreensaver=gnomexscreensaver:main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want this to be a drop-in replacement for gnome-screensaver
, hence the executable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that to be confusing in process manager. Or is there something that attempts to run it directly?
@@ -0,0 +1,229 @@ | |||
import subprocess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python should use four space indentation. Also dbus-python is deprecated so maybe something like jeepney would work better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with pydbus
first but it didn't work (and also seems to be dead for 3 years). jeepney
doesn't seem to support exporting interfaces and other libraries also seemed quite immature.
inhibitions.pop(cookie, None) | ||
|
||
def Throttle(app_name, reason, cookie): | ||
# TODO, not sure if this is possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manpage suggests to turn off the monitor 😆 https://www.jwz.org/xscreensaver/man3.html#4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯_(ツ)_/¯
return int((time - blank_time).total_seconds()) | ||
|
||
def GetSessionIdle(): | ||
# TODO: is this possible to implement? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using -watch
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually -time
prints details XScreenSaver 5.43: screen non-blanked since Sat Dec 28 08:22:48 2019 (hack #186)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't report idleness unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say XScreenSaver 5.43: screen blanked since Sat Dec 28 08:26:18 2019 (hack #211)
is idle.
I would expect idle to mean blank, since there is no other similar thing in the dbus api: https://gitlab.gnome.org/Archive/gnome-screensaver/blob/master/doc/dbus-interface.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think idle means the user not moving (even before the screensaver turns on). What you're talking about is GetActiveTime
. I'm currently looking at getting the idle time either with xprintidle
or with dbus from the gnome session manager.
796c4a1
to
10f790a
Compare
10f790a
to
7d99da9
Compare
Closing as gnome-flashback now has screensaver support built-in. |
Motivation for this change
gnome-screensaver
is used by default bygnome-flashback
even though it's deprecated and doesn't have a configuration tool. This commit adds an option that replaces it with a wrapper around xscreensaver.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @