aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-05-21 21:10:27 +0200
committerRasmus Steinke <rasi@xssn.at>2017-05-21 21:10:27 +0200
commitdb8282e3d3beb0d89475f911060db2b1b17ed227 (patch)
treeed15e8ed1337c6bfbf185df6818e48dfb9f19591
parent90889a90ede4684e1a787ca2378b274580829bfc (diff)
downloadrofi-pass-db8282e3d3beb0d89475f911060db2b1b17ed227.tar.gz
let the user enter their own setxkbmap command. more error-prone and flexible1.5.0
-rw-r--r--config.example14
-rwxr-xr-xrofi-pass24
2 files changed, 7 insertions, 31 deletions
diff --git a/config.example b/config.example
index 098a036..818cb11 100644
--- a/config.example
+++ b/config.example
@@ -9,15 +9,13 @@ _rofi () {
# xdotool needs the keyboard layout to be set using setxkbmap
# You can do this in your autostart scripts (e.g. xinitrc)
-# Alternatively you can set your options here and set fix_layout to "true"
-# rofi-pass will try to autodetect correct settings, if no layout is set (not recommended)
-# if model is unset, rofi-pass defaults to 'pc104'
-
+# If for some reason, you cannot do this, you can set the command here.
+# and set fix_layout to true
fix_layout=false
-model=pc104
-layout=us
-#variant=us
-#option=compose:caps
+
+layout_cmd () {
+ setxkbmap us
+}
# fields to be used
URL_field='url'
diff --git a/rofi-pass b/rofi-pass
index c905f59..61c3b32 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -597,29 +597,7 @@ fi
# fix keyboard layout if enabled in config
if [[ $fix_layout == "true" ]]
then
- if [[ -z $model ]]
- then
- model=pc104
- fi
- if [[ -n $layout ]]
- then
- if [[ -n $variant && -n $option ]]
- then
- setxkbmap -model $model -layout $layout -variant $variant -option $option
- elif [[ -n $variant && -z $option ]]
- then
- setxkbmap -model $model -layout $layout -variant $variant
- elif [[ -z $variant && -n $option ]]
- then
- setxkbmap -model $model -layout $layout -option $option
- elif [[ -z $variant && -z $option ]]
- then
- setxkbmap -model $model -layout $layout
- fi
- else
- keyboard=$(setxkbmap -query | grep -E 'layout|variant' | grep -oE '[^: ]+$' | tr '\n' ' ')
- setxkbmap ${keyboard}
- fi
+ layout_cmd
fi
# set help color