packages feed

dmenu 0.1.0.2 → 0.2.0.0

raw patch · 3 files changed

+148/−74 lines, 3 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

- DMenu: Options :: FilePath -> Bool -> Bool -> Bool -> Int -> Int -> String -> String -> Color -> Color -> Color -> Color -> Bool -> Options2 -> Bool -> Options
- DMenu: Options2 :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Int -> String -> String -> Double -> Double -> Color -> Int -> Int -> Int -> Int -> Int -> Color -> FilePath -> Options2
- DMenu: [_binaryPath] :: Options -> FilePath
- DMenu: [_caseInsensitive] :: Options -> Bool
- DMenu: [_displayAtBottom] :: Options -> Bool
- DMenu: [_displayNoItemsIfEmpty] :: Options2 -> Bool
- DMenu: [_dmenu2] :: Options -> Options2
- DMenu: [_filterMode] :: Options2 -> Bool
- DMenu: [_font] :: Options -> String
- DMenu: [_fuzzyMatching] :: Options2 -> Bool
- DMenu: [_grabKeyboardBeforeStdin] :: Options -> Bool
- DMenu: [_heightInPixels] :: Options2 -> Int
- DMenu: [_historyFile] :: Options2 -> FilePath
- DMenu: [_ignoreStdin] :: Options2 -> Bool
- DMenu: [_maskInputWithStar] :: Options2 -> Bool
- DMenu: [_noDMenu2] :: Options -> Bool
- DMenu: [_normalBGColor] :: Options -> Color
- DMenu: [_normalFGColor] :: Options -> Color
- DMenu: [_numLines] :: Options -> Int
- DMenu: [_printVersionAndExit] :: Options -> Bool
- DMenu: [_prompt] :: Options -> String
- DMenu: [_selectedBGColor] :: Options -> Color
- DMenu: [_selectedFGColor] :: Options -> Color
- DMenu: [_spawnOnMonitor] :: Options -> Int
- DMenu: [_spawnOnScreen] :: Options2 -> Int
- DMenu: [_tokenMatching] :: Options2 -> Bool
- DMenu: [_underlineColor] :: Options2 -> Color
- DMenu: [_underlineHeightInPixels] :: Options2 -> Int
- DMenu: [_width] :: Options2 -> Int
- DMenu: [_windowClass] :: Options2 -> String
- DMenu: [_windowDimColor] :: Options2 -> Color
- DMenu: [_windowDimOpacity] :: Options2 -> Double
- DMenu: [_windowName] :: Options2 -> String
- DMenu: [_windowOffsetX] :: Options2 -> Int
- DMenu: [_windowOffsetY] :: Options2 -> Int
- DMenu: [_windowOpacity] :: Options2 -> Double
+ DMenu.Lens: makeLensesL :: Name -> DecsQ

Files

dmenu.cabal view
@@ -1,7 +1,7 @@ name:   dmenu version:-  0.1.0.2+  0.2.0.0 synopsis:   Complete bindings to the dmenu and dmenu2 command line tools. description:
src/DMenu.hs view
@@ -17,7 +17,7 @@     filterM, filter, filterWithM, filterWith,      -- * @dmenu@ Command Line Options-    Options(..),+    Options(),     -- ** Lenses     binaryPath,     displayAtBottom,@@ -34,7 +34,7 @@     printVersionAndExit,      -- * @dmenu2@-specific Command Line Options-    Options2(..),+    Options2(),     -- ** Lenses     displayNoItemsIfEmpty,     filterMode,
src/DMenu/Options.hs view
@@ -6,43 +6,26 @@ import Control.Lens  import DMenu.Color+import DMenu.Lens  -- | Contains the binary path and command line options of dmenu. -- The option descriptions are copied from the @dmenu@ @man@ page. data Options = Options-  { -- | Path to the the dmenu executable file.-    --   Default looks for @dmenu@ in the @PATH@ enviroment variable.-    _binaryPath :: FilePath-    -- | @-b@; dmenu appears at the bottom of the screen.-  , _displayAtBottom :: Bool-    -- | @-f@; dmenu grabs the keyboard before reading stdin.  This is faster, but will lock up X until stdin reaches end-of-file.+  { _binaryPath              :: FilePath+  , _displayAtBottom         :: Bool   , _grabKeyboardBeforeStdin :: Bool-    -- | @-i@; dmenu matches menu items case insensitively.-  , _caseInsensitive :: Bool-    -- | @-m screen@; dmenu is displayed on the monitor number supplied. Monitor numbers are starting from 0.-  , _spawnOnMonitor :: Int-    -- | @-l lines@; dmenu lists items vertically, with the given number of lines.-  , _numLines :: Int-    -- | @-p prompt@; defines the prompt to be displayed to the left of the input field.-  , _prompt :: String-    -- | @-fn font@; defines the font or font set used. eg. @\"fixed\"@ or @\"Monospace-12:normal\"@ (an xft font)-  , _font :: String-    -- | @-nb color@; defines the normal background color.  @#RGB@, @#RRGGBB@, and X color names are supported.-  , _normalBGColor :: Color-    -- | @-nf color@; defines the normal foreground color.-  , _normalFGColor :: Color-    -- | @-sb color@; defines the selected background color.-  , _selectedBGColor :: Color-    -- | @-sf color@; defines the selected foreground color.-  , _selectedFGColor :: Color-    -- | @-v@; prints version information to stdout, then exits.-  , _printVersionAndExit :: Bool-    -- | Extra options only available in the dmenu2 fork.-  , _dmenu2 :: Options2-    -- | When set to @True@, the @dmenu2@ options in '_dmenu2' are ignored. This-    -- ensures compatibility with the normal @dmenu@. A user may set this flag-    -- in the configuration file.-  , _noDMenu2 :: Bool+  , _caseInsensitive         :: Bool+  , _spawnOnMonitor          :: Int+  , _numLines                :: Int+  , _prompt                  :: String+  , _font                    :: String+  , _normalBGColor           :: Color+  , _normalFGColor           :: Color+  , _selectedBGColor         :: Color+  , _selectedFGColor         :: Color+  , _printVersionAndExit     :: Bool+  , _dmenu2                  :: Options2+  , _noDMenu2                :: Bool   }  -- | Contains the command line options of @dmenu2@ which are not part of@@ -50,48 +33,139 @@ -- using @DMenu.filter@ instead of @DMenu.select@. The option descriptions are -- copied from the @dmenu2@ @man@ page. data Options2 = Options2-  { -- | @-q@; dmenu will not show any items if the search string is empty.-    _displayNoItemsIfEmpty :: Bool-    -- | @-r@; activates filter mode. All matching items currently shown in the list will be selected, starting with the item that is highlighted and wrapping around to the beginning of the list. (/Note/: Instead of setting this flag yourself, the @dmenu@ @filter@ functions can be used instead of the @select@ functions.)-  , _filterMode :: Bool-    -- | @-z@; dmenu uses fuzzy matching. It matches items that have all characters entered, in sequence they are entered, but there may be any number of characters between matched characters.  For example it takes @\"txt\"@ makes it to @\"*t*x*t\"@ glob pattern and checks if it matches.-  , _fuzzyMatching :: Bool-    -- | @-t@; dmenu uses space-separated tokens to match menu items. Using this overrides @-z@ option.-  , _tokenMatching :: Bool-    -- | @-mask@; dmenu masks input with asterisk characters (@*@).-  , _maskInputWithStar :: Bool-    -- | @-noinput@; dmenu ignores input from stdin (equivalent to: @echo | dmenu@).-  , _ignoreStdin :: Bool-    -- | @-s screen@; dmenu apears on the specified screen number. Number given corespondes to screen number in X optionsuration.-  , _spawnOnScreen :: Int-    -- | @-name name@; defines window name for dmenu. Defaults to @\"dmenu\"@.-  , _windowName :: String-    -- | @-class class@; defines window class for dmenu. Defaults to @\"Dmenu"@.-  , _windowClass :: String-    -- | @-o opacity@; defines window opacity for dmenu. Defaults to @1.0@.-  , _windowOpacity :: Double-    -- | @-dim opacity@; enables screen dimming when dmenu appers. Takes dim opacity as argument.-  , _windowDimOpacity :: Double-    -- | @-dc color@; defines color of screen dimming. Active only when @-dim@ in effect. Defautls to black (@#000000@)-  , _windowDimColor :: Color-    -- | @-h height@; defines the height of the bar in pixels.-  , _heightInPixels :: Int-    -- | @-uh height@; defines the height of the underline in pixels.+  { _displayNoItemsIfEmpty   :: Bool+  , _filterMode              :: Bool+  , _fuzzyMatching           :: Bool+  , _tokenMatching           :: Bool+  , _maskInputWithStar       :: Bool+  , _ignoreStdin             :: Bool+  , _spawnOnScreen           :: Int+  , _windowName              :: String+  , _windowClass             :: String+  , _windowOpacity           :: Double+  , _windowDimOpacity        :: Double+  , _windowDimColor          :: Color+  , _heightInPixels          :: Int   , _underlineHeightInPixels :: Int-    -- | @-x xoffset@; defines the offset from the left border of the screen.-  , _windowOffsetX :: Int-    -- | @-y yoffset@; defines the offset from the top border of the screen.-  , _windowOffsetY :: Int-    -- | @-w width@; defines the desired menu window width.-  , _width :: Int-    -- | @-uc color@; defines the underline color.-  , _underlineColor :: Color-    -- | @-hist <histfile>@; the file to use for history-  , _historyFile :: FilePath+  , _windowOffsetX           :: Int+  , _windowOffsetY           :: Int+  , _width                   :: Int+  , _underlineColor          :: Color+  , _historyFile             :: FilePath   } -makeLenses ''Options-makeLenses ''Options2+-- We create temporary lenses with suffix `L`, and then write wrappers for them+-- to attach documentation.+makeLensesL ''Options+makeLensesL ''Options2++-- | Path to the the dmenu executable file.+--   Default looks for @dmenu@ in the @PATH@ enviroment variable.+binaryPath :: Lens' Options FilePath+binaryPath = _binaryPathL+-- | @-b@; dmenu appears at the bottom of the screen.+displayAtBottom :: Lens' Options Bool+displayAtBottom = _displayAtBottomL+-- | @-f@; dmenu grabs the keyboard before reading stdin.  This is faster, but will lock up X until stdin reaches end-of-file.+grabKeyboardBeforeStdin :: Lens' Options Bool+grabKeyboardBeforeStdin = _grabKeyboardBeforeStdinL+-- | @-i@; dmenu matches menu items case insensitively.+caseInsensitive :: Lens' Options Bool+caseInsensitive = _caseInsensitiveL+-- | @-m screen@; dmenu is displayed on the monitor number supplied. Monitor numbers are starting from 0.+spawnOnMonitor :: Lens' Options Int+spawnOnMonitor = _spawnOnMonitorL+-- | @-l lines@; dmenu lists items vertically, with the given number of lines.+numLines :: Lens' Options Int+numLines = _numLinesL+-- | @-p prompt@; defines the prompt to be displayed to the left of the input field.+prompt :: Lens' Options String+prompt = _promptL+-- | @-fn font@; defines the font or font set used. eg. @\"fixed\"@ or @\"Monospace-12:normal\"@ (an xft font)+font :: Lens' Options String+font = _fontL+-- | @-nb color@; defines the normal background color.  @#RGB@, @#RRGGBB@, and X color names are supported.+normalBGColor :: Lens' Options Color+normalBGColor = _normalBGColorL+-- | @-nf color@; defines the normal foreground color.+normalFGColor :: Lens' Options Color+normalFGColor = _normalFGColorL+-- | @-sb color@; defines the selected background color.+selectedBGColor :: Lens' Options Color+selectedBGColor = _selectedBGColorL+-- | @-sf color@; defines the selected foreground color.+selectedFGColor :: Lens' Options Color+selectedFGColor = _selectedFGColorL+-- | @-v@; prints version information to stdout, then exits.+printVersionAndExit :: Lens' Options Bool+printVersionAndExit = _printVersionAndExitL+-- | Extra options only available in the dmenu2 fork.+dmenu2 :: Lens' Options Options2+dmenu2 = _dmenu2L+-- | When set to @True@, the @dmenu2@ options in '_dmenu2' are ignored. This+-- ensures compatibility with the normal @dmenu@. A user may set this flag+-- in the configuration file.+noDMenu2 :: Lens' Options Bool+noDMenu2 = _noDMenu2L++-- | @-q@; dmenu will not show any items if the search string is empty.+displayNoItemsIfEmpty :: Lens' Options2 Bool+displayNoItemsIfEmpty = _displayNoItemsIfEmptyL+-- | @-r@; activates filter mode. All matching items currently shown in the list will be selected, starting with the item that is highlighted and wrapping around to the beginning of the list. (/Note/: Instead of setting this flag yourself, the @dmenu@ @filter@ functions can be used instead of the @select@ functions.)+filterMode :: Lens' Options2 Bool+filterMode = _filterModeL+-- | @-z@; dmenu uses fuzzy matching. It matches items that have all characters entered, in sequence they are entered, but there may be any number of characters between matched characters.  For example it takes @\"txt\"@ makes it to @\"*t*x*t\"@ glob pattern and checks if it matches.+fuzzyMatching :: Lens' Options2 Bool+fuzzyMatching = _fuzzyMatchingL+-- | @-t@; dmenu uses space-separated tokens to match menu items. Using this overrides @-z@ option.+tokenMatching :: Lens' Options2 Bool+tokenMatching = _tokenMatchingL+-- | @-mask@; dmenu masks input with asterisk characters (@*@).+maskInputWithStar :: Lens' Options2 Bool+maskInputWithStar = _maskInputWithStarL+-- | @-noinput@; dmenu ignores input from stdin (equivalent to: @echo | dmenu@).+ignoreStdin :: Lens' Options2 Bool+ignoreStdin = _ignoreStdinL+-- | @-s screen@; dmenu apears on the specified screen number. Number given corespondes to screen number in X configuration.+spawnOnScreen :: Lens' Options2 Int+spawnOnScreen = _spawnOnScreenL+-- | @-name name@; defines window name for dmenu. Defaults to @\"dmenu\"@.+windowName :: Lens' Options2 String+windowName = _windowNameL+-- | @-class class@; defines window class for dmenu. Defaults to @\"Dmenu"@.+windowClass :: Lens' Options2 String+windowClass = _windowClassL+-- | @-o opacity@; defines window opacity for dmenu. Defaults to @1.0@.+windowOpacity :: Lens' Options2 Double+windowOpacity = _windowOpacityL+-- | @-dim opacity@; enables screen dimming when dmenu appers. Takes dim opacity as argument.+windowDimOpacity :: Lens' Options2 Double+windowDimOpacity = _windowDimOpacityL+-- | @-dc color@; defines color of screen dimming. Active only when @-dim@ in effect. Defautls to black (@#000000@)+windowDimColor :: Lens' Options2 Color+windowDimColor = _windowDimColorL+-- | @-h height@; defines the height of the bar in pixels.+heightInPixels :: Lens' Options2 Int+heightInPixels = _heightInPixelsL+-- | @-uh height@; defines the height of the underline in pixels.+underlineHeightInPixels :: Lens' Options2 Int+underlineHeightInPixels = _underlineHeightInPixelsL+-- | @-x xoffset@; defines the offset from the left border of the screen.+windowOffsetX :: Lens' Options2 Int+windowOffsetX = _windowOffsetXL+-- | @-y yoffset@; defines the offset from the top border of the screen.+windowOffsetY :: Lens' Options2 Int+windowOffsetY = _windowOffsetYL+-- | @-w width@; defines the desired menu window width.+width :: Lens' Options2 Int+width = _widthL+-- | @-uc color@; defines the underline color.+underlineColor :: Lens' Options2 Color+underlineColor = _underlineColorL+-- | @-hist <histfile>@; the file to use for history+historyFile :: Lens' Options2 FilePath+historyFile = _historyFileL+  defOptions :: Options defOptions = Options