Page 1 of 1

Lock Screen Menu Item In Buster

Posted: Sun Aug 04, 2019 12:35 am
by erikhermesman
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
    }

Re: Lock Screen Menu Item In Buster

Posted: Sun Aug 04, 2019 3:30 am
by klricks
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
    }

Re: Lock Screen Menu Item In Buster

Posted: Sun Aug 04, 2019 5:02 pm
by erikhermesman
Awesome, that did the trick. Thanks!

Re: Lock Screen Menu Item In Buster

Posted: Tue Sep 17, 2019 10:01 pm
by mattoni
It doesn't work for me...both of methods...
I have raspberry pi 4 with raspbian buster

Re: Lock Screen Menu Item In Buster

Posted: Wed Sep 18, 2019 12:19 am
by klricks
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

Re: Lock Screen Menu Item In Buster

Posted: Thu Sep 19, 2019 1:34 pm
by mattoni
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.

Re: Lock Screen Menu Item In Buster

Posted: Thu Sep 19, 2019 1:48 pm
by mattoni
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)

Re: Lock Screen Menu Item In Buster

Posted: Thu Sep 19, 2019 3:08 pm
by klricks
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

Re: Lock Screen Menu Item In Buster

Posted: Thu Sep 19, 2019 6:26 pm
by mattoni
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