All firefox windows will have VM_CLASS "Navigator.Firefox" as can be seen by running wmctrl -lx while firefox is running $ wmctrl -lxĠx03ba3d43 3 gnome-terminal.Gnome-terminal pilot TerminalĠx04c000bc 0 Navigator.Firefox pilot Group #1 - Speed Dial - Mozilla Firefox With -x, wmctrl will operate on the VM_CLASS of a window, which will typically have a unique value per program. Other windows than firefox windows could potentially contain that string in their title, so we should find a more reliable way of identifying the right window in this case. Secondly, if no windows match, wmctrl will do nothing and exit with a non-zero (false) exit status, in which case we can assume the program is not running, and start it instead. That is, move to the workspace it's in, bring it to the front and give it focus. Wmctrl -a 'Mozilla Firefox' will find a window containing "Mozilla Firefox" in its title, and "activate" it. Just running vlc & instead will likely be more correct.īad shell advice is unfortunately commonplace on the internet.įrom your problem description, what you want the result to be is that the program is run if it isn't already running, and if it is running, bring that window to the front, and give it focus. If there are more than one process matching "vlc", vlc & will not be run. If there are no processes matching "vlc", and if there are exactly one process matching "vlc". Some of the shell code from that source doesn't do what it claims to do mainly the type that goes: if then (vlc &) fi This only happens sometimes.Ĭould anyone help me to edit this script to fix this misbehaviour? ( Source of the script which I modified.) As problem remains that it doesn't put Firefox in the foreground when it is already running. ) and add an adress like about:blank it solves the problem partly. So, when I modify the command in the script ( config =. *** Preventing external load of chrome: URI into browser window. firefox chrome://speeddial/content/speeddial.xul - Firefox doesn't open:.(!) firefox about:blank - Firefox opens with an additional new, blank tab.firefox about:startpage - Firefox opens with an additional new tab with the preconfigured startpage.
0 Comments
Leave a Reply. |