# starting xautolock from ~/.xinitrc doesn't black screen (ignores xlock's X resources)



## jrm@ (Aug 30, 2012)

Hello; when I run 
	
	



```
xautolock -time 15&
```
 from ~/.xinitrc the screen is locked as expected after 15 minutes of inactivity. However, despite having xlock*dpmsoff: 5 in ~/.Xdefaults the screen is not blanked. I think the X resource set in ~/.Xdefaults is fine because when I run xlock from a shell or even when I run xautolock from a shell after Xorg has started the screen is blanked.  Why don't the resources for xlock work when xautolock is started from ~/.xinitrc?


----------



## SirDice (Aug 31, 2012)

It's possible the resources are being loaded _after_ xlock has already started. In that case the settings don't work. Try adding xrdb(1) to your ~/.xinitrc to load it beforehand.


----------



## jrm@ (Aug 31, 2012)

Running xrdb() doesn't change anything.  When I don't use resources, but specify everything in ~/.xinitrc the same problem occurs.  That is, when I put something like xautolock -time 15& -launcher "/usr/locl/bin/xlock +description +showdate -lockdelay 5 -dpmsoff 5", there are still problems.  Actually, when I specify the options in ~/.xinitrc all the options are ignored.  That is, xlock starts after the specified time, but the default description and the date show up and the screen doesn't blank.

So, the problem has something to do with xlock/xautolock ignoring options.

I also noticed that xlock messes up reading options when you specify an empty string for the -info option.  That is, xlock -info "" will cause problems, so I just did xlock -info " " and everything works fine when I run xlock from a shell prompt.

Update: The command above should be xautolock -time 15 -locker "/usr/locl/bin/xlock +description +showdate -lockdelay 5 -dpmsoff 5"


----------



## freethread (Aug 31, 2012)

jrm said:
			
		

> xautolock -time 15& -launcher "/usr/locl/bin/xlock +description +showdate -lockdelay 5 -dpmsoff 5"



I don't know what that command do. Could the ampersand be interpreted as 'run in background'? Should it be xautolock -time '15&' -launcher "/usr/locl/bin/xlock +description +showdate -lockdelay 5 -dpmsoff 5"?


----------



## SirDice (Sep 1, 2012)

I'm guessing the & needs to move all the way to the end of the command. 


```
xautolock -time 15 -launcher "/usr/locl/bin/xlock +description +showdate -lockdelay 5 -dpmsoff 5" &
```


----------



## jrm@ (Sep 3, 2012)

What @SirDice wrote, was what I meant to write, but I was, at the time, suffering a bad case of cerebral flatulence.  Besides the '&' in the incorrect spot, -launcher should have been -locker.  I *think* I have it working now.  What I did was put a space for the resource xlock*info:  .  That got the monitor turning off, but after a little while it would come back on.  Putting

```
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
```
in /usr/local/etc/X11/xorg.conf seems to solve that.  I'm keeping my fingers crossed and hoping I don't see the monitor back on when I return to my computer.


----------

