{"action":"created","issue":{"url":"https://api.github.com/repos/awesomeWM/awesome/issues/468","labels_url":"https://api.github.com/repos/awesomeWM/awesome/issues/468/labels{/name}","comments_url":"https://api.github.com/repos/awesomeWM/awesome/issues/468/comments","events_url":"https://api.github.com/repos/awesomeWM/awesome/issues/468/events","html_url":"https://github.com/awesomeWM/awesome/pull/468","id":107714553,"number":468,"title":"Enhance menubar icon path lookup","user":{"login":"nuko8","id":13826919,"avatar_url":"https://avatars.githubusercontent.com/u/13826919?v=3","gravatar_id":"","url":"https://api.github.com/users/nuko8","html_url":"https://github.com/nuko8","followers_url":"https://api.github.com/users/nuko8/followers","following_url":"https://api.github.com/users/nuko8/following{/other_user}","gists_url":"https://api.github.com/users/nuko8/gists{/gist_id}","starred_url":"https://api.github.com/users/nuko8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuko8/subscriptions","organizations_url":"https://api.github.com/users/nuko8/orgs","repos_url":"https://api.github.com/users/nuko8/repos","events_url":"https://api.github.com/users/nuko8/events{/privacy}","received_events_url":"https://api.github.com/users/nuko8/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/awesomeWM/awesome/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-09-22T13:25:42Z","updated_at":"2015-09-26T10:03:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/awesomeWM/awesome/pulls/468","html_url":"https://github.com/awesomeWM/awesome/pull/468","diff_url":"https://github.com/awesomeWM/awesome/pull/468.diff","patch_url":"https://github.com/awesomeWM/awesome/pull/468.patch"},"body":"The way of icon path lookup for `menubar` is enhanced so that it is\r\nbased on a theme-oriented way as described in the specification:\r\n\r\n  Icon Theme Specification, Ver. 0.12\r\n  http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html\r\n\r\nTo accomplish this:\r\n\r\n * Add the two new files `icon_theme.lua` and `index_theme.lua`.\r\n\r\n   The former implements an icon lookup algorithm suggested in the URL\r\n   above.  The latter implements a helper object to parse the cache file\r\n   `index.theme` of which data is used by the former.\r\n\r\n * Modify `menu_gen.lua` to use the new algorithm.\r\n\r\n   - The implementation of `lookup_category_icons` is changed\r\n     accordingly.\r\n   - The values of the field `all_categories.icon_name` are changed file\r\n     names to icon names, i.e., file extensions which are used to\r\n     indicate image file formats are removed.\r\n\r\n * Add the new file `icon_theme_spec.lua` for a unit test for checking\r\n   if `icon_theme.lua` together with `index_theme.lua` works as\r\n   expected.\r\n\r\n----\r\nI hope this fixes Issue #410.\r\n\r\nThe lookup algorithm depends on the status (i.e., defined or undefined) or the values of `$XDG_DATA_HOME` and `$XDG_DATA_DIRS`.  So, even if the modules work correctly, the unit test can fail in case those environmental variables are handled incorrectly.\r\n\r\n~~The default value of the icon theme name is `gtk-icon-theme-name`.~~  If not set,  the value is selected among`Adwaita`, `gnome` and `hicolor` in this order.\r\n\r\nThe icon theme name is can be set via `theme.icon_theme` of `theme.lua`, and it overwrites the default value.\r\n\r\nI'm not familiar with unit test stuff.  So, I'm quite open to rewriting it if necessary.\r\n\r\nOf course, other feedbacks are also welcome."},"comment":{"url":"https://api.github.com/repos/awesomeWM/awesome/issues/comments/143416724","html_url":"https://github.com/awesomeWM/awesome/pull/468#issuecomment-143416724","issue_url":"https://api.github.com/repos/awesomeWM/awesome/issues/468","id":143416724,"user":{"login":"Elv13","id":340384,"avatar_url":"https://avatars.githubusercontent.com/u/340384?v=3","gravatar_id":"","url":"https://api.github.com/users/Elv13","html_url":"https://github.com/Elv13","followers_url":"https://api.github.com/users/Elv13/followers","following_url":"https://api.github.com/users/Elv13/following{/other_user}","gists_url":"https://api.github.com/users/Elv13/gists{/gist_id}","starred_url":"https://api.github.com/users/Elv13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elv13/subscriptions","organizations_url":"https://api.github.com/users/Elv13/orgs","repos_url":"https://api.github.com/users/Elv13/repos","events_url":"https://api.github.com/users/Elv13/events{/privacy}","received_events_url":"https://api.github.com/users/Elv13/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T10:03:16Z","updated_at":"2015-09-26T10:03:16Z","body":"Sorry for comming late into the game here, but isn't better to simply use GTK for this, I never had any lockup with that code path and GTK provide 100% XDG icon theme support with caching https://github.com/Elv13/awesome-configs/blob/master/utils/fd_async.lua#L414\r\n\r\nCode like this PR is still necessary because Awesome doesn't depend on GTK, but I am not sure sure about the performance compared to just using GTK (when we can)"}}