Skip to content

Commit db8282e

Browse files
committedMay 21, 2017
let the user enter their own setxkbmap command. more error-prone and flexible
1 parent 90889a9 commit db8282e

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed
 

‎config.example

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ _rofi () {
99
# xdotool needs the keyboard layout to be set using setxkbmap
1010
# You can do this in your autostart scripts (e.g. xinitrc)
1111

12-
# Alternatively you can set your options here and set fix_layout to "true"
13-
# rofi-pass will try to autodetect correct settings, if no layout is set (not recommended)
14-
# if model is unset, rofi-pass defaults to 'pc104'
15-
12+
# If for some reason, you cannot do this, you can set the command here.
13+
# and set fix_layout to true
1614
fix_layout=false
17-
model=pc104
18-
layout=us
19-
#variant=us
20-
#option=compose:caps
15+
16+
layout_cmd () {
17+
setxkbmap us
18+
}
2119

2220
# fields to be used
2321
URL_field='url'

‎rofi-pass

+1-23
Original file line numberDiff line numberDiff line change
@@ -597,29 +597,7 @@ fi
597597
# fix keyboard layout if enabled in config
598598
if [[ $fix_layout == "true" ]]
599599
then
600-
if [[ -z $model ]]
601-
then
602-
model=pc104
603-
fi
604-
if [[ -n $layout ]]
605-
then
606-
if [[ -n $variant && -n $option ]]
607-
then
608-
setxkbmap -model $model -layout $layout -variant $variant -option $option
609-
elif [[ -n $variant && -z $option ]]
610-
then
611-
setxkbmap -model $model -layout $layout -variant $variant
612-
elif [[ -z $variant && -n $option ]]
613-
then
614-
setxkbmap -model $model -layout $layout -option $option
615-
elif [[ -z $variant && -z $option ]]
616-
then
617-
setxkbmap -model $model -layout $layout
618-
fi
619-
else
620-
keyboard=$(setxkbmap -query | grep -E 'layout|variant' | grep -oE '[^: ]+$' | tr '\n' ' ')
621-
setxkbmap ${keyboard}
622-
fi
600+
layout_cmd
623601
fi
624602

625603
# set help color

0 commit comments

Comments
 (0)
Please sign in to comment.