From 9497ba3762d1661b89237ad4dd30f2d813a99642 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Thu, 31 Mar 2016 21:40:35 +0200 Subject: [PATCH] Now understood how xinitrc and xprofile files work Now it should work correctly which DM, a problem that I did not know it didn't worked. --- xinitrc | 58 +++++++++----------------------------------------------- xprofile | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 49 deletions(-) create mode 100644 xprofile diff --git a/xinitrc b/xinitrc index 01ec458..d0f8fa1 100644 --- a/xinitrc +++ b/xinitrc @@ -1,56 +1,16 @@ #!/bin/sh - # # ~/.xinitrc # # Executed by startx (run your window manager from here) -# -[ -f ~/.Xresources ] && xrdb -merge -I$HOME ~/.Xresources - -export GTK2_RC_FILES="$HOME/.gtkrc-2.0" - -found=0 -tryDM() { - if [ $found -eq 0 ]; then - parameters='' - case $1 in - awesome ) executable=awesome;; - bspwm ) executable=bspwm;; - catwm ) executable=catwm;; - cinnamon ) executable=cinnamon-session;; - dwm ) executable=dwm;; - enlightenment ) executable=enlightenment_start;; - ede ) executable=startede;; - fluxbox ) executable=startfluxbox;; - gnome ) executable=gnome-session;; - gnome-classic ) executable=gnome-session; parameters="--session=gnome-classic";; - i3|i3wm ) executable=i3;; - icewm ) executable=icewm-session;; - jwm ) executable=jwm;; - kde ) executable=startkde;; - mate ) executable=mate-session;; - monster|monsterwm ) executable=monsterwm;; - notion ) executable=notion;; - openbox ) executable=openbox-session;; - unity ) executable=unity;; - xfce|xfce4 ) executable=startxfce4;; - xmonad ) executable=xmonad;; - *) executabke=$1;; - esac - path=$(which $executable 2> /dev/null) - if [ $? -eq 0 ]; then - found=1 - exec $path $parameters - fi - fi -} - -if [ ! -z $1 ]; then - tryDM $1 +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f fi -tryDM i3 -tryDM xfce4 -tryDM mate -tryDM gnome -tryDM kde + +[ -f /etc/xprofile ] && source /etc/xprofile +[ -f ~/.xprofile ] && source ~/.xprofile + diff --git a/xprofile b/xprofile new file mode 100644 index 0000000..af8b2cb --- /dev/null +++ b/xprofile @@ -0,0 +1,57 @@ +#!/bin/sh + +# +# ~/.xprofile +# +# sourced by your display manager +# + +[ -f ~/.Xresources ] && xrdb -merge -I$HOME ~/.Xresources + +export GTK2_RC_FILES="$HOME/.gtkrc-2.0" + +found=0 +tryDM() { + if [ $found -eq 0 ]; then + parameters='' + case $1 in + awesome ) executable=awesome;; + bspwm ) executable=bspwm;; + catwm ) executable=catwm;; + cinnamon ) executable=cinnamon-session;; + dwm ) executable=dwm;; + enlightenment ) executable=enlightenment_start;; + ede ) executable=startede;; + fluxbox ) executable=startfluxbox;; + gnome ) executable=gnome-session;; + gnome-classic ) executable=gnome-session; parameters="--session=gnome-classic";; + i3|i3wm ) executable=i3;; + icewm ) executable=icewm-session;; + jwm ) executable=jwm;; + kde ) executable=startkde;; + mate ) executable=mate-session;; + monster|monsterwm ) executable=monsterwm;; + notion ) executable=notion;; + openbox ) executable=openbox-session;; + unity ) executable=unity;; + xfce|xfce4 ) executable=startxfce4;; + xmonad ) executable=xmonad;; + *) executable=$1;; + esac + path=$(which $executable 2> /dev/null) + if [ $? -eq 0 ]; then + found=1 + exec $path $parameters + fi + fi +} + +if [ ! -z $1 ]; then + tryDM $1 +fi +tryDM i3 +tryDM xfce4 +tryDM mate +tryDM gnome +tryDM kde +