Created
March 19, 2019 14:45
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config { font = "-terminus-medium-*-*-*-*-14-*-*-*-*-*-*-*" | |
, additionalFonts = [] | |
, borderColor = "black" | |
, border = TopB | |
, bgColor = "darkblue" | |
, fgColor = "grey" | |
, alpha = 255 | |
, position = Top | |
, textOffset = -1 | |
, iconOffset = -1 | |
, lowerOnStart = True | |
, pickBroadest = False | |
, persistent = False | |
, hideOnStart = False | |
, iconRoot = "." | |
, allDesktops = True | |
, overrideRedirect = True | |
, commands = [ Run StdinReader | |
, Run Network "wlp4s0" [ "-L", "0" | |
, "-H", "32" | |
, "--normal", "green" | |
, "--high", "red" | |
] 10 | |
, Run Wireless "wlp4s0" [ "--template", "802.11: <essid> <quality>%" | |
] 10 | |
, Run Cpu ["--template", "CPU: <total>%", | |
"-L", "3", | |
"-H", "50", | |
"--normal", "green", | |
"--high","red" | |
] 10 | |
, Run Memory ["-t", "Mem: <usedratio>%"] 10 | |
, Run CoreTemp ["-t", "<core0>°C"] 10 | |
, Run Date "%a %Y-%m-%d %I:%M:%S%p" "date" 10 | |
, Run BatteryN ["BAT0"] [ "--template" , "Batt0: <acstatus>" | |
, "--Low" , "10" -- units: % | |
, "--High" , "80" -- units: % | |
, "--low" , "red" | |
, "--normal" , "orange" | |
, "--high" , "green" | |
, "--" -- battery specific options | |
-- discharging status | |
, "-o" , "<left>% (<timeleft>)" | |
-- AC "on" status | |
, "-O" , "<fc=#dAA520>Charging</fc>" | |
-- charged status | |
, "-i" , "<fc=green>Charged</fc>" | |
] 50 "battery0" | |
, Run BatteryN ["BAT1"] [ "--template" , "Batt1: <acstatus>" | |
, "--Low" , "10" -- units: % | |
, "--High" , "80" -- units: % | |
, "--low" , "red" | |
, "--normal" , "orange" | |
, "--high" , "green" | |
, "--" -- battery specific options | |
-- discharging status | |
, "-o" , "<left>% (<timeleft>)" | |
-- AC "on" status | |
, "-O" , "<fc=#dAA520>Charging</fc>" | |
-- charged status | |
, "-i" , "<fc=green>Charged</fc>" | |
] 50 "battery1" | |
] | |
, sepChar = "%" | |
, alignSep = "}{" | |
, template = "%StdinReader% }{ %cpu%, %coretemp% | %memory% | %wlp4s0wi% | <fc=#ee9a00>%date%</fc> | %battery0% %battery1%" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
import XMonad hiding ( (|||) ) | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.EZConfig | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Layout.LayoutCombinators | |
import XMonad.Layout.Renamed | |
import XMonad.Actions.CopyWindow | |
import XMonad.Actions.CycleWS | |
import XMonad.Layout.LayoutModifier | |
import qualified XMonad.StackSet as W | |
import XMonad.Hooks.EwmhDesktops (ewmh) | |
import XMonad.Hooks.UrgencyHook | |
import Graphics.X11.ExtraTypes.XF86 | |
main :: IO() | |
main = do | |
xmonad =<< localXmobar localConfig | |
toggleStrutsKey :: XConfig t -> (KeyMask, KeySym) | |
toggleStrutsKey XConfig{modMask = modm} = (modm, xK_b ) | |
localXmobar :: LayoutClass l Window | |
=> XConfig l -> IO (XConfig (ModifiedLayout AvoidStruts l)) | |
localXmobar conf = statusBar "xmobar" localXmobarPP toggleStrutsKey conf | |
localXmobarPP :: PP | |
localXmobarPP = def { ppCurrent = xmobarColor "yellow" "" | |
, ppTitle = xmobarColor "yellow" "" | |
, ppUrgent = xmobarColor "red" "" | |
} | |
localConfig = | |
withUrgencyHook NoUrgencyHook $ | |
ewmh $ | |
def { modMask = mod4Mask | |
, terminal = "urxvt" | |
, manageHook = manageDocks <+> manageHook def | |
, layoutHook = avoidStruts $ localLayout | |
} `additionalKeysP` localKeys `additionalKeys` volumeKeys `additionalKeys` brightnessKeys | |
-- Good thing we have to define this ourselves | |
tiled :: Tall a | |
tiled = Tall 1 (3/100) (1/2) | |
-- Even better we have to define this | |
localLayout = renamed [Replace "tiled"] tiled | |
||| renamed [Replace "mirror-tiled"] (Mirror tiled) | |
||| renamed [Replace "full"] Full | |
localKeys :: [([Char], X ())] | |
localKeys = [ ("M-m", sendMessage (JumpToLayout "full")) | |
, ("M-t", sendMessage (JumpToLayout "tiled")) | |
, ("M-v", sendMessage (JumpToLayout "mirror-tiled")) | |
, ("M-S-0", windows copyToAll) | |
, ("M-u", prevWS) | |
, ("M-i", nextWS) | |
, ("M-S-t", withFocused $ windows . W.sink) | |
] | |
volumeKeys :: [((KeyMask, KeySym), X ())] | |
volumeKeys = [ ((0, xF86XK_AudioMute), spawn "amixer -q set Master,0 toggle") | |
, ((0, xF86XK_AudioLowerVolume), spawn "amixer -q set Master,0 2%- unmute") | |
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer -q set Master,0 2%+ unmute") | |
, ((0, xF86XK_AudioMicMute), spawn "amixer -q set Capture,0 toggle") | |
] | |
brightnessKeys :: [((KeyMask, KeySym), X ())] | |
brightnessKeys = [ ((0, xF86XK_MonBrightnessDown), spawn "brightness down") | |
, ((0, xF86XK_MonBrightnessUp), spawn "brightness up") | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment