swaywm / swaylock Goto Github PK
View Code? Open in Web Editor NEWScreen locker for Wayland
License: MIT License
Screen locker for Wayland
License: MIT License
Would be really nice to have an option to clear all the input with one backspace.
Hi,
Here we have:
It builds though, but doesn't integrate well in gentoo's package management system (portage)
Thks 4 ur attention.
Just need to implement logging internally.
Probably just add some sleep
calls when verification fails.
most screen lockers these days have an option to delay the password requirement, so that if your locker activates you have 2-3 seconds to just press a button and get your screen back without typing the password.
meson_options.txt defines {bash,fish,zsh}-completions but after swaywm/sway@3fca8b8d22ee the files are missing.
completions/bash/swaylock
completions/fish/swaylock.fish
completions/zsh/_swaylock
Trying to replicate the behavior from i3lock with the following systemd service:
[Unit]
Description=Lock screen on resume from suspend
Before=sleep.target
[Service]
User=kf
Environment=DISPLAY=:0
Type=forking
ExecStart=/usr/bin/swaylock
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
but it is not running... the exact same service runs fine with i3lock.
Output from journalctl:
Feb 02 15:13:48 arch systemd-logind[3378]: Lid closed.
Feb 02 15:13:48 arch systemd-logind[3378]: Suspending...
Feb 02 15:13:48 arch systemd[1]: Starting Lock screen on resume from suspend...
-- Subject: A start job for unit lock.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit lock.service has begun execution.
--
-- The job identifier is 1703.
Feb 02 15:13:48 arch swaylock[16317]: error: XDG_RUNTIME_DIR not set in the environment.
Feb 02 15:13:48 arch swaylock[16317]: 2019-02-02 15:13:48 - [swaylock/main.c:1047] Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY enviro>
Feb 02 15:13:48 arch systemd[1]: lock.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An ExecStart= process belonging to unit lock.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Feb 02 15:13:49 arch systemd[1]: lock.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit lock.service has entered the 'failed' state with result 'exit-code'.
Feb 02 15:13:49 arch systemd[1]: Failed to start Lock screen on resume from suspend.
-- Subject: A start job for unit lock.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit lock.service has finished with a failure.
--
-- The job identifier is 1703 and the job result is failed.
Feb 02 15:13:49 arch systemd[1]: Reached target Sleep.
-- Subject: A start job for unit sleep.target has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit sleep.target has finished successfully.
--
-- The job identifier is 1649.
Feb 02 15:13:49 arch systemd[1]: Starting Suspend...
-- Subject: A start job for unit systemd-suspend.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit systemd-suspend.service has begun execution.
--
-- The job identifier is 1646.
Feb 02 15:13:49 arch systemd-sleep[16320]: Suspending system...
-- Subject: System sleep state suspend entered
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The system has now entered the suspend sleep state.
System Arch Linux 4.14.71-rt44-1-rt-lts, sway version 1.0-beta.2-204-g70637b40 (Jan 17 2019, branch 'master'), swaylock version 1.2-46-geffdea5 (Feb 1 2019, branch 'master')
Am I just messing up the systemd service file, or is there a bug somewhere?
This is an enhancement request. It would be nice if swaylock supported disabling switching consoles, for obvious reasons...
Hi, I'm loving using Sway and Wayland so far! I've got some high hopes for the future.
It looks like there aren't options for a clock or a date to be displayed on the lock screen. I was wondering if there are plans to add these features to swaylock. I was using i3lock-color before switching to Sway, and I loved the ability to show a clock and date in one corner while setting the indicator to display in another corner.
This is really minor. As long as you don't move your cursor after activating swaylock, the cursor will stay on screen. Once you do move your cursor, it will disappear (and on a sidenote, it does a strange movement before disappearing, kind of like a slide-fade into the bottom right corner... perhaps intended?).
i3lock features a '--show-failed-attempts' parameter that displays the number of failed login attempts on the lock screen, it would be nice if this could get implemented for swaylock as well.
I'm getting the following errors when unlocking my screen:
swaylock[13620]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
swaylock[13620]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
pam_tally
is used to keep a count on attempted accesses, and deny access if too many attempts fail. I'm using the default PAM configuration provided by Arch Linux. I think pam_tally
is invoked from /etc/pam.d/system-login
(included from system-local-login
from login
from swaylock
).
I understand that using pam_tally
is a configuration option. But I think that it shouldn't fail with swaylock.
On my Arch Linux machine the swaylock
pam file is installed to /usr/local/etc/pam.d/
if I use ninja to install from source and if the meson option --prefix /usr
is not given.
If I use the prefix option it goes to /etc/pam.d/
as it should be.
I am not entirely sure if this is the expected behavior, but it seems strange to me.
Attempting to lock using swaylock yields endless spam in the terminal as it is trying to get data from an inactive output. It consistently rotates the name of the expected image in the tmp folder. In my case I have two active outputs, HDMI-A-2 and HDMI-A-3 used from the Internal GPU on my i5-6600k. I use the Nvidia GPU in passthrough to a Windows VM. This Windows output would be called DP-3. The output in question "DVI-D-1" refers to the DVI port on the Nvidia card that has no cables attached to it at all. I can't pin this to an exact package update. Swaylock was functional for me prior to Sway 1.0. Running swaymsg -t get_outputs does not show DVI-D-1 as a registered output, just the two HDMI ports.
unknown output 'DVI-D-1'convert: no decode delegate for this image format `MUZWT0F2KP' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.MUZWt0F2kP' @ error/convert.c/ConvertImageCommand/3300.
convert: no decode delegate for this image format `OIIWVWUV3V' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.OIIwvwuv3v' @ error/convert.c/ConvertImageCommand/3300.
unknown output 'DVI-D-1'convert: no decode delegate for this image format `UBCNU76T2U' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.uBCnu76t2u' @ error/convert.c/ConvertImageCommand/3300.
convert: no decode delegate for this image format `CIBV0DKQPP' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.cIbV0DKqpP' @ error/convert.c/ConvertImageCommand/3300.
unknown output 'DVI-D-1'convert: no decode delegate for this image format `KWF9JRIHH0' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.Kwf9jriHh0' @ error/convert.c/ConvertImageCommand/3300.
convert: no decode delegate for this image format `0VNHWHHCBM' @ error/constitute.c/ReadImage/556.
convert: no images defined `/tmp/tmp.0VnhWhHcbm' @ error/convert.c/ConvertImageCommand/3300.
I'm running the master version (12-02-19). I'm pretty sure I'm typing my password in the correct way and still swaylock won't let me unlock my screen.
2019-02-12 00:05:45 - [sway/commands/exec_always.c:46] Executing swaylock
2019-02-12 00:05:45 - [sway/commands/exec_always.c:87] Child process created with pid 9294
2019-02-12 00:05:45 - [sway/tree/root.c:253] Recording workspace for process 9294
2019-02-12 00:05:45 - [subprojects/wlroots/types/wlr_surface.c:595] New wlr_surface 0x55e7ceba42d0 (res 0x55e7ceb76ad0)
2019-02-12 00:05:45 - [subprojects/wlroots/types/wlr_layer_shell_v1.c:388] new layer_surface 0x55e7ceba45f0 (res 0x55e7ceb769b0)
2019-02-12 00:05:45 - [sway/desktop/layer_shell.c:365] new layer surface: namespace lockscreen layer 3 anchor 3 size 0x0 margin 0,0,0,0
2019-02-12 00:05:47 - [pam.c:102] pam_authenticate failed: invalid credentials
2019-02-12 00:05:49 - [GLES2] FS SIMD8 shader: 15 inst, 0 loops, 308 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 240 to 160 bytes.
2019-02-12 00:05:49 - [GLES2] FS SIMD16 shader: 15 inst, 0 loops, 322 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 240 to 160 bytes.
2019-02-12 00:05:50 - [pam.c:102] pam_authenticate failed: invalid credentials
I see it gives me "invalid credentials" but just like I said: I'm pretty sure there is nothing wrong with my typing. Any ideas?
Running the following command with i3lock will lock the screen and then suspend the computer, so the next time the computer is started you will be prompted for a password.
i3lock && systemctl suspend
Running the same command with swaylock will lock the screen and prompt you for a password and when you unlock, the rest of the command will be run and the computer will be suspended without a password on next startup.
Is this a security feature of swaylock or a bug? Is it possible to get it to work as i3lock?
Using sway 1.0, swaylock 1.3 and mako 1.3 on Arch Linux.
I'm using mako configured to display notifications in an "overlay layer", which is meant to have notifications displayed above fullscreen windows.
I've found out however that this also results in the notifications being displayed on top of swaylock, which I would consider being an issue.
I'm not sure where this should be reported though. I would guess the problem belongs in sway or swaylock which should prevent any such above display when the screen is locked.
Let me know if this issue should be moved to another project.
Hi,
swaylock fails immediately on assertion:
version 98e5afe
$ swaylock -d
2019-04-03 10:57:17 - [main.c:1018] Parsing CLI Args
swaylock: ../main.c:1054: main: Assertion `state.compositor && state.layer_shell && state.shm' failed.
Aborted
external monitor
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
XWAYLAND1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
1920x1080 59.96*+
Gnome 3.30.2, Debian buster
Thanks for investigating. Please let me know if there is some additional info I can give.
Swaylock version: 1.3
OS: Arch Linux
Sway version: 1.0
Laptop: Thinkpad T540p
If I lock the screen with swaylock I have to enter the password (obviously), but after entering the correct password, it will not let me in. This is when my fingerprint reader starts showing its "scanning" light. It only lets me in when I scan my fingerprint.
The scanner doesn't start until I enter something (Not necessarily my actual password - can even press Enter) and doesn't work even if entering right password (until I scan my fingerprint).
It appears that the fingerprint scanner doesn't start automatically until a key press triggers the login process.
When you try to unlock the screen but get the password wrong, you have to wait until the 'wrong' indicator goes away. Xscreensaver allows you to start typing again while this message is shown and I'd like to see the same behavior in swaylock.
Seeing a layout is really nice addon, but 'd be nice to log in only entering a password without switching a layout. Pretty sure almost everyone got their keyword on a specific language.
xoxo to every contributor 🖤
If swaylock has been compiled with PAM and has suid, we should probably error out.
If I don't have wlroots as a build dependency I get:
meson.build:38:0: ERROR: Dependency "wayland-client" not found, tried pkgconfig
Should 56b672a have removed wayland_client = dependency('wayland-client')
or does it need wlroots/sway installed to build?
For people that have different xkb layouts configured, it can be problem when trying to unlock their computer by typing in cyrillics when their password is in latin.
swaylock should display the current xkb layout, perhaps similar to how it displays when caps-lock is pressed.
Version
swaylock version 1.4-4-ga9b274e (Jun 9 2019, branch 'master')
Problem
I have a custom keyboard layout which should display as "English (Custom)" under the password wheel on the lock screen. But instead it looks like this:
nglish (Custo
Where the beginning and end is truncated, almost like there's a pixel width limit and if the word is too long it gets truncated in this odd way.
P.S. This used not to be the case a few versions back, it would display the whole name as expected.
The last screen locker I used was xscreensaver
, in which I could confirm the password typed with Ctrl+m
. swaylock
only allows me to press Enter
instead. 😞
This is by far not a big deal. But why doesn't Ctrl+m
works the same as Enter
? It would be nice to have it working with Ctrl+m
.
On Arch, whenever the package is updated /etc/pam.d/swaylock
is overwritten, which means that I have to change it manually every time. Is this a n issue with the packaging on Arch (that is, should I report the bug to the package maintainer)?
poll
is an XSI extension in POSIX < 2008, so either _POSIX_C_SOURCE
should be bumped or replaced with _XOPEN_SOURCE
.
../loop.c: In function 'loop_poll':
../loop.c:83:2: error: implicit declaration of function 'poll'; did you mean 'powl'? [-Werror=implicit-function-declaration]
poll(loop->fds, loop->fd_length, ms);
^~~~
powl
http://muscles.dragonflybsd.org/synth/logs/x11___swaylock.log
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/v5.4.2/sys/sys/poll.h#L99-L101
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/v5.4.2/sys/sys/cdefs.h#L612-L615
https://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html (POSIX 2001, X/Open 6)
https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html (POSIX 2008, X/Open 7)
Just an idea I had, it would be interesting if the user could set a script/exec to run on each password entry failure. My motivation for this is I'd like to get a snapshot with the camera, and then attempt to upload it to my VPS. Of course I'm sure many other creative uses for this feature must exist, so it might be worth considering
When a lock is about to happen, visually indicate this in some way so the user can preempt the lock, avoiding the need to retype their password. Other environments use a "fade to black" to indicate an impending lock. I guess this would be "fade to background".
This would alleviate user pain due to lack of inhibit support in various applications (fullscreen video in Firefox), which makes undesired locks common.
I configure sway to lock my screen on timeout or suspend:
exec swayidle -w \
timeout 7200 'swaylock -f' \
before-sleep 'swaylock -f'
Sometimes when I try to unlock the machine I need to enter my password multiple times. I am certain I am typing it correctly and the failure message does not show up.
I suspect this happens when I suspend the machine when it is already locked, using a hardware button. However, when I just tested this for this bug report, I could not reproduce it again, yet it happened to me a day ago and I have not updated anything since then.
Is there any possibility of an option like --show-keyboard-layout, but where it hides the keyboard layout even if there are multiple activated?
Thanks!
i3lock would display an image across multiple screens. However swaylock does repeat the same image on all screens. It would be nice to have an option where swaylock displays a single image across both screens, I usually set one large image to stretch both screens.
Hi! I know this is low priority compared to the amazing work you're doing on moving sway to wlroots, but one of the things that'd hold me back from moving to sway is the lack of support for MFA on Swaylock.
I use a yubikey as a second factor of authencication and TOTP (google auth) as a fallback in case I lose the yubikey. For some reason, it seems that neither scenarios are covered or supported by swaylock.
Anyway, thanks for the good work.
Cheers,
Henry John Kupty
Hi,
not sure if that should be handled here ore in scdoc, but the manpage of swaylock shows a warning:
# man --warnings -l swaylock.1 >/dev/null
troff: <standard input>:70: warning: macro ':'' not defined
this comes from line 52 in the swaylock.1.scd which starts with ':'
':' to prevent interpreting part of it as
it can be fixed by moving the newline before the term 'another', but it could also be fixed by scdoc by adding a zero-width space (\&
) before a '
at the start of a line
Hi, I've got this output when trying out swaylock.
$ swaylock --image /opt/images/lock_screen_image.jpg
swaylock: unrecognized option '--image /opt/images/lock_screen_image.jpg'
Usage: swaylock [options...]
-C, --config <config_file> Path to the config file.
-c, --color <color> Turn the screen into the given color instead of white.
-d, --debug Enable debugging output.
-e, --ignore-empty-password When an empty password is provided, do not validate it.
-f, --daemonize Detach from the controlling terminal after locking.
-h, --help Show help message and quit.
-i, --image [[<output>]:]<path> Display the given image.
-L, --disable-caps-lock-text Disable the Caps Lock text.
-l, --indicator-caps-lock Show the current Caps Lock state also on the indicator.
-s, --scaling <mode> Scaling mode: stretch, fill, fit, center, tile.
-t, --tiling Same as --scaling=tile.
-u, --no-unlock-indicator Disable the unlock indicator.
-F, --show-failed-attempts Show current count of failed authentication attempts.
-v, --version Show the version number and quit.
--bs-hl-color <color> Sets the color of backspace highlight segments.
--caps-lock-bs-hl-color <color> Sets the color of backspace highlight segments when Caps Lock is active.
--caps-lock-key-hl-color <color> Sets the color of the key press highlight segments when Caps Lock is active.
--font <font> Sets the font of the text.
--indicator-radius <radius> Sets the indicator radius.
--indicator-thickness <thick> Sets the indicator thickness.
--inside-color <color> Sets the color of the inside of the indicator.
--inside-clear-color <color> Sets the color of the inside of the indicator when cleared.
--inside-caps-lock-color <color> Sets the color of the inside of the indicator when Caps Lock is active.
--inside-ver-color <color> Sets the color of the inside of the indicator when verifying.
--inside-wrong-color <color> Sets the color of the inside of the indicator when invalid.
--key-hl-color <color> Sets the color of the key press highlight segments.
--line-color <color> Sets the color of the line between the inside and ring.
--line-clear-color <color> Sets the color of the line between the inside and ring when cleared.
--line-caps-lock-color <color> Sets the color of the line between the inside and ring when Caps Lock is active.
--line-ver-color <color> Sets the color of the line between the inside and ring when verifying.
--line-wrong-color <color> Sets the color of the line between the inside and ring when invalid.
-n, --line-uses-inside Use the inside color for the line between the inside and ring.
-r, --line-uses-ring Use the ring color for the line between the inside and ring.
--ring-color <color> Sets the color of the ring of the indicator.
--ring-clear-color <color> Sets the color of the ring of the indicator when cleared.
--ring-caps-lock-color <color> Sets the color of the ring of the indicator when Caps Lock is active.
--ring-ver-color <color> Sets the color of the ring of the indicator when verifying.
--ring-wrong-color <color> Sets the color of the ring of the indicator when invalid.
--separator-color <color> Sets the color of the lines that separate highlight segments.
--text-color <color> Sets the color of the text.
--text-clear-color <color> Sets the color of the text when cleared.
--text-caps-lock-color <color> Sets the color of the text when Caps Lock is active.
--text-ver-color <color> Sets the color of the text when verifying.
--text-wrong-color <color> Sets the color of the text when invalid.
All <color> options are of the form <rrggbb[aa]>.
The image is actually set for the lock screen, but this output bothers me.
If it happens again I may have a clearer picture of how to trigger it, but here's a stack trace:
#0 0x00007feada6632c0 in xkb_state_update_mask () at /usr/lib/libxkbcommon.so.0
#1 0x000056168fee0187 in keyboard_modifiers (data=0x56168fee7d20 <state>, wl_keyboard=0x561691baeae0, serial=8405, mods_depressed=0, mods_latched=0, mods_locked=0, group=0) at ../swaylock/seat.c:64
state = 0x56168fee7d20 <state>
caps_lock = 22038
#2 0x00007fead944a6d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#3 0x00007fead944a0a0 in ffi_call () at /usr/lib/libffi.so.6
#4 0x00007feada6528bc in wl_closure_invoke (closure=closure@entry=0x561691badba0, flags=flags@entry=1, target=<optimized out>, target@entry=0x561691baeae0, opcode=opcode@entry=4, data=<optimized out>)
at src/connection.c:1006
count = <optimized out>
cif = {abi = FFI_UNIX64, nargs = 7, arg_types = 0x7ffe3049a2c0, rtype = 0x7fead944b180 <ffi_type_void>, bytes = 8, flags = 0}
ffi_types =
{0x7fead944b060 <ffi_type_pointer>, 0x7fead944b060 <ffi_type_pointer>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7feada65068b <wl_proxy_marshal_array_constructor_versioned+178>, 0x561691bae870, 0x28, 0x561691bae870, 0x0, 0x56168fee6c20 <wl_callback_interface>, 0x7ffe3049a370, 0x0, 0x7feada651cad <wl_closure_clear_fds+59>, 0x75, 0xfceb347a3cc71200, 0x1, 0x561691bae700, 0x1, 0x7feada651fd9 <wl_closure_init+129>}
ffi_args =
{0x7ffe3049a290, 0x7ffe3049a298, 0x561691badbb8, 0x561691badbc0, 0x561691badbc8, 0x561691badbd0, 0x561691badbd8, 0x561691bae7d0, 0x7ffe40000000, 0x561691ba9218, 0x7feada659d38 <wl_display_events+24>, 0x7feada6526fb <wl_closure_lookup_objects+160>, 0x561691ba9218, 0xfceb347a3cc71200, 0x91baa475, 0x561691bae0d0, 0x7feada654463, 0x3, 0x561691bae0d0, 0x0, 0x0, 0x7feada652de1 <wl_closure_destroy+22>}
implementation = <optimized out>
#5 0x00007feada650132 in dispatch_event (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1427
closure = 0x561691badba0
proxy = 0x561691baeae0
opcode = 4
proxy_destroyed = <optimized out>
#6 0x00007feada650198 in dispatch_queue (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1573
count = 4
#7 0x00007feada650ea6 in wl_display_dispatch_queue_pending (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1815
ret = <optimized out>
#8 0x00007feada651049 in wl_display_dispatch_queue (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1791
ret = <optimized out>
#9 0x00007feada651244 in wl_display_roundtrip_queue (display=0x561691ba91a0, queue=0x561691ba9268) at src/wayland-client.c:1238
display_wrapper = <optimized out>
callback = 0x561691bae9d0
done = 0
ret = 0
#10 0x00007feada651277 in wl_display_roundtrip (display=<optimized out>) at src/wayland-client.c:1267
#11 0x000056168feddfac in main (argc=4, argv=0x7ffe3049a698) at ../swaylock/main.c:1135
line_mode = LM_LINE
config_path = 0x0
result = 0
registry = 0x561691bad320
__PRETTY_FUNCTION__ = "main"
surface = 0x56168fee7c90 <types+112>
This will require some refactoring. Can probably replace it with wl_list.
(5) may or may not be visible during a long time, depending on various conditions. Recording the screen with a camera might allow to retrieve the screen contents.
I wanted to inquire whether you plan a new release for swaylock (and swayidle).
As I understand it the last stable version of sway included these programs. But with sway 1.0 this is going to be changed and they are seperate.
If this is the case I suggest creating new releases for swaylock and swayidle when releasing sway 1.0.
Latest release of swaylock for example doesn't even build for me because of a wrong include path. I fixed this for our local package but having everthing in order when sway 1.0 gets out would be nice.
I would also suggest to set a version automatically instead of needing to pass them at build time.
So in case git is not present just use that version. If git is present use version + git hash or whatever.
With an image background displayed on multiple monitors (laptop monitor and 2 external screens), I experience huge delays (i.e., delays from key presses to visual acknowledgments). Also, the three displays are not synchronized (key presses are shown at different times) and CPU usage is very high while I enter my password.
It's smooth without a background image. There's a small delay with one monitor (laptop screen), but it's much better.
Is that a known issue? Could that be due to the image format? (Mine is a 4000 x 2330 PNG.)
Swaylock used to support transparent png's. I use this functionality to check my status bar when locked. It can often be handy to check wifi status, battery level, time and so on even when the computer is locked. I have cut a hole in the upper right corner of my lock screen bg to check for exactly that, but more or less since the split from sway, swaylock doesn't let me see through to waybar and instead just renders the transparent pixels as white.
Swaylock crashes if you spam enter really fast and gives you full access to the desktop.
lock command
bindsym XF86ScreenSaver exec swaylock --scaling=fill -i ~/Pictures/22713368_10213619311424692_4943994771009049545_o.jpg
Even if i use the -e
option i'm able to crash it.
The only unusual pam module that i use is pam_mount (but it has always worked fine)
System info and related logs following.
OS: Arch Linux
Kernel: x86_64 Linux 4.20.0-arch1-1-ARCH
Uptime: 3m
Shell: bash 4.4.23
Resolution: 1600x900
WM: sway
GTK Theme: "Adapta-Nokto-Eta" [GTK3]
CPU: Intel Core i5-3320M @ 4x 3.3GHz [47.0°C]
GPU: Mesa DRI Intel(R) Ivybridge Mobile
RAM: 1059MiB / 7791MiB
Display Manager: GDM 3.30.2 (gdm-plymouth from aur)
Jan 16 01:15:50 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:50 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:50 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:50 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:50 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:48 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:48 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:48 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:48 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:48 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:47 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:47 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:47 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:47 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:47 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:45 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:45 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:45 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:45 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:45 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:43 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:43 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:43 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:43 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:43 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:42 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:42 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:42 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:42 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:42 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:40 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:40 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:40 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:40 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:40 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:38 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:38 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:38 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:38 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:38 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:36 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:36 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:36 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:36 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:36 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:34 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:34 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:34 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:34 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:34 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:33 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:33 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:33 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:33 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:33 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:31 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:31 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
Jan 16 01:15:31 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for update
Jan 16 01:15:31 codeWriter /usr/lib/gdm-wayland-session[30626]: 2019-01-16 01:15:31 - [sway/swaylock/pam.c:49] pam_authenticate failed
Jan 16 01:15:29 codeWriter swaylock[3398]: pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=jacotsu
Jan 16 01:15:29 codeWriter swaylock[3398]: pam_tally(swaylock:auth): Error opening /var/log/faillog for read
On my laptop, I noticed that the keyboard has an erratic behavior when resuming from sleep. After a few seconds of black screen the screen appears, the keyboard works during about 1 second, stops working during a 1 or 2 seconds and then start working again. For instance, when I quickly type '1' to '9' after resume I typically get something like '34789'. The missing '12' are expected but the missing '56' are a bit annoying. I lost count of the number of times I missed my password because of that.
The console shows the same behavior so this is not specific to wayland or swaylock. I assume that this is because the linux kernel is reinitializing the input devices (though libinput does not report any device change).
So I do not expect that swaylock can fix that behavior but it would be nice to have a way to mitigate the effect. Swaylock probably has no ways to know when the keyboard is actually ready so a simple workaround could be to display a black screen for a few seconds without accepting keyboard events. The delay would be specified on the command line and would be zero by default.
Version info (using the Arch Linux package):
$ swaylock --version
swaylock version (Mar 11 2019, branch '')
$ pacman -Qo $(which swaylock)
/usr/bin/swaylock is owned by swaylock 1.3-3
Regardless of how I quote the filename in the shell, swaylock fails to open it if there are spaces present.
$ ls -l Running\ Man\ Nebula.jpg
-rw-r--r-- 1 josh josh 1872438 Mar 6 16:33 'Running Man Nebula.jpg'
$ swaylock -i Running\ Man\ Nebula.jpg
2019-03-25 11:16:53 - [swaylock-1.3/background-image.c:31] Failed to load background image (Failed to open file “Running”: No such file or directory).
$ swaylock -i 'Running Man Nebula.jpg'
2019-03-25 11:19:04 - [swaylock-1.3/background-image.c:31] Failed to load background image (Failed to open file “Running”: No such file or directory).
I have swaylock occasionally segfaulting at the point of locking before suspend:
https://gist.github.com/luispabon/5489fc8207b69f47691a2bd94ea290a0
https://github.com/luispabon/sway-dotfiles
https://github.com/luispabon/sway-dotfiles/blob/master/configs/swaylock/config
https://github.com/luispabon/sway-dotfiles/blob/master/configs/sway/conf.d/idle-and-lockscreen
I'm not too versed on debugging this sort of thing. I've installed what I believe to be debug symbols, providing that's what I need to get a trace or something could you please let me know how to set things up next time it crashes?
These commits are all the latest versions as of monday:
swaylock 1156038 (latest as of today)
sway 5becce8005e3c617afbdddda8f0da95f84540b27
wlroots 46dc4100d66567f77a413627a0a0b046ccf8094b
Ubuntu 19.04
The i3 man page provides this nice script to turn off dpms on i3lock
and turn on dpms on action.
#!/bin/sh
revert() {
xset dpms 0 0 0
}
trap revert SIGHUP SIGINT SIGTERM
xset +dpms dpms 5 5 5
i3lock -n
revert
We should document this in the README or elsewhere too. It would look something like:
#!/bin/sh
revert() {
swaymsg "output * dpms on"
}
trap revert SIGHUP SIGINT SIGTERM # How to fix this line?
swaymsg "output * dpms off"
swaylock
revert
But the trap
command does not work. The dpms is off until the screen is unlocked (revert on last line).
What would be the wayland/wlroots equivalent for trap
?
Contrary to the documented behaviour, specifying both --color and --image will only produce the effects of the one option which was given last (via command line or config file), i.e. either
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.