auto-locking screensaver

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

auto-locking screensaver

#1 Post by Subito Piano »

Puppy packages are tiny and surprisingly well designed. One example of this is Xlock. However, for years I wanted a screensaver to automatically lock the screen after a few minutes of inactivity. I tried xscreensaver (won't work as root user) and slock (too erratic), and i didn't want all the bloat of Gnome or KDE screensavers. This post showed me how to adapt Xlock to do this, with no bloat:
  • 1. First, run xlock and set your password
    2. Download xautolock from Puppy Package Manager (61KB!)
    3. Create a script as follows (i.e., copy and paste the following into a text editor):

    Code: Select all

    #!/bin/bash
    xautolock -locker xlock -time 5
    (5 = 5 minutes inactivity before xlock starts and locks the screen; use whatever number you please)
    4 Save your new script as "autolock" or whatever, and place it in an appropriate directory such as /usr/bin or /usr/local/bin
    5. Make it executable
    6. Symlink your new "autolock" script to ~/Startup
    7. That's it! It will start working after restarting X.
Similarly, while you can't require a login password in Puppy, you can achieve the same result by symlinking xlock to your startup folder. As soon as X starts, the xlock screensaver kicks in, requiring you to enter the password to unlock the screen.

Comments/critiques welcome. Hope this helps someone!

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#2 Post by slavvo67 »

Thank you, Subito Piano. I've wanted to do something like this for a while. I suppose one can still get in my alt-control-backspace and play in terminal.

User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

#3 Post by Subito Piano »

I tried it out...you are right! BUT if you symlink xlock to your startup folder, the problem is solved. Anyone smart enough to use ctrl+alt+backspace to get to the commandline and type "xwin" at the prompt simply restarts the x server....and xlock kicks right back in, locking the would-be hacker into an endless loop.

Of course, for total security, one must also encrypt his/her pupsave file.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#4 Post by slavvo67 »

Actually, the alt control backspace froze my Quirky April so it looks like a pretty safe screen lock.

Confirmed your instructions work in Quirky April. - Thanks

Slavvo67

User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

#5 Post by Subito Piano »

Ahh, yes....i meant to mention i'm using TahrPup 6. Glad it works for you. :)

PetRose
Posts: 4
Joined: Tue 19 Jan 2016, 08:04

Hi, as newbie on Puppy (Slacko)

#6 Post by PetRose »

I made a Symlink to Xlock, in Startup folder, did not work.
Tried a ROX file to symlink copy, by dragging, did not work

Neither way (they were noted as executables), nothing happened after Restart (tried X restart, and also full Puppy restart)

I did not find the Puppy Package xautolock, so I tried the tip using the Xlock app alone.

Cheers

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Hello subito_piano.

About your title : "auto-locking screensaver".

Yeah, that is e-x-a-c-t-l-y what screen savers are supposed to do :
lock your screen automatically after x minutes of inactivity.

You got a problem with that? :twisted:

Why you would need an extra script to do that, I do not understand.
Puppies already have one.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

#8 Post by Subito Piano »

PetRose: Not sure which Puppy you are using -- slackware-based or ubuntu-based? I've got ubuntu-based Tahr-Pup. That might make a difference. Anyway, i found xautolock just by using the Puppy Package Manager and choosing to search all repositories. You might have to update the database, though. Lemmeknow if you can't find it, i can upload it and post the link.

As far as symlinking Xlock, i first set up xlock by clicking on it and setting a password, then i symlinked it. I'd try clicking on it now to set a password, then restarting X to see if it kicks in when X starts. Again, post your results...

musher0 - Xlock is a manual screenlocking device -- it doesn't run automatically after a delay. The screensaver in Puppy kicks in automatically but it's not a screenlocking device.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

Yes it is. You need a proper password, that's all.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

#10 Post by Subito Piano »

interesting -- it's never worked for me, but i checked just before replying...hit xlock, set up a password, entered the password a second time, set time to 60 seconds, the screen went blank, i moved the mouse...and i was back in X-land, no password required.

I'd be interested to find out if i've been needlessly frustrated all these years. :D

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#11 Post by ebisu »

Last edited by ebisu on Mon 01 Aug 2016, 08:18, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

Hi.

I use the run-of-the-mill XLock at /usr/local/apps/Xlock, and it does indeed accept
and implement a password. It will most certainly shut you out of your own computer
if you forget your d... password! ;)

BFN.
Attachments
Xlock_config_2016-03-20.jpg
To see and use this config menu, right-click on the padlock icon on your desktop.
Items #2 and #3 in this menu are the ones to use to configure XLock.
(Sorry for the French, but I'm sure you get the idea.)
(42.1 KiB) Downloaded 499 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#13 Post by ebisu »

Last edited by ebisu on Mon 01 Aug 2016, 08:18, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

You're right, ebizu. My apologies.

Where is that xautolock, exactly? Would you or SubitoPiano have an URL for it?
It doesn't show in the PPM for the WheezyPup I'm on. Thanks in advance.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#15 Post by ebisu »

Last edited by ebisu on Mon 01 Aug 2016, 08:17, edited 2 times in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#16 Post by musher0 »

Got it, thanks.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply