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

Swaylock does not process any given arguments #356

Closed
dxdye opened this issue Apr 25, 2024 · 7 comments
Closed

Swaylock does not process any given arguments #356

dxdye opened this issue Apr 25, 2024 · 7 comments

Comments

@dxdye
Copy link

dxdye commented Apr 25, 2024

Got simple command 'swaylock -c 000000' which should lock the screen with of background-color black.
Or simple command like 'swaylock -i /path/to/picture' -
both and other options won't work.

OS is Fedora 39
Wm installed are gnome, kde and xorg (what might be relevant?).
I know that wayland is the important thing here.

Would salute it, to be able to comprehend this bug.
I tried to reinstall swaylock, however it does nothing. Maybe I look forward to compile it seperatly.

It may be interesting to you, that following command do not work when using GNOME xx (which might be irrelevant):
$ export DISPLAY=:0
$ dbus-send --session
--dest=org.gnome.ScreenSaver
--type=method_call
--print-reply
--reply-timeout=20000
/org/gnome/ScreenSaver
org.gnome.ScreenSaver.SetActive
boolean:false

This is what I get when I do 'swaylock -c 000000':
swaylock: option '--indicator' is ambiguous; possibilities: '--indicator-caps-lock' '--indicator-idle-visible' '--indicator-radius' '--indicator-thickness' '--indicator-x-position' '--indicator-y-position'
Usage: swaylock [options...]

-C, --config <config_file> Path to the config file.
-c, --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, --show-failed-attempts Show current count of failed authentication attempts.
-f, --daemonize Detach from the controlling terminal after locking.
-h, --help Show help message and quit.
-i, --image [[]:] Display the given image, optionally only on the given output.
-k, --show-keyboard-layout Display the current xkb layout while typing.
-K, --hide-keyboard-layout Hide the current xkb layout while typing.
-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 Image scaling mode: stretch, fill, fit, center, tile, solid_color.
-t, --tiling Same as --scaling=tile.
-u, --no-unlock-indicator Disable the unlock indicator.
-v, --version Show the version number and quit.
--bs-hl-color Sets the color of backspace highlight segments.
--caps-lock-bs-hl-color Sets the color of backspace highlight segments when Caps Lock is active.
--caps-lock-key-hl-color Sets the color of the key press highlight segments when Caps Lock is active.
--font Sets the font of the text.
--font-size Sets a fixed font size for the indicator text.
--indicator-idle-visible Sets the indicator to show even if idle.
--indicator-radius Sets the indicator radius.
--indicator-thickness Sets the indicator thickness.
--indicator-x-position Sets the horizontal position of the indicator.
--indicator-y-position Sets the vertical position of the indicator.
--inside-color Sets the color of the inside of the indicator.
--inside-clear-color Sets the color of the inside of the indicator when cleared.
--inside-caps-lock-color Sets the color of the inside of the indicator when Caps Lock is active.
--inside-ver-color Sets the color of the inside of the indicator when verifying.
--inside-wrong-color Sets the color of the inside of the indicator when invalid.
--key-hl-color Sets the color of the key press highlight segments.
--layout-bg-color Sets the background color of the box containing the layout text.
--layout-border-color Sets the color of the border of the box containing the layout text.
--layout-text-color Sets the color of the layout text.
--line-color Sets the color of the line between the inside and ring.
--line-clear-color Sets the color of the line between the inside and ring when cleared.
--line-caps-lock-color Sets the color of the line between the inside and ring when Caps Lock is active.
--line-ver-color Sets the color of the line between the inside and ring when verifying.
--line-wrong-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 Sets the color of the ring of the indicator.
--ring-clear-color Sets the color of the ring of the indicator when cleared.
--ring-caps-lock-color Sets the color of the ring of the indicator when Caps Lock is active.
--ring-ver-color Sets the color of the ring of the indicator when verifying.
--ring-wrong-color Sets the color of the ring of the indicator when invalid.
--separator-color Sets the color of the lines that separate highlight segments.
--text-color Sets the color of the text.
--text-clear-color Sets the color of the text when cleared.
--text-caps-lock-color Sets the color of the text when Caps Lock is active.
--text-ver-color Sets the color of the text when verifying.
--text-wrong-color Sets the color of the text when invalid.

All options are of the form <rrggbb[aa]>.
swaylock: invalid option -- ''
Usage: swaylock [options...]

-C, --config <config_file> Path to the config file.
-c, --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, --show-failed-attempts Show current count of failed authentication attempts.
-f, --daemonize Detach from the controlling terminal after locking.
-h, --help Show help message and quit.
-i, --image [[]:] Display the given image, optionally only on the given output.
-k, --show-keyboard-layout Display the current xkb layout while typing.
-K, --hide-keyboard-layout Hide the current xkb layout while typing.
-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 Image scaling mode: stretch, fill, fit, center, tile, solid_color.
-t, --tiling Same as --scaling=tile.
-u, --no-unlock-indicator Disable the unlock indicator.
-v, --version Show the version number and quit.
--bs-hl-color Sets the color of backspace highlight segments.
--caps-lock-bs-hl-color Sets the color of backspace highlight segments when Caps Lock is active.
--caps-lock-key-hl-color Sets the color of the key press highlight segments when Caps Lock is active.
--font Sets the font of the text.
--font-size Sets a fixed font size for the indicator text.
--indicator-idle-visible Sets the indicator to show even if idle.
--indicator-radius Sets the indicator radius.
--indicator-thickness Sets the indicator thickness.
--indicator-x-position Sets the horizontal position of the indicator.
--indicator-y-position Sets the vertical position of the indicator.
--inside-color Sets the color of the inside of the indicator.
--inside-clear-color Sets the color of the inside of the indicator when cleared.
--inside-caps-lock-color Sets the color of the inside of the indicator when Caps Lock is active.
--inside-ver-color Sets the color of the inside of the indicator when verifying.
--inside-wrong-color Sets the color of the inside of the indicator when invalid.
--key-hl-color Sets the color of the key press highlight segments.
--layout-bg-color Sets the background color of the box containing the layout text.
--layout-border-color Sets the color of the border of the box containing the layout text.
--layout-text-color Sets the color of the layout text.
--line-color Sets the color of the line between the inside and ring.
--line-clear-color Sets the color of the line between the inside and ring when cleared.
--line-caps-lock-color Sets the color of the line between the inside and ring when Caps Lock is active.
--line-ver-color Sets the color of the line between the inside and ring when verifying.
--line-wrong-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 Sets the color of the ring of the indicator.
--ring-clear-color Sets the color of the ring of the indicator when cleared.
--ring-caps-lock-color Sets the color of the ring of the indicator when Caps Lock is active.
--ring-ver-color Sets the color of the ring of the indicator when verifying.
--ring-wrong-color Sets the color of the ring of the indicator when invalid.
--separator-color Sets the color of the lines that separate highlight segments.
--text-color Sets the color of the text.
--text-clear-color Sets the color of the text when cleared.
--text-caps-lock-color Sets the color of the text when Caps Lock is active.
--text-ver-color Sets the color of the text when verifying.
--text-wrong-color Sets the color of the text when invalid.

All options are of the form <rrggbb[aa]>.

may be a problem of my bash, I'm uberpruefen it.

@kennylevinsen
Copy link
Member

wm installed are gnome, kde and xorg.

swaylock only works for Wayland display servers that support ext-session-lock, like sway or other wlroots-based display servers.

@dxdye
Copy link
Author

dxdye commented Apr 25, 2024

this is what I get when I do:
loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'

-> 'wayland'

So wayland seems to be used there.
Update: in GNOME and in Sway

@dxdye
Copy link
Author

dxdye commented Apr 25, 2024

Ok it seems to be my bash

@dxdye
Copy link
Author

dxdye commented Apr 25, 2024

Used fish and 'swaylock -c 000000' worked
But -i with image not
EDIT/UPDATE:
well I got it work one time in fish, however -i
seems not to be working (it seems to now run in a separate process)

executing 'swaylock -c 000000' in zsh also not working exiting with 1:
swaylock: option '--indicator' is ambiguous; possibilities: '--indicator-caps-lock' '--indicator-idle-visible' '--indicator-radius' '--indicator-thickness' '--indicator-x-position' '--indicator-y-position'
Usage: swaylock [options...]

-C, --config <config_file> Path to the config file.
-c, --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, --show-failed-attempts Show current count of failed authentication attempts.
-f, --daemonize Detach from the controlling terminal after locking.
-h, --help Show help message and quit.
-i, --image [[]:] Display the given image, optionally only on the given output.
-k, --show-keyboard-layout Display the current xkb layout while typing.
-K, --hide-keyboard-layout Hide the current xkb layout while typing.
-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 Image scaling mode: stretch, fill, fit, center, tile, solid_color.
-t, --tiling Same as --scaling=tile.
-u, --no-unlock-indicator Disable the unlock indicator.
-v, --version Show the version number and quit.
--bs-hl-color Sets the color of backspace highlight segments.
--caps-lock-bs-hl-color Sets the color of backspace highlight segments when Caps Lock is active.
--caps-lock-key-hl-color Sets the color of the key press highlight segments when Caps Lock is active.
--font Sets the font of the text.
--font-size Sets a fixed font size for the indicator text.
--indicator-idle-visible Sets the indicator to show even if idle.
--indicator-radius Sets the indicator radius.
--indicator-thickness Sets the indicator thickness.
--indicator-x-position Sets the horizontal position of the indicator.
--indicator-y-position Sets the vertical position of the indicator.
--inside-color Sets the color of the inside of the indicator.
--inside-clear-color Sets the color of the inside of the indicator when cleared.
--inside-caps-lock-color Sets the color of the inside of the indicator when Caps Lock is active.
--inside-ver-color Sets the color of the inside of the indicator when verifying.
--inside-wrong-color Sets the color of the inside of the indicator when invalid.
--key-hl-color Sets the color of the key press highlight segments.
--layout-bg-color Sets the background color of the box containing the layout text.
--layout-border-color Sets the color of the border of the box containing the layout text.
--layout-text-color Sets the color of the layout text.
--line-color Sets the color of the line between the inside and ring.
--line-clear-color Sets the color of the line between the inside and ring when cleared.
--line-caps-lock-color Sets the color of the line between the inside and ring when Caps Lock is active.
--line-ver-color Sets the color of the line between the inside and ring when verifying.
--line-wrong-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 Sets the color of the ring of the indicator.
--ring-clear-color Sets the color of the ring of the indicator when cleared.
--ring-caps-lock-color Sets the color of the ring of the indicator when Caps Lock is active.
--ring-ver-color Sets the color of the ring of the indicator when verifying.
--ring-wrong-color Sets the color of the ring of the indicator when invalid.
--separator-color Sets the color of the lines that separate highlight segments.
--text-color Sets the color of the text.
--text-clear-color Sets the color of the text when cleared.
--text-caps-lock-color Sets the color of the text when Caps Lock is active.
--text-ver-color Sets the color of the text when verifying.
--text-wrong-color Sets the color of the text when invalid.

All options are of the form <rrggbb[aa]>.
swaylock: invalid option -- ''
Usage: swaylock [options...]

-C, --config <config_file> Path to the config file.
-c, --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, --show-failed-attempts Show current count of failed authentication attempts.
-f, --daemonize Detach from the controlling terminal after locking.
-h, --help Show help message and quit.
-i, --image [[]:] Display the given image, optionally only on the given output.
-k, --show-keyboard-layout Display the current xkb layout while typing.
-K, --hide-keyboard-layout Hide the current xkb layout while typing.
-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 Image scaling mode: stretch, fill, fit, center, tile, solid_color.
-t, --tiling Same as --scaling=tile.
-u, --no-unlock-indicator Disable the unlock indicator.
-v, --version Show the version number and quit.
--bs-hl-color Sets the color of backspace highlight segments.
--caps-lock-bs-hl-color Sets the color of backspace highlight segments when Caps Lock is active.
--caps-lock-key-hl-color Sets the color of the key press highlight segments when Caps Lock is active.
--font Sets the font of the text.
--font-size Sets a fixed font size for the indicator text.
--indicator-idle-visible Sets the indicator to show even if idle.
--indicator-radius Sets the indicator radius.
--indicator-thickness Sets the indicator thickness.
--indicator-x-position Sets the horizontal position of the indicator.
--indicator-y-position Sets the vertical position of the indicator.
--inside-color Sets the color of the inside of the indicator.
--inside-clear-color Sets the color of the inside of the indicator when cleared.
--inside-caps-lock-color Sets the color of the inside of the indicator when Caps Lock is active.
--inside-ver-color Sets the color of the inside of the indicator when verifying.
--inside-wrong-color Sets the color of the inside of the indicator when invalid.
--key-hl-color Sets the color of the key press highlight segments.
--layout-bg-color Sets the background color of the box containing the layout text.
--layout-border-color Sets the color of the border of the box containing the layout text.
--layout-text-color Sets the color of the layout text.
--line-color Sets the color of the line between the inside and ring.
--line-clear-color Sets the color of the line between the inside and ring when cleared.
--line-caps-lock-color Sets the color of the line between the inside and ring when Caps Lock is active.
--line-ver-color Sets the color of the line between the inside and ring when verifying.
--line-wrong-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 Sets the color of the ring of the indicator.
--ring-clear-color Sets the color of the ring of the indicator when cleared.
--ring-caps-lock-color Sets the color of the ring of the indicator when Caps Lock is active.
--ring-ver-color Sets the color of the ring of the indicator when verifying.
--ring-wrong-color Sets the color of the ring of the indicator when invalid.
--separator-color Sets the color of the lines that separate highlight segments.
--text-color Sets the color of the text.
--text-clear-color Sets the color of the text when cleared.
--text-caps-lock-color Sets the color of the text when Caps Lock is active.
--text-ver-color Sets the color of the text when verifying.
--text-wrong-color Sets the color of the text when invalid.

@kennylevinsen
Copy link
Member

this is what I get when I do: loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'

-> 'wayland'

So wayland seems to be used there. Update: in GNOME and in Sway

It doesn't matter if you run Wayland (nor does the logind session class have any meaning), what matters is if your specific Wayland server of choice supports the necessary protocols.

Neither GNOME (Mutter) nor KDE (kwin) supports ext-session-lock and swaylock will not run there. https://wayland.app/protocols/ext-session-lock-v1#compositor-support.

—-

Try with --image and an absolute file path.

@dxdye
Copy link
Author

dxdye commented Apr 25, 2024

swaylock --image /home/xyzzz/Downloads/bilder/f28.png
not working.

however swaylock it self, without any additional arguments working fine (is just a bit unaesthetic because of white bg)

(ran them all in Sway)

@dxdye
Copy link
Author

dxdye commented Apr 26, 2024

ok problem was solved: ~/$USER/.config/swaylock/config was the problem. It ran in th.e background ignoring my arguments and it not had the required syntax. For whoever reads this: Look for this dir/ config - this might be the issue.

@dxdye dxdye closed this as completed Apr 26, 2024
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