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

@chpatrick chpatrick commented Dec 26, 2019

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

@chpatrick chpatrick commented Dec 26, 2019

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

@nixos-discourse nixos-discourse commented Dec 27, 2019

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

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

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

This comment has been minimized.

@chpatrick

chpatrick Dec 28, 2019
Author Contributor

I want this to be a drop-in replacement for gnome-screensaver, hence the executable name.

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

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

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

Python should use four space indentation. Also dbus-python is deprecated so maybe something like jeepney would work better.

This comment has been minimized.

@chpatrick

chpatrick Dec 28, 2019
Author Contributor

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

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

manpage suggests to turn off the monitor 😆 https://www.jwz.org/xscreensaver/man3.html#4

This comment has been minimized.

@chpatrick

chpatrick Dec 28, 2019
Author Contributor

¯_(ツ)_/¯

return int((time - blank_time).total_seconds())

def GetSessionIdle():
# TODO: is this possible to implement?

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

Maybe using -watch?

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

Actually -time prints details XScreenSaver 5.43: screen non-blanked since Sat Dec 28 08:22:48 2019 (hack #186)

This comment has been minimized.

@chpatrick

chpatrick Dec 28, 2019
Author Contributor

It doesn't report idleness unfortunately.

This comment has been minimized.

@jtojnar

jtojnar Dec 28, 2019
Contributor

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

This comment has been minimized.

@chpatrick

chpatrick Dec 28, 2019
Author Contributor

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.

@chpatrick chpatrick force-pushed the chpatrick:gnome-xscreensaver branch from 796c4a1 to 10f790a Dec 28, 2019
@chpatrick chpatrick force-pushed the chpatrick:gnome-xscreensaver branch from 10f790a to 7d99da9 Dec 28, 2019
@jtojnar jtojnar mentioned this pull request Mar 17, 2020
@jtojnar
Copy link
Contributor

@jtojnar 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.