gcollazo / BrowserRefresh-Sublime

This plugin will switch from ST2 and ST3 to Google Chrome, Google Chrome Canary, Safari, Firefox or Opera and reload the active tab
http://gcollazo.github.com/BrowserRefresh-Sublime
565 stars 61 forks source link

Linux xdotool hangs if window type not found (not opened) -> subl hangs #83

Open Kwaadpepper opened 8 years ago

Kwaadpepper commented 8 years ago

Plugin is working firefox and firefox-trunk. the following command xdotool search --sync --onlyvisible --class chromium windowfocus key F5 is working however inputing chromium in browsers won't make chromium to load. That is for a linux up to date status.

Now for this issue if xdotool do not find window class it hangs until it is opened. This is because of the --sync.

Another issue is duplicate and --onlyvisible not working : firefox has invisible windows sometimes. So what you have to do is send key to all match results. This command is much more effective: xdotool search --onlyvisible --class firefox | while read w; do xdotool key --window $w F5; done How ever if you have firefox-trunk and firefox it will send to both windows.

wmctrl dos not seem to have this oddbehaviour: xdotool key --window $(wmctrl -l | grep -ie 'firefox' | awk "/$title/ {print "'$1}') F5

This is the best solution i've found. It supports all navigators based on their name, for example having firefox-trunk, we could use nigthly so the refresh will be sent only to nigthly. It also works with chromium, it avoids the deadlock described above.

I'm not a python guy but i will try to make a pull request for this.