diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-03-12 18:56:23 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-03-12 18:56:23 +0100 |
commit | 1672ad4c6049885e12c8d1bd2399ebca5f422263 (patch) | |
tree | b1570a822d25380ad13c2a37a86f4ff7b923ffac | |
parent | 8d3f9e75bb5b59e391152acbedb1c554e64658ce (diff) | |
download | rofi-pass-1672ad4c6049885e12c8d1bd2399ebca5f422263.tar.gz |
Add comment about keyboard layouts and set it if user explicitly asks for it
-rw-r--r-- | config.example | 7 | ||||
-rwxr-xr-x | rofi-pass | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/config.example b/config.example index 471fe6c..a6166b6 100644 --- a/config.example +++ b/config.example @@ -3,9 +3,14 @@ # rofi command. Make sure to have "$@" as last argument _rofi () { - rofi -i -width 700 -no-levenshtein-sort "$@" + rofi "$@" } +# If you want rofi-pass to set keyboard layout, enable this +# However It's recommended to call setxkbmap on login manually +# Setting it in Xorg config is not sufficient for some reason +fix_layout=false + # rofi-pass tries to detect keyboard layout automatically # if this fails try to set it manually here. # keyboard=us @@ -565,6 +565,18 @@ if [[ ! -d "$HOME/.cache/rofi-pass" ]]; then mkdir "$HOME/.cache/rofi-pass" fi +# fix keyboard layout if enabled in config +if [[ $fix_layout == "true" ]] +then + if [[ -n $keyboard ]] + then + setxkbmap "${keyboard}" + else + keyboard=$(setxkbmap -query | grep -E 'layout|variant|options' | grep -oE '[^: ]+$' | tr '\n' ' ') + setxkbmap ${keyboard} + fi +fi + # set help color if [[ $help_color == "" ]]; then help_color=$(rofi -dump-xresources | grep 'rofi.color.normal' | gawk -F ',' '/,/{gsub(/ /, "", $2); print $2}') |