aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-03-12 18:56:23 +0100
committerRasmus Steinke <rasi@xssn.at>2017-03-12 18:56:23 +0100
commit1672ad4c6049885e12c8d1bd2399ebca5f422263 (patch)
treeb1570a822d25380ad13c2a37a86f4ff7b923ffac
parent8d3f9e75bb5b59e391152acbedb1c554e64658ce (diff)
downloadrofi-pass-1672ad4c6049885e12c8d1bd2399ebca5f422263.tar.gz
Add comment about keyboard layouts and set it if user explicitly asks for it
-rw-r--r--config.example7
-rwxr-xr-xrofi-pass12
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
diff --git a/rofi-pass b/rofi-pass
index fcd9282..59172f8 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -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}')