gnome-screensaver-command -a
at -f filename.sh now + 1 minutes
notify-send -i imgFile.jpg "Title" "notification information"
unity-mail
eval "export
Xclip is an application that needs environment variables such as $XAUTHORITY and $DISPLAY to talk to the X11-server. You can create a cronjob the looks as follows:
/bin/su your_username -c "export XAUTHORITY='/home/your_username/.Xauthority'; export DISPLAY='$(strings /proc/$(pgrep -n Xorg)/environ | awk -F== '$1 ~ "DISPLAY"{print $2}')'; echo -n "message" | xclip -selection clipboard"
Use your own username instead of your_username. It is a long line, but cron doesn't accept multiple lines as cronjob entries. However, here is what it does:
- /bin/su your_username: it switches the user
- -c "...": and runs the command in the quotes
- export XAUTHORITY='...';: first we need the $XAUTHORITY variable
- export DISPLAY='...': and the $DISPLAY variable, this is mostly :0, but if not, we can get the variable from the environment of the Xorg process
- echo ... | xclip ...: finally run the desired command within that environment. No need to use absolute paths anymore because we have a minimal environment now.