From 638442cd6d10eba67928ec4e1c623a727da1fcb4 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Wed, 17 Oct 2018 10:28:55 +0100 Subject: [PATCH] Split x startup into xinitrc and xprofile .xprofile can be sourced from display managers. .xinitrc sources .xprofile and starts a particular desktop env for use with startx --- X/.xinitrc | 68 +++-------------------------------------------------- X/.xprofile | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 65 deletions(-) create mode 100644 X/.xprofile diff --git a/X/.xinitrc b/X/.xinitrc index 0546ebf..d12fed3 100644 --- a/X/.xinitrc +++ b/X/.xinitrc @@ -12,71 +12,9 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then unset f fi - -# Load .Xresources -xrdb -merge ~/.Xresources &> /dev/null -if [ -f ~/.Xresources.$HOSTNAME ]; then - xrdb -merge ~/.Xresources.$HOSTNAME &> /dev/null -fi - -# Set keyboard layout -case $HOSTNAME in - platinum) - setxkbmap -variant colemak gb - xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L" - xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R" - xmodmap -e "add Control = Control_L Control_R" - ;; - magnesium) - setxkbmap -variant colemak us - xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L" - xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R" - xmodmap -e "add Control = Control_L Control_R" - ;; - *) - ;; -esac - -# Set screen layout -case $HOSTNAME in - magnesium) - xrandr --output VGA1 --right-of HDMI2 - ;; - *) - ;; -esac - -# Set java font option -export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" - -feh --bg-scale ~/Pictures/background.jpg& - -/usr/lib64/xfce4/notifyd/xfce4-notifyd& - -xset -b - -# Battery monitoring -case $HOSTNAME in - platinum) - ~/.local/bin/bat_mgt.sh& - ;; - *) - ;; -esac - -cat ~/.ratpoisonrc.base ~/.ratpoisonrc.$HOSTNAME > ~/.ratpoisonrc - -# run xcreensaver -if [ -x $(which xscreensaver) ]; then - xscreensaver& -fi - -# configure i3 - -if [ -f ~/.config/i3/config.base ]; then - cat ~/.config/i3/config.base ~/.config/i3/config.${HOSTNAME} > ~/.config/i3/config -fi - +# Source ~/.xprofile +[ -f /etc/xprofile ] && . /etc/xprofile +[ -f ~/.xprofile ] && . ~/.xprofile case $HOSTNAME in magnesium|platinum|plutonium) exec i3 diff --git a/X/.xprofile b/X/.xprofile new file mode 100644 index 0000000..59defe4 --- /dev/null +++ b/X/.xprofile @@ -0,0 +1,67 @@ +# Load .Xresources +xrdb -merge ~/.Xresources &> /dev/null +if [ -f ~/.Xresources.$HOSTNAME ]; then + xrdb -merge ~/.Xresources.$HOSTNAME &> /dev/null +fi + +# Set keyboard layout +case $HOSTNAME in + platinum) + setxkbmap -variant colemak gb + xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L" + xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R" + xmodmap -e "add Control = Control_L Control_R" + ;; + magnesium) + setxkbmap -variant colemak us + xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L" + xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R" + xmodmap -e "add Control = Control_L Control_R" + ;; + *) + ;; +esac + +# Set screen layout +case $HOSTNAME in + magnesium) + xrandr --output HDMI3 --right-of HDMI2 + ;; + *) + ;; +esac + +# Set java font option +export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" + +feh --bg-scale ~/Pictures/background.jpg& + +/usr/lib64/xfce4/notifyd/xfce4-notifyd& + +xset -b + +# Battery monitoring +case $HOSTNAME in + platinum) + ~/.local/bin/bat_mgt.sh& + ;; + *) + ;; +esac + +cat ~/.ratpoisonrc.base ~/.ratpoisonrc.$HOSTNAME > ~/.ratpoisonrc + +# run xcreensaver +if [ -x $(which xscreensaver) ]; then + xscreensaver& +fi + +# configure i3 + +if [ -f ~/.config/i3/config.base ]; then + cat ~/.config/i3/config.base ~/.config/i3/config.${HOSTNAME} > ~/.config/i3/config +fi + +if [ -f ~/.bash_profile ]; then + source ~/.bash_profile +fi -- 2.46.2