环境:Deepin 25(DDE 25,bloom 主题,系统盘只读) 适用:把 AppImage / 绿色软件放到 ~/apps 后,启动器图标空白、显示通用图标,或改了图标一直不刷新。
~/apps
DDE 的启动器按 .desktop 里的 Icon= 去找图标:
.desktop
Icon=
CrealityPrint
~/.local/share/icons/hicolor/<尺寸>/apps/<名字>.png
hicolor
index.theme
dde-application-manager
~/.cache/deepin/icons/*.png
很多人卡在第三步和第四步:图标文件明明放了,但没 index.theme,或者缓存没清。
mkdir -p ~/apps mv CrealityPrint.AppImage ~/apps/ chmod +x ~/apps/CrealityPrint.AppImage
如果 AppImage 里自带图标,可以先解包找:
cd /tmp ~/apps/CrealityPrint.AppImage --appimage-extract find squashfs-root -maxdepth 4 -iname '*.png' -o -iname '*.svg' | head # 常见位置:squashfs-root/.DirIcon、squashfs-root/usr/share/icons/...
拿到一张 512×512 或更大的 PNG 后,用 PIL 生成整套尺寸:
from PIL import Image src = "icon.png" # 换成你的原图 name = "CrealityPrint" # 与 .desktop 的 Icon= 一致 sizes = (16, 24, 32, 48, 64, 96, 128, 192, 256, 512) im = Image.open(src).convert("RGBA") for s in sizes: out = f"/home/{__import__('getpass').getuser()}/.local/share/icons/hicolor/{s}x{s}/apps" import os; os.makedirs(out, exist_ok=True) im.resize((s, s), Image.LANCZOS).save(f"{out}/{name}.png")
没有 PIL 就 sudo apt install python3-pil,或者用 ImageMagick: for s in 16 24 32 48 64 96 128 192 256 512; do convert icon.png -resize ${s}x${s} ...; done
sudo apt install python3-pil
for s in 16 24 32 48 64 96 128 192 256 512; do convert icon.png -resize ${s}x${s} ...; done
~/.local/share/applications/crealityprint.desktop:
~/.local/share/applications/crealityprint.desktop
[Desktop Entry] Type=Application Name=Creality Print Comment=3D 打印切片软件 Exec=/home/maf/apps/CrealityPrint.AppImage %U Icon=CrealityPrint Terminal=false Categories=Graphics;3DGraphics;
注意:
Exec=
libfuse2
StartupWMClass=
xprop WM_CLASS
校验:
desktop-file-validate ~/.local/share/applications/crealityprint.desktop
hicolor/index.theme
~/.local/share/icons/hicolor/index.theme:
~/.local/share/icons/hicolor/index.theme
[Icon Theme] Directory=16x16/apps,24x24/apps,32x32/apps,48x48/apps,64x64/apps,96x96/apps,128x128/apps,192x192/apps,256x256/apps,512x512/apps [16x16/apps] Contexts=Applications Size=16 MinSize=16 MaxSize=16 Type=Directories [24x24/apps] Contexts=Applications Size=24 MinSize=24 MaxSize=24 Type=Directories [32x32/apps] Contexts=Applications Size=32 MinSize=32 MaxSize=32 Type=Directories [48x48/apps] Contexts=Applications Size=48 MinSize=48 MaxSize=48 Type=Directories [64x64/apps] Contexts=Applications Size=64 MinSize=64 MaxSize=64 Type=Directories [96x96/apps] Contexts=Applications Size=96 MinSize=96 MaxSize=96 Type=Directories [128x128/apps] Contexts=Applications Size=128 MinSize=128 MaxSize=128 Type=Directories [192x192/apps] Contexts=Applications Size=192 MinSize=192 MaxSize=192 Type=Directories [256x256/apps] Contexts=Applications Size=256 MinSize=256 MaxSize=256 Type=Directories [512x512/apps] Contexts=Applications Size=512 MinSize=512 MaxSize=512 Type=Directories
gtk-update-icon-cache -f ~/.local/share/icons/hicolor
rm -f ~/.cache/deepin/icons/*.png pkill -f dde-application-manager # 会被自动拉起
然后重新打开启动器(或注销重登一次)。
# 1. desktop 文件合法 desktop-file-validate ~/.local/share/applications/crealityprint.desktop # 2. 图标主题能被识别 ls ~/.local/share/icons/hicolor/index.theme ls ~/.local/share/icons/hicolor/256x256/apps/CrealityPrint.png # 3. 缓存已重建 ls -l ~/.cache/deepin/icons/ | head # 4. 直接按 desktop 启动,确认 Exec 没问题 gtk-launch crealityprint
~/.local/share/icons/bloom/
Icon=/home/maf/apps/icon.png
/usr/share
/usr/share/applications
/usr/share/icons
~/.local/share
这套流程在 Blender、FreeCAD 1.1.3、CrealityPrint 7.2.1 上都验证过,装完启动器图标正常。核心就三件事:主题名 + hicolor 带 index.theme + 清 DDE 缓存。
👍
雷锋
直接用workbuddy写,还会考虑版本升级的问题
Featured Collection
Popular Ranking
Popular Events
Deepin 25 手动装 AppImage 后启动器图标不对?一套可复制的修复步骤
一、先搞清楚 DDE 怎么找图标
DDE 的启动器按
.desktop里的Icon=去找图标:Icon=写的是主题图标名(如CrealityPrint),不是文件路径~/.local/share/icons/hicolor/<尺寸>/apps/<名字>.pnghicolor目录必须有index.theme,否则 DDE/GTK 不会把它当成一个图标主题来扫描dde-application-manager会把渲染结果缓存到~/.cache/deepin/icons/*.png,改图标后不清缓存就会一直显示旧图很多人卡在第三步和第四步:图标文件明明放了,但没
index.theme,或者缓存没清。二、完整步骤
1. 放好 AppImage
2. 拿到一张原图,生成多尺寸图标
如果 AppImage 里自带图标,可以先解包找:
拿到一张 512×512 或更大的 PNG 后,用 PIL 生成整套尺寸:
3. 写
.desktop~/.local/share/applications/crealityprint.desktop:注意:
Icon=只写名字CrealityPrint,不要写绝对路径Exec=用绝对路径;如果 AppImage 需要 FUSE,确保libfuse2已安装StartupWMClass=,值用运行后xprop WM_CLASS查到的类名校验:
4. 补用户级
hicolor/index.theme(关键)~/.local/share/icons/hicolor/index.theme:5. 刷新图标缓存
6. 清 DDE 的渲染缓存并重启 app-manager
然后重新打开启动器(或注销重登一次)。
三、验证清单
四、我踩过的坑
~/.local/share/icons/bloom/去覆盖当前主题。同名主题的
index.theme不是"合并",而是遮蔽:整套 bloom 图标会被降级成只有你放进去的那几个,其他地方全变通用图标。已撤销。Icon=写绝对路径不如主题名可靠。在 DDE 25 上,
Icon=/home/maf/apps/icon.png有时能显示、有时不能;改成主题名 + hicolor 后稳定。/usr/share是只读的(快照根)。别往
/usr/share/applications、/usr/share/icons里装东西,重启就没了;一律放~/.local/share。~/.cache/deepin/icons/*.png里存的是按内容哈希命名的渲染结果,旧图会一直命中;清掉并重启dde-application-manager才生效。.desktop文件名 = 换应用 ID。改名后旧缓存仍占着旧 ID,可能出现"两个同样的图标";改名后同样清一次缓存。
这套流程在 Blender、FreeCAD 1.1.3、CrealityPrint 7.2.1 上都验证过,装完启动器图标正常。核心就三件事:主题名 + hicolor 带 index.theme + 清 DDE 缓存。