You are not logged in.

#1 2015-01-06 03:38:59

Wind
Member
Registered: 2014-11-25
Posts: 17

LightDM running xinitrc help

I'm using LightDM and would like it to run startx or whatever's in my xinitrc so my dwm session can have time, wallpaper, etc. How would I go about doing this?

Offline

#2 2015-01-06 04:17:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: LightDM running xinitrc help

I'm not using LightDM and I'm a bit confused as https://wiki.archlinux.org/index.php/Xprofile says xinitrc is sourced by LightDM while https://wiki.archlinux.org/index.php/Li … _from_SLiM says to use xprofile.
Maybe you have to http://askubuntu.com/questions/77191/ho … d-sessions ?

Offline

#3 2015-01-06 11:44:03

Wind
Member
Registered: 2014-11-25
Posts: 17

Re: LightDM running xinitrc help

karol wrote:

I'm not using LightDM and I'm a bit confused as https://wiki.archlinux.org/index.php/Xprofile says xinitrc is sourced by LightDM while https://wiki.archlinux.org/index.php/Li … _from_SLiM says to use xprofile.
Maybe you have to http://askubuntu.com/questions/77191/ho … d-sessions ?

LightDM uses .desktops or whatever so I created my custom desktop session to select when logging in and pointed to /etc/X11/Xsession like the askubuntu says, and it didn't work. But I checked /etc/X11/Xsession and file doesn't even exist.

Offline

#4 2015-01-07 09:35:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: LightDM running xinitrc help

lightdm provides /etc/lightdm/Xsession.

Offline

#5 2015-07-09 12:41:59

jrk
Member
From: Nämberch
Registered: 2012-10-16
Posts: 37

Re: LightDM running xinitrc help

Offline

#6 2015-07-09 13:05:06

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: LightDM running xinitrc help

Ok let me clean this up. LightDM will indeed use the .desktop files in /usr/share/xsessions to start the session. It will also execute ~/.xprofile and that is what you should use. Any commands that you would normally put in your ~/.xinitrc you should put in your ~/.xprofile file instead and they will be started on login.

@karol thanks for pointing that out. I believe the wiki is in error there. I think it's referring to this (for LightDM):

# Run all system xinitrc shell scripts.
xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then
    for script in $xinitdir/*; do
        echo "Loading xinit script $script"
        if [ -x "$script" -a ! -d "$script" ]; then
            . "$script"
        fi
    done
fi

which starts scripts like 30-dbus.sh

But LightDM, GDM etc will definitely not run /etc/X11/xinit/xinitrc or ~/.xinitrc

Last edited by Chazza (2015-07-09 13:14:54)

Offline

#7 2015-07-09 22:06:38

hungerfish
Member
Registered: 2009-09-13
Posts: 254

Re: LightDM running xinitrc help

Alternatively, its trivial to write your own 'dwm.desktop' file and put it in /usr/share/xsessions. From there you could then call any script you want! So you could have a script called 'run-dwm' somewhere which contains all the commands you would normally put in .xinitrc when running dwm via startx. Its nice and clean that way, and you get to use Lightdm's session selection menu.
Trying out a new wm (say bspwm...), just add a new .desktop file pointing to the right script and you're golden!

[Desktop Entry]
Type=XSession
Exec=/path/to/run-dwm
TryExec=/path/to/run-dwm
Name=Dwm
#!/bin/bash
## run-dwm
all your startup stuff, panels, xsetroot etc. goes here...
dwm 2> ~/.dwm.log

Beetles and bacteria are vastly more successful than humans in terms of survival.

Offline

Board footer

Powered by FluxBB