0

I'm doing web development and for that reason I need to refresh some page in firefox frequently (it's on another display, so I see both IDE and browser at the same time). At the moment I manually use the mouse to set focus to firefox, refresh it, and then put the focus back to IDE.

How can I add a keyboard shortcut that would make the currently active tab of a visible browser refresh the page, with focus staying where it currently is?

2 Answers 2

3

You can use a xdotool-based shell script for that.

sudo apt-get install xdotool

Then write a simple script like this one:

#!/bin/bash

WID=`xdotool search --name "Mozilla Firefox" | head -1`
xdotool key --window $WID F5

Name it and place it as you wish. Make it executable:

chmod a+x /path/to/script

Now you can simply make a custom keyboard shortcut that will execute the script and you are all set up.

1
  • This works, also you can have it in one command: xdotool search --name "Mozilla Firefox" key "F5"
    – Fluffy
    Jun 9, 2014 at 13:36
0

Checkout Auto Reload. It's an add-on for Firefox that automatically reloads the page when a particular local file is modified.

1
  • I tried one of those, but I'd need to set a small refresh interval, and when something goes wrong I need to disable autorefresh which is even more hassle than refreshing manually.
    – Fluffy
    Jun 9, 2014 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .