Add lock script that clears key caches

This commit is contained in:
M1dgard 2019-03-11 11:18:16 +01:00
parent dfc8a9e9de
commit d20d5c774f
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 14 additions and 1 deletions

View file

@ -92,7 +92,7 @@ bindsym $mod+c mode $macromode
################
# lock the screen
bindsym Mod1+l exec --no-startup-id i3lock --tiling --show-failed-attempts --color=000000 --image="$HOME/img/bg/Red-billed_streamertail_Trochilus_polytmus_female_in_flight_2_lock.png" || notify-send -u normal -i lock -a i3 "Failed to lock screen" "i3lock had a non-zero exit code."
bindsym Mod1+l exec --no-startup-id $HOME/.config/i3/lock.sh
# start a terminal
bindsym $mod+Return exec $term

13
i3/lock.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
if ! ssh-add -D; then
notify-send -u normal -i lock -a i3 'Failed to clear SSH key cache' 'ssh-add had a non-zero exit code.'
fi
if ! gpg-connect-agent reloadagent /bye; then
notify-send -u normal -i lock -a i3 'Failed to clear GPG key cache' 'gpg-connect-agent had a non-zero exit code.'
fi
if ! i3lock --tiling --lock-console --show-failed-attempts --color=000000 --image="$HOME/img/bg/Red-billed_streamertail_Trochilus_polytmus_female_in_flight_2_lock.png"; then
notify-send -u normal -i lock -a i3 'Failed to lock screen' 'i3lock had a non-zero exit code.'
fi