aboutsummaryrefslogtreecommitdiff
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
parentc54028716921f75b9c4a5f667504629616df1288 (diff)
downloadswayrice-42fe8f180b3ae0ee84ed978bca787d042ca72d79.tar.gz
swayrice-42fe8f180b3ae0ee84ed978bca787d042ca72d79.zip
changes around lock script for better handling of gpg key unlocking
-rw-r--r--dotfiles/.config/swaylock/config2
-rw-r--r--dotfiles/.gnupg/gpg-agent.conf4
-rwxr-xr-xdotfiles/.local/bin/lock-color4
-rwxr-xr-xdotfiles/.local/bin/mailsync3
4 files changed, 8 insertions, 5 deletions
diff --git a/dotfiles/.config/swaylock/config b/dotfiles/.config/swaylock/config
index 5907f4a..1d977f2 100644
--- a/dotfiles/.config/swaylock/config
+++ b/dotfiles/.config/swaylock/config
@@ -1,7 +1,7 @@
image=~/.config/lockwall.png
color=#00000000
font=BlexMono Nerd Font Mono
-font-size=48
+font-size=36
scaling=fill
indicator-radius=100
show-failed-attempts
diff --git a/dotfiles/.gnupg/gpg-agent.conf b/dotfiles/.gnupg/gpg-agent.conf
index 1d09028..b90f973 100644
--- a/dotfiles/.gnupg/gpg-agent.conf
+++ b/dotfiles/.gnupg/gpg-agent.conf
@@ -1,3 +1,3 @@
allow-preset-passphrase
-max-cache-ttl 86400
-default-cache-ttl 86400
+max-cache-ttl 43200
+default-cache-ttl 43200
diff --git a/dotfiles/.local/bin/lock-color b/dotfiles/.local/bin/lock-color
index c43fc15..0026842 100755
--- a/dotfiles/.local/bin/lock-color
+++ b/dotfiles/.local/bin/lock-color
@@ -2,9 +2,9 @@
swaymsg input type:keyboard xkb_switch_layout 0
-swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
+gpg-connect-agent --no-autostart reloadagent /bye
+swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
swaylock
pkill -n swayidle
-
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