Recent

Author Topic: How to get user idle time in Linux?  (Read 4370 times)

artem101

  • Jr. Member
  • **
  • Posts: 84
Re: How to get user idle time in Linux?
« Reply #45 on: June 25, 2022, 11:34:18 am »
I'd suggest moving reading the DISPLAY shell variable into the program initialisation

I think this may cause crashes after changing screen configuration (for example, when user connect additional monitor).

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: How to get user idle time in Linux?
« Reply #46 on: June 25, 2022, 12:10:22 pm »
I'd suggest moving reading the DISPLAY shell variable into the program initialisation

I think this may cause crashes after changing screen configuration (for example, when user connect additional monitor).

I wouldn't have thought so, since generally speaking identifiers will be claimed by X11 servers sequentially rather than being shuffled. And I'd have expected that to have applied irrespective of whether multiple monitors tiled onto the same desktop environment or were allocated different desktop environments (i.e. distinct window managers).

Also I wouldn't have expected X11 applications to have tolerated having to shut their existing socket connection (TCP, unix-domain or whatever... basically, what you weren't closing earlier even if it's not readily visible) in response to that sort of external event.

I was "playing" with multiple devices a few weeks ago, but I don't think that involved any hotplugging (multiple outputs on the same physical card, and the low-level X11 driver wanted to know which ones had something attached when it initialised).

However I'd be interested to be proven wrong :-)

MarkMLl
« Last Edit: June 25, 2022, 04:26:24 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: How to get user idle time in Linux?
« Reply #47 on: June 25, 2022, 03:54:15 pm »
I'd suggest moving reading the DISPLAY shell variable into the program initialisation

I think this may cause crashes after changing screen configuration (for example, when user connect additional monitor).

I wouldn't have thought so, since generally speaking identifiers will be claimed by X11 servers sequentially rather than being shuffled. And I'd have expected that to have applied irrespective of whether multiple monitors tiled onto the same desktop environment or were allocated different desktop environments (i.e. distinct window managers).

Also I wouldn't have expected X11 applications to have tolerated having to shut their existing socket connection (TCP, unix-domain or whatever... basically, what you weren't closing earlier even if it's not readily visible) in response to that sort of external event.

I was "playing" with multiple devices a few weeks ago, but I don't think that involved any hotplugging (multiple outputs on the same physical card, and the low-level X11 driver wanted to know which ones had something attached when it initialised).

However I'd be interested to be proven wrong :-)

MarkMLl

OT: You say you don't boost your stats and here you are: replying to yourself  :)

P.S.: No hard feeling, I am only joking, I see you probably wanted to edit your post  ;)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: How to get user idle time in Linux?
« Reply #48 on: June 25, 2022, 04:24:39 pm »
OT: You say you don't boost your stats and here you are: replying to yourself  :)

P.S.: No hard feeling, I am only joking, I see you probably wanted to edit your post  ;)

Ouch :-) Sorry, you're right: I'd incorrectly said UDP when I meant TCP, and wanted to emphasise that it was a correction-oriented protocol.

Edit: CONNECTION, dagnabbit :-)

MarkMLl
« Last Edit: June 25, 2022, 04:59:25 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018