From 748eb8ec392c21424ccd9fbefef2b3ee0fce2ab3 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sat, 11 Mar 2017 19:14:10 +0100 Subject: [PATCH] try to detect keyboard layout --- config.example | 5 +++-- rofi-pass | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) 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