0

i want to be able to execute code when swaylock gets locked and something different when unlocking (eg swaylock was locked and i entered my password correctly). everything i found is a way to execute code after swaylock gets locked, which is possible with:

swaylock -f;somethingToExecute

the -f means "daemonize", this is the reaason why ...;somethingToExecute gets execute after locking the session. The other way around is the same without daemonizing the process, so everything behind the ; will be executed after swaylock exited (which means "the session is unlocked" because the swaylock-process is running as long as the session is locked).

But what if i want to execute code when locking AND unlocking the session?

mr.alex
  • 503
  • 1
  • 8
  • 16

1 Answers1

0

So...Sometimes one is just thinking way too complicated. In fact the answer is already inside the question:

somethingToExecuteWhenLocking; swaylock; somethingToExecuteWhenUnlocking
mr.alex
  • 503
  • 1
  • 8
  • 16