Skip to content

Instantly share code, notes, and snippets.

@wturnerharris
Created January 20, 2015 20:55
Show Gist options
  • Save wturnerharris/7c8267e279bf927c49e1 to your computer and use it in GitHub Desktop.
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
#!/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