MDM - Auto Login with Screen Lock

MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Fri Apr 05, 2013 1:27 pm

Hi

How can I enable autologin in such a way that when my system logs-in, the screen locks automatically (just like we have functionality in KDM)?
PS. I am using Linux Mint 14 MATE Edition.

Regards
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Linux Mint is funded by ads and donations.
 

Re: MDM - Auto Login with Screen Lock

Postby HeWhoWas on Sun Apr 07, 2013 5:22 am

Ok, here's my solution to this:

1. Open Screensaver Preferences and ensure "Lock screen when screensaver is active" is checked.
2. Open up your text editor and paste the following into it:
Code: Select all
#!/bin/bash
mate-screensaver-command -a

3. Save the file somewhere safe, where it won't be accidentally deleted.
4. Right click the file you just created, go to Permissions and check the "Execute" box.
5. Open Startup Application Preferences and add an item pointing to the file you just created.
6. Enable auto-login.

This is a bit roundabout, and if someone could supply us with the command to lock the screen directly rather than using the screensaver it would be appreciated.

Edit - This also has the side effect that your screensaver will lock your computer now as well. I would assume that if you're looking to lock on boot then you don't mind this :)

Thanks guys.
HeWhoWas
Level 1
Level 1
 
Posts: 5
Joined: Sun Apr 07, 2013 5:16 am

Re: MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Sun Apr 07, 2013 8:19 am

HeWhoWas!
Thanks a lot for your tip. I will try this today and will tell you the results :)

Regards
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Re: MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Sun Apr 07, 2013 3:51 pm

I have tried your solution but its not working. Here what I did;
1. created a file and put the following;
#!/bin/bash
mate-screensaver-command -a
2. make the file executable
3. put the file in auto start using "Startup Applications"
But the system is not auto locking at startup! The script is correct b/c when I double click on it, it locks the screen.
I have tried a lot but I don't know why its not working!! :(
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Re: MDM - Auto Login with Screen Lock

Postby HeWhoWas on Sun Apr 07, 2013 10:35 pm

My apologies, I wrote this before bed and didn't actually test it. To make it start on boot succesfully you need to change the Startup command to this:

Code: Select all
bash -c "sleep x; y"


Where x is the number of seconds to wait, and y is the location of the file to execute. For example, mine looks like:

Code: Select all
Removed. See below.


Edit - After looking at this for a second, I wonder why I didn't make it easier. Forget the bash script, and just use this command in your startup application:

Code: Select all
bash -c "sleep 5; /usr/bin/mate-screensaver-command -a"


Don't forget to mark the thread solved if this helped!
HeWhoWas
Level 1
Level 1
 
Posts: 5
Joined: Sun Apr 07, 2013 5:16 am

Re: MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Mon Apr 08, 2013 5:13 pm

No, its still not working :(
Code: Select all
bash -c "sleep 5; /usr/bin/mate-screensaver-command -a"

The command is working when issued in command prompt but not working when put in Startup Applications.
Kindly check the attached screenshot.
Attachments
Screenshot.png
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Re: MDM - Auto Login with Screen Lock

Postby HeWhoWas on Tue Apr 09, 2013 3:44 am

Try and put it inside a bash script, and then call that as I originally suggested. I have the bash script version running and tested. Here are my details:

Script: /home/ben/scripts/screensaver-start.sh

Script Contents:
Code: Select all
#!/bin/bash
mate-screensaver-command -a


Startup Program Config:

Name: Start Screensaver
Command: bash -c "sleep 5; /home/ben/bin/start-screensaver"

I may have led you astray with using the command directly, that was untested sorry.
HeWhoWas
Level 1
Level 1
 
Posts: 5
Joined: Sun Apr 07, 2013 5:16 am

Re: MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Tue Apr 09, 2013 12:35 pm

It just came to my mind that may be your solution is not working on my PC because I have turned off the sleep function of my monitor. Actually when I installed Mint, there was a problem that the monitor sleeps after some time (even after disabling sleep from control panel) and when I press any key to bring the display back, the display comes back but with milkiness in it. So I searched internet and found some command to completely disable that sleep function. Thats may be the reason that your solution is not working. Now I am looking in bash and firefox history that which command I have used but it is not there :(
If I am able to bring back that sleep functionality, then I think your solution will work. Do you have any idea that how can I bring back that sleep functionality?
Regards
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Re: MDM - Auto Login with Screen Lock

Postby HeWhoWas on Tue Apr 09, 2013 6:02 pm

Ah, bugger. Sorry, without knowing how you went about disabling it, it would be difficult to re-enable it.

I've only been using Mint for a few weeks, but if it has some kind of system repair functionality you might want to look into that. Backup your /home/ directory as a precaution beforehand, unless it's on another partition.

Edit - If you can find the instructions you used to do it, I would be able to help.
HeWhoWas
Level 1
Level 1
 
Posts: 5
Joined: Sun Apr 07, 2013 5:16 am

Re: MDM - Auto Login with Screen Lock

Postby zetrotrack000 on Wed Apr 10, 2013 5:05 am

hmm... Thanks for your time and patience :)
zetrotrack000
Level 1
Level 1
 
Posts: 13
Joined: Fri Apr 05, 2013 1:13 pm

Linux Mint is funded by ads and donations.
 

Return to MATE

Who is online

Users browsing this forum: Bing [Bot] and 8 guests