diff --git a/config.example b/config.example index 3e3c8bf..471fe6c 100644 --- a/config.example +++ b/config.example @@ -6,8 +6,9 @@ _rofi () { rofi -i -width 700 -no-levenshtein-sort "$@" } -# keyboard layout (set this to your actual layout. E.g. keyboard="de us" -keyboard=us +# rofi-pass tries to detect keyboard layout automatically +# if this fails try to set it manually here. +# keyboard=us # fields to be used URL_field='url' diff --git a/rofi-pass b/rofi-pass index c0d72df..53e5de5 100755 --- a/rofi-pass +++ b/rofi-pass @@ -563,6 +563,9 @@ fi if [[ -n $keyboard ]]; then setxkbmap ${keyboard} +else + keyboard=$(setxkbmap -query | grep layout | grep -oE '[^: ]+$') + setxkbmap ${keyboard} fi # set help color