Glossary menu - bakkeby/dusk GitHub Wiki
TMTLAs they say (short for Too Many Three Letter Acronyms).
On occasion I may come across an acronym that I don't remember what it is short for. Often in such situations I have found myself using a search engine in an attempt to look it up. Many times this can be effective, other times there may be some false positives.
For example UPS being United Parcel Service, USB being University of Santa Barbara.
Reusing the dmenu lookup, add and remove functionality from other scripts I have found it practical to be able to look up acronyms and other definitions using a dmenu script.
I started out by borrowing a base set of acronyms from a website listing IT related abbreviations and add new ones as I come across them. There are of course many workplace acronyms to keep track of as well.
Example presentation:
Searching for an acronym:
Pressing enter:
Pressing enter again will copy the above text to the clipboard, should you need it.
Hitting escape will lead you back to the glossary menu again.
Dependencies:
- dmenu
notify-send
xclip
To set this up you will need:
- glossary_menu.sh
- glossary.dat (optional)
Note that you may want to make some adjustments to the size of the menu as well as the number of lines and columns.
MENU="dmenu -c -w 50% -bw 20"
SELECTION=$($MENU -l 20 -g 15 -gw 80 -dp -d '|' -p "${TOPIC}:" < "${DAT}")
The -gw 80
will set the minimum column width to 80 pixels, which will dynamically override the specified number of columns if they would result in a column width below that.
NB: When copying the glossary.dat
file make sure to add a newline at the end of the file. Otherwise the first acronym you add may be appended to the last in the list. Github Gists helpfully remove trailing newlines by the looks of it.
Back to Other scripts and life hacks.