From e6d3579a105b078d85d6f289c7735d29f29cabb8 Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 16 May 2019 17:24:58 +0200 Subject: Use new pinentry script to select if this need GUI or TUI By default is TUI but if a programm need a GUI for acces gpg keys just add PINENTRY_USER_DATA="gtk" before start it. --- gnupg/.gnupg/gpg-agent.conf | 2 ++ gnupg/.gnupg/gpg.conf | 1 + i3/.config/i3/config | 2 +- scripts/.scripts/launch_rofi-pass.sh | 1 + scripts/.scripts/my-pinentry | 16 ++++++++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gnupg/.gnupg/gpg-agent.conf create mode 100644 gnupg/.gnupg/gpg.conf create mode 100755 scripts/.scripts/launch_rofi-pass.sh create mode 100755 scripts/.scripts/my-pinentry diff --git a/gnupg/.gnupg/gpg-agent.conf b/gnupg/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..83b82fb --- /dev/null +++ b/gnupg/.gnupg/gpg-agent.conf @@ -0,0 +1,2 @@ +pinentry-program /home/neodarz/.scripts/my-pinentry +allow-loopback-pinentry diff --git a/gnupg/.gnupg/gpg.conf b/gnupg/.gnupg/gpg.conf new file mode 100644 index 0000000..d8017a9 --- /dev/null +++ b/gnupg/.gnupg/gpg.conf @@ -0,0 +1 @@ +pinentry-mode default diff --git a/i3/.config/i3/config b/i3/.config/i3/config index c9ce53c..24941cd 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -116,7 +116,7 @@ bindsym $WinKey+Shift+F8 exec alacritty -e qutebrowser #bindsym $AltKey+a exec urxvt -name floatme --background "#000000" -cursorColor "#31363B" -font 7x13 -geometry 88x33 -e "pygmentize ~/.zsh/aliases.zsh | less" #bindsym $WinKey+Shift+v move morkspace to output right bindsym $WinKey+control+l exec i3lock-fancy -p -n -bindsym $WinKey+p exec rofi-pass +bindsym $WinKey+p exec ~/.scripts/launch_rofi-pass.sh #bindsym $WinKey+Shift+$AltKey+0 exec ~/.config/i3/switch-workspace.py 6 bindsym XF86AudioPlay exec ~/.config/i3/switch_audio.sh 8 bindsym $WinKey+g exec ~/.scripts/cycle-workspace.py diff --git a/scripts/.scripts/launch_rofi-pass.sh b/scripts/.scripts/launch_rofi-pass.sh new file mode 100755 index 0000000..87654ce --- /dev/null +++ b/scripts/.scripts/launch_rofi-pass.sh @@ -0,0 +1 @@ +PINENTRY_USER_DATA="gtk" exec rofi-pass diff --git a/scripts/.scripts/my-pinentry b/scripts/.scripts/my-pinentry new file mode 100755 index 0000000..b46687e --- /dev/null +++ b/scripts/.scripts/my-pinentry @@ -0,0 +1,16 @@ +#!/bin/bash +# choose pinentry depending on PINENTRY_USER_DATA +# requires pinentry-curses and pinentry-gtk2 +# this *only works* with gpg 2 +# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802020 + +case $PINENTRY_USER_DATA in +gtk) + exec /usr/bin/pinentry-gtk-2 "$@" + ;; +none) + exit 1 # do not ask for passphrase + ;; +*) + exec /usr/bin/pinentry-curses "$@" +esac -- cgit v1.2.1