Last active
May 16, 2019 09:17
-
-
Save albertorb/f0c3df6c125a50ee2fdeaab7fa234c70 to your computer and use it in GitHub Desktop.
Nativefier directly to launcher shortcut
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 | |
POSITIONAL=() | |
while [[ $# -gt 0 ]] | |
do | |
key="$1" | |
case $key in | |
-n|--name) | |
Name="$2" | |
shift | |
shift | |
;; | |
-u|--url) | |
URL="$2" | |
shift | |
shift | |
;; | |
esac | |
done | |
set -- "${POSITIONAL[@]}" | |
FILE=$HOME/.local/share/applications/nativefier/$Name.desktop | |
nativefier $URL --name $Name $HOME/Applications/ | |
echo "creating desktop shortcut at $FILE..." | |
cat > $FILE <<- EOM | |
[Desktop Entry] | |
Comment=Created with script. | |
Terminal=false | |
Name=$Name | |
Exec=$HOME/Applications/nativefier/$Name-linux-x64/$Name | |
Type=Application | |
Icon=$HOME/Imágenes/nativefier/$Name.png | |
Categories=nativefier; | |
EOM | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment