diff options
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | bspwmrc | 5 | ||||
-rwxr-xr-x | install.sh | 14 |
3 files changed, 16 insertions, 8 deletions
@@ -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. @@ -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 @@ -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 |