Skip to content

Instantly share code, notes, and snippets.

@aragaer
Created July 27, 2017 20:09
Show Gist options
  • Save aragaer/013f667f30ba54605f5173dc3f8e1f95 to your computer and use it in GitHub Desktop.
Save aragaer/013f667f30ba54605f5173dc3f8e1f95 to your computer and use it in GitHub Desktop.
xmonad
Config {
font = "xft:Droid Sans Mono:size=9:bold:antialias=true"
bgColor = "#000000",
fgColor = "#ffffff",
position = Top,
lowerOnStart = True,
commands = [
Run CommandReader "~/Projects/pymodoro/pymodoro.py" "pomodoro"
,Run Kbd [("us", "US"), ("ru", "RU")]
,Run Date "%Y.%m.%d %H:%M:%S" "date" 10
,Run BatteryN ["BAT1"] ["-t", "<left>% <timeleft>"] 60 "battery"
,Run StdinReader
],
sepChar = "%",
alignSep = "}{",
template = "%StdinReader% }{ %pomodoro% | %battery% | %kbd% | <fc=#FFFFCC>%date%</fc> "
}
import System.IO
import XMonad
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run(spawnPipe)
-- Colors and Borders
xmobarTitleColor = "#FFB6B0" -- Current window title
xmobarCurrentWorkspaceColor = "#CEFFAC" -- Current workspace
defaults = defaultConfig {
modMask = mod4Mask,
terminal = "urxvt",
manageHook = composeAll [
className =? "mpv" --> doFloat,
isFullscreen --> doFullFloat,
manageHook defaultConfig],
layoutHook = avoidStruts $ smartBorders $ layoutHook desktopConfig,
handleEventHook = fullscreenEventHook,
startupHook = setWMName "LG3D"
} `additionalKeys` myKeys
myKeys = [
((mod4Mask, xK_n), spawn "touch ~/.pomodoro_session"),
((mod4Mask .|. shiftMask, xK_n), spawn "rm ~/.pomodoro_session"),
((mod4Mask, xK_apostrophe), sendMessage ToggleStruts)
]
main = do
xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobar.hs"
xmonad . docks $ defaults {
logHook = dynamicLogWithPP $ defaultPP {
ppOutput = System.IO.hPutStrLn xmproc
, ppTitle = xmobarColor xmobarTitleColor "" . shorten 100
, ppCurrent = xmobarColor xmobarCurrentWorkspaceColor "" . wrap "[" "]"
, ppSep = " "
, ppWsSep = " "
, ppLayout = (\ x -> case x of
"Spacing 6 Mosaic" -> "[:]"
"Spacing 6 Mirror Tall" -> "[M]"
"Spacing 6 Hinted Tabbed Simplest" -> "[T]"
"Spacing 6 Full" -> "[ ]"
_ -> x )
, ppHiddenNoWindows = showNamedWorkspaces
}
} where showNamedWorkspaces wsId = if any (`elem` wsId) ['a'..'z']
then pad wsId
else ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment