WayAFK

By SomewhereOutInSpace
Version: 1.0.0
Updated: 04/10/2023 00:45:39
Downloads: 2,113
A fix for AFK detection under Wayland display servers.

WayAFK

This is a simple plugin for BetterDiscord that fixes this longstanding bug with AFK detection on Wayland.

Normally, when running the Discord client under Wayland, the AFK detection will never fire. EVER. This means (among other things) that you won't receive mobile notifications while the client is open under Wayland, which is incredibly frustrating.

WayAFK fixes this by implementing its own form of AFK monitoring, then lying to Discord about your status once it's tripped.

  • On startup, WayAFK subscribes to the keydown and mousedown events. Whenever you press a key or use your mouse inside the Discord window, a timer will be reset.
  • Once a second, WayAFK checks to see if the time since your last "interaction" has exceeded the (user-configurable) timeout threshold.
    • If it has, WayAFK will send a "user is AFK" event, then start suppressing any events that say otherwise.
    • Once it detects another interaction, this behavior stops until the timeout is tripped again.

Actions

About

Author

User avatar
SomewhereOutInSpace

Tags

utility