xmonad-vanessa 0.1.1.8 → 0.2.0.1
raw patch · 7 files changed
+28/−21 lines, 7 filesdep +semigroupsPVP ok
version bump matches the API change (PVP)
Dependencies added: semigroups
API changes (from Hackage documentation)
- XMonad.Util.Keyboard: anglisc :: KbLayout
Files
- README.md +1/−1
- cabal.project.local +2/−1
- src/XMonad/Config/Vanessa.hs +10/−7
- src/XMonad/Util/Brightness.hs +2/−2
- src/XMonad/Util/Keyboard.hs +4/−6
- src/XMonad/Util/Volume.hs +4/−3
- xmonad-vanessa.cabal +5/−1
README.md view
@@ -4,7 +4,7 @@ ## Requirements -Requires libxft-dev, amixer for volume, gnome-terminal, and setxkbmap to switch keyboard layouts.+Requires libxft-dev, amixer for volume, gnome-terminal or alacritty, and setxkbmap to switch keyboard layouts. ## Sugestions
cabal.project.local view
@@ -1,4 +1,5 @@ constraints: xmonad-vanessa -library with-compiler: ghc-8.2.2 optimization: 2-documentation: True+tests: true+documentation: true
src/XMonad/Config/Vanessa.hs view
@@ -1,5 +1,6 @@ {-# OPTIONS_GHC -fno-warn-missing-signatures #-}--- | Configuration with defaults I like and brightness adjustable for my computer and appropriate++-- | Configuration with defaults I like. module XMonad.Config.Vanessa (vConfig) where import qualified Data.Map as M@@ -24,6 +25,8 @@ import XMonad.Util.Run import XMonad.Util.Volume +-- TODO screenshot/wallpaper?+ -- | IO action of the whole thing vConfig :: IO () vConfig = xmonad . config' =<< spawnPipe "xmobar"@@ -42,8 +45,7 @@ musicString :: X String musicString = do winset <- gets windowset- {-- let p = (== "5") . fst --}- wt <- maybe (pure "") (fmap show . getName) . fmap snd . listToMaybe {--. filter p--} $ zip ((map tag . workspaces) winset) (allWindows winset)+ wt <- maybe (pure "") (fmap show . getName) . fmap snd . listToMaybe $ zip ((map tag . workspaces) winset) (allWindows winset) pure . xmobarColor "green" "black" . take 40 $ wt -- | Provides custom hooks to xmonad. This disables printing the window title/connects xmobar and xmonad.@@ -97,11 +99,13 @@ , ((modm .|. shiftMask, xK_n), spawn "firefox") , ((modm .|. controlMask, xK_Return), spawn "gnome-terminal") --launch bar- , ((modm, xK_p), spawn "yeganesh -x")+ , ((modm, xK_p), spawn "$(yeganesh -x)") --screenshots , ((0, xK_Print), spawn "cd ~/.screenshots && scrot") -- open scratchpad , ((modm .|. shiftMask, xK_p), withFocused (mconcat . sequence [float, mkSmall]))+ -- TODO: keybindings to move all windows in a workspace to another+ -- workspace? --shutdown etc. , ((modm .|. shiftMask, xK_End), spawn "shutdown now") -- lock screen@@ -112,9 +116,8 @@ , ((modm, xK_F3), setLang accented) , ((modm, xK_F4), setLang français) , ((modm, xK_F5), setLang deutsch)- , ((modm, xK_F6), setLang anglisc)- , ((modm, xK_F7), setLang dansk)- , ((modm, xK_F9), setLang dzongkha)+ , ((modm, xK_F6), setLang dansk)+ , ((modm, xK_F7), setLang dzongkha) -- hide windows , ((modm .|. shiftMask, xK_h), withFocused (mconcat . sequence [hide, hideWindow])) , ((modm, xK_u), popNewestHiddenWindow >> withFocused reveal)
src/XMonad/Util/Brightness.hs view
@@ -8,10 +8,10 @@ brighten :: Int -> X () brighten n = liftIO $ do currentBacklight <- readFile "/sys/class/backlight/intel_backlight/brightness"- length currentBacklight `seq` (writeFile "/sys/class/backlight/intel_backlight/brightness" (show . guard $ (read currentBacklight :: Int) + n))+ length currentBacklight `seq` writeFile "/sys/class/backlight/intel_backlight/brightness" (show . guard $ (read currentBacklight :: Int) + n) -- | Don't let the brightness be obnoxious guard :: Int -> Int-guard = (gu 2000) . (gl 0)+guard = gu 2000 . gl 0 where gu m n = if n > m then m else n gl m n = if n < m then m else n
src/XMonad/Util/Keyboard.hs view
@@ -9,7 +9,6 @@ , français , deutsch , dansk- , anglisc , dzongkha ) where @@ -23,6 +22,9 @@ -- | Datatype for a keyboard layout. data KbLayout = Simple String | Regional String String +-- Æ æ ð Ð þ Þ+-- TODO keybord w/ Ƿ/ƿ & Ȝ/ȝ+ instance Show KbLayout where show (Simple "us") = "US" show (Simple "layout") = "US"@@ -54,7 +56,7 @@ else pure (Regional (line 2) (line 3)) --- | keyboard layout for typing Tibetan text+-- | Tibetan keyboard layout tibetan :: KbLayout tibetan = Regional "cn" "tib" @@ -69,10 +71,6 @@ -- | Danish keyboard dansk :: KbLayout dansk = Simple "dk"---- | Icelandic keyboard; also good for typesetting Old English.-anglisc :: KbLayout-anglisc = Simple "is" -- | Dzongkha keyboard dzongkha :: KbLayout
src/XMonad/Util/Volume.hs view
@@ -1,11 +1,12 @@ -- | Utils to use to control volume via amixer module XMonad.Util.Volume where +import Data.Semigroup import XMonad -- | Generate action in the X monad to vol :: String -> X ()-vol = spawn . ((++) "amixer -D pulse sset Master ")+vol = spawn . (++) "amixer -D pulse sset Master " -- | Mute/unmute within the `X` Monad. toggleMute :: X ()@@ -13,8 +14,8 @@ -- | Raise volume raiseVolume :: (Integral a, Show a) => a -> X ()-raiseVolume n = vol $ (show n) ++ "%+"+raiseVolume n = vol $ show n <> "%+" -- | Lower volume lowerVolume :: (Integral a, Show a) => a -> X ()-lowerVolume n = vol $ (show n) ++ "%-"+lowerVolume n = vol $ show n <> "%-"
xmonad-vanessa.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: xmonad-vanessa-version: 0.1.1.8+version: 0.2.0.1 license: BSD3 license-file: LICENSE copyright: 2017-2018 Vanessa McHale@@ -43,6 +43,10 @@ process -any, X11 -any, transformers -any+ + if !impl(ghc >=8.0)+ build-depends:+ semigroups -any executable xmonad main-is: Main.hs