{"action":"created","issue":{"url":"https://api.github.com/repos/travitch/taffybar/issues/240","repository_url":"https://api.github.com/repos/travitch/taffybar","labels_url":"https://api.github.com/repos/travitch/taffybar/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/travitch/taffybar/issues/240/comments","events_url":"https://api.github.com/repos/travitch/taffybar/issues/240/events","html_url":"https://github.com/travitch/taffybar/issues/240","id":273203856,"number":240,"title":"freedesktop menu widget breaks on nonexistent XDG_CONFIG_DIRS items, empty menu prefix","user":{"login":"benley","id":1432730,"avatar_url":"https://avatars1.githubusercontent.com/u/1432730?v=4","gravatar_id":"","url":"https://api.github.com/users/benley","html_url":"https://github.com/benley","followers_url":"https://api.github.com/users/benley/followers","following_url":"https://api.github.com/users/benley/following{/other_user}","gists_url":"https://api.github.com/users/benley/gists{/gist_id}","starred_url":"https://api.github.com/users/benley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benley/subscriptions","organizations_url":"https://api.github.com/users/benley/orgs","repos_url":"https://api.github.com/users/benley/repos","events_url":"https://api.github.com/users/benley/events{/privacy}","received_events_url":"https://api.github.com/users/benley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-12T05:19:38Z","updated_at":"2018-03-31T20:12:53Z","closed_at":"2018-03-31T20:12:53Z","author_association":"CONTRIBUTOR","body":"built at 2647bc9071fb926d460e447ba1c333c06736b7d7\r\n\r\nI'm running taffybar on NixOS, which sets various XDG_* variables somewhat differently than typical linux distros, and the menu widget is failing to load the system menus:\r\n\r\n```\r\n$ result/sw/bin/taffybar \r\nLaunching custom binary /home/benley/.cache/taffybar/taffybar-linux-x86_64\r\n\r\nReading /home/benley/.nix-profile/etc/xdg/menus/gnome-applications.menu\r\ntaffybar-linux-x86_64: /home/benley/.nix-profile/etc/xdg/menus/gnome-applications.menu: openFile: does not exist (No such file or directory)\r\n```\r\n\r\nRelevant environment:\r\n```\r\n$ env|grep XDG_\r\nXDG_VTNR=7\r\nXDG_SESSION_ID=6\r\nXDG_SESSION_TYPE=x11\r\nXDG_DATA_DIRS=/run/opengl-driver/share:/run/opengl-driver-32/share:/etc/per-user-pkgs/benley/share:/home/benley/.nix-profile/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share\r\nXDG_SESSION_DESKTOP=\r\nXDG_SESSION_CLASS=user\r\nXDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0\r\nXDG_CURRENT_DESKTOP=\r\nXDG_SEAT=seat0\r\nXDG_RUNTIME_DIR=/run/user/1000\r\nXDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session3\r\nXDG_CONFIG_DIRS=/etc/per-user-pkgs/benley/etc/xdg:/home/benley/.nix-profile/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg\r\n```\r\n\r\nIt looks like XDG_CONFIG_DIRS is the one that affects this.  Of the items listed in that variable, only `/run/current-system/sw/etc/xdg` contains a `menus` directory, but `getXdgConfigDir` just checks for the existence of the `..../etc/xdg` directory.  If there is no `menus` subdirectory, taffybar crashes.\r\n\r\nAlso, `menuWidgetNew` does not work in the case where XDG_MENU_PREFIX is empty and only `applications.menu` exists.  It currently requires that _some_ `*-applications.menu` file exists in an xdg config dir, but that's not always going to work.  On my system:\r\n\r\n```\r\n$ ls /run/current-system/sw/etc/xdg/menus/\r\napplications.menu  kinfocenter.menu\r\n```\r\n\r\nI'm invoking the widget as `menuWidgetNew Nothing` in my taffybar.hs."},"comment":{"url":"https://api.github.com/repos/travitch/taffybar/issues/comments/377720064","html_url":"https://github.com/travitch/taffybar/issues/240#issuecomment-377720064","issue_url":"https://api.github.com/repos/travitch/taffybar/issues/240","id":377720064,"user":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars3.githubusercontent.com/u/1246619?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"created_at":"2018-03-31T20:12:53Z","updated_at":"2018-03-31T20:12:53Z","author_association":"COLLABORATOR","body":"@benley @u11gh #242 fixed this correct? I'm going to close this, but feel free to reopen or comment if it is still an issue."}}
{"actor":{"display_login":"IvanMalison"}}