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

Animated lock/screensaver #2254

Closed
TimsManter opened this issue Jul 12, 2018 · 3 comments
Closed

Animated lock/screensaver #2254

TimsManter opened this issue Jul 12, 2018 · 3 comments

Comments

@TimsManter
Copy link

TimsManter commented Jul 12, 2018

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 cmatrix and enables transparent swaylock so nothing below is visible,
  • If there's e.g. fullscreen YouTube video or any other fullscreen window: Termite is not getting fullscreen so the primary window is visible under transparent swaylock (so it's still locked).

I think there're at least two things that can be improved:

  1. Ability to set command to run in swaylock container just like solid color or image so the script wouldn't be mandatory,
  2. Appearance setting to disable cleared indicator or set delay in seconds after indicator is hidden; current --no-unlock-indicator is not a good solution.

BTW: The setup above works on current wlroots version of sway from the latest master branch.

@ddevault
Copy link
Contributor

Ability to set command to run in swaylock container just like solid color or image so the script wouldn't be mandatory,

What?

I'm not sure what you expect to come out of this ticket.

@TimsManter
Copy link
Author

TimsManter commented Jul 12, 2018

Ability to set command to run in swaylock container just like solid color or image so the script wouldn't be mandatory
What?

Currently swaylock behaves as a top layer to sway workspace. swaylock by itself renders two separate layers - background and indicator - it's possible to set color or image as a background layer but not a window like termite. Such option would make many customization possibilities.

I'm not sure what you expect to come out of this ticket.

I introduced my hack to make something like xscreensaver mixed with lock screen but in Wayland/Sway way and only thing I expect is opinion that it could be eventually implemented more natively in Sway later on in form of appearance settings in this or other way.

@ddevault
Copy link
Contributor

Currently swaylock behaves as a top layer to sway workspace. swaylock by itself renders two separate layers - background and indicator - it's possible to set color or image as a background layer but not a window like termite. Such option would make many customization possibilities.

This isn't going to happen.

I suggest you fork swaylock.

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

No branches or pull requests

2 participants