Created
January 20, 2015 20:55
-
-
Save wturnerharris/7c8267e279bf927c49e1 to your computer and use it in GitHub Desktop.
This script reloads the top-most Chromium window and alerts any tty windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set display | |
export DISPLAY=":0" | |
# set var to retrieve window id | |
WID=$(xdotool search --onlyvisible --class chromium|head -1) | |
# reload window according to cron schedule | |
if [ -n $WID ]; then | |
echo "===> Reloading Chromium..." | |
echo "Reloading Chromium" | wall | |
xdotool windowactivate $WID | |
xdotool key ctrl+shift+r | |
else | |
echo "No window to reload" | |
echo "Chromium not reloaded" | wall | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment