I have a lock screen script (via i3lock) that runs correctly in a terminal window, but not when used as a keybind in i3 config.
The script is pretty straightforward:
# Take screenshot
scrot /tmp/screenshot.png
# Pixelate and add central logo
magick /tmp/screenshot.png -scale 10% -scale 1000% -gravity center /home/user/bin/archlogo.png -composite /tmp/lock.png
# Lock using pixelated image & logo
i3lock -e -f -c 000000 -i /tmp/lock.png
The script is saved to ~/bin/lock
and executable. The directory has also been identified in my ~/.bash_profile
.
There is no error message, only brief flash of the terminal cursor.
The relevant lines in ~/.config/i3/config
:
# lock screen
bindsym $mod+l exec lock
(the default keybind for $mod+l was deleted and i3 was restarted).