Skip to content

Instantly share code, notes, and snippets.

@albertorb
Last active May 16, 2019 09:17
Show Gist options
  • Save albertorb/f0c3df6c125a50ee2fdeaab7fa234c70 to your computer and use it in GitHub Desktop.
Save albertorb/f0c3df6c125a50ee2fdeaab7fa234c70 to your computer and use it in GitHub Desktop.
Nativefier directly to launcher shortcut
#!/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