2019-03-11 11:18:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-06-13 19:20:54 +02:00
|
|
|
set -euo pipefail
|
|
|
|
|
2022-06-11 20:00:32 +02:00
|
|
|
#ssh_agent_file="/run/user/$EUID/ssh-agent-session"
|
|
|
|
#if pgrep -u "$USER" ssh-agent > /dev/null && [[ -f "$ssh_agent_file" ]]; then
|
|
|
|
# source "$ssh_agent_file"
|
|
|
|
# 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
|
|
|
|
#else
|
|
|
|
# notify-send -u normal -i lock -a i3 'No SSH agent running' 'No running SSH agent detected, so not clearing the key cache.'
|
|
|
|
#fi
|
2019-03-11 11:18:16 +01:00
|
|
|
|
|
|
|
if ! gpg-connect-agent reloadagent /bye; then
|
2022-06-11 20:00:32 +02:00
|
|
|
:
|
|
|
|
# notify-send -u normal -i lock -a i3 'Failed to clear GPG key cache' 'gpg-connect-agent had a non-zero exit code.'
|
2019-03-11 11:18:16 +01:00
|
|
|
fi
|
|
|
|
|
2022-08-30 01:52:44 +02:00
|
|
|
if ! i3lock --tiling --lock-console --show-failed-attempts --color=000000 --image="$HOME/.config/i3/background_lock"; then
|
2022-06-11 20:00:32 +02:00
|
|
|
exec i3lock
|
|
|
|
fi
|