User avatar
erikhermesman
Posts: 4
Joined: Wed May 29, 2019 12:35 am
Location: USA
Contact: Twitter

Lock Screen Menu Item In Buster

Sun Aug 04, 2019 12:35 am

Did something change in Buster? I'm trying to add the Lock Screen menu item with instructions from here - https://thepihut.com/blogs/raspberry-pi ... -pi-screen - but the icon is not showing up in the menu.

Code: Select all

/etc/xdg/lxpanel/LXDE-pi/panels/panel

Code: Select all

 item {
      name=Lock…
      image=gnome-lockscreen
      action=/usr/bin/dm-tool lock
    }

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Lock Screen Menu Item In Buster

Sun Aug 04, 2019 3:30 am

erikhermesman wrote:
Sun Aug 04, 2019 12:35 am
Did something change in Buster? I'm trying to add the Lock Screen menu item with instructions from here - https://thepihut.com/blogs/raspberry-pi ... -pi-screen - but the icon is not showing up in the menu.

Code: Select all

/etc/xdg/lxpanel/LXDE-pi/panels/panel

Code: Select all

 item {
      name=Lock…
      image=gnome-lockscreen
      action=/usr/bin/dm-tool lock
    }
Use this one instead:

Code: Select all

nano /home/pi/.config/lxpanel/LXDE-pi/panels/panel
Looks better with separator:

Code: Select all

separator {
     }
item {
      name=Lock…
      image=gnome-lockscreen
      action=/usr/bin/dm-tool lock
    }
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
erikhermesman
Posts: 4
Joined: Wed May 29, 2019 12:35 am
Location: USA
Contact: Twitter

Re: Lock Screen Menu Item In Buster

Sun Aug 04, 2019 5:02 pm

Awesome, that did the trick. Thanks!

mattoni
Posts: 17
Joined: Tue Dec 22, 2015 9:57 am

Re: Lock Screen Menu Item In Buster

Tue Sep 17, 2019 10:01 pm

It doesn't work for me...both of methods...
I have raspberry pi 4 with raspbian buster

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Lock Screen Menu Item In Buster

Wed Sep 18, 2019 12:19 am

mattoni wrote:
Tue Sep 17, 2019 10:01 pm
It doesn't work for me...both of methods...
I have raspberry pi 4 with raspbian buster
Something has changed. Works on my 3B+ but not on my 4B.
It was a bad idea to direct edit the panel file anyway as it is subject to being overwritten in an update. There is even a warning at the top of the file.

I would suggest to use Main Menu Editor and add the lock command to the menu. Then if you prefer make a desktop icon. (Right click on the menu item and select add to desktop).

The command is:

Code: Select all

dm-tool lock
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

mattoni
Posts: 17
Joined: Tue Dec 22, 2015 9:57 am

Re: Lock Screen Menu Item In Buster

Thu Sep 19, 2019 1:34 pm

klricks wrote:
Wed Sep 18, 2019 12:19 am
mattoni wrote:
Tue Sep 17, 2019 10:01 pm
It doesn't work for me...both of methods...
I have raspberry pi 4 with raspbian buster
Something has changed. Works on my 3B+ but not on my 4B.
It was a bad idea to direct edit the panel file anyway as it is subject to being overwritten in an update. There is even a warning at the top of the file.

I would suggest to use Main Menu Editor and add the lock command to the menu. Then if you prefer make a desktop icon. (Right click on the menu item and select add to desktop).

The command is:

Code: Select all

dm-tool lock
yes...in fact this is what i was going to do ...create an icon on my desktop.
Unfortunately, it seems it's not so easy on buster or in raspbian in general...i had to create a "lock.sh" executable file with "dm-tool lock" in it....so no chance to choose a nice icon and moreover you will get a confirmation popup as soon as you double click on the script.

mattoni
Posts: 17
Joined: Tue Dec 22, 2015 9:57 am

Re: Lock Screen Menu Item In Buster

Thu Sep 19, 2019 1:48 pm

klricks wrote:
Wed Sep 18, 2019 12:19 am
mattoni wrote:
Tue Sep 17, 2019 10:01 pm
It doesn't work for me...both of methods...
I have raspberry pi 4 with raspbian buster
Something has changed. Works on my 3B+ but not on my 4B.
It was a bad idea to direct edit the panel file anyway as it is subject to being overwritten in an update. There is even a warning at the top of the file.

I would suggest to use Main Menu Editor and add the lock command to the menu. Then if you prefer make a desktop icon. (Right click on the menu item and select add to desktop).

The command is:

Code: Select all

dm-tool lock
ah yes..the Main Menu Editor is a more elegant solution...i just had some troubles finding it.
So i downloaded the icon from here:
https://en.wikipedia.org/wiki/File:Gnome-lockscreen.svg
I've copied it in /usr/share/icons (i haven't found any subfolder more appropriate) and created a new "Lock" item using the menu editor.
Thanks!
(much better than my previous shell script)

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Lock Screen Menu Item In Buster

Thu Sep 19, 2019 3:08 pm

mattoni wrote:
Thu Sep 19, 2019 1:48 pm
...

ah yes..the Main Menu Editor is a more elegant solution...i just had some troubles finding it.
So i downloaded the icon from here:
https://en.wikipedia.org/wiki/File:Gnome-lockscreen.svg
I've copied it in /usr/share/icons (i haven't found any subfolder more appropriate) and created a new "Lock" item using the menu editor.
Thanks!
(much better than my previous shell script)
FYI gnome-lockscreen.png already exists in /usr/share/icons/gnome/......
Also the exe popup can be turned off: https://www.raspberrypi.org/forums/view ... 1&t=251999
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

mattoni
Posts: 17
Joined: Tue Dec 22, 2015 9:57 am

Re: Lock Screen Menu Item In Buster

Thu Sep 19, 2019 6:26 pm

klricks wrote:
Thu Sep 19, 2019 3:08 pm
mattoni wrote:
Thu Sep 19, 2019 1:48 pm
...

ah yes..the Main Menu Editor is a more elegant solution...i just had some troubles finding it.
So i downloaded the icon from here:
https://en.wikipedia.org/wiki/File:Gnome-lockscreen.svg
I've copied it in /usr/share/icons (i haven't found any subfolder more appropriate) and created a new "Lock" item using the menu editor.
Thanks!
(much better than my previous shell script)
FYI gnome-lockscreen.png already exists in /usr/share/icons/gnome/......
Also the exe popup can be turned off: https://www.raspberrypi.org/forums/view ... 1&t=251999
oh good to know! thanks

Return to “Troubleshooting”