Open Note - bakkeby/dusk GitHub Wiki
I wanted to share an idea that has significantly transformed the way I work.
For context I work in a technical support role that involves a lot of analysis, and generally we document all the investigation steps and findings in Jira comments. The user interface as well as formatting options are to be honest not particularly great in the tool, and while it does not happen that often there is always the risk of accidentally losing a comment that you have spent a lot of time writing up.
To compensate I have been preparing comments and keeping track of temporary investigation notes in a text editor. More often than not it has also been useful to store these notes in case I need to refer to them in the future. Going through and saving such untitled notes was somewhat time consuming, annoying and a slight source of frustration.
That brings us to the eureka moment.
The idea is that:
- I have a Jira ticket open in my browser and
- I press a keybinding (F9) triggering a script which
- gets the window title of the active window and
- extracts some uniquely identifiable information (like the Jira issue key) and
- checks if a note already exists for this key, and if not then it creates it and
- it opens the notes file in your text editor of choice
In practice that means that after opening a Jira ticket I can just press F9 to open the notes file for that ticket. This takes less than a second. The file is already named so I can just do Ctrl+s
to save it.
I specifically refer to Jira here, but this idea can be applied to other services as well like github issues for example.
Working with a note file in an editor this way has some additional benefits:
- you have all the tools of your editor at hand to manipulate the text
- you can add additional notes in there that are just for your own reference
- you have a local record of all the tickets / issues you have worked on
- if you need to save additional files (e.g. images, documents) then the latest tickets will be listed first when ordering the directories by the time they were modified in the file chooser UI
- you can
grep
through everything you have worked on
Another optional idea is that if you have a note open in your text editor and you press the same keybinding, then that could open the corresponding ticket / issue in your browser.
Example directory structure:
Dependencies:
- xdotool
bash
sed
To set this up you will need:
- open_note.sh
- a button binding set up e.g. via dusk or sxhkd
Note that the script may need some tweaking depending on what you use it for. The window titles may also vary depending on what browser is being used.
Example sxhkd keybinding:
F9
open_note.sh
Example dusk keybinding:
{ ClkClientWin, NULL, XK_F9, spawn, CMD("~/bin/open_note.sh") },
Should things not work or do anything then you can uncomment the set -x
at the start of the script which will output everything that the script does.
For testing purposes you can also trigger this from the command line using a sleep and specifying the editor to use.
$ sleep 5 && EDITOR=kate ~/bin/open_note.sh
Found title of Wayland support · Issue #10 · bakkeby/dusk - Google Chrome
Found github key of 00010
Also refer to:
Back to Other scripts and life hacks.