Skip to content

Commit

Permalink
Fix idle-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
bgamari committed Nov 3, 2019
1 parent 804eddf commit 69bea3d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/hamster/idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,8 @@ def bus_inspector(self, bus, message):
idle_state = message.get_args_list()[0]
if idle_state:
self.idle_from = dt.datetime.now()

# from gnome screensaver 2.24 to 2.28 they have switched
# configuration keys and signal types.
# luckily we can determine key by signal type
if member == "SessionIdleChanged":
delay_key = "/apps/gnome-screensaver/idle_delay"
else:
delay_key = "/desktop/gnome/session/idle_delay"

settings = gio.Settings()
self.timeout_minutes = client.get_value(delay_key)
settings = gio.Settings("org.gnome.desktop.session")
self.timeout_minutes = settings.get_value("idle-delay")

else:
self.screen_locked = False
Expand Down

0 comments on commit 69bea3d

Please sign in to comment.