Skip to content

Instantly share code, notes, and snippets.

@gelin
Created February 20, 2020 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gelin/deef007eabc9b205ef73891451bbf1c3 to your computer and use it in GitHub Desktop.
Save gelin/deef007eabc9b205ef73891451bbf1c3 to your computer and use it in GitHub Desktop.
Installs Redmine Time Tracker to main menu
#!/bin/sh
# Adds Redmine Time Tracker to the main menu.
# https://www.redmine.org/plugins/redmine-time-tracking-software
set -e
jar=$(find $PWD/ -name "*.jar")
echo "Found '$jar'"
if [ ! -f "$jar" ]
then
echo "Run install.sh from the folder with 'Redmine Time Tracker - x.x.x.jar' file"
exit 1
fi
vendor="java"
class="RedmineTimeTracker.RedmineTimeTracker"
title="Redmine Time Tracker"
unzip -ju "$jar" "RedmineTimeTracker/resources/*logo*.png"
xdg-icon-resource install --size 128 redmine_logo_green.png "$vendor-$class"
cat > "$vendor-$class.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=$title
Icon=$vendor-$class
Exec=java -XX:MaxRAM=256m -jar "$jar"
StartupWMClass=$class
Terminal=false
Categories=Development
EOF
xdg-desktop-menu install "$vendor-$class.desktop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment