import XMonad import Control.Monad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.SetWMName import XMonad.Util.Run (spawnPipe) import XMonad.Util.EZConfig (additionalKeys, additionalMouseBindings) import XMonad.Util.SpawnOnce import XMonad.Util.Loggers import qualified XMonad.StackSet as W import qualified Data.Map as M import GHC.IO.Handle.Types as H import XMonad.Layout.Spacing import XMonad.Layout.Fullscreen import XMonad.Layout.NoBorders import XMonad.Layout.ResizableTile import XMonad.Layout.WindowArranger import XMonad.Actions.CycleWS (prevWS, nextWS) import System.IO ic = " ^i(/home/yotsuba/.xmonad/symbol/" i = " ^i(/home/yotsuba/.xmonad/xbm/" myws :: [String] myws = clickable $ [ i ++ "term.xbm) TERM " , i ++ "cat.xbm) WEB " , i ++ "edit2.xbm) INFO " , i ++ "pacman2.xbm) FILE " , i ++ "diskette.xbm) WORK " ] where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" | (i,ws) <- zip [1..] l, let n = i ] mkeys = [ ((mod4Mask, xK_Return), spawn "urxvt") , ((mod4Mask, xK_Left), prevWS) , ((mod4Mask, xK_Right), nextWS) , ((mod4Mask, xK_Up), sendMessage MirrorExpand) , ((mod4Mask, xK_Down), sendMessage MirrorShrink) , ((mod4Mask, xK_r), spawn "dmenu_run -b") , ((mod4Mask .|. shiftMask, xK_r), spawn "killall dzen2 && xmonad --restart") -- sound and others -- , ((mod4Mask .|. mod1Mask, xK_Up), spawn "amixer set Master 5%+") , ((mod4Mask .|. mod1Mask, xK_Down), spawn "amixer set Master 5%-") , ((0, xK_F9), spawn "mpc toggle") , ((0, xK_F11), spawn "mpc prev") , ((0, xK_F12), spawn "mpc next") , ((modm .|. controlMask , xK_s ), sendMessage Arrange ) , ((modm .|. controlMask .|. shiftMask, xK_s ), sendMessage DeArrange ) , ((modm .|. controlMask , xK_Left ), sendMessage (MoveLeft 10)) , ((modm .|. controlMask , xK_Right), sendMessage (MoveRight 10)) , ((modm .|. controlMask , xK_Down ), sendMessage (MoveDown 10)) , ((modm .|. controlMask , xK_Up ), sendMessage (MoveUp 10)) , ((modm .|. shiftMask, xK_Left ), sendMessage (IncreaseLeft 10)) , ((modm .|. shiftMask, xK_Right), sendMessage (IncreaseRight 10)) , ((modm .|. shiftMask, xK_Down ), sendMessage (IncreaseDown 10)) , ((modm .|. shiftMask, xK_Up ), sendMessage (IncreaseUp 10)) , ((modm .|. controlMask .|. shiftMask, xK_Left ), sendMessage (DecreaseLeft 10)) , ((modm .|. controlMask .|. shiftMask, xK_Right), sendMessage (DecreaseRight 10)) , ((modm .|. controlMask .|. shiftMask, xK_Down ), sendMessage (DecreaseDown 10)) , ((modm .|. controlMask .|. shiftMask, xK_Up ), sendMessage (DecreaseUp 10)) ] where modm = mod4Mask -- color -- black = "#333333" grey1 = "#BFBFBF" grey2 = "#7B7B7B" grey3 = "#EEEEEE" grey5 = "#DCDCDC" grey7 = "#194350" white = "#FFFFFF" blue1 = "#60B0D2" blue2 = "#5C86FF" blue3 = "#30B1B8" pink1 = "#E38179" navy1 = "#02151B" navy2 = "#46b0b3" navy3 = "#317876" redd1 = "#b84130" o = "sh /home/yotsuba/.xmonad/script/mpc.sh" apps = "^bg("++blue3++") ^fg(#ffffff)APPLICATION^fg() ^bg()" logBar h = do dynamicLogWithPP $ tryPP h tryPP :: Handle -> PP tryPP h = defaultPP { ppOutput = hPutStrLn h , ppCurrent = dzenColor (white) (redd1) . pad , ppVisible = dzenColor (white) (navy1) . pad , ppHidden = dzenColor (white) (navy1) . pad , ppHiddenNoWindows = dzenColor (grey7) (navy1) . pad , ppUrgent = dzenColor (blue1) (navy1) . pad , ppWsSep = "" , ppOrder = \(ws:l:t:_) -> [ws,l] , ppSep = "" -- " ^r(4x4) " , ppLayout = dzenColor (white) (blue3) . ( \t -> case t of "Spacing 2 Tall" -> " " ++ k ++ "tile.xbm) TILE " ) } where k = "^i(/home/yotsuba/.xmonad/ws/" myfn = "M+ 1m-8:Bold" -- layout -- res = ResizableTall 1 (2/100) (1/2) [] ful = noBorders (fullscreenFull Full) layout = avoidStruts (spacing 2 $ layoutHook defaultConfig ||| res ) ||| ful -- startup -- start :: X () start = do spawnOnce "compton -f -D8 -I0.05 -O0.05" spawnOnce "./.fehbg" main = do panel <- spawnPipe top panel2 <- spawnPipe "sh /home/yotsuba/.xmonad/script/kananatas.sh" xmonad $ defaultConfig { manageHook = manageDocks <+> manageHook defaultConfig , layoutHook = windowArrange layout , modMask = mod4Mask , focusedBorderColor = "#b84130" , normalBorderColor = "#02151B" , borderWidth = 4 , workspaces = myws , terminal = "urxvt" , startupHook = start , logHook = logBar panel } `additionalKeys` mkeys where top = "dzen2 -p -ta l -e 'button3=' -fn '" ++ myfn ++ "' -fg '" ++ black ++ "' -bg '" ++ navy1 ++ "' -w 400" ++ " -h 22 "