Skip to content

Moves a running application in focus. If no Instance is running it starts a new one.

Notifications You must be signed in to change notification settings

Treborium/OpenExistingInstance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenExistingInstance

This little python script moves a given application in focus. If no instance of the application is currently running a new one will be launched.

Usage

Simply call the script file from your terminal or via a keyboard shortcut with the application you want to focus as the 1st argument and the application you want to launch as the 2nd argument. If no 2nd argument is provided it will use the 1st one for both parameters.

Requirements

In order to use this script you need to have a window manager that is supported by the wmctrl module

Getting Started

From a Terminal: ./OpenExistingInstance.py "Firefox" "Chrome"

Via a Keyboardshortcut in Gnome: python3 ./OpenExistingInstance.py "Firefox" "Chrome"

Here we try to focus Firefox, if no instance of Firefox is currently running we'll launch Chrome.

About

Moves a running application in focus. If no Instance is running it starts a new one.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages