taffybar-4.0.0: A desktop bar similar to xmobar, but with more GUI
Copyright2017 Ulf Jasper
LicenseBSD3-style (see LICENSE)
MaintainerUlf Jasper <ulf.jasper@web.de>
Stabilityunstable
Portabilityunportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Taffybar.Widget.XDGMenu.MenuWidget

Contents

Description

MenuWidget provides a hierachical GTK menu containing all applicable desktop entries found on the system. The menu is built according to the version 1.1 of the XDG "Desktop Menu Specification", see https://specifications.freedesktop.org/menu-spec/menu-spec-1.1.html

Synopsis

Usage

In order to use this widget add the following line to your taffybar.hs file:

import System.Taffybar.Widget.XDGMenu.MenuWidget
main = do
  let menu = menuWidgetNew $ Just "PREFIX-"

The menu will look for a file named "PREFIX-applications.menu" in the (subdirectory "menus" of the) directories specified by the environment variables XDG_CONFIG_HOME and XDG_CONFIG_DIRS. (If XDG_CONFIG_HOME is not set or empty then $HOME/.config is used, if XDG_CONFIG_DIRS is not set or empty then "etcxdg" is used). If no prefix is given (i.e. if you pass Nothing) then the value of the environment variable XDG_MENU_PREFIX is used, if it is set. If taffybar is running inside a desktop environment like Mate, Gnome, XFCE etc. the environment variables XDG_CONFIG_DIRS and XDG_MENU_PREFIX should be set and you may create the menu like this:

  let menu = menuWidgetNew Nothing

Now you can use menu as any other Taffybar widget.

menuWidgetNew Source #

Arguments

:: MonadIO m 
=> Maybe String

menu name, must end with a dash, e.g. "mate-" or "gnome-"

-> m Widget 

Create a new XDG Menu Widget.