Issue
I'd like to trigger a tab refresh on Firefox from a command line. I'm working on a web app and the refresh goes after the app compiles. I trigger the compile from a command in my IDE. It's not a fixed url, nor can it be derived from the open file in the IDE. Thus, the currently open url in the active tab.
The thing is, I'm in a double headed box with no Xinerama support, which means I can't alt+tab to Firefox, instead I must move the mouse to the other screen, click on Firefox and then Ctrl+R. That can't be right.
I tried some sort of bookmarklet stuff, like DISPLAY=':0.1' firefox -remote 'openurl(javascript:alert(1);)'
, but FF wouldn't run that.
Any ideas?
Solution
Here's an updated version of @geekQ's script that will return focus to the previous program (however, the firefox window will still be pulled to the top).
#!/bin/bash
CURRENT_WID=$(xdotool getwindowfocus)
WID=$(xdotool search --name "Mozilla Firefox")
xdotool windowactivate $WID
xdotool key F5
xdotool windowactivate $CURRENT_WID
Answered By - Jason Axelson Answer Checked By - Timothy Miller (WPSolving Admin)