Created
December 10, 2020 10:48
-
-
Save idling-mind/772e1442abaf978daea0c556d1598690 to your computer and use it in GitHub Desktop.
A Simple GNOME launcher in 20 lines of code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Config file stores all the commands as csv data | |
configfile=$HOME/.config/zenlauncher/applist.csv | |
configdir=$(dirname $configfile) | |
# Create the config file if it's not existing and add the first command | |
if [ ! -f $configfile ] ; | |
then | |
mkdir -p $configdir | |
echo "Add to Zen, Add a new entry to zen launcher, addtozen" >> $configfile | |
fi | |
# addtozen to append a line to config file | |
function addtozen { | |
mkdir -p $configdir | |
zenity --forms --add-entry="Name" --add-entry="Description" --add-entry="Command" --separator="," >> $configfile | |
} | |
app=$(cat $configfile | sed 's/,/\n/g' | sed 's/^ *\(.*\) *$/\1/g' | zenity --list --title="ZenLauncher" --column="Name" --column="Description" --column="Command" --print-column=3 --width=800 --height=300) | |
eval $app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment