You are not logged in.
Say you are working with specific applications alot and alt-tabs between them. Programs like chrome, geany, terminator etc. I noticed that sometimes it can take a few seconds to find chrome, or that specific terminal if you are running alot of programs at once. I found that wmctrl is a tool you can use for this purpose. I put together a little script that enables you to bind any program, e.g google-chrome terminator etc. It's a script that utilizes wmctrl. Use it with your favorite window manager e.g. openbox. When you press a key, just call this script and pass the executible as an argument.
Install
sudo apt-get install wmctrl
cd /usr/local/bin
sudo vim wswitch#!/bin/bash
if [ "$(wmctrl -l -x | grep ${1^})" ]; then
wmctrl -a $1 -x
else
$1 &
fisudo chmod +x wswitchAdd keybindings in rc.xml (openbox)
Example keybindings:
<keybind key="section">
<action name="Execute">
<execute>wswitch terminator</execute>
</action>
</keybind>
<keybind key="C-space">
<action name="Execute">
<execute>wswitch x-www-browser</execute>
</action>
</keybind>openbox --restartIf you don't have your browser opened it will start it.
If you have your browser already running it will focus
that window regardless where you are in the X-system.
Say you are working with terminator on desktop 4. If you
press C-space now you will automatically goto where
x-www-browser is at the moment and it will focus the window!
What do you think?
Edit: Rewrote subject/intro and switched from python to bash
Last edited by elias.ericson (2013-04-20 13:48:50)
Offline
Its OK.
Only grudge I have is you use python to launch a couple of script commands.
Why don't you implement it in bash straight away, and not pay the penalty of starting python.
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
Its OK.
Only grudge I have is you use python to launch a couple of script commands.
Why don't you implement it in bash straight away, and not pay the penalty of starting python.
Yeah that's true, rewrote it in bash. Thanks for pointing it out.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.