Files
dotfiles/x/xinitrc
Hannes Körber 5caefa1b2b Added dynamic config generation for i3.
The script genconfig.bash concatenates the main configuration file with
a host specific one to create a session-specific configration file that
is then passed to i3. It therefore has to be called in .xinitrc or
something comparable before starting i3. If no host specific
configuration is found, a default file will be used instead. This is
useful for providing default that should not go into the main
configuration file, maybe because they are incompatible with some host
specific settings. For example a default bar{} block goes there, as if
this was in the main config, two i3bar instances would be started when a
host specific config specifies its own.
2013-09-18 20:07:35 +02:00

37 lines
756 B
Bash
Executable File

#!/bin/bash
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
[ -f /etc/xprofile ] && source /etc/xprofile
[ -f ~/.xprofile ] && source ~/.xprofile
# keyboard options
keyboard_layout=de
keyboard_options= nodeadkeys
keyboard_repeat_delay=150
keyboard_repeat_speed=30
# execute the host-specific .xinitrc-addition
hostfile="$HOME/.xinitrc.d/$(hostname).xinitrc"
[[ -f "$hostfile" ]] && bash "$hostfile" &
# set keyboard layout
setxkbmap $keyboard_layout $keyboard_options
# set key repeat delay
xset r rate $keyboard_repeat_delay $keyboard_repeat_speed
case $1 in
*)
SESSION_CONF=$(bash "$HOME/.i3/scripts/genconfig.bash")
exec i3 -c "$SESSION_CONF"
;;
esac