https://github.com/weakish/jump-or-exec
shell script to jump or exec an application under X window manager
https://github.com/weakish/jump-or-exec
Last synced: about 1 year ago
JSON representation
shell script to jump or exec an application under X window manager
- Host: GitHub
- URL: https://github.com/weakish/jump-or-exec
- Owner: weakish
- License: other
- Created: 2015-01-02T14:51:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-20T14:28:11.000Z (about 10 years ago)
- Last Synced: 2025-03-02T05:28:33.325Z (over 1 year ago)
- Language: Shell
- Size: 431 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
`jump-or-exec` tries to see if an application is already running, and if so, bring the application's window to the front, otherwise launch an instance.
Bind it to a shortcut key and it will be useful!
## Usage
```sh
jump-or-exec command [window_name]
```
## Install
### Dependencies
This script uses [wmctrl](http://tomas.styblo.name/wmctrl/), which is a UNIX/Linux command line tool to interact with an EWMH/NetWM compatible X Window Manager.
### via basher
```sh
; basher install weakish/jump-or-exec
```
Require [basher][] version: `>=39875bc`.
[basher]: https://github.com/basherpm/basher
### manually
You just need to download `jump-or-exec.sh`, and put it into your `$PATH`,
probably after renaming to `jump-or-exec` and `chomd a+x`.
## See also
This script is based on the version in [eshock/.bashrc.d](https://github.com/eshock/.bashrc.d/blob/master/tools/jump-or-exec), in which `window_name` cannot be omitted.
There are also other scripts based on wmctrl, for example, [jumpapp](https://github.com/mkropat/jumpapp) and [brocket](https://github.com/dmikalova/brocket).
Both are more complex^w feature rich.
And I failed to make them work with some applications.
Thus I wrote this script.
Besides wmctrl, it is also possible to implement `jump or exec` in Xlib directly.
For example, here is [a Python script](http://www.aifreedom.com/pluskid/JumpOrExec.html).
The script runs as a daemon, to avoid possible delays when invoking shell script and wmctrl.
The post is written in Chinese, but don't worry, you can read code in Python and code comments in English.
On my machine, `wmctrl` is fast enough.
Thus I consider I don't need a persistent daemon.