taffybar-3.0.0: A desktop bar similar to xmobar, but with more GUI

Copyright | 2017 Ulf Jasper
License | BSD3-style (see LICENSE)
Maintainer | Ulf Jasper <ulf.jasper@web.de>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

System.Taffybar.Information.XDG.Protocol

Description

Implementation of version 1.1 of the XDG "Desktop Menu Specification", see https://specifications.freedesktop.org/menu-spec/menu-spec-1.1.html

Synopsis

- data XDGMenu = XDGMenu {
  - xmAppDir :: Maybe String
  - xmDefaultAppDirs :: Bool
  - xmDirectoryDir :: Maybe String
  - xmDefaultDirectoryDirs :: Bool
  - xmLegacyDirs :: [String]
  - xmName :: String
  - xmDirectory :: String
  - xmOnlyUnallocated :: Bool
  - xmDeleted :: Bool
  - xmInclude :: Maybe DesktopEntryCondition
  - xmExclude :: Maybe DesktopEntryCondition
  - xmSubmenus :: [XDGMenu]
  - xmLayout :: [XDGLayoutItem]
  }
- data DesktopEntryCondition
  - = Category String
  - | Filename String
  - | Not DesktopEntryCondition
  - | And [DesktopEntryCondition]
  - | Or [DesktopEntryCondition]
  - | All
  - | None
- readXDGMenu :: Maybe String -> IO (Maybe (XDGMenu, [DesktopEntry]))
- matchesCondition :: DesktopEntry -> DesktopEntryCondition -> Bool
- getXDGDesktop :: IO String
- getDirectoryDirs :: IO [FilePath]
- getApplicationEntries :: [String] -> XDGMenu -> IO [DesktopEntry]
- getPreferredLanguages :: IO [String]

# Documentation

data XDGMenu Source #

XDG Menu, cf. "Desktop Menu Specification".

Constructors

XDGMenu |

Fields

- xmAppDir :: Maybe String
- xmDefaultAppDirs :: Bool
- xmDirectoryDir :: Maybe String
- xmDefaultDirectoryDirs :: Bool
- xmLegacyDirs :: [String]
- xmName :: String
- xmDirectory :: String
- xmOnlyUnallocated :: Bool
- xmDeleted :: Bool
- xmInclude :: Maybe DesktopEntryCondition
- xmExclude :: Maybe DesktopEntryCondition
- xmSubmenus :: [XDGMenu]
- xmLayout :: [XDGLayoutItem]

Instances

Show XDGMenu Source # |
Instance details Defined in System.Taffybar.Information.XDG.Protocol Methods showsPrec :: Int -> XDGMenu -> ShowS Source # show :: XDGMenu -> String Source # showList :: [XDGMenu] -> ShowS Source #

data DesktopEntryCondition Source #

Combinable conditions for Include and Exclude statements.

Constructors

Category String |
Filename String |
Not DesktopEntryCondition |
And [DesktopEntryCondition] |
Or [DesktopEntryCondition] |
All |
None |

Instances

Eq DesktopEntryCondition Source # |
Instance details Defined in System.Taffybar.Information.XDG.Protocol Methods (==) :: DesktopEntryCondition -> DesktopEntryCondition -> Bool Source # (/=) :: DesktopEntryCondition -> DesktopEntryCondition -> Bool Source #
Read DesktopEntryCondition Source # |
Instance details Defined in System.Taffybar.Information.XDG.Protocol Methods readsPrec :: Int -> ReadS DesktopEntryCondition Source # readList :: ReadS [DesktopEntryCondition] Source # readPrec :: ReadPrec DesktopEntryCondition Source # readListPrec :: ReadPrec [DesktopEntryCondition] Source #
Show DesktopEntryCondition Source # |
Instance details Defined in System.Taffybar.Information.XDG.Protocol Methods showsPrec :: Int -> DesktopEntryCondition -> ShowS Source # show :: DesktopEntryCondition -> String Source # showList :: [DesktopEntryCondition] -> ShowS Source #

readXDGMenu :: Maybe String -> IO (Maybe (XDGMenu, [DesktopEntry])) Source #

Fetch menus and desktop entries and assemble the XDG menu.

matchesCondition :: DesktopEntry -> DesktopEntryCondition -> Bool Source #

Determine whether a desktop entry fulfils a condition.

getXDGDesktop :: IO String Source #

Determine current Desktop

getDirectoryDirs :: IO [FilePath] Source #

Return desktop directories

getApplicationEntries Source #

Arguments

:: [String] | Preferred languages
-> XDGMenu |
-> IO [DesktopEntry] |

Return a list of all available desktop entries for a given xdg menu.

getPreferredLanguages :: IO [String] Source #

Determine locale language settings