Skip to content
/ jumpapp Public
forked from mkropat/jumpapp

A run-or-raise application switcher for any X11 desktop

License

Notifications You must be signed in to change notification settings

e3rd/jumpapp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jumpapp

A run-or-raise application switcher for any X11 desktop

The idea is simple — bind a key for any given application that will:

  • launch the application, if it's not already running, or
  • focus the application's window, if it is running

Pressing the key again will cycle to the application's next window, if there's more than one.

In short, jumpapp is probably the fastest way for a keyboard-junkie to switch between applications in a modern desktop environment. Once installed, all you have to do is configure the key bindings you want to use:

Settings Example

Synopsis

Usage: jumpapp [OPTION]... COMMAND [ARG]...

Jump to (focus) the first open window for an application, if it's running.
Otherwise, launch COMMAND (with opitonal ARGs) to start the application.

Options:
  -f -- force COMMAND to launch if process found but no windows found
  -L -- list matching windows for COMMAND and quit
  -n -- do not fork into background when launching COMMAND
  -r -- cycle through windows in reverse order
  -p -- always launch COMMAND when ARGs passed
        (see Argument Passthrough in man page)
  -c NAME -- find window using NAME as WM_CLASS (instead of COMMAND)
  -i NAME -- find process using NAME as the command name (instead of COMMAND)

Installation

Ubuntu and Linux Mint

sudo add-apt-repository ppa:mkropat/ppa
sudo apt-get update
sudo apt-get install jumpapp

Debian and Friends

sudo apt-get install build-essential debhelper pandoc shunit2
git clone https://github.com/mkropat/jumpapp.git
cd jumpapp
make deb
sudo dpkg -i jumpapp*all.deb
sudo apt-get install -f	# if there were missing dependencies

Fedora and Friends

git clone https://github.com/mkropat/jumpapp.git
cd jumpapp
make rpm
sudo yum localinstall jumpapp*.noarch.rpm

From Source

git clone https://github.com/mkropat/jumpapp.git
cd jumpapp
make && sudo make install

Argument Passthrough (-p option)

Many applications keep track of what windows they have open so that if you run the command again, it will interact with the existing application window instead of launching a new instance of the application.

Take Firefox, for example. If you already have a Firefox window open and you run firefox https://github.com/, Firefox won't start a new instance. What it does is open a new tab in the existing window and browse to the URL you passed.

Especially in the case of Desktop Entry files, we want to preserve this behavior. With jumpapp -p COMMAND [ARGs]..., when you include one or more ARGs, COMMAND is always executed in order to pass the ARGs to the running application. But if no ARGs are included, jumpapp will behave normally.

A Wrapper Around wmctrl(1)

All the heavy lifting is done by Tomáš Stýblo's powerful wmctrl. You must have it installed to use jumpapp.

jumpapp was built for the GNOME desktop environment. There's a good chance though that it'll work on any window manager supported by wmctrl.

XBindKeys

If your desktop environment doesn't offer a way to bind keys to commands — or if it's too limited — take a look at XBindKeys.

Example .xbindkeysrc:

"jumpapp chromium"
  control + alt + c

"jumpapp -r chromium"
  shift + control + alt + c

"jumpapp firefox"
  control + alt + f

"jumpapp -r firefox"
  shift + control + alt + f

"jumpapp gnome-terminal"
  control + alt + t

"jumpapp -r gnome-terminal"
  shift + control + alt + t

jumpappify-desktop-entry(1)

jumpapp ships with a helper utility:

Usage: jumpappify-desktop-entry SOMEFILE.desktop

Given a desktop entry file (*.desktop), output a new desktop entry file that
wraps the application's `Exec` in a call to jumpapp(1).

EXAMPLES

    jumpappify-desktop-entry /usr/share/applications/chromium-browser.desktop \
        > ~/.local/share/applications/chromium-browser.desktop

Or convert multiple in one go:

    for entry in /usr/share/applications/{firefox,gnome-terminal}.desktop; do
        target=~/".local/share/applications/$(basename "$entry")"
        jumpappify-desktop-entry "$entry" >"$target"
    done

See Also

  • Blazing-Fast Application Switching in Linux — a blog post that talks about the advantages of this style of application switching
  • brocket — a Bash script that works very similiarly to jumpapp. Check it out, particularly if you're looking for options for managing windows in different desktops.

About

A run-or-raise application switcher for any X11 desktop

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 85.1%
  • Makefile 14.9%