Integrated development window manager
There is an integrated development window manager where you can:
What if I told you it is actually just a 100 line shell script?
- Select any compiler error text in any terminal and open the correct file and line in your text editor.
- Click on the output of ls in any terminal and open the corresponding file with the correct program.
- Click any url from any text on your OS and open it in your browser.
A small correction for the video, I didn't mean my solution is simpler than the plan9 plumber, just that it is easier to setup and use on linux.
Update - The script is now a bit bigger, ~150 lines plus ~25 lines of comments to add 'bookmarking', this new feature is shown below.
How it works
A hotkey in your window manager runs a script (I use windowskey + g), the script then does a simple set of actions.
The code is on github.
- Use 'xdotool' to get active window title, and use that to work out what the current working directory is.
- Use 'xclip' to get the currently highlighted text.
- Use grep and some simple checks to work out what the correct action to take for the current text.
- Perform the correct action, e.g. open a web browser, or open text editor.
You can configure xterm to make double click select directories and URL's by adding the following to ~/.Xresources.
XTerm*charClass: 33:48, 37:48, 42:48, 45-47:48, 58:48, 63-64:48, 126:48
By default it will only select english words with a double click.
I know I am not the first person to do this with x11, though I do wish somebody has shown me this a long time ago, which is why this post is here to show you. I was inspired to set this up by the plan9 operating system's plumber tool (which you should look up) and Russ Cox's tour of acme video.
Homework for readers
- Add more commands e.g. open github issues, ipfs links etc.
Allow regex patterns like:
so our link comments are not brittle. - done
Integrate with dmenu to allow interactive action choices. - done
- Have contextual actions based on the program controlling the active window.
- Make a version for windows.