Skip to content

Instantly share code, notes, and snippets.

@tzbob
Created July 16, 2013 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzbob/6007809 to your computer and use it in GitHub Desktop.
Save tzbob/6007809 to your computer and use it in GitHub Desktop.
[options]
resize_grip = false
scroll_on_output = false
scroll_on_keystroke = true
audible_bell = false
visible_bell = false
mouse_autohide = false
allow_bold = false
dynamic_title = true
urgent_on_bell = true
clickable_url = true
font = Inconsolata 10
scrollback_lines = 1000
search_wrap = true
icon_name = terminal
#geometry = 640x480
# 0.0: opaque, 1.0: transparent
transparency = 0.0
pseudo_transparency = false
# "system", "on" or "off"
cursor_blink = system
# "block", "underline" or "ibeam"
cursor_shape = underline
# $BROWSER is used by default
#browser = firefox
# word characters used for word selection
# (default if unset: all graphic non-punctuation/space characters)
#word_chars = -A-Za-z0-9,./?%&#:_=+@~
[colors]
background = #FEFEFE
foreground = #282828
foreground_bold = #888888
foreground_dim = #888888
cursor = #000000
# if unset, will reverse foreground and background
highlight = #2f2f2f
# black
color0 = #000000
# bright_black
color8 = #282828
# red
color1 = #a97475
# bright_red
color9 = #bb9091
# green
color2 = #75a974
# bright_green
color10 = #91bb90
# yellow
color3 = #a9a774
# bright_yellow
color11 = #bbb990
# blue
color4 = #7475a9
# bright_blue
color12 = #9091bb
# magenta
color5 = #a774a9
# bright_magenta
color13 = #b990bb
# cyan
color6 = #74a9a7
# bright_cyan
color14 = #90bbb9
# white
color7 = #c3c3c3
# bright_white
color15 = #AAAAAA
-`
.o+` tzbob@magi
`ooo/ OS: Arch Linux
`+oooo: Kernel: x86_64 Linux 3.9.9-1-ARCH
`+oooooo: Uptime: 4h 36m
-+oooooo+: Packages: 1033
`/:-:++oooo+: Shell: bash 4.2.45
`/++++/+++++++: Resolution: 1920x1080
`/++++++++++++++: WM: xmonad
`/+++ooooooooooooo/` WM Theme: Not Found
./ooosssso++osssssso+` GTK2 Theme: Numix
.oossssso-````/ossssss+` GTK3 Theme: Numix
-osssssso. :ssssssso. Icon Theme: Numix
:osssssss/ osssso+++. Font: Quantico 9
/ossssssss/ +ssssooo/- CPU: Intel Core i7-2630QM CPU @ 2.9GHz
`/ossssso+/:- -:/+osssso+- RAM: 3230MB / 7883MB
`+sso+:-` `.-/+oso:
`++:. `-/+/
.` `/
import XMonad
import Data.Monoid
import System.Exit
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.EwmhDesktops
import XMonad.Actions.UpdatePointer
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.Spacing
import XMonad.Util.Run(spawnPipe)
import System.IO(hPutStrLn)
import qualified XMonad.StackSet as W
import qualified Data.Map as M
myTerminal = "termite"
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
myModMask = mod4Mask
myWorkspaces = ["a ","s ","d ","f"]
myMainColor = "#822724"
myBgColor = "#EFEFEF"
myTextcolor = "#333333"
myLowColor = "#999999"
myBorderWidth = 0
myNormalBorderColor = myTextcolor
myFocusedBorderColor = myNormalBorderColor
-- Key bindings. Add, modify or remove key bindings here.
-------------------------------------------------------------------------------
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
-- close focused window
, ((modm .|. shiftMask, xK_c), kill)
-- Rotate through the available layout algorithms
, ((modm, xK_space ), sendMessage NextLayout)
-- Move focus to the next window
, ((modm, xK_j), windows W.focusDown)
-- Move focus to the previous window
, ((modm, xK_k), windows W.focusUp )
-- Swap the focused window and the master window
, ((modm, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window
, ((modm .|. shiftMask, xK_j), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modm .|. shiftMask, xK_k), windows W.swapUp )
-- Shrink the master area
, ((modm, xK_h), sendMessage Shrink)
-- Expand the master area
, ((modm, xK_l), sendMessage Expand)
-- Shrink a window
, ((modm, xK_u), sendMessage MirrorShrink)
-- Expand a window
, ((modm, xK_i), sendMessage MirrorExpand)
-- Push window back into tiling
, ((modm, xK_t), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area
, ((modm .|. shiftMask, xK_h), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
, ((modm .|. shiftMask, xK_l), sendMessage (IncMasterN (-1)))
-- Volume
, ((modm .|. controlMask , xK_j), spawn "amixer -q set Master 5- unmute")
, ((modm .|. controlMask , xK_k), spawn "amixer -q set Master 5+ unmute")
, ((modm .|. controlMask , xK_m), spawn "amixer set Master toggle")
-- Cover the status bar gap
, ((modm, xK_c), sendMessage ToggleStruts)
-- Programs
, ((modm, xK_p), spawn "dmenu_run")
, ((modm, xK_m), spawn "dmount")
, ((modm, xK_b), spawn "chromium")
-- Restart xmonad
, ((modm, xK_q), spawn "xmonad --recompile; xmonad --restart")
]
++
--
-- mod-[asdf], Switch to workspace N
-- mod-shift-[asdf], Move client to workspace N
--
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_a, xK_s, xK_d, xK_f]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
-- ++
--
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
--
--[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
-- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
--, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
-- Mouse bindings: default actions bound to mouse events
-------------------------------------------------------------------------------
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList
-- mod-button1, Set the window to floating mode and move by dragging
[ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
>> windows W.shiftMaster))
-- mod-button2, Raise the window to the top of the stack
, ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modm, button3), (\w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster))
]
-- Layouts
------------------------------------------------------------------------
myLayout = avoidStruts $ smartSpacing 5 $ tiled ||| Mirror tiled ||| Full
where
tiled = ResizableTall 1 (3/100) (3/5) []
-- Window rules:
-- > xprop | grep WM_CLASS
-------------------------------------------------------------------------------
myManageHook = manageDocks <+> composeAll
[ isFullscreen --> doFullFloat
--,
]
-- Event handling
-------------------------------------------------------------------------------
myEventHook = fullscreenEventHook
-- Status bars and logging
-------------------------------------------------------------------------------
addPad = wrap " " " "
myPP statusPipe = xmobarPP {
ppOutput = hPutStrLn statusPipe
, ppCurrent = xmobarColor myMainColor myBgColor . addPad
, ppHiddenNoWindows = xmobarColor myLowColor "" . addPad
, ppHidden = xmobarColor myTextcolor "" . addPad
, ppTitle = xmobarColor myTextcolor ""
, ppSep = xmobarColor myMainColor myBgColor " | "
}
myLogHook = updatePointer (Relative 0.5 0.5)
-- Startup hook
-------------------------------------------------------------------------------
myStartupHook = setWMName "LG3D"
-- Configuration structure
-------------------------------------------------------------------------------
--defaults statusPipe = ewmh defaultConfig {
defaults = ewmh defaultConfig {
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = myLogHook,
startupHook = myStartupHook
}
-- Run xmonad with the settings specified. No need to modify this.
-------------------------------------------------------------------------------
main = do
xmonad $ defaults --statusPipe
-- XMobar remnants
--myLogHook pipe = dynamicLogWithPP (myPP pipe) >> updatePointer (Relative 0.5 0.5)
--statusPipe <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment