6

I'm having difficulties with creating a custom keyboard shortcut. I'm trying to lock my screen using i3lock with a picture.

From the terminal, the command

i3lock -i ~/Pictures/lock.png

works like charm.

When I go System Settings -> Keyboard -> Custom Shortcut what do I write into the Command line?

I've tried:

gnome-terminal -e "i3lock -i ~/Pictures/lock.png"

but it doesn't work.

1
  • Does using the same command used in the terminal not work?
    – HalosGhost
    Commented Aug 16, 2014 at 15:16

2 Answers 2

4

Okay, so I managed to solve it - maybe it's not the most elegant way but it works and it's good enough.

First I wrote a small script:

#!/bin/sh i3lock -i ~/Pictures/lock.png

Saved it (e.g. .locker) to the HOME address, then I ran "chmod +x .locker" so I could execute it and at the Custom Shortcuts to the Command line I wrote ./.locker

Choose an arbitrary shortcut for it (mine is SUPER+L).

3

Another way to solve this is in your i3 config (probably at ~/.i3/config) do something like :

bindsym Control+mod1+l exec i3lock -i ~/Pictures/lock.png

or

bindsym Control+mod1+l exec ~/.i3/scripts/locker

And remove any gnome shortcut that mirrors what you want to use. Obviously, the shortcut can be specified as wanted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .