aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/mailsync
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-07-14 04:28:12 +0300
committerYaroslav <contact@yaroslavps.com>2020-07-14 04:28:12 +0300
commit42fe8f180b3ae0ee84ed978bca787d042ca72d79 (patch)
tree32152891a7293a6343398f9b5c227709a4be4599 /dotfiles/.local/bin/mailsync
parentc54028716921f75b9c4a5f667504629616df1288 (diff)
downloadswayrice-42fe8f180b3ae0ee84ed978bca787d042ca72d79.tar.gz
swayrice-42fe8f180b3ae0ee84ed978bca787d042ca72d79.zip
changes around lock script for better handling of gpg key unlocking
Diffstat (limited to 'dotfiles/.local/bin/mailsync')
-rwxr-xr-xdotfiles/.local/bin/mailsync3
1 files changed, 3 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/mailsync b/dotfiles/.local/bin/mailsync
index 2a5ed03..431d314 100755
--- a/dotfiles/.local/bin/mailsync
+++ b/dotfiles/.local/bin/mailsync
@@ -4,6 +4,9 @@
# Run only if user logged in (prevent cron errors)
w | grep "^$USER\W" >/dev/null || exit
+# Don't run if screen is locked (gpg key is locked too)
+pidof swaylock && exit
+
# Check several times before giving up, useful when just waking up from sleep
# since internet is usually not available right away
wget -q --tries=3 --timeout=20 --spider 1.1.1.1 > /dev/null || exit