User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 3:21 pm

I just enabled the lxlock option (that works with the screen lock icon located in Menu/Other/), and tested it, and all seems to work fine.

Code: Select all

sudo apt-get install light-lock
sudo reboot
Image

I want to add the 'lxlock' run command to the Menu 'End Session' options (e.g., shutdown; reboot; logout)
Shutdown
Reboot
Logout
Lock
add 'Lock' option here:
Image

I am having difficulty locating the correct file to edit and add 'lxlock' to the 'End Session' menu.


Can anyone assist?

Thanks.
Last edited by Rive on Thu Apr 21, 2016 4:45 pm, edited 4 times in total.
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: Menu "End Session" shutdown options

Thu Apr 21, 2016 4:33 pm

Edited for clarification.
DNPNWO

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6305
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:23 pm

What distro is that?

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:25 pm

ShiftPlusOne wrote:What distro is that?

Raspbian Debian Jessie

Image
Last edited by Rive on Thu Apr 21, 2016 5:30 pm, edited 1 time in total.
DNPNWO

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6305
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:28 pm

Looks like it hasn't been updated properly, but that's a side issue.

Would lxde-logout suit your needs?

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:33 pm

ShiftPlusOne wrote:Looks like it hasn't been updated properly, but that's a side issue.

Would lxde-logout suit your needs?
It might, thanks.

It is the most up to date version via apt-get update/apt-get upgrade (as of yesterday)

Code: Select all

Linux version 4.1.19-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 SMP Tue Mar 15 15:56:00 GMT 2016

Code: Select all

Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

Code: Select all

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Last edited by Rive on Thu Apr 21, 2016 5:42 pm, edited 1 time in total.
DNPNWO

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6305
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:40 pm

Rive wrote: It is the most up to date version via apt-get update/apt-get upgrade (as of yesterday)
apt-get dist-upgrade? You seem to be missing pishutdown, which replaces the old shutdown menu, but doesn't really help you.
ShiftPlusOne wrote: as for "lxde-logout" it might... where is the location?
Standard (/usr/bin/lxde-logout)

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:43 pm

ShiftPlusOne wrote:
Rive wrote: It is the most up to date version via apt-get update/apt-get upgrade (as of yesterday)
apt-get dist-upgrade? You seem to be missing pishutdown, which replaces the old shutdown menu, but doesn't really help you.
ShiftPlusOne wrote: as for "lxde-logout" it might... where is the location?
Standard (/usr/bin/lxde-logout)

No. i didnt do dist-upgrade.
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 5:49 pm

ShiftPlusOne wrote: Standard (/usr/bin/lxde-logout)
I dont think that is what i am looking for. This is all that is there:

Code: Select all

#!/bin/sh
lxsession-logout --banner "/usr/share/lxde/images/logout-banner.png" --side=top


but this may be it...

lxde-pi-shutdown-helper

Code: Select all

#!/bin/sh

LIGHTDM="Exit to command line"
if [ -e /etc/init.d/lightdm ]; then
  if ! service lightdm status | grep -q inactive; then
    LIGHTDM="Logout"
  fi
fi

RET=0
ACTION=$(zenity --list --radiolist \
  --hide-header \
  --title="End session" \
  --text="What would you like to do?" \
  --column "Select" --column="Action" TRUE "Shutdown" FALSE "Reboot" FALSE "$LIGHTDM" )
RET=$?
echo $SOUND
if [ "$ACTION" = "Shutdown" ]; then
  sudo shutdown -h now
elif [ "$ACTION" = "Reboot" ]; then
  sudo reboot
elif [ "$ACTION" = "$LIGHTDM" ]; then
  kill $_LXSESSION_PID
else
   echo "cancel"
fi]
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 7:05 pm

This is what I am trying to do , but I just can't get it to work.

Code: Select all

#!/bin/sh

LIGHTDM="Exit to command line"
if [ -e /etc/init.d/lightdm ]; then
  if ! service lightdm status | grep -q inactive; then
    LIGHTDM="Logout"
  fi
fi

RET=0
ACTION=$(zenity --list --radiolist \
  --hide-header \
  --title="End session" \
  --text="What would you like to do?" \
  --column "Select" --column="Action" TRUE "Shutdown" FALSE "Reboot" FALSE "lock Screen" FALSE "$LIGHTDM" )
RET=$?
echo $SOUND
if [ "$ACTION" = "Shutdown" ]; then
  sudo shutdown -h now
elif [ "$ACTION" = "Reboot" ]; then
  sudo reboot
elif [ "$ACTION" = "Lock Screen" ]; then
  lxlock
elif [ "$ACTION" = "$LIGHTDM" ]; then
  kill $_LXSESSION_PID
else
   echo "cancel"
fi
Last edited by Rive on Thu Apr 21, 2016 10:19 pm, edited 1 time in total.
DNPNWO

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 7:31 pm

Your "lxde-pi-shutdown-helper" file is nothing like mine, and I'm using the same Jessie version

Code: Select all

uname -a
Linux rpi5 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
I checked it on two different RPi's running that same version of Jessie (#858) and on both of them the "lxde-pi-shutdown-helper" file is a binary rather than a text file. Here's the contents of my file

Code: Select all

/usr/bin/lxde-pi-shutdown-helper

^?ELF^A^A^A^@^@^@^@^@^@^@^@^@^B^@(^@^A^@^@^@�^Q^A^@4^@^@^@�!^@^@^B^D^@^E4^@ ^@  ^@(^@^[^@$
,2�^A�^BC^H^F^H^H^E^@^@^@^@^@^@^@^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^G^@^@^@^@^@^@^@$
^@^@^@^@^@^@^@^L^@^@^@^M^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^O^@^@^@^P^@^@^@^@^@^@^@^Q^@^@^@^R^$
^@^@4 ^B^@^V^H^@^@8 ^B^@^V^Z^@^@< ^B^@^V#^@^@@ ^B^@^V^N^@^@D ^B^@^V^G^@^@H ^B^@^V       ^$
^P������^@^P���^B������^@^P��^D^@��q���^@^P��^AP��^D^@������^E0��p^R��p"��^D^@��^@P��^DP�$
�^@��^?^P��`���^E^@P�^C^@^@
�^@��<^Q��$ ��<���$^@��^E ��^@^@P�^@^@�^S$^Q�^U$^Q�^EA���"���^\^P��^@p��F���^\0���^@S�^C^$
��� ^N^A^@�^@^@^@^\0��^\^@��^C0`�^F^@S�^^�/�^P0��^@^@S�^^�/^A^S�/�� ^B^@� ^B^@^@^@^@^@$^P$
3�/������^^^B^@^@^@^@^@^P@-�^A^@��^A@��T^P������^@^@P�^O^@^@
^D^@��D^P������^@^@P�^G^@^@
^D^@��4^P������^@^@P�^P��^X(^@��^P@������ ^@����������^X^@�����������^S^A^@�^S^A^@�^S^A^@$
^@^@^@u^C^@^@^K^@^@^@^P^@^@^@^U^@^@^@^@^@^@^@^C^@^@^@^@ ^B^@^B^@^@^@^X^A^@^@^T^@^@^@^Q^@^$
^A^@���o^C^@^@^@���of
^A^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^$
^B^R^D^S^A^T^A^U^A^W^C^X^A^Y^A^Z^B^[^C^\^A"^A^@.shstrtab^@.interp^@.note.ABI-tag^@.note.g$
^A^@f
^@^@b^@^@^@^E^@^@^@^@^@^@^@^B^@^@^@^B^@^@^@[^@^@^@���o^B^@^@^@�
^A^@�
^@^@p^@^@^@^F^@^@^@^C^@^@^@^D^@^@^@^@^@^@^@j^@^@^@      ^@^@^@^B^@^@^@8^K^A^@8^K^@^@^P^@^$
I was going to play around and experiment a little, but my "lxde-pi-shutdown-helper" isn't a editable text file. I wonder why there's a difference?

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 8:50 pm

I checked it on two different RPi's running that same version of Jessie (#858) and on both of them the "lxde-pi-shutdown-helper" file is a binary rather than a text file. Here's the contents of my file
You must have the dist-upgrade. I tried it, don't like it (lots of stuff just not right, including 'right click'; selections fade out/disappear in Chromium), restored my backup (that is why I only do "apt-get upgrade").

Dist:
Image
Image
Image

/usr/bin/lxde-pi-shutdown-helper

Code: Select all

^?ELF^A^A^A^@^@^@^@^@^@^@^@^@^B^@(^@^A^@^@^@�^Q^A^@4^@^@^@�!^@^@^B^D^@^E4^@ ^@  ^@(^@^[^@$
,2�^A�^BC^H^F^H^H^E^@^@^@^@^@^@^@^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^G^@^@^@^@^@^@^@$
^@^@^@^@^@^@^@^L^@^@^@^M^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^O^@^@^@^P^@^@^@^@^@^@^@^Q^@^@^@^R^$
^@^@4 ^B^@^V^H^@^@8 ^B^@^V^Z^@^@< ^B^@^V#^@^@@ ^B^@^V^N^@^@D ^B^@^V^G^@^@H ^B^@^V       ^$
^P������^@^P���^B������^@^P��^D^@��q���^@^P��^AP��^D^@������^E0��p^R��p"��^D^@��^@P��^DP�$
�^@��^?^P��`���^E^@P�^C^@^@
�^@��<^Q��$ ��<���$^@��^E ��^@^@P�^@^@�^S$^Q�^U$^Q�^EA���"���^\^P��^@p��F���^\0���^@S�^C^$
��� ^N^A^@�^@^@^@^\0��^\^@��^C0`�^F^@S�^^�/�^P0��^@^@S�^^�/^A^S�/�� ^B^@� ^B^@^@^@^@^@$^P$
3�/������^^^B^@^@^@^@^@^P@-�^A^@��^A@��T^P������^@^@P�^O^@^@
^D^@��D^P������^@^@P�^G^@^@
^D^@��4^P������^@^@P�^P��^X(^@��^P@������ ^@����������^X^@�����������^S^A^@�^S^A^@�^S^A^@$
^@^@^@u^C^@^@^K^@^@^@^P^@^@^@^U^@^@^@^@^@^@^@^C^@^@^@^@ ^B^@^B^@^@^@^X^A^@^@^T^@^@^@^Q^@^$
^A^@���o^C^@^@^@���of
^A^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^$
^B^R^D^S^A^T^A^U^A^W^C^X^A^Y^A^Z^B^[^C^\^A"^A^@.shstrtab^@.interp^@.note.ABI-tag^@.note.g$
^A^@f
^@^@b^@^@^@^E^@^@^@^@^@^@^@^B^@^@^@^B^@^@^@[^@^@^@���o^B^@^@^@�
^A^@�
^@^@p^@^@^@^F^@^@^@^C^@^@^@^D^@^@^@^@^@^@^@j^@^@^@      ^@^@^@^B^@^@^@8^K^A^@8^K^@^@^P^@^$
orig:
Image

/usr/bin/lxde-pi-shutdown-helper

Code: Select all

#!/bin/sh

LIGHTDM="Exit to command line"
if [ -e /etc/init.d/lightdm ]; then
  if ! service lightdm status | grep -q inactive; then
    LIGHTDM="Logout"
  fi
fi

RET=0
ACTION=$(zenity --list --radiolist \
  --hide-header \
  --title="End session" \
  --text="What would you like to do?" \
  --column "Select" --column="Action" TRUE "Shutdown" FALSE "Reboot" FALSE "$LIGHTDM" )
RET=$?
echo $SOUND
if [ "$ACTION" = "Shutdown" ]; then
  sudo shutdown -h now
elif [ "$ACTION" = "Reboot" ]; then
  sudo reboot
elif [ "$ACTION" = "$LIGHTDM" ]; then
  kill $_LXSESSION_PID
else
   echo "cancel"
fi]
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Thu Apr 21, 2016 10:22 pm

I was going to play around and experiment a little, but my "lxde-pi-shutdown-helper" isn't a editable text file. I wonder why there's a difference?
(old)
lxde-pi-shutdown-helper.tar.gz
(486 Bytes) Downloaded 80 times
Just rename your original, and play with this (right click properties and set them same as the original one you copy/paste into /user/bin/)
Last edited by Rive on Fri Apr 22, 2016 2:37 pm, edited 3 times in total.
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: LXDE 'lxlock' Lock Screen Option

Fri Apr 22, 2016 2:09 pm

Well, I give up on this project.

Instead, I cannibalized the buggy dist-upgrade and added the new lxde pi helper shutdown to the (apt-get upgrade) non distribution upgrade version (that I had backed up prior to apt-get dist-upgrade)

Image
Download: (new) LXDE_pi_shutdown_helper

And setup the lxlock screen like so (disabling screen blanking, and setting monitor to turn off after 20min, then lock via ~/.config/lxsession/LXDE-pi/autostart)

I will just have to settle with the Start/Menu item option for Screenlock, or desktop option for manual locking.
viewtopic.php?p=958891#p958891
DNPNWO

Return to “Troubleshooting”