diff --git a/build/linux/Install menu entry.sh b/build/linux/Install menu entry.sh new file mode 100755 index 0000000..a10ff77 --- /dev/null +++ b/build/linux/Install menu entry.sh @@ -0,0 +1,59 @@ +#! /bin/bash +# (MIT/GPL3+) Alberto Salvia Novella (es20490446e.wordpress.com) + + +mainFunction () { + installIcon + installMenuEntry +} + + +changeToThisProgramDir () { + cd "$( dirname "${BASH_SOURCE[0]}" )" +} + + +checkPermissions () { + user=$(id -u) + + if [ "${user}" -ne 0 ]; then + sudo "${BASH_SOURCE[0]}" + exit ${?} + fi +} + + +execute () { + function="${1}" + command="${2}" + error=$(eval "${command}" 2>&1 >"/dev/null") + + if [ ${?} -ne 0 ]; then + echo "${function}: ${error}" + exit 1 + fi +} + + +installIcon () { + logo="Instagram_logo_2016.svg" + version="20160929161413" + execute "installIcon" "wget \"https://upload.wikimedia.org/wikipedia/commons/archive/e/e7/${version}%21${logo}\"" + execute "installIcon" "mv \"${version}!${logo}\" \"/usr/share/pixmaps/igdm.svg\"" +} + + +installMenuEntry () { + entry="igdm.desktop" + execute "installMenuEntry" "cp ${entry} /usr/share/applications/${entry}" +} + + +setEnvironment () { + changeToThisProgramDir + checkPermissions +} + + +setEnvironment +mainFunction diff --git a/build/linux/igdm.desktop b/build/linux/igdm.desktop new file mode 100644 index 0000000..9261dfc --- /dev/null +++ b/build/linux/igdm.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Categories=Network;Chat +Exec=igdm +Icon=/usr/share/pixmaps/igdm.svg +Keywords=igdm +Name=Instagram Desktop Messenger +Path=/opt/igdm/ +Type=Application