Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 1677  / 3 Years ago, sat, june 26, 2021, 9:06:04

An elderly relative uses a Ubuntu 18.04 + LXDE desktop, mostly just for internet browsing and to play a few word games. They rarely shut the PC down...last time I checked, it had been turned on for over 15 days.


I administer the system remotely over ssh.


For the occasional time that I need to reboot the system, I'd like some means to determine if my relative is actively using it so that I don't disrupt them. I've done it in the middle of the night sometimes, but they sleep poorly and sometimes get up and play their games then.


Calling them on the phone works, but there are several time zones between us, and sometimes it wakes them up.


If they are playing a game, I can see that in top, but I can't find a way to tell if they are actively using the browser.


Some kind of mouse and/or keyboard activity indicator would be awesome, but I wish to stay away from any kind of keylogger type software. I suspect such a "mouse/keyboard activity detected" thing exists - to put the system to sleep / activate the screensaver** and wake it up if for nothing else - but I can't find it.


** I don't think they actually use a screensaver, that was just an example. I think the power manager just blanks the screen.


Is there a "time since last keyboard/mouse interaction from user" tracked somewhere?


Any solutions need to be do-able over ssh.


More From » keyboard

 Answers
2

There exists an utility to print the idle time of the X screen:


DISPLAY=":0" xprintidle

It prints the time since last keyboard or mouse input in milliseconds.




Another option would be to pop up a question box:


DISPLAY=":0" zenity --question --text="Organic Marble asks: Are you currently using this computer?" && echo yes

Then if you get no answer within a few minutes, just ctrl-c it out and proceed to reboot.


[#1126] Sunday, June 27, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
suitman

Total Points: 487
Total Questions: 105
Total Answers: 98

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
;