Navigation Menu

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

Get idle status independent of Xserver #1431

Closed
freswa opened this issue Oct 16, 2020 · 6 comments
Closed

Get idle status independent of Xserver #1431

freswa opened this issue Oct 16, 2020 · 6 comments

Comments

@freswa
Copy link

freswa commented Oct 16, 2020

Expected Behavior

Show the correct idle time when using a Wayland based DE.

Current Behavior

Idle time depends from time actively using profanity only

Possible Solution

Implement the Gnome and KDE DBus interfaces to get the idle time independent from the Xserver.

@jubalh
Copy link
Member

jubalh commented Oct 16, 2020

And if the user uses another wayland compositor?

@freswa
Copy link
Author

freswa commented Oct 16, 2020

I digged through the existing wayland compositors. I could only find sway implementing the KDE protocol and a ticket on the wayland protocols repo to merge the KDE approach into the official protocol repository. Other compositors seem to not have picked up any idle protocol at all.
Imho writing the DBus integration is the big problem here. Switching between protocols or integrate protocol changes should be rather straight forward.

@freswa
Copy link
Author

freswa commented Oct 16, 2020

I checked both protocols and they both use a subscription mechanism. In the end events get fired if the user is idle for a certain amount of time and when he's back.

A small summary what has to be done imho, comments appreciated:

  1. If we detect that we can subscribe to a DBus interface, we should disable the call of session_check_autoaway(); in src/profanity.c:113.
  2. We should refactor some logic out of void session_check_autoaway(void) at src/xmpp/session.c:375. We don't need the time calculation for the DBus approach, but the logic about what away msg to set depending on the fired event. I propose to implement a method void set_activity_state(activity_state_t) to make that logic available to the dbus code.
  3. The DBus stuff itself.

@jubalh
Copy link
Member

jubalh commented Jun 9, 2021

@freswa can you implement this?

@freswa
Copy link
Author

freswa commented Jun 9, 2021

@jubalh My work schedule is to tight for now - sorry. Maybe later this year. I'm happy to test and help anyone who like to implement this :)

@jubalh
Copy link
Member

jubalh commented Jun 9, 2021

Ok I don't plan to implement this myself. Feel free to open a PR when you have time :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants