Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conveniences for create_project_shortcuts.sh #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions create_project_shortcuts.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ fi
PROJECT_NAME="$1"
PROJECT_PATH="$2"

if [[ ! -d ${PROJECT_PATH} ]]; then
echo "error: project directory '${PROJECT_PATH}' does not exist."
exit 1
fi

function icon {
icon_usage() { echo "icon: [-n NICKNAME] projectName projectDir scriptName scriptIcon script" 1>&2; exit; }
local nickname=""
Expand Down Expand Up @@ -56,21 +61,22 @@ function icon {
fi

NOSPACES=${SOFTWARE_NAME// /-}
FILENAME=${PROJECT_PATH}"/dcc_${NOSPACES,,}"
NOSPACES_PROJECT=${PROJECT_NAME// /-}
FILENAME=${PROJECT_PATH}"/dcc_${NOSPACES_PROJECT,,}_${NOSPACES,,}.desktop"

echo "#!/usr/bin/env xdg-open" > ${FILENAME}.desktop
echo "[Desktop Entry]" >> ${FILENAME}.desktop
echo "Version=0.1" >> ${FILENAME}.desktop
echo "Name=${PROGRAM_NAME}" >> ${FILENAME}.desktop
echo "Name[en_US]=${PROGRAM_NAME}" >> ${FILENAME}.desktop
echo "Comment=DCC Pipe shortcut for ${SOFTWARE_NAME}" >> ${FILENAME}.desktop
echo "Exec=${PROJECT_PATH}/${SCRIPT}" >> ${FILENAME}.desktop
echo "Icon=${PROJECT_PATH}/${ICON}" >> ${FILENAME}.desktop
echo "Terminal=false" >> ${FILENAME}.desktop
echo "Type=Application" >> ${FILENAME}.desktop
echo "Categories=Utility;Application;" >> ${FILENAME}.desktop
echo "#!/usr/bin/env xdg-open" > ${FILENAME}
echo "[Desktop Entry]" >> ${FILENAME}
echo "Version=0.1" >> ${FILENAME}
echo "Name=${PROGRAM_NAME}" >> ${FILENAME}
echo "Name[en_US]=${PROGRAM_NAME}" >> ${FILENAME}
echo "Comment=DCC Pipe shortcut for ${SOFTWARE_NAME}" >> ${FILENAME}
echo "Exec=${PROJECT_PATH}/${SCRIPT}" >> ${FILENAME}
echo "Icon=${PROJECT_PATH}/${ICON}" >> ${FILENAME}
echo "Terminal=false" >> ${FILENAME}
echo "Type=Application" >> ${FILENAME}
echo "Categories=Utility;Application;" >> ${FILENAME}

chmod 770 ${FILENAME}.desktop
chmod 770 ${FILENAME}
}


Expand Down