25 lines
550 B
Bash
Executable file
25 lines
550 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Remove SSH and GPG keys from keystores
|
|
ssh-add -D
|
|
echo RELOADAGENT | gpg-connect-agent
|
|
rm -rf "/tmp/cached_pass_$UID"
|
|
|
|
|
|
dm-tool lock
|
|
if [ $? -ne 0 ]; then
|
|
if [ -d ~/.cache/lockpatterns ]
|
|
then
|
|
pattern=$(find ~/.cache/lockpatterns/ | sort -R | head -1)
|
|
else
|
|
pattern=$HOME/.config/i3/lock.png
|
|
fi
|
|
revert() {
|
|
xset dpms 0 0 0
|
|
}
|
|
trap revert SIGHUP SIGINT SIGTERM
|
|
xset dpms 5 5 5
|
|
i3lock --nofork --color 648901 --image=$pattern --tiling --ignore-empty-password
|
|
revert
|
|
fi
|