# system lock



## sk8harddiefast (Jul 6, 2010)

Is any simple gui tool (like gksu) to lock my screen after 15 seconds?
Not with a lot of dependencies.
Just to lock it after some time.
I use fluxbox.


----------



## Alt (Jul 6, 2010)

Have you tried x11/xlockmore ? It doesnt have timers (just a program that locks), but i think you can tune fluxbox


----------



## sk8harddiefast (Jul 6, 2010)

i have problem with timers. I would like better to lock my computer when i want just from menu 
I will try it now


----------



## Beastie (Jul 6, 2010)

`% sleep 15 ; xlockmore` or whatever xlockmore's binary is called.
Just add it as a menu item.
There's also x11/xtrlock.


----------



## aragon (Jul 7, 2010)

I like xtrlock too.  Been meaning to adopt that port...

Years ago I wrote a small patch which would make xtrlock black the screen when locking - the only feature it was missing.  Download attached file and copy to /usr/ports/x11/xtrlock/files if you want to try it.


----------



## sk8harddiefast (Jul 7, 2010)

I tried both of them. I really like xtrlock and the patch is also very good 
You could also make a patch to choose a wallpaper 
And i believe that this patch should be exists as a flag on xtrlock 
*But* *there is an issue on both of them. Ctrl_alt_bckspc kill xserver and with startx you are back normally!*
Also any other that have the choise to give username & password?
Something like windows lock but more UNIX!


----------



## aragon (Jul 7, 2010)

sk8harddiefast said:
			
		

> You could also make a patch to choose a wallpaper
> And i believe that this patch should be exists as a flag on xtrlock


Good ideas - might have a go at it sometime. 



			
				sk8harddiefast said:
			
		

> Ctrl_alt_bckspc kill xserver and with startx you are back normally!


In the mean time, disable ctrl_alt_bckspc or preferably, use xdm/gdm via init.  See here.




			
				sk8harddiefast said:
			
		

> Also any other that have the choise to give username & password?


This is probably complicated to do...


----------



## jgh@ (Jul 7, 2010)

sk8harddiefast said:
			
		

> I tried both of them. I really like xtrlock and the patch is also very good
> You could also make a patch to choose a wallpaper
> And i believe that this patch should be exists as a flag on xtrlock
> *But* *there is an issue on both of them. Ctrl_alt_bckspc kill xserver and with startx you are back normally!*
> ...



That isn't a problem with the utilities. That is an issue with the X configuration. You can disable that in your X configuration, though.


----------



## sk8harddiefast (Jul 7, 2010)

> In the mean time, disable ctrl_alt_bckspc


ctrl_alt_bckspc is really very helpful for me. I don't want to remove it from .xinitrc. Any way that ctrl_alt_bckspc do not respond on this action when is running?


> This is probably complicated to do...


Or just the password


----------



## Beastie (Jul 7, 2010)

sk8harddiefast said:
			
		

> Or just the password


Eh, isn't that what it already does?


----------



## aragon (Jul 8, 2010)

sk8harddiefast said:
			
		

> ctrl_alt_bckspc is really very helpful for me. I don't want to remove it from .xinitrc. Any way that ctrl_alt_bckspc do not respond on this action when is running?


It seems there is a way.  You need to use setxkbmap.  First you need to check your existing map:


```
$ setxkbmap -verbose
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+compose(ralt)+terminate(ctrl_alt_bksp)
geometry:   pc(pc104)
```


Then you need to clear the options and add whatever options you want to keep back in:


```
$ setxkbmap -option "" -option "compose:ralt"
$ setxkbmap -verbose
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+compose(ralt)
geometry:   pc(pc104)
```


And now ctrl+alt+bksp is disabled.  To re-enable:


```
$ setxkbmap -option "terminate:ctrl_alt_bksp"
```

So create a script which runs those commands before and after running xtrlock, and configure your WM to run your script for the lock event.

In theory it should be possible for xtrlock to do this for you so no script is needed.  I'll add that to my list of things to try one day. 

Any coders out there, feel free to beat me to it.


----------



## sk8harddiefast (Jul 8, 2010)

I will give a try


----------

