How To Lock Your Screen in Lubuntu

Please post all general support questions for LXDE here.
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

How To Lock Your Screen in Lubuntu

Post by amjjawad »

Hello Everyone,

I'm a new contributor to LXDE and Lubuntu Team and I'd like to post my first HOWTO in this Forum.

As everyone may know, LXDE differs from other Desktop Environment in many things. It's very fast and easy to use. However, sometimes you need to do some "few simple steps" to achieve what you are looking for. Myself and others users may notice that Lubuntu 11.04, by default, does NOT have any Shortcut or Menu Entry to Lock The Screen. Those who have used or still using GNOME, they know that could be done very easily with "Keyboard Shortcut" which is installed by default, say Ubuntu 11.04.

Please, don't blame LXDE or Lubuntu for not making this "simple" feature to work Out-Of-The Box. NOTHING is perfect, period.
Yes, it's true that in MS Windows, you can simply Press "Window Logo + L" to Lock the Screen but Linux is not Windows. With Linux, you can do that yourself or perhaps someone else have done it for you. In Lubuntu 11.04, you need to do it yourself.
Again, please don't consider this as a disadvantage.

Ok, so all what you need to do is:

1- Accessories > LXTerminal

2-

Code: Select all

gksudo leafpad /usr/share/applications/lubuntu-screenlock.desktop
3- lubuntu-screenlock.desktop file will look like this:

Code: Select all

[Desktop Entry]
Name=ScreenLock
Name[zh_TW]=鎖住螢幕
Comment=Lock your screen
Icon=system-lock-screen
Exec=xscreensaver-command -lock
NoDisplay=true

4- Change the value of "NoDisplay" to false.

5- Add these two lines:

Type=Application
Categories=Settings;DesktopSettings


Your lubuntu-screenlock.desktop file will look like:

Code: Select all

[Desktop Entry]
Name=ScreenLock
Name[zh_TW]=鎖住螢幕
Comment=Lock your screen
Icon=system-lock-screen
Exec=xscreensaver-command -lock
NoDisplay=false
Type=Application
Categories=Settings;DesktopSettings
6- Save and Exit.

7- Right Click on the LXPanel then Add/Remove Panel Items

8- Click "Add"

Image

Then "Application Launch Bar"

Image

9- Double-Click on the new added "Application Launch Bar" > Preferences > Add: ScreenLock > Close > Close

Image


10- Now, you can "simply" click on the ScreenLock Icon next to your "Shutdown" on your LXPanel.

Enjoy and Have Fun :D

Remember, the more contributor/supporter to LXDE and Lubuntu, the better these two projects will be. Don't forget to tell your friends about Lubuntu :)

Please, FEEL FREE to ask any question or post any suggestion and I'll do my best to get back to you ASAP.
Feel Free to contact me: http://amjjawad.net
rokytnji
Posts: 131
Joined: Mon Jun 13, 2011 10:45 pm
Location: pecos.tx
Contact:

Re: HOW TO: Lock Your Screen in Lubuntu 11.04 in Few Steps :

Post by rokytnji »

Nice How to .

:)

Looks like it can be applied a little for adding any application to panels (I run 2 like a Gnome setup with no icons on Desktop). All my Desktop type launchers sit in top taskbar (like antixcc=antiX control center) and bottom taskbar is used mainly for monitoring, (Arch Linix Batterymon), along with Conky.
Amrel RT 786ex 1.6ghz, 512MB ram , AntiX 8.5 core, Biker Linux user # 475019
Lead,Follow, or get the heck out of the way
My AntiX LXDE Install
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: HOW TO: Lock Your Screen in Lubuntu 11.04 in Few Steps :

Post by amjjawad »

rokytnji wrote:Nice How to .

:)

Looks like it can be applied a little for adding any application to panels.
Thank you :)

And YES, I think so :)
Feel Free to contact me: http://amjjawad.net
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How To Lock Your Screen in Lubuntu 11.04 in Few Steps :)

Post by amjjawad »

> > > > > Updates < < < < <

For those who would like to add a Shortcut to Lock their Screen instead of clicking on the "ScreenLock" icon, here is a few lines to be added in your lubuntu-rc.xml file.

Code: Select all

<keybind key="C-l">
     <action name="Execute">
        	<command>xscreensaver-command -lock</command>
     </action>
</keybind>
Steps:

1- Open PCManFM > Tools > Open Current Folder as Root.

2- Ctrl + H to show Hidden Files.

3- Go to: /home/your-username/.config/openbox and open lubuntu-rc.xml with leafpad.

4- Add the above code. For me, I added it into this section:

Code: Select all

<!-- Keybindings for desktop switching -->
5- Save then Logout. After you login back, try "Ctrl+l" and it should work.

Enjoy :)
Feel Free to contact me: http://amjjawad.net
sorin_danulescu
Posts: 1
Joined: Wed Sep 21, 2011 9:27 pm

Re: How To Lock Your Screen in Lubuntu 11.04 in Few Steps :)

Post by sorin_danulescu »

I have Ubuntu server 10.04 with LXDE
instead of /usr/share/applications/lubuntu-rc.xml, use /usr/share/applications/lxde-screenlock.desktop
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How To Lock Your Screen in Lubuntu 11.04 in Few Steps :)

Post by amjjawad »

sorin_danulescu wrote:I have Ubuntu server 10.04 with LXDE
instead of /usr/share/applications/lubuntu-rc.xml, use /usr/share/applications/lxde-screenlock.desktop
Please, check the first post :)

Code: Select all

sudo leafpad /usr/share/applications/lubuntu-screenlock.desktop
Thank you!
Feel Free to contact me: http://amjjawad.net
MarkusEkback
Posts: 1
Joined: Sun Oct 09, 2011 9:21 am

Re: How To Lock Your Screen in Lubuntu 11.04 in Few Steps :)

Post by MarkusEkback »

Thanks alot, wonderful post, especially with the pics!
Totally LOVE the LXDE environment - running Lubuntu on a small netbook! It Rocks! :mrgreen:
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How To Lock Your Screen in Lubuntu 11.04 in Few Steps :)

Post by amjjawad »

MarkusEkback wrote:Thanks alot, wonderful post, especially with the pics!
Totally LOVE the LXDE environment - running Lubuntu on a small netbook! It Rocks! :mrgreen:
Oh yes, it rocks indeed and you'll love it more when the next release will be ready :)

Thanks a lot for your nice words and glad to see more users interested in LXDE. Thanks for choosing LXDE and for loving it :)

By the way, welcome to LXDE Forum ;)
Feel Free to contact me: http://amjjawad.net
nocturtle
Posts: 7
Joined: Sat Dec 03, 2011 12:44 am

Re: How To Lock Your Screen in Lubuntu

Post by nocturtle »

FIrst of all thanks for all your work on Lubuntu. (I'm a recent convert, Unity pushed me over the edge.) I know this how-to is written for 11.04 but I tried it in 11.10. The lock function works, but when you hit the 'new login' button on the xscreensaver prompt it complains about missing gdmflexiserver and re-locks. Based on a package search this is a component of gdm. You can only log into the same session, so another person can't login to their own session using that button as it implies. Doesn't appear to be working as designed.

Also, the shutdown launcher doesn't have a "switch user" button unlike the stock lxde does. I looked in /etc/lxdm at all the config files and there doesn't seem to be a way to enable this. My main computer is logged into repeatedly by 3 different people all day, so it would be nice to be able to save my session without all my stuff getting dumped.

Once again, great work. Lubuntu is clearly destined for greatness!
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How To Lock Your Screen in Lubuntu

Post by amjjawad »

nocturtle wrote:FIrst of all thanks for all your work on Lubuntu. (I'm a recent convert, Unity pushed me over the edge.) I know this how-to is written for 11.04 but I tried it in 11.10. The lock function works, but when you hit the 'new login' button on the xscreensaver prompt it complains about missing gdmflexiserver and re-locks. Based on a package search this is a component of gdm. You can only log into the same session, so another person can't login to their own session using that button as it implies. Doesn't appear to be working as designed.

Also, the shutdown launcher doesn't have a "switch user" button unlike the stock lxde does. I looked in /etc/lxdm at all the config files and there doesn't seem to be a way to enable this. My main computer is logged into repeatedly by 3 different people all day, so it would be nice to be able to save my session without all my stuff getting dumped.

Once again, great work. Lubuntu is clearly destined for greatness!
Hello and Welcome to LXDE Forum :)

I'm glad you like Lubuntu and good to see more users are using Lubuntu. Thanks for using and choosing Lubuntu :)

Kindly start a new Topic/Thread and explain the issues you mentioned above in your post. This is a HOTWO Topic for Locking the Screen on Lubuntu (it should work for any release by the way) and all posts/comments should be related to the same topic :)

Thank you for your understanding.
Feel Free to contact me: http://amjjawad.net
Locked