#!/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

export LANG=en_US.UTF-8


# keyboard options
keyboard_layout=de
keyboard_variant=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 -layout "$keyboard_layout" -variant "$keyboard_variant"

# set key repeat delay
xset r rate "$keyboard_repeat_delay" "$keyboard_repeat_speed"

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

SESSION_CONF=$(bash "$HOME/.i3/scripts/genconfig.bash")
exec i3 -c "$SESSION_CONF" >> ~/.i3/logs/i3.log
