lxqt / lxqt-session

The LXQt session manager
https://lxqt.github.io
GNU Lesser General Public License v2.1
57 stars 52 forks source link

Feature request: make lxqt-leave work completely under wayland #459

Closed stefonarch closed 7 months ago

stefonarch commented 1 year ago

As it looks like thatlxqt-session has to be started by the compositor lxqt-leave -logout will not stop the compositor running (and processes started by it).

Possible Solution

Usingwlogout the commands can be specified in XDG_CONFIG_HOME/wlogout/layout :


{
    "label" : "logout",
    "action" : "lxqt-leave --logout && loginctl terminate-user $USER",
    "text" : "Logout",
    "keybind" : "c"
}
{
    "label" : "shutdown",
    "action" : "lxqt-leave --shutdown",
    "text" : "Shutdown",
    "keybind" : "s"
}
{
    "label" : "reboot",
    "action" : "lxqt-leave --reboot",
    "text" : "Reboot",
    "keybind" : "r"
}
{
    "label" : "lock",
    "action" : "swaylock",
    "text" : "Lock screen",
    "keybind" : "b"
}

Except of the logout and the lockscreen this does the same as thelxqt-leaveapp, which could modify those 2 commands if running under wayland. Afaik there are only 2 valid lockers (excluding gtklock), swaylock and waylock (which I didn't look into it yet).

Maybe a setting for preferred screenlocker under wayland is needed in lxqt-session.

Context

I've running a full lxqt-session (except of lxqt-panel - started by wayfire.ini - and apps eventually started by shortcut) running now and am using wlogout.

System Information
stefonarch commented 1 year ago

Testing some approaches maybe this cannot be achieved bylxqt-leave, as it cannot execute any command after itself. So probably it should run directly a custom lxqt-wlogout version if running under wayland.

Or maybe for the logout this has to be done by powermanager.logout()

stefonarch commented 1 year ago

Using now https://github.com/stefonarch/lxqt-wlogout which works nicely. loginctl terminate-user $USER closes also tty sessions which is not wanted.

For screenlocking this piece in lxqt-lockscreen.desktop works from the menu:

[Desktop Entry]
Type=Application
Exec=bash -c "if [ "$XDG_SESSION_TYPE" = "wayland" ]; then swaylock; else lxqt-leave --lockscreen; fi"
Icon=system-lock-screen
Categories=System;Screensaver;
OnlyShowIn=LXQt;

It shouldn't be too difficult to make powermanager.lockscreen() use different actions depending on session type.

stefonarch commented 7 months ago

Probably impossible as a child process started by lxqt will die with the session while the compositor is still running.