aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rwxr-xr-xbspwmrc5
-rwxr-xr-xinstall.sh14
3 files changed, 16 insertions, 8 deletions
diff --git a/README.md b/README.md
index 21cc1bb..5c67e0f 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,8 @@ The software the scripts install depends on your distro.
I don't maintain a separate list in the README anymore,
but you can look at the scripts yourself (you should already be doing this).
-bspwm will attempt to load the keyboard layout in `~/.xkeymap`.
-To set it, run `echo LAYOUT > ~/.xkeymap` where `LAYOUT` is
-the lower case two character code (e.g. `us` or `de`).
+The keyboard layout is handled by the installer and written
+to `/etc/X11/xorg.conf.d/00-keyboard.conf` automatically.
## install.sh
The `install.sh` script installs the entire setup.
diff --git a/bspwmrc b/bspwmrc
index 3a5af15..d30d18c 100755
--- a/bspwmrc
+++ b/bspwmrc
@@ -15,11 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-KEYMAP=$(cat ~/.xkeymap)
-if [ -n "${KEYMAP}" ]; then
- setxkbmap -layout ${KEYMAP}
-fi
-
pgrep -x sxhkd > /dev/null || sxhkd &
xrandr --output 'DP2' --auto
diff --git a/install.sh b/install.sh
index 9f183f7..2b3ed66 100755
--- a/install.sh
+++ b/install.sh
@@ -17,6 +17,11 @@
set -e
+if [[ -z "$1" || -z "$2" ]]; then
+ echo -e "\e[1m\e[1;31mUsage: <xkblayout> <xkbvariant>"
+ exit 1
+fi
+
echo -e "\e[1m\e[1;31mMAKE SURE YOU ARE IN THE DIRECTORY THIS SCRIPT IS LOCATED IN!"
echo -e "\e[0m\e[1;31mIf you're sure you are in the correct dir, press Enter."
read
@@ -129,6 +134,15 @@ else
exit 1
fi
+cat <<EOT | ${SUDO} tee /etc/X11/xorg.conf.d/00-keyboard.conf
+Section "InputClass"
+ Identifier "system-keyboard"
+ MatchIsKeyboard "on"
+ Option "XkbLayout" "$1"
+ Option "XkbVariant" "$2"
+EndSection
+EOT
+
mkdir -p ~/.config/bspwm
ln -sf ${PWD}/bspwmrc ~/.config/bspwm/bspwmrc
ln -sf ${PWD}/init_monitor.sh ~/.config/bspwm/init_monitor.sh