Add xidle-dim notifier to dim the screen before xss-lock locks
Fades a black window in over the screen through the compositor, so it works with redshift (no gamma changes); does nothing without a compositor. README shows it in the xss-lock setup.
This commit is contained in:
@@ -28,6 +28,7 @@ Formerly `xautolock-inhibit`, which supported only xautolock.
|
||||
- `xautolock` or `xss-lock`, already running in the session
|
||||
- `python`, `python-gobject`
|
||||
- `libx11`, `libxss`
|
||||
- For `xidle-dim`: a compositor, such as picom
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -46,14 +47,16 @@ spawnOnce "xautolock -time 10 -locker slock -detectsleep"
|
||||
spawnOnce "systemctl --user start xidle-inhibit"
|
||||
```
|
||||
|
||||
With xss-lock, the lock timeout is the X screensaver timeout (`xset s`):
|
||||
With xss-lock, the lock timeout is the X screensaver timeout (`xset s TIMEOUT CYCLE`). This dims the screen with `xidle-dim` at 9:50 and locks at 10:00:
|
||||
|
||||
```haskell
|
||||
spawnOnce "xset s 600"
|
||||
spawnOnce "xss-lock -- slock"
|
||||
spawnOnce "xset s 590 10"
|
||||
spawnOnce "xss-lock -n xidle-dim -- slock"
|
||||
spawnOnce "systemctl --user start xidle-inhibit"
|
||||
```
|
||||
|
||||
Without dimming, use `xset s 600 0` and `xss-lock -- slock`. Start xss-lock from the window manager, not from a terminal: terminals like kitty run commands outside the login session, and xss-lock then ignores `loginctl lock-session`.
|
||||
|
||||
The unit has no `[Install]` section on purpose. Enabling it at login would also start it in a desktop environment, or before X is up; starting it from the window manager limits it to that session. The user service manager needs `DISPLAY` (and `XAUTHORITY`) in its environment, which `/etc/X11/xinit/xinitrc.d/50-systemd-user.sh` sets up for `startx` sessions.
|
||||
|
||||
### Upgrading from xautolock-inhibit
|
||||
@@ -107,6 +110,19 @@ Every request, release and locker command is logged to the journal:
|
||||
journalctl --user -u xidle-inhibit
|
||||
```
|
||||
|
||||
### Dimming before the lock
|
||||
|
||||
`xidle-dim` is an xss-lock notifier (`-n`). It fades a black window over the screen until xss-lock stops it, on user activity or when the locker starts. It needs a compositor such as picom and does nothing without one. Because it doesn't change gamma, it works alongside redshift.
|
||||
|
||||
```
|
||||
xidle-dim [--opacity 0-1] [--fade SECONDS]
|
||||
```
|
||||
|
||||
- `--opacity`: final darkness (default 0.6).
|
||||
- `--fade`: fade-in time (default 1.5).
|
||||
|
||||
Options go inside the notifier command: `xss-lock -n "xidle-dim --opacity 0.8" -- slock`.
|
||||
|
||||
## App notes
|
||||
|
||||
- **Sandboxed apps** may be blocked from reaching the service. For a firejail profile that filters D-Bus (`dbus-user filter`, as the Firefox-based profiles do), allow it in the app's `.local` file, e.g. `zen-browser.local`:
|
||||
|
||||
Reference in New Issue
Block a user