Skip to content
Snippets Groups Projects
Commit 1d6e54cd authored by Pascal Grafe's avatar Pascal Grafe
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
install:
cp lisaacro /usr/local/bin
cp lisaacro.completion /etc/bash_completion.d/
# Fast LISA Acronym lookup
A simple script for Linux to look up LISA acronyms.
The acronyms are fetched from <https://www.github.com/nluetzge/LISA_acronyms_dictionary>.
## Install
`sudo make install`
(Or see `Makefile` on how to copy manually)
## Features
* Bash: Auto completion
* KDE: Shows dialog if started from krunner
lisaacro 0 → 100644
#!/usr/bin/env bash
url='https://raw.githubusercontent.com/nluetzge/LISA_acronyms_dictionary/master/tables/LISA_acronyms.csv'
data="$(wget "$url" -O - 2> /dev/null | tail -n+2)"
if [ $1 == "get" ]; then
echo "$data" | cut -f1 -d,
else
terminal=$(cat /proc/$(ps -p $$ -o ppid | tail -n+2 | tr -d ' ')/comm)
result="$(echo "$data" | grep -i "^$1" | tr ',' ' ')"
if [ $terminal == krunner ]; then
kdialog --msgbox "$result"
else
echo "$result"
fi
fi
#!/usr/bin/env bash
_lisaacro() {
local cur
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
local tags=$(lisaacro get)
COMPREPLY=($(compgen -W "${tags}" -- $cur))
}
complete -F _lisaacro lisaacro
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment