You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何为「Show App Icon」启用颜色?自定义SVG图标灰色问题求助

Hey there! Let's tackle your two questions one by one:

Q1: 如何为「Show App Icon」启用颜色显示?

This usually depends on your desktop environment's theme settings—since you mentioned the "Show Apps" icon, I'll assume you're using GNOME Shell (the most common setup for this icon):

  • First, install GNOME Tweaks if you haven't already:
    • For Debian/Ubuntu-based systems: sudo apt install gnome-tweaks
    • For Fedora/RHEL-based systems: sudo dnf install gnome-tweaks
  • Open Tweaks, navigate to the Appearance tab.
  • Under the Icons section, select a theme that supports colored app icons. Default options like Adwaita or Yaru work great, or you can pick any third-party colored icon theme you prefer.
  • If you want a more custom workaround, you can manually replace the Show Apps icon file with a colored version (place it in ~/.local/share/icons/hicolor/scalable/actions/ and run gtk-update-icon-cache ~/.local/share/icons/hicolor/ to refresh the cache), but switching themes is the quickest and most maintainable fix.
Q2: 自定义SVG版「Show Apps」图标显示为灰色,如何修改颜色?

The grayed-out issue typically happens because your desktop theme forces monochrome styling via CSS, or your SVG uses dynamic color values that inherit the theme's default gray. Here are three reliable fixes:

Option 1: Edit the SVG directly (most straightforward)

  • Open your SVG file in an editor like Inkscape or a free online SVG tool.
  • Locate the main path elements of your icon. Look for attributes like fill="currentColor" or fill="inherit"—these are what let the theme override the icon's color to gray.
  • Replace that dynamic value with a fixed hex color, e.g., fill="#2196F3" (a bright blue) or any color you want. Save the file, and your icon will now display the chosen color instead of gray.

Option 2: Override the theme's CSS (for GNOME Shell)

  • If you want to keep dynamic coloring but change the theme's default gray:
    1. Open your theme's CSS file (system default is /usr/share/gnome-shell/theme/gnome-shell.css; use sudo for system files) with a text editor.
    2. Find the selector .show-apps-icon—it likely has a color: #some-gray-hex line.
    3. Replace that hex value with your preferred color, save the file.
    4. Restart GNOME Shell by pressing Alt+F2, typing r, and hitting Enter.
    • Note: System CSS files get overwritten during OS updates, so consider creating a custom theme if you want this change to persist long-term.

Option 3: Refresh the icon cache

  • After replacing or editing the SVG, make sure the system picks up your changes by updating the icon cache:
    gtk-update-icon-cache ~/.local/share/icons/hicolor/
    

内容的提问来源于stack exchange,提问作者Reivax

火山引擎 最新活动