-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·66 lines (58 loc) · 2.22 KB
/
Copy pathdev.sh
File metadata and controls
executable file
·66 lines (58 loc) · 2.22 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
export SCRIPT_DIR
# One-time .dev-prefix setup + build env vars + project-local toolchain.
source "$SCRIPT_DIR/build-env.sh"
# Free port 1420 if a stale process holds it
fuser -k 1420/tcp 2>/dev/null || true
# --- Taskbar icon for the dev build (Wayland/KDE, GNOME, …) ------------------
# Wayland compositors don't read a window's embedded icon like X11 did; they
# resolve the taskbar icon purely by matching the window's app_id to an
# installed .desktop file. `tauri dev` installs nothing, so the app_id
# (`veydanbrowser`, = the binary basename) matches no desktop file and the DE
# falls back to a generated letter-avatar placeholder instead of our logo.
# Drop a desktop file + icons into the user's XDG dirs so the logo resolves.
# Idempotent and best-effort — never abort the dev run over it.
install_dev_icon() {
local app_id="veydanbrowser"
local apps_dir="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
local icons_base="${XDG_DATA_HOME:-$HOME/.local/share}/icons/hicolor"
local src="$SCRIPT_DIR/src-tauri/icons"
mkdir -p "$apps_dir"
# size -> source png (hicolor needs each size in its own dir)
local map=(
"32x32:$src/32x32.png"
"64x64:$src/64x64.png"
"128x128:$src/128x128.png"
"256x256:$src/128x128@2x.png"
"512x512:$src/icon.png"
)
local entry size file
for entry in "${map[@]}"; do
size="${entry%%:*}"; file="${entry#*:}"
[ -f "$file" ] || continue
mkdir -p "$icons_base/$size/apps"
cp -f "$file" "$icons_base/$size/apps/$app_id.png"
done
cat > "$apps_dir/$app_id.desktop" << EOF
[Desktop Entry]
Type=Application
Name=Veydan Browser
Comment=Multi-Accounting Workspace (dev)
Exec=$SCRIPT_DIR/dev.sh
Icon=$app_id
Terminal=false
Categories=Network;WebBrowser;Security;
StartupNotify=true
StartupWMClass=$app_id
NoDisplay=true
EOF
# Refresh caches where the tools exist (KDE reads live, GNOME likes a nudge)
command -v update-desktop-database >/dev/null 2>&1 && \
update-desktop-database "$apps_dir" >/dev/null 2>&1 || true
command -v gtk-update-icon-cache >/dev/null 2>&1 && \
gtk-update-icon-cache -q -t -f "$icons_base" >/dev/null 2>&1 || true
}
install_dev_icon || true
exec pnpm tauri dev