1
0
Fork 0
mirror of https://github.com/kastdeur/dotfiles.git synced 2024-12-22 01:03:35 +01:00

[X11]: rewrote xinitrc, moved to xprofile instead of xsession

This commit is contained in:
Eric Teunis de Boone 2020-04-16 00:30:47 +02:00
parent 4a1ee2deb0
commit 08ae066a7a
4 changed files with 47 additions and 59 deletions

View file

@ -22,7 +22,7 @@
~/.tmux.conf: tmux/tmux.conf ~/.tmux.conf: tmux/tmux.conf
~/.vimrc: vim/vimrc ~/.vimrc: vim/vimrc
~/.xinitrc: X11/xinitrc ~/.xinitrc: X11/xinitrc
~/.xsession: X11/xsession ~/.xprofile: X11/xprofile
~/.Xresources: X11/Xresources ~/.Xresources: X11/Xresources
~/.Xresources.d/urxvt: urxvt/Xresources ~/.Xresources.d/urxvt: urxvt/Xresources
~/.config/user-dirs.dirs: X11/user-dirs.dirs ~/.config/user-dirs.dirs: X11/user-dirs.dirs

View file

@ -1,5 +1,11 @@
#!/bin/sh #!/bin/sh
#Standard Stuff
# Default values for session and term
[ "$1" ] || set -- cinnamon
TERM=urxvt
# Source the Standard Stuff from this machine
. /etc/X11/xinit/xinitrc-common . /etc/X11/xinit/xinitrc-common
if [ -f $HOME/.Xclients ]; then if [ -f $HOME/.Xclients ]; then
exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients || \ exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients || \
@ -15,60 +21,22 @@ else
[ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 & [ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
[ -x /usr/bin/twm ] && /usr/bin/twm [ -x /usr/bin/twm ] && /usr/bin/twm
fi fi
# ---------------------------------------------------------------
# OWN
# ---------------------------------------------------------------
# Load Main Xresources # Source the xprofile files
[ -f ~/.Xresources ] && xrdb -merge $HOME/.Xresources [ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
# Load specific Xresources # Set Desktop or Window Manager
XRESD="$HOME/.Xresources.d/"
for f in "$XRESD*"
do
xrdb -merge "$f"
done
numlockx on # turn on numlock
setxkbmap -option caps:escape # caps lock works as escape
# Load session
DEFAULT_SESSION="awesome >> $HOME/.cache/awesome/stdout 2>> $HOME/.cache/awesome/stderr"
XTERM=xterm
case $1 in case $1 in
xfce4) cinnamon) set -- cinnamon-session;;
RUN=startxfce4 gnome) set -- gnome-session;;
;; kde) set -- startkde;;
awesome) xfce) set -- xfce4-session;;
xscreensaver -nosplash & awesome) set -- awesome;;
nm-applet & enlightenment) set -- enlightenment_start;;
RUN=awesome
;;
enlightenment)
RUN=enlightenment_start
;;
openbox)
RUN=openbox
;;
cinnamon)
RUN=cinnamon
;;
kde)
RUN=startkde
;;
gnome)
RUN=gnome-session
;;
unity)
RUN=unity
;;
xterm)
RUN=xterm
;;
*)
RUN=$DEFAULT_SESSION
;;
esac esac
exec "$RUN" || exec "$XTERM" # Run the session, if it doesn't work try TERM,
# finally fallback to xterm if there's nothing
exec "$@" || exec "$TERM" || exec xterm

25
X11/xprofile Normal file
View file

@ -0,0 +1,25 @@
#~/bin/sh
# This file is the equivalent of .profile when using X.
# It is hopefully sourced by the DE.
# It is definitely sourced from .xinitrc
# Merge the Main Xresources
[ -f ~/.Xresources ] && xrdb -merge $HOME/.Xresources
# Turn on numlock
numlockx on
# Caps Lock works as escape key: whoever uses CapsLock?
setxkbmap -option caps:escape
# Start redshift if it exists
if [[ $(command -v redshift) ]]; then
redshift &
fi
# See if we can set the background using feh
[ -x ~/.fehbg ] && ~/.fehbg
# Source the local xprofiles
[ -r ~/.xprofile.local ] && . ~/.xprofile.local
[ -r ~/.local/.xprofile ] && . ~/.local/.xprofile

View file

@ -1,5 +0,0 @@
#!/bin/bash
if [[ $(command -v redshift) ]]; then
redshift &
fi