-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
It's an use case of swaylock and an idea for little improvement to make swaylock more flexible.
I've managed to personalize swaylock so it now works as animated lock screen. The way is to use custom script which creates floating window with specified title (termite + cmatrix in my case), next runs swaylock with transparent color and at the end waits for swaylock process to exit then kills floating window. Script by itself looks like so:
#!/bin/sh
term='termite -t Screensaver -e'
saver=cmatrix
locker='swaylock -c 00000000'
($term $saver) &
sleep .2
($locker && kill $!) &And is controlled by swayidle in config:
for_window [title="Screensaver"] floating enable
for_window [title="Screensaver"] fullscreen enable
set $kbdbl sudo brightnessctl -d tpacpi::kbd_backlight set
set $scroff swaymsg "output * dpms off"
set $scron swaymsg "output * dpms on"
set $hidecursor swaymsg seat seat0 cursor set 2000 2000
exec swayidle \
timeout 5 '$hidecursor' \
timeout 300 locker \
timeout 360 '$scroff; $kbdbl 0' \
resume '$scron; $kbdbl 1' \
before-sleep locker
The final result depends on:
- If there's no fullscreen window already: Shows fullscreen
cmatrixand enables transparentswaylockso nothing below is visible, - If there's e.g. fullscreen YouTube video or any other fullscreen window:
Termiteis not getting fullscreen so the primary window is visible under transparentswaylock(so it's still locked).
I think there're at least two things that can be improved:
- Ability to set command to run in
swaylockcontainer just like solid color or image so the script wouldn't be mandatory, - Appearance setting to disable
clearedindicator or set delay in seconds after indicator is hidden; current--no-unlock-indicatoris not a good solution.
BTW: The setup above works on current wlroots version of sway from the latest master branch.
Metadata
Metadata
Assignees
Labels
No labels