Starts an application, or if it is already running, gives it focus.
- POSIX-compliant shell (
/bin/sh
) pidof
commandwmctrl
command
Note: The script will check for the required commands itself, so you do not have to.
start-or-focus -- <name> [ <process> [ <command> ] ]
or:
start-or-focus (--version | -V | -v)
or:
start-or-focus (--help | -H | -h | -?)
--version, -V, -v
- Print version and copyright information.
--help, -H, -h, -?
- Print the usage message.
<name>
- Name of the application as it appears in the window (case insensitive).
<process>
- Name of the application's process (case sensitive). If not given, assumed to
be same as
<name>
.
- Name of the application's process (case sensitive). If not given, assumed to
be same as
<command>
- The command used to start the application. If not given, assumed to be same
as
<process>
.
- The command used to start the application. If not given, assumed to be same
as
-
start-or-focus -- "ghostwriter"
-
start-or-focus -- "Geany" "geany"
-
start-or-focus -- \ "Mozilla Firefox" \ "/usr/lib/firefox/firefox"
-
start-or-focus -- \ "Firefox Developer Edition" \ "/opt/firefox-developer-edition/firefox"
-
(Starts Chromium in incognito mode.)
start-or-focus -- \ "Chromium" \ "chromium-browse" \ "chromium-browser --incognito"
Automated tests are done using shUnit2 and ShellCheck.
- Install ShellCheck 0.4.7.
- Run
./test
.