The icon is a plate wearing headphones with a red Nordic house cookie on it. It replaces the default Godot icon, so the game window, Windows and macOS builds use it. Linux programs can't carry their own icon, so the build now also makes MusicPlayer_<version>_linux.tar.gz with the game, the icon as a PNG, a .desktop menu entry and install.sh, which installs them for the current user. The bare Linux binary is still published.
31 lines
1.3 KiB
Bash
Executable File
31 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Installs Music Player Randomizer for the current user, with an app menu entry and icon.
|
|
# Run it from the unpacked release folder: ./install.sh
|
|
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
bin_dir="${XDG_BIN_HOME:-$HOME/.local/bin}"
|
|
data_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
binary="$bin_dir/music-player-randomizer"
|
|
|
|
icon_dir="$data_dir/icons/hicolor/256x256/apps"
|
|
mkdir -p "$bin_dir" "$icon_dir" "$data_dir/applications"
|
|
install -m755 MusicPlayer.x86_64 "$binary"
|
|
install -m644 music-player-randomizer.png "$icon_dir/music-player-randomizer.png"
|
|
# The menu entry needs the full path, since ~/.local/bin is not always on PATH
|
|
sed "s|^Exec=.*|Exec=$binary|" music-player-randomizer.desktop \
|
|
> "$data_dir/applications/music-player-randomizer.desktop"
|
|
|
|
# Refresh menu and icon caches where the tools exist; most desktops also notice on their own
|
|
command -v update-desktop-database > /dev/null \
|
|
&& update-desktop-database "$data_dir/applications" || true
|
|
command -v gtk-update-icon-cache > /dev/null \
|
|
&& gtk-update-icon-cache -q "$data_dir/icons/hicolor" || true
|
|
|
|
echo "Installed. Start it from your app menu, or run: $binary"
|
|
echo "To uninstall, delete:"
|
|
echo " $binary"
|
|
echo " $data_dir/applications/music-player-randomizer.desktop"
|
|
echo " $icon_dir/music-player-randomizer.png"
|