-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_linux_desktop.sh
More file actions
executable file
·40 lines (32 loc) · 1.33 KB
/
Copy pathinstall_linux_desktop.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Installs .desktop file and icon so KDE Wayland (and other DEs) show the
# knook icon in the title bar and taskbar instead of the generic icon.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DESKTOP_SRC="${SCRIPT_DIR}/linux/com.example.chess_auto_prep.desktop"
ICON_SRC="${SCRIPT_DIR}/assets/images/knook.png"
APPS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
ICONS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/icons/hicolor"
if [[ ! -f "$DESKTOP_SRC" ]]; then
echo "Error: Desktop file not found at $DESKTOP_SRC"
exit 1
fi
if [[ ! -f "$ICON_SRC" ]]; then
echo "Error: Icon not found at $ICON_SRC"
exit 1
fi
mkdir -p "$APPS_DIR"
mkdir -p "$ICONS_DIR/256x256/apps"
mkdir -p "$ICONS_DIR/48x48/apps"
cp "$DESKTOP_SRC" "$APPS_DIR/"
cp "$ICON_SRC" "$ICONS_DIR/256x256/apps/chess_auto_prep.png"
cp "$ICON_SRC" "$ICONS_DIR/48x48/apps/chess_auto_prep.png"
# Refresh desktop database (optional, helps some environments)
if command -v update-desktop-database &>/dev/null; then
update-desktop-database -q "$APPS_DIR" 2>/dev/null || true
fi
if command -v gtk-update-icon-cache &>/dev/null; then
gtk-update-icon-cache -qtf "$ICONS_DIR" 2>/dev/null || true
fi
echo "Installed Chess Auto Prep desktop entry and icon."
echo "Restart the app (or close and run 'flutter run -d linux' again) to see the knook icon."