The setxkbmap
command depends on the $DISPLAY
environment variable to specify the X display it will affect.
On my system, if I run it without setting $DISPLAY
, I get:
$ setxkbmap fr
Cannot open display "default display"
Crontab does not set $DISPLAY
for the jobs it runs. In fact it provides only a minimal set of environment variables (on my system, just $HOME
, $LOGNAME
, $PATH
, $LANG
, $SHELL
, and $PWD
).
Anything a command prints to stdout
or stderr
will normally be e-mailed to the owner of the crontab. You're likely to have an e-mail message on your system containing an error message similar to the above.
It's likely that X Windows isn't even running yet when crontab executes the @reboot
job. You'll have to find another way to run that command automatically, or just run it manually. (Or there could be another way to do this that I haven't thought of.)