Skip to content

Commit 067248f

Browse files
committed
fix: install AppImage icon under app_id name for the window title bar
The title bar icon is looked up in the icon theme by the window app_id (the program name, OpenShock.Desktop), not the .desktop Icon= name. Install the icon under that name too so it resolves alongside the taskbar icon.
1 parent ff04164 commit 067248f

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

packaging/appimage/AppRun

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,22 @@ if [ -n "${APPIMAGE:-}" ]; then
3030
apps_dir="${data_dir}/applications"
3131
icon_dir="${data_dir}/icons/hicolor/512x512/apps"
3232
handler_file="${apps_dir}/openshock-desktop.desktop"
33-
icon_file="${icon_dir}/openshock-desktop.png"
3433
icon_src="${HERE}/usr/share/icons/hicolor/512x512/apps/openshock-desktop.png"
3534

3635
changed=0
3736

38-
if [ ! -e "${icon_file}" ] && [ -e "${icon_src}" ]; then
39-
mkdir -p "${icon_dir}"
40-
cp "${icon_src}" "${icon_file}"
41-
changed=1
37+
# Install the icon under both the .desktop Icon= name and the window app_id
38+
# (the program name, "OpenShock.Desktop"). KWin resolves the *taskbar* icon via
39+
# the .desktop Icon=, but the *title bar* looks the icon up in the theme by the
40+
# window app_id directly, so the theme needs an entry under that name too.
41+
if [ -e "${icon_src}" ]; then
42+
for icon_name in openshock-desktop OpenShock.Desktop; do
43+
if [ ! -e "${icon_dir}/${icon_name}.png" ]; then
44+
mkdir -p "${icon_dir}"
45+
cp "${icon_src}" "${icon_dir}/${icon_name}.png"
46+
changed=1
47+
fi
48+
done
4249
fi
4350

4451
if [ ! -e "${handler_file}" ]; then

0 commit comments

Comments
 (0)