This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.pinentry-rofi: improve cached PIN dialog

Show OK/Cancel/Clear cache options instead of confusing menu.
Add -only-match to prevent typing from breaking selection.

+19 -11
+19 -11
tools/pinentry-rofi/pinentry-rofi.sh
··· 106 106 # Check for cached PIN 107 107 cached_pin="" 108 108 if cached_pin=$(get_cached_pin 2>/dev/null) && [[ -n "$cached_pin" ]]; then 109 - # Show menu with cache options 110 - choice=$(printf "Use cached PIN\nClear cache" | rofi -dmenu \ 111 - -p "PIN cached" \ 109 + # Show menu with cache options - use -only-match to prevent typing from breaking selection 110 + choice=$(printf "OK\nCancel\nClear cache" | rofi -dmenu \ 111 + -no-custom \ 112 + -only-match \ 112 113 -no-fixed-num-lines \ 114 + -theme-str 'inputbar { enabled: false; }' \ 113 115 "${mesg_args[@]}" \ 114 116 "${theme_args[@]}" \ 115 117 2>/dev/null) || exit 1 116 118 117 - if [[ "$choice" == "Use cached PIN" ]]; then 118 - extend_cache 119 - echo "$cached_pin" 120 - exit 0 121 - elif [[ "$choice" == "Clear cache" ]]; then 122 - clear_cache 123 - fi 124 - # Fall through to PIN prompt if cache cleared 119 + case "$choice" in 120 + "OK") 121 + extend_cache 122 + echo "$cached_pin" 123 + exit 0 124 + ;; 125 + "Cancel") 126 + exit 1 127 + ;; 128 + "Clear cache") 129 + clear_cache 130 + exit 1 131 + ;; 132 + esac 125 133 fi 126 134 127 135 # Use rofi in password mode