0

Running Manjaro with i3wm, and my .i3/config has the following related to locking the screen:

# Lock screen
exec --no-startup-id xss-lock -- ~/.i3/lock.sh
bindsym $mod+Ctrl+l exec --no-startup-id i3exit lock
bindsym $mod+9 exec --no-startup-id blurlock

The script lock.sh is:

#!/bin/sh
set -e
xset s off dpms 0 10 0
i3lock --color=4c7899 --ignore-empty-password --show-failed-attempts --nofork
xset s off -dpms

Similar to this post I want to have a picture taken via a script every time the screen is unlocked. I've written a script that captures a picture from the local webcam, and this works perfectly fine - how do I alter the above setup to have the script run after unlocking my screen?

I hope this can be done at the level of the .i3/config rather than messing with pam.d files like the answer in the linked post.

nonreligious
  • 113
  • 6

1 Answers1

0

OK, after some digging around the Arch Wiki and web pages for the other packages, I realized I didn't have to adjust any of the pam.d config files at all.

blurlock is simply an i3lock wrapper that blurs the screen, so I can use the i3lock -n option in combination with my picture taking script.

This is the line in my .i3/config:

bindsym $mod+9 exec --no-startup-id "blurlock -n && auth_picture"

Similarly, I can adjust the lock.sh script to run auth_picture after the screen has been unlocked after suspension.

#!/bin/sh
set -e
xset s off dpms 0 10 0
i3lock --color=4c7899 --ignore-empty-password --show-failed-attempts --nofork
auth_picture
xset s off -dpms
nonreligious
  • 113
  • 6