Is there any way I can clear the X clipboard from a cron job? The usual commands for xclip
don't seem to work.
echo -n | xclip -selection clipboard
doesn't work from cron.
Is there any way I can clear the X clipboard from a cron job? The usual commands for xclip
don't seem to work.
echo -n | xclip -selection clipboard
doesn't work from cron.
X programs use DISPLAYs to work out what X11 instance to apply the program to. If you are the sole user of your host then most likely your display will be localhost:0
or often abbreviated to :0
. you can find your DISPLAY variable by using:
echo ${DISPLAY}
To tell xclip to use that display, issue the -display
command line option, or set the the DISPLAY environment variable
echo -n | xclip -display :0 -selection clipboard
:0
, and trying to use:1
will result in an error. – larsks Aug 04 '15 at 12:31