Shortcut for Lightdm restart

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.
Locked
User avatar
borissa
Posts: 1
Joined: Mon Oct 25, 2021 5:44 am

Shortcut for Lightdm restart

Post by borissa »

Hello guys,
I am trying unsuccessfully to add a shortcut on my Raspberry to restart LightDM, the classic CTRL-ALT-BackSpace

I tried to add the following with the same result in /etc/xdg/openbox/lxde-pi-rc.xml and ~/.config/openbox/lxde-pi-rc.xml

Code: Select all

<keybind key="C-A-BackSpace">
      <action name="Execute">
        <command>sudo systemctl restart lightdm</command>
      </action>
    </keybind>
I tried also

Code: Select all

  <keybind key="C-A-BackSpace">
      <action name="Execute">
        <command>sudo service lightdm restart</command>
      </action>
    </keybind>
If I run these commands on terminal of course they works, but there's no way for me to add it as a shortcut,

help please!
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Shortcut for Lightdm restart

Post by drooly »

Chances are your raspberry Pi's OS uses systemd, so the first command is right.
Have you tried entering that command without sudo? Maybe it'll work.
If not, you have to find a way to enter the password graphically - try "sudo -A systemctl restart lightdm".
Locked