||7 months ago|
|README.org||8 months ago|
|exwm-ss.el||7 months ago|
EXWM-SS is a global minor mode which inhibits the screensaver automatically when watching videos. This fills a gap in EXWM, compared to other Linux DEs.
The default behavior is to inhibit the screensaver if:
- Any X client is fullscreen and visible (that is: not in a workspace which isn’t being displayed by some monitor).
A special X client is visible (even if it’s not fullscreen).
- Special clients are MPV, VLC, and Jellyfin Media Player, but this can be extended.
Use straight.el. You can install straight-weirdware to add the recipe, or install manually with:
(use-package exwm-ss :defer t :after exwm :straight (exwm-ss :repo "https://codeberg.org/emacs-weirdware/exwm-ss.git") :init (exwm-ss-mode 1))
Enable the mode:
For maximum flexibility, EXWM-SS is factored out into several pieces:
EXWM-SSdetermines how the screensaver is inhibited.
EXWM-SSimplementation which uses
xset(1)to control DPMS screen blanking.
EXWM-SSimplementation which calls
xscreensaver-command -deactivateevery 60 seconds, to prevent it from activating.
EXWM-SS-CONTROLdetermines when the screensaver should (or should not) be activated.
- It handles hooking into EXWM to pick up state change events.
- Generic function
EXWM-SS-INHIBITED?determines whether the current WM state should cause the screensaver to be inhibited.
EXWM-SS-CONTROLimplementation which contains the default logic for when the screensaver should be inhibited — visible fullscreen or visible special client.
EXWM-SS-CONTROL-DEFAULTis the composite default
EXWM-SS-CONTROLimplementation. It contains no logic of its own, and inherits from
- Alternate controller classes may be specified by customizing
EXWM-SS-CONTROLLER-CLASS. Your controller must inherit from
EXWM-SS-CONTROLand mix in one or more
Example of Extending EXWM-SS
Say that you’d like the screensaver to be inhibited when a hypothetical new video player, Coolplayer, is visible.
First, create a new implementation of
(defclass my-exwm-ss-control (exwm-ss-control-default) () :documentation "My personal `EXWM-SS-CONTROL' implementation.") (cl-defmethod exwm-ss-special? ((ssc my-exwm-ss-control) buf) (or (cl-call-next-method ssc buf) (string= exwm-class-name "coolplayer")))
(use-package exwm-ss :defer t :after exwm :straight (exwm-ss :repo "http://codeberg.org/ieure/exwm-ss.git") :custom (exwm-ss-controller-class 'my-exwm-ss-control) :init (exwm-ss-mode 1))
If you need a new mechanism for disabling
screensavers, that can be done by creating an
implementation, and declaring a new class which mixes it in:
(defclass my-exwm-ss-control (exwm-ss-control-base my-exwm-ss-screensaver-method) ())
Then set the controller class the same way.