[Solved] MDM - Auto Login with Screen Lock
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[Solved] MDM - Auto Login with Screen Lock
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
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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: MDM - Auto Login with Screen Lock
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:
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.
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
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.
Re: MDM - Auto Login with Screen Lock
HeWhoWas!
Thanks a lot for your tip. I will try this today and will tell you the results
Regards
Thanks a lot for your tip. I will try this today and will tell you the results
Regards
Re: MDM - Auto Login with Screen Lock
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!!
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!!
Re: MDM - Auto Login with Screen Lock
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:
Where x is the number of seconds to wait, and y is the location of the file to execute. For example, mine looks like:
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:
Don't forget to mark the thread solved if this helped!
Code: Select all
bash -c "sleep x; y"
Code: Select all
Removed. See below.
Code: Select all
bash -c "sleep 5; /usr/bin/mate-screensaver-command -a"
Re: MDM - Auto Login with Screen Lock
No, its still not working
The command is working when issued in command prompt but not working when put in Startup Applications.
Kindly check the attached screenshot.
Code: Select all
bash -c "sleep 5; /usr/bin/mate-screensaver-command -a"
Kindly check the attached screenshot.
Re: MDM - Auto Login with Screen Lock
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:
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.
Script: /home/ben/scripts/screensaver-start.sh
Script Contents:
Code: Select all
#!/bin/bash
mate-screensaver-command -a
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.
Re: MDM - Auto Login with Screen Lock
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
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
Re: MDM - Auto Login with Screen Lock
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.
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.
Re: MDM - Auto Login with Screen Lock
Now, it worked. Thanks a lotHeWhoWas wrote: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:Startup Program Config:Code: Select all
#!/bin/bash mate-screensaver-command -a
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.