How to know and how to change my session manager?

I am confused. I’ve googled all the internet.
It seems that ArchLabs doesnt use xinit as a session manager. At least, there are no files in /etc/X11/xinit or ~/.xinitrc.
I used lightDM display manager, and there was Xsession file in /etc/lightdm folder. Now I’ve disabled lightdm service and enabled LXDM. I’ve also installed lxsession-gtk3. But I haven’t found a slightest manual in the internet on how to make lxsession to work. They all just say do sudo pacman -S lxsession which is done of course. They say, there 'd be a config file for lxsession in ~/.configs or at least /etc/xdg/lxsession (there is NO such folder).
There is a folder /usr/share/xsessions which contain only bspwm.desktop (I am using bspwm window manager).

Th question of the day.
Do I need to create all these folders and files for lxsession manually, how do I set lxsession on autostart and how to know what is my session manager and where are it’s configs? Is there a universal way to chek it?
It seems I have neither xinit as a session manager nor lightDM nor Lxsession.
I have no idea what I have and where are the configs.
I am totally confused.

P. S. I know these are stupid questions so I am sorry, but a little help with explanations would be very appreciated.

I’ve realized that the display manager chooses my session manager.
I’ve found the configs, and they are commented i.e. inactive.
image

I guess I do not have any session manager and I have only bspwm.desktop which automatically launches from /usr/share/xsessions ? Is that possible?
And does display manager tries to launch all desktop entries in /…/xsessions or, if the session manager is specified, only the session manager, which’s configs define all other entiries?

I think that’s the session manager for LXDE so it would only be used for that desktop environment.

If you want to use it with bspwm then try adding this line to ~/.config/bspwm/bspwmrc:

lxsession &

Not sure if that would actually work though.

Sounds reasonable to me: if there are no xsessions listed in /etc/lxdm/lxdm.conf and only one file in /usr/share/xsessions/then that would be run. Additionally, ~/.dmrc can be used for user-specific configuration.

You can also check /var/lib/lxdm/lxdm.conf to see the last-used sessions.

1 Like

Wow, that was almost obvious, I got too focused on how to make bspwm work via lxsession though I could’ve done just the opposite.

But I’ve tried to launch lxsession and got this:

Also my tint2 panel got disabled after this for some reason.
image

I guess lxsession just cannot find LXDE files and configs so it just returned all processes to point zero, including the processes launched by bspwm (like tint2)?

Is Xfce’s session manager running as well? I think that’s what ArchLabs uses by default.

This might show what’s already running:

pgrep -a polkit

I can’t see all of the text, can you post it with code tags instead of as a photograph? Use ``` (three backticks) on a line by itself to start and end a code block.

pgrep -a polkit
gave me this:

515 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
550 /usr/lib/polkit-1/polkitd --no-debug

lxsession output:

** Message: 16:04:17.082: main.vala:102: Session is (null)
** Message: 16:04:17.085: main.vala:103: DE is (null)
** Message: 16:04:17.085: main.vala:107: No session set, fallback to LXDE session
** Message: 16:04:17.085: main.vala:113: No desktop environnement set, fallback to LXDE
** Message: 16:04:17.144: main.vala:134: log directory: /home/wrabbit/.cache/lxsession/LXDE
** Message: 16:04:17.144: main.vala:135: log path: /home/wrabbit/.cache/lxsession/LXDE/run.log

tint2 & output after lxsession:

wrabbit@archlabs ~ % tint2: Using glib slice allocator (default). Run tint2 with environment variable G_SLICE=always-malloc in case of strange behavior or crashes
tint2: xRandr: Found crtc's: 4
tint2: xRandr: Linking output eDP1 with crtc 0, resolution 1920x1080, DPI 144
tint2: xRandr: crtc 1 seems disabled
tint2: xRandr: crtc 2 seems disabled
tint2: xRandr: crtc 3 seems disabled
tint2: warning : WM doesn't respect NETWM specs. tint2 default to 1 desktop.
tint2: No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.
tint2: Loading config file: /home/wrabbit/.config/tint2/tint2rc
tint2: Warning: separator items should shart with 'separator = new'
tint2: real transparency on... depth: 32
tint2: panel items: PT:BSC
tint2: Systray composited rendering on
tint2: Found power device BAT1
Found battery "BAT1"
tint2: Found power device ACAD
Found mains "ACAD"
tint2: nb monitors 1, nb monitors used 1, nb desktops 1
tint2: panel 1 uses scale 1
tint2: Kernel uevent interface initialized...
tint2: systray window 14680081
tint2: systray started

Where does polkit-gnome launch from and how do I change it to lxsession?

pstree has showed that polkit-gnome in started by bspwm, but there are no such option in bspwmrc.
in /etc/xdg/autostart, there are only the following, no polkit-gnome:

at-spi-dbus-bus.desktop
gnome-keyring-pkcs11.desktop
gnome-keyring-secrets.desktop
gnome-keyring-ssh.desktop
lxpolkit.desktop
nm-applet.desktop
pulseaudio.desktop
xfce4-power-manager.desktop
xfsettingsd.desktop

It’s probably activated by systemd, check

systemctl status --no-p

Might be better to stop lxpolkit from starting instead, the conflict between that and polkit-gnome-authentication-agent-1 is why you’re getting the error message.

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/lxpolkit.desktop ~/.config/autostart
echo 'Hidden=true' >> ~/.config/autostart/lxpolkit.desktop

Not sure about your tint2 issue though, that output looks normal to me.

Why do you want to use lxsession anyway? What does it achieve for you?

No, seems it’s not. I’ve checked it. It is very strange, all I’ve found is a desktop application in applications folder, and also when I remove polkit-gnome, my nm-applet stops working (at least it disappears from tint2).

Both when I do so and when I remove polkit-gnome, the warning message doesn’t pop up, but the output in the terminal is the same, and tint2 also disappears.
It seems that lxsession doesn’t really work without full LXDE installed.
That’s strange considering it’s suggested in a list of graphical authentication agents here:
https://wiki.archlinux.org/index.php/Polkit#Authentication_agents

It gives lxappearance the opportunity to change color scheme manually, and considering it provides it’s own polkit, I thought it’s a good idea to have it installed instead of gnomes and stuff.
But it seems it’s a no-go.

grep 'polkit-gnome' ~/.* 2>/dev/null

It’ll be in ~/.xprofile.

1 Like

Oh. I am an idiot again, it was really there. The warning message had confused me, I thought that the content of a message I was getting in the terminal was actually a content of the file, nevermind, thank you.

But I guess lxsession still won’t work.

Why’s this?

lxsession should work fine, just need to start it somewhere.

Because, as I mentioned before, when I run lxsession, it outputs:

** Message: 16:04:17.082: main.vala:102: Session is (null)
** Message: 16:04:17.085: main.vala:103: DE is (null)
** Message: 16:04:17.085: main.vala:107: No session set, fallback to LXDE session
** Message: 16:04:17.085: main.vala:113: No desktop environnement set, fallback to LXDE
** Message: 16:04:17.144: main.vala:134: log directory: /home/wrabbit/.cache/lxsession/LXDE
** Message: 16:04:17.144: main.vala:135: log path: /home/wrabbit/.cache/lxsession/LXDE/run.log

…and kills my tint2.
After disabling polkit-gnome, the popup about polkit doesn’t show, but the output and the result is still the same.

Those don’t seem like errors to me, does it exit with some error?

lxsession || echo "error occurred while running lxsession"

I’m not sure why it’s killing the panel, can you start it back up after the session is running?

lxsession & disown
tint2

After trying it a bit I’ve found you are right and lxsession can’t really be used outside of lxde, you can change the wm used by lxde to bspwm or whatever but I’m not sure how it will work.

If you just want the polkit you can run lxpolkit instead without needing to change anything.

1 Like