For a standard Xfce session with lightdm you need to do as Wey suggested - as follows:
# nano /etc/X11/xinit/xinitrc
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/* ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login
[[ -f /etc/profile ]] && . /etc/profile
exec $1
# chmod +x /etc/X11/xinit/xinitrc
# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..........
session-wrapper=/etc/X11/xinit/xinitrc
..........
Now just login to the normal Xfce Session from lightdm.
As for auto-login maybe try the following:
# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..........
autologin-user=<<USERNAME>>
autologin-user-timeout=<<SECONDS>>
autologin-session=/etc/X11/xinit/xinitrc
.........
Cheers.
]]>[SeatDefaults]
..............
autologin-user=tom
autologin-user-timeout=3
It still let me input password. I found this line in lightdm.conf
#autologin-session=UNIMPLEMENTED
Thank you any way,The primal problem(posted on #12) was solved.
]]>Excellent!! It works fine to me
By the way, how to autologin in lightDM+xfce4?
# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..............
autologin-user=<<USERNAME>>
autologin-user-timeout=<<TIME IN SECONDS>>
..............
Cheers.
]]>My local solution (I use Xfce so modify according to your desktop of choice)
# cp /usr/share/xsessions/xfce.desktop /usr/share/xsessions/<<WHATEVER>>.desktop #nano /usr/share/xsessions/<<WHATEVER>>.desktop
Change the Name= field to something other than Xfce Session ( i just set it as my username)
Change the Exec= field to /home/<<USERNAME>>/.xinitrc
(Of course you could do as Wey has suggested and create a global xinitrc)
Save the file.Now just export PATH in your ~/.xinitrc and launch your desktop session (no need to ck-launch-session as lightdm handles this). eg:
#! /bin/bash export PATH=/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/local/bin/:/usr/bin/:/bin/ exec startxfce4
and make ~/.xinirtc executable
$ chmod +x ~/.xinitrc
Now when you login, in lightdm select the session name you created in /use/share/xsessions.
Cheers.
Excellent!! It works fine to me
By the way, how to autologin in lightDM+xfce4?
# cp /usr/share/xsessions/xfce.desktop /usr/share/xsessions/<<WHATEVER>>.desktop
#nano /usr/share/xsessions/<<WHATEVER>>.desktop
Change the Name= field to something other than Xfce Session ( i just set it as my username)
Change the Exec= field to /home/<<USERNAME>>/.xinitrc
(Of course you could do as Wey has suggested and create a global xinitrc)
Save the file.
Now just export PATH in your ~/.xinitrc and launch your desktop session (no need to ck-launch-session as lightdm handles this). eg:
#! /bin/bash
export PATH=/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/local/bin/:/usr/bin/:/bin/
exec startxfce4
and make ~/.xinirtc executable
$ chmod +x ~/.xinitrc
Now when you login, in lightdm select the session name you created in /use/share/xsessions.
Cheers.
]]>Also, why don't you just write your own "session wrapper".
-Set up a global xinitrc in /etc/X11/xinit/ and make sure its executable.
-Make it functionally equivalent to this:#!/bin/sh [[ -f /etc/profile ]] && . /etc/profile exec ck-launch-session $1
-Open /etc/lightdm/lightdm.conf and set
session-wrapper=/etc/X11/xinit/xinitrc
-Start lightdm normally and login. It should pick up the right environment variable. I haven't tested it to a great extend though, and maybe it works without ck-launch-session.
Hi, everyone,I need your help.
I tried the session wrapper and it works. However, it block the regular user(no root) to shutdown/reboot/suspend/hibernate from the logout panel in xfce4.The panel just show log out button , the shutdown/reboot/suspend/hibernate buttons became gray and unable to click. After I commented the session wrapper line in lightdm.conf, the log out panel return to normal. Is there any better methods to source /etc/profile? THANKS!
-Set up a global xinitrc in /etc/X11/xinit/ and make sure its executable.
-Make it functionally equivalent to this:
#!/bin/sh
[[ -f /etc/profile ]] && . /etc/profile
exec ck-launch-session $1
-Open /etc/lightdm/lightdm.conf and set
session-wrapper=/etc/X11/xinit/xinitrc
-Start lightdm normally and login. It should pick up the right environment variable. I haven't tested it to a great extend though, and maybe it works without ck-launch-session.
]]>Hence the $PATH problem, I wrote back and force with the Robert Ancell the developer of the LightDM project bout the cause of the problem and how to solve it.
Robert replied; "LightDM uses a default PATH /usr/local/bin:/usr/bin:/bin which is overridden by PAM if it is configured that way (it is in Ubuntu). " so the investigation of the case leed us to this.
"but LightDM simply sets a default PATH like every other display manager (gdm/kdm/xdm etc.) for the session. You still haven't told us what distribution/OS you're actually using
but if you want a different PATH for the session you are free to override it in the session wrapper script or via PAM as with any other display manager."
and
"change PATH in the session wrapper script, i.e. the script that's referenced by the session-wrapper option in lightdm.conf."
[BOLD]the problem is that what is session wrapper for arch and where is it?[/BOLD]
as the project manager pointed it out
change PATH in the session wrapper script, i.e. the script that's referenced by the session-wrapper option in lightdm.conf.
but there is non to my knowledge present.
what lightdm project manager suggested was " it is usually a shell script which sets up your session and
starts the windowmanager or desktop environment, so you could add
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
in an appropriate place."
Note that this script is not part of LightDM, it is your distributions responsibility to provide such a wrapper script and to configure LightDM to use it. If that's not the case I would
file a bug against your distros LightDM package
So How should we proceed?
PATH=/usr/local/sbin:/usr/sbin:/sbin:"${PATH}"
which with what you said lightdm sets it to should get it back to the defaults.
Cheers
After the fresh install of arch linux what should the $PATH in /etc/profile be ?
Here's the default /etc/profile file ( i've never touched it...)
# /etc/profile
#Set our umask
umask 022
# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH
# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -r "$profile" && . "$profile"
done
unset profile
fi
# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
. /etc/bash.bashrc
fi
# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP
# Man is much better than us at figuring this out
unset MANPATH
Cheers
]]>