38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# Adds VibEdit to your applications menu. Run it again after moving this
|
|
# folder; "./install.sh --uninstall" removes the menu entry.
|
|
set -eu
|
|
dir=$(cd "$(dirname "$0")" && pwd)
|
|
apps=${XDG_DATA_HOME:-$HOME/.local/share}/applications
|
|
entry=$apps/vibedit.desktop
|
|
|
|
if [ "${1:-}" = "--uninstall" ]; then
|
|
rm -f "$entry"
|
|
echo "Removed $entry"
|
|
exit 0
|
|
fi
|
|
|
|
# These would need escaping in the desktop entry's Exec line.
|
|
case $dir in
|
|
*[\"\`\$\\]*)
|
|
echo "Move this folder to a path without \" \` \$ or \\ in it, then run install.sh again." >&2
|
|
exit 1 ;;
|
|
esac
|
|
|
|
mkdir -p "$apps"
|
|
cat > "$entry" <<EOF
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=VibEdit
|
|
GenericName=Video Cutter
|
|
Comment=Cut clips out of videos and join them with ffmpeg
|
|
Exec="$(printf '%s' "$dir" | sed 's/%/%%/g')/vibedit"
|
|
Icon=$dir/vibedit.png
|
|
Terminal=false
|
|
Categories=AudioVideo;Video;AudioVideoEditing;
|
|
EOF
|
|
if command -v update-desktop-database >/dev/null 2>&1; then
|
|
update-desktop-database -q "$apps" || true
|
|
fi
|
|
echo "Added VibEdit to your applications menu ($entry)"
|