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

gnome-flashback: add option to replace gnome-screensaver with xscreensaver #76540

Closed
wants to merge 3 commits into from

Conversation

chpatrick
Copy link
Contributor

Motivation for this change

gnome-screensaver is used by default by gnome-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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@chpatrick
Copy link
Contributor Author

I'd really appreciate some help with how to structure this. Also, currently it works because gnome launches the dbus service for gnome-screensaver, but really it should be autostarted by gnome-flashback. I couldn't get this to work though.

Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
@nixos-discourse
Copy link

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gnome-screensaver=gnomexscreensaver:main
gnome-xscreensaver=gnomexscreensaver:main

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe using -watch?

Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

@jtojnar
Copy link
Contributor

jtojnar commented Mar 26, 2020

Closing as gnome-flashback now has screensaver support built-in.

@jtojnar jtojnar closed this Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants