1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 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 "
|
x
Anomareh said about 10 years ago
Man, this is super crisp and clean! I find myself wishing the term colors were as crisp as the status bar, but it’s still a nice looking setup.
hokagemadura said about 10 years ago
haha thank you. i just generated the terminal color scheme and was too lazy to make them manually by hand. :D
Zypeh said about 9 years ago
Can I have your dzen2 bar’s config ? thanks
hokagemadura said about 9 years ago
@Zypeh i’m sorry i don’t use that anymore, and neither i have it anymore.. it’s basically conky piped to dzen2. but if you want to build one like that, i’ll gladly help you.
Zypeh said about 9 years ago
@hokagemadura Nevermind, I found your tutorial from your blog :-) Thanks yea
edited about 9 years ago
KusiKusa said about 8 years ago
@Zypeh where’s that tutorial/blog?