Start .xinitrc from LXDM + metacity logout

All questions and problems regarding LXDE components including LXSession, LXAppearance, GPicView, Leafpad, LXTerminal, Xarchiver, LXNM to be discussed here.

For PCManFM questions, please ask in the dedicated forum below.
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Start .xinitrc from LXDM + metacity logout

Post by lodger »

Hi,
How Can I start my "~/.xinitrc" from LXDM?

I would like to use a session with metacity+lxpanel, then I have edited my .dmrc:

Code: Select all

$ cat ~/.dmrc
[Desktop]
Session=metacity
it works, but when I login my session (default) from LXDM, there is only metacity with nothing. how can I add "lxpanel" on start?
I tryed to put "lxpanel.desktop" on" ~/.config/autostart" but it doesn't work.

Someone can help me?
Thanks.
Last edited by lodger on Sat Jun 27, 2015 8:47 am, edited 2 times in total.
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Re: Start .xinitrc from LXDM

Post by lodger »

I SOLVED with a workaround:

Code: Select all

$ cat ~/.dmrc
[Desktop]
Session=/home/pippo/dm.sh

Code: Select all

$ cat ~/dm.sh
metacity &
lxpanel
but now lxde-logout of lxpanel doesn't work good (when i press "logout" nothing happens).
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Start .xinitrc from LXDM

Post by drooly »

lodger wrote:I SOLVED with a workaround:

Code: Select all

$ cat ~/.dmrc
[Desktop]
Session=/home/pippo/dm.sh

Code: Select all

$ cat ~/dm.sh
metacity &
lxpanel
but now lxde-logout of lxpanel doesn't work good (when i press "logout" nothing happens).
because most of the things that are executed during login, don't get executed with your solution.
permission management in this case.
like dbus, keyring, polkit,...
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Re: Start .xinitrc from LXDM

Post by lodger »

what should i run? i don't want to start lxsession.
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Start .xinitrc from LXDM

Post by drooly »

try adding

Code: Select all

lxpolkit &
to your startup file.
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Re: Start .xinitrc from LXDM

Post by lodger »

i have added it but it still doesnt work (when i press logout nothing happens).
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Start .xinitrc from LXDM

Post by drooly »

sorry, i don't really know what's happening there.

what's this .dmrc?

what are the exact contents of both files now?

how do you tell lightdm to execute .dmrc?

what commands does lxpanel execute to log you out (hint: i think it's some python script called lxde-logout or sth like that)?

did you already tell us what distro you're using? did it come with lxde preinstalled, or did you install that yourself?
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Re: Start .xinitrc from LXDM

Post by lodger »

drooly wrote:sorry, i don't really know what's happening there.

what's this .dmrc?
https://wiki.archlinux.org/index.php/LXDM#Per_user
drooly wrote:what are the exact contents of both files now?

Code: Select all

$ cat ~/.dmrc
[Desktop]
Session=/home/pippo/dm.sh

Code: Select all

$ cat ~/dm.sh
metacity &
clipit &
pcmanfm --desktop &
lxpolkit &
lxpanel
drooly wrote:how do you tell lightdm to execute .dmrc?
i don't use lightdm, i use LXDM.
drooly wrote:what commands does lxpanel execute to log you out (hint: i think it's some python script called lxde-logout or sth like that)?
lxde-logout (it's GUI of lxsession-logout)

Code: Select all

$ cat ~/.config/lxpanel/default/config 
[Command]
Logout=lxde-logout
drooly wrote:did you already tell us what distro you're using? did it come with lxde preinstalled, or did you install that yourself?
i use ArchLinux 32bit. i installed LXDE with:

Code: Select all

 # pacman -S lxde
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Start .xinitrc from LXDM

Post by drooly »

like the name of the utility says, it logs you out of an lxsession.
however, you're not starting an lxsession at login.
lxsession-logout is not a script, it's binary, so there isn't much tweaking you can do with it.
but you can tell lxpanel to use something else to logout.
i'm sure you can find useful instructions on wiki.archlinux.org.
lodger
Posts: 33
Joined: Fri Mar 21, 2014 7:01 pm

Re: Start .xinitrc from LXDM

Post by lodger »

maybe i need to edit the source of lxsession-logout:
https://github.com/lxde/lxsession/tree/ ... ion-logout
but what should i edit?

for logout to LXDM i would like to use this command:

Code: Select all

$ pkill -u nickname
SOLVED:
i have edited these lines of "lxsession-logout.c":

Code: Select all

/* Handler for "clicked" signal on Logout button. */
static void logout_clicked(GtkButton * button, HandlerContext * handler_context)
{
    if (handler_context->lxsession_pid != 0)
    {
        kill(handler_context->lxsession_pid, SIGTERM);
    }
    else
    {
        /* Assume we are under openbox */
        g_spawn_command_line_async("openbox --exit", NULL);
    }
    {
        /* Assume we are under metacity or marco */
        g_spawn_command_line_async("killall -u $USER", NULL);
    }
    gtk_main_quit();
}
Locked