[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-newbies
Subject:    How to lock the screen after suspending in OpenBSD in 6 steps
From:       Pau Amaro-Seoane <pau.amaro.seoane () gmail ! com>
Date:       2016-04-12 11:27:14
Message-ID: CAPsSEY=sA9p8VShL5JyF65pRinDPWBOwFX6YMs7h0hW+m04LqQ () mail ! gmail ! com
[Download RAW message or body]

Hello:

Since I guess some one might run into this problem in the future, I
thought it would be a good idea to have this information in the
mailing list.

If you see anything wrong, please let me know.

Thanks again,

Pau

How to lock the screen after suspending in OpenBSD in 6 steps:
======================================

1- Since you do not want to leave a terminal open, do not start X with
startx. This
would leave open that terminal and launch X on another one. Hence, use xdm

2- Since you are using xdm, you need a .xsession file instead of a .xinitrc

3- My .xsession file looks like

 xmodmap -e "keycode 22 = BackSpace BackSpace BackSpace BackSpace
BackSpace BackSpace"
 pkill xidle
 xidle -delay 5 -sw -program "/usr/X11R6/bin/xlock -mode blank" -timeout 90 &
 exec cwm

The first line cancels the function Zap of X, which means that nobody
can interrupt
your X session by pressing CTRL+Alt+Backspace

xidle is necessary to launch the screensaver via xlock

4- Create a suspend file in /etc/apm:

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

5- Make sure it is executable

6- Make sure apm is running everytime after boot. If it is not, while
your laptop
will suspend, the script suspend will not be executed, and the screen
will not be
locked. To test if apmd is running, type zzz from the terminal. A message like
zzz: cannot connect to apmd: No such file or directory

Will tell you that your apmd is NOT running.

To have apmd run after boot, add a flag to rc.conf.local:

$ cat /etc/rc.conf.local
sshd_flags=NO
pkg_scripts="dbus_daemon avahi_daemon"
dbus_enable=YES
apmd_flags="-A"
xdm_flags=""
mixerctl inputs.spkr.mute=on
_______________________________________________
Openbsd-newbies mailing list
Openbsd-newbies@sfobug.theapt.org
http://mailman.theapt.org/listinfo/openbsd-newbies
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic