summary refs log tree commit diff stats
path: root/bin
diff options
context:
space:
mode:
authorChristian Krinitsin <code@krinitsin.xyz>2024-12-29 12:41:27 +0100
committerChristian Krinitsin <code@krinitsin.xyz>2024-12-29 12:41:27 +0100
commita557436416587d4de3e58f25cd34ba21bf963441 (patch)
tree0bf707bd1072484e90e9bfa1bdbf1116f6461403 /bin
parent13358986633120fcce9efe5294da4537552cfd62 (diff)
downloaddotfiles-a557436416587d4de3e58f25cd34ba21bf963441.tar.gz
dotfiles-a557436416587d4de3e58f25cd34ba21bf963441.zip
add notify watch, so that pinentry-dmenu is shown on focused monitor
Diffstat (limited to 'bin')
-rwxr-xr-xbin/prepinentry10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/prepinentry b/bin/prepinentry
new file mode 100755
index 0000000..bec7c46
--- /dev/null
+++ b/bin/prepinentry
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+TARGET_PROGRAM="/home/chris/.gnupg/pinentry-dmenu"
+
+inotifywait -m -e access "$TARGET_PROGRAM" | while read; do
+    if [ -f "/home/chris/.gnupg/current_monitor" ]; then
+        rm /home/chris/.gnupg/current_monitor
+    fi
+    swaymsg -t get_outputs | jq -r '.[] | select(.focused==true).name' >> /home/chris/.gnupg/current_monitor
+done