DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd May 2015
bceverly bceverly is offline
Shell Scout
 
Join Date: Mar 2015
Posts: 88
Question Thinkpad x220 resume not locking screen

Hi,

I'm running OpenBSD 5.7 and Gnome3 on my Thinkpad x220 and everything is working great with one small exception:

When I open my laptop after it has been suspended, the screen is not locked.

Is there something I need to configure to get this to lock on lid close so that when it opens I am prompted for my password just as if the screen locked normally via a timeout?

Thanks in advance.
Reply With Quote
  #2   (View Single Post)  
Old 22nd May 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I do this with xidle(1) and apmd(8) scripts in /etc/apm, as articulated in the FILES section of that man page. The scripts use "pkill -USR1 xidle"
Reply With Quote
  #3   (View Single Post)  
Old 24th May 2015
bceverly bceverly is offline
Shell Scout
 
Join Date: Mar 2015
Posts: 88
Default

Thanks for the suggestion. I looked at the apmd manpage and it was pretty clear. I created /etc/apm and put a file called "resume" in there with the following contents:

dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver \
org.gnome.ScreenSaver.Lock
echo "resuming..." >>/tmp/results.txt

I marked the file as executable and have verified that the dbus-send command does lock the screen. I can see that /tmp/results.txt is getting appended to so I know it's running. Any suggestions? I tried renaming the file to suspend and am getting the same results.

Sorry to be such a n00b. I'd be fine even with a way to configure Gnome to lock on resume from suspend. It just seems silly to have an encrypted drive and have opening the lid when I suspend take me right to the desktop.

Last edited by bceverly; 24th May 2015 at 11:01 PM.
Reply With Quote
  #4   (View Single Post)  
Old 24th May 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I have the following within the $HOME/{.xinitrc,.xsession} script. These are the same file, linked with ln(1) in the event I manually start X or use xdm(1).
Code:
xidle -delay 3 -sw -program "/usr/X11R6/bin/xlock -mode atunnels" &
Then, my /etc/apm/{suspend,standby,hibernate} script contains the pkill command, followed by a 2 second sleep(1).
Code:
pkill -USR1 xidle
sleep 2
I'm not using Gnome, just a simple tiling window manager.
Reply With Quote
  #5   (View Single Post)  
Old 26th May 2015
spiderpig spiderpig is offline
Port Guard
 
Join Date: May 2008
Posts: 29
Default

Quote:
Originally Posted by jggimi View Post
Then, my /etc/apm/{suspend,standby,hibernate} script contains the pkill command, followed by a 2 second sleep(1).
Code:
pkill -USR1 xidle
sleep 2
I have a couple of questions...
  1. What is the purpose of the sleep statement here?
  2. Does this executable script need to have the following line at the top?
    Code:
    #!/bin/sh
    Is this not necessary?
Thanks for the info!
Reply With Quote
  #6   (View Single Post)  
Old 26th May 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Both script fragments show in this thread were excerpts from longer scripts. I'm sorry if that added any confusion.

I used hash bangs (or, as Wikipedia calls them, shebangs) as these are executable shell scripts. Per apmd(8):
Quote:
Each file must be an executable binary or shell script.
The two second delay was added because I discovered I needed it with the low power workstation where it is deployed. You may not require it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
for all who love suspend/resume ocicat OpenBSD General 2 21st October 2013 04:35 AM
OpenBSD keeps locking up/crashing unixjingleman OpenBSD General 7 18th April 2012 02:26 PM
Error in locking Authority jerryw OpenBSD Installation and Upgrading 4 14th November 2009 06:25 PM
Thinkpad boot screen Carpetsmoker Off-Topic 6 21st September 2009 05:11 PM
Locking a Computer JMJ_coder General software and network 8 21st September 2008 03:33 AM


All times are GMT. The time now is 12:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick