Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

Trey Sizemore
Hi-

I've install OpenBSD 6.5 on my Lenovo Thinkpad X! carbon (5th gen).

I have installed XFCE4 and have most features working well.

One remaining issue is getting the screen to lock when the laptop lid is closed and the laptop suspends.  The screen does not lock and just resumes to the XFCE4 desktop.

I have the following in my .xsession:

bsd$ cat .xsession
xidle -timeout 300 -program "/usr/local/bin/slock" &

Any help greatly appreciated.

--
  Trey Sizemore
  [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

joshua stein-3
On Tue, 03 Sep 2019 at 19:41:40 -0400, Trey Sizemore wrote:
> One remaining issue is getting the screen to lock when the laptop lid is closed and the laptop suspends.  The screen does not lock and just resumes to the XFCE4 desktop.
>
> I have the following in my .xsession:
>
> bsd$ cat .xsession
> xidle -timeout 300 -program "/usr/local/bin/slock" &
>
> Any help greatly appreciated.

xidle locks on SIGUSR1, so you could send it such a signal upon
suspend.

With apmd enabled, add "pkill -USR1 xidle" to /etc/apm/suspend

Reply | Threaded
Open this post in threaded view
|

Re: Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

Trey Sizemore
On Tue, Sep 3, 2019, at 8:54 PM, joshua stein wrote:

> On Tue, 03 Sep 2019 at 19:41:40 -0400, Trey Sizemore wrote:
> > One remaining issue is getting the screen to lock when the laptop lid is closed and the laptop suspends.  The screen does not lock and just resumes to the XFCE4 desktop.
> >
> > I have the following in my .xsession:
> >
> > bsd$ cat .xsession
> > xidle -timeout 300 -program "/usr/local/bin/slock" &
> >
> > Any help greatly appreciated.
>
> xidle locks on SIGUSR1, so you could send it such a signal upon
> suspend.
>
> With apmd enabled, add "pkill -USR1 xidle" to /etc/apm/suspend
>
>

Thank you.  I should have said, I have the following:

bsd# cat /etc/apm/suspend                                                                                                                                                                
#!/bin/sh
pkill -USR1 xidle

and that file is executable.

Reply | Threaded
Open this post in threaded view
|

Re: Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

Anatoli
On surface this is the correct configuration. I would try putting
something like: echo "lock" >> /tmp/lock.log to /etc/apm/suspend to see
if it's executed at all and then something like: pgrep xidle >>
/tmp/lock.log to see if xidle is running at that moment, then ls
/usr/local/bin/slock >> /tmp/lock.log.

Also would check for the correct permissions.

Please let us know what it was when you identify the problem.

BTW, you can put the timeout value and program to ~/.Xresources and just
execute xidle &.

On 3/9/19 22:09, Trey Sizemore wrote:

> On Tue, Sep 3, 2019, at 8:54 PM, joshua stein wrote:
>> On Tue, 03 Sep 2019 at 19:41:40 -0400, Trey Sizemore wrote:
>>> One remaining issue is getting the screen to lock when the laptop lid is closed and the laptop suspends.  The screen does not lock and just resumes to the XFCE4 desktop.
>>>
>>> I have the following in my .xsession:
>>>
>>> bsd$ cat .xsession
>>> xidle -timeout 300 -program "/usr/local/bin/slock" &
>>>
>>> Any help greatly appreciated.
>>
>> xidle locks on SIGUSR1, so you could send it such a signal upon
>> suspend.
>>
>> With apmd enabled, add "pkill -USR1 xidle" to /etc/apm/suspend
>>
>>
>
> Thank you.  I should have said, I have the following:
>
> bsd# cat /etc/apm/suspend
> #!/bin/sh
> pkill -USR1 xidle
>
> and that file is executable.
>

Reply | Threaded
Open this post in threaded view
|

Re: Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

Michael Hekeler
In reply to this post by Trey Sizemore
On 03.09.19 21:09:11, Trey Sizemore wrote:
> (...)
> Thank you.  I should have said, I have the following:
>
> bsd# cat /etc/apm/suspend                                                                                                                                                                
> #!/bin/sh
> pkill -USR1 xidle
>
> and that file is executable.

Maybe xidle isn't running at the time you suspend your laptop?
Please check if there is a process with name "xidle" which listens to
USR1 by typing this pkill command in a shell and see if it looks your
screen like you expect.