Skip to content

Record screen saver/locker status for inactivity tagging#40

Draft
liskin wants to merge 3 commits intonomeata:masterfrom
liskin:screensaver
Draft

Record screen saver/locker status for inactivity tagging#40
liskin wants to merge 3 commits intonomeata:masterfrom
liskin:screensaver

Conversation

@liskin
Copy link
Contributor

@liskin liskin commented Dec 6, 2020

Tracking inactivity via idle time is unsuitable if one wants to account for activities such as watching movies or reading difficult texts. As media players usually keep the screen saver/locker from triggering, tracking inactivity that way might be more accurate, as long as the screen saver trigger is set to low enough duration or the user diligently locks their screen when walking away.

Currently implemented for X11 only, and even that implementation supports only a few desktop environments.

Closes: #39


  • support for gnome/kde screensavers
  • support for Win32/OSX (probably won't to tackle this myself)
  • documentation

Copy link
Owner

@nomeata nomeata left a comment

Choose a reason for hiding this comment

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

Looks good so far

Comment on lines +131 to +154
-- This most likely only works with the simple built-in screen saver
-- configured using @xset s@. Screen savers/lockers such as xscreensaver,
-- xsecurelock, i3lock, etc. work differently.
Copy link
Owner

Choose a reason for hiding this comment

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

Ah, too bad. I was hoping this simple interface sufficies, and we’d not have to worry about dbus dependencies, error handling, and the cost of doing dbus calls on each sample :-/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's quite disappointing. Doing 5 dbus calls on each sample to discard 4 of them is bad. Caching which one works and which one just returns errors would be possible, but the code will get considerably more complex. :-(

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe submit patches to the screensavers to set the X11 screen saver satus correctly? :-)

@liskin liskin force-pushed the screensaver branch 2 times, most recently from e8c41dc to 63e28d5 Compare March 5, 2021 12:33
liskin added 3 commits March 5, 2021 12:35
Tracking inactivity via idle time is unsuitable if one wants to account
for activities such as watching movies or reading difficult texts.
As media players usually keep the screen saver/locker from triggering,
tracking inactivity that way might be more accurate, as long as the
screen saver trigger is set to low enough duration or the user
diligently locks their screen when walking away.

Currently implemented for X11 only, and even that implementation
supports only a few desktop environments.

Relates: nomeata#39
This makes it possible to detect locked session in a multi-session
setup. Beware, this is niche among niches: very few people use user
systemd and multiple X sessions together, as it's not supported by any
desktop environments.
@gitlerat
Copy link

gitlerat commented Oct 9, 2022

I just discoverd this after creating my issue #163
Wouldnt the idea in 163 also a solution so that idle time = no active window?

@liskin
Copy link
Contributor Author

liskin commented Oct 9, 2022

@gitlerat Sure, I could try to remember to switch all three monitors to an empty virtual desktop every time I leave my computer and make a rule like ! any window $active ==> tag inactive but I'm 99.9% sure it'd take years to retrain my brain to do it, and I'd still forget every time I need to lock it in a hurry. :-/

@gitlerat
Copy link

gitlerat commented Oct 9, 2022

@gitlerat Sure, I could try to remember to switch all three monitors to an empty virtual desktop every time I leave my computer and make a rule like ! any window $active ==> tag inactive but I'm 99.9% sure it'd take years to retrain my brain to do it, and I'd still forget every time I need to lock it in a hurry. :-/

Yeah I understand your point! So I am right that this feature is not in debian versin 0.10.2-0.2? (screenlocker detection)

@liskin
Copy link
Contributor Author

liskin commented Oct 9, 2022

So I am right that this feature is not in debian versin 0.10.2-0.2? (screenlocker detection)

Indeed. It's not even merged to arbtt upstream yet.

The reason it's not merged is because I only got it working for myself, then realised it probably doesn't work in many other scenarios (different desktop environments, different screensavers, …; also the implementation for Win/Mac isn't there at all), but never really managed to get back to it and actually test it, document it, possibly even do the work needed to support the different environments. I think it's somewhat likely to work in GNOME, so it'd certainly make sense to test it, doc it (including the limitations) and get it merged. Even that is probably an afternoon's worth of work and getting that prioritised over all the other stuff going on in my life these days is a challenge. :-/ It is still on my personal TODO list, though, so it's not forgotten.

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

Successfully merging this pull request may close these issues.

Use screen saver/locker to tag inactivity

3 participants