解锁屏幕/登录i3后拍照

解锁屏幕/登录i3后拍照

使用 i3wm 运行 Manjaro,我的.i3/config有以下与锁定屏幕相关的信息:

# 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

脚本lock.sh是:

#!/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

类似这个帖子我想在每次屏幕解锁时通过脚本拍摄一张照片。我编写了一个脚本,可以从本地网络摄像头捕获图片,并且效果非常好 -如何更改上述设置以在解锁屏幕后运行脚本?

我希望这可以在 级别完成,而不是像链接帖子中的答案那样.i3/config弄乱文件。pam.d

答案1

好的,在深入研究 Arch Wiki 和其他软件包的网页后,我意识到我pam.d根本不需要调整任何配置文件。

blurlock只是一个i3lock模糊屏幕的包装器,因此我可以将该i3lock -n选项与我的拍照脚本结合使用。

这是我的行.i3/config

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

同样,我可以将脚本调整为在暂停后解锁屏幕后lock.sh运行。auth_picture

#!/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

相关内容