Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menubar doesn't show all Numix(-Circle) icons due to special directory names #1675

Open
hexchain opened this issue Mar 26, 2017 · 3 comments

Comments

@hexchain
Copy link
Contributor

hexchain commented Mar 26, 2017

Output of awesome --version:

awesome v4.1 (Technologic)
• Compiled against Lua 5.3.4 (running with Lua 5.3)
• D-Bus support: ✔
• execinfo support: ✔
• xcb-randr version: 1.5
• LGI version: 0.9.1

How to reproduce the issue:

  1. Install Numix(-Circle) icon and use it in theme.lua
  2. Open menubar

Actual result:

No icon if .desktop does not specify one.

Expected result:

Menubar items are shown with correct icon.

By poking around in lib/menubar I guess awesome does not support unnormal size names for directory. A hardcoded table limits all possible directory names but Numix project uses special ones:

~ $ tree -L 2 /usr/share/icons/Numix-Circle/
/usr/share/icons/Numix-Circle/
├── 16
│   └── panel -> ../../Numix/16/panel
├── 16@2x -> 16
├── 22
│   └── panel -> ../../Numix/22/panel
├── 22@2x -> 22
├── 24
│   └── panel -> ../../Numix/24/panel
├── 24@2x -> 24
├── 48
│   └── apps
├── 48@2x -> 48
├── icon-theme.cache
└── index.theme

12 directories, 2 files

Actually there are code for index.theme parsing (and per Icon Theme Specification the correct way to find icon in a theme is to read that index file for possible paths), but it seems not used for application icons, only for category icons.

Manually adding 16, 22, 24 and 48 to all_icon_sizes table makes it work as expected but that's probably not the right solution.

@Veratil
Copy link
Contributor

Veratil commented Mar 26, 2017

For now your manually added strings is the best solution I think. That's actually using the utils icon lookup (one of the three in the codebase).

menubar is in need of a rewrite anyway; it's on the todo list. Handling unorthodox directory names is a good thing to watch out for though.

@rjhwelsh
Copy link

I noticed that menubar/utils.lua only searches for particular icon types; apps and categories. Presumably these are only icons that are fit for an application menu?

I think perhaps this bug should be turned into a feature request for generic icon search interface.

local function get_icon_lookup_path()

...

 local app_in_theme_paths = {}
    for _, icon_theme_directory in ipairs(icon_theme_paths) do
        for _, size in ipairs(all_icon_sizes) do
            table.insert(app_in_theme_paths,
                         glib.build_filenamev({ icon_theme_directory,
                                                size, 'apps' }))
            table.insert(app_in_theme_paths,
                         glib.build_filenamev({ icon_theme_directory,
                                                size, 'categories' }))
        end
    end

...

My related issue and a slight workaround is here.

@actionless
Copy link
Member

actionless commented Sep 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants