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 | import XMonad
import XMonad hiding (Tall)
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Layout.LayoutHints
import XMonad.Layout.ResizableTile
import XMonad.Layout.Grid
import XMonad.Actions.CycleWS
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Util.Run(spawnPipe)
import System.Exit
import System.IO
import Data.Monoid
import XMonad.Layout.Grid
import XMonad.Actions.GridSelect
import XMonad.Layout.Tabbed
import XMonad.Layout.SimplestFloat
import qualified XMonad.StackSet as W
import qualified Data.Map as M
urgentColor = ("#8787af", "")
currentColor = ("#87afd7", "")
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ withUrgencyHook NoUrgencyHook
$ defaultConfig {
terminal = "urxvt",
modMask = mod4Mask,
workspaces = ["[1]:[pr0n]", "[2]:[irc]", "[3]:[code]", "[4]:[terms]", "[5]:[porr]", "[6]", "[7]", "[8]", "[9]:[music]"],
normalBorderColor = "#202020",
focusedBorderColor = "#8787af",
manageHook = myManageHook,
keys = myKeys,
mouseBindings = myMouseBindings,
layoutHook = myLayout,
logHook = dynamicLogWithPP $ xmobarPP {
ppOutput = hPutStrLn xmproc,
ppCurrent = xmobarColor (fst currentColor) (snd currentColor),
ppTitle = xmobarColor "#ffaf5f" "" . shorten 150
}
}
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod1Mask , xK_Return ), spawn $ XMonad.terminal conf)
, ((mod1Mask .|. shiftMask, xK_c ), kill)
, ((mod1Mask , xK_space ), sendMessage NextLayout)
, ((mod1Mask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
, ((modMask , xK_n ), refresh)
, ((mod1Mask , xK_Tab ), windows W.focusDown)
, ((mod1Mask , xK_j ), windows W.focusDown)
, ((mod1Mask , xK_k ), windows W.focusUp)
, ((mod1Mask , xK_m ), windows W.focusMaster)
, ((mod1Mask .|. shiftMask, xK_Return ), windows W.swapMaster)
, ((mod1Mask .|. shiftMask, xK_j ), windows W.swapDown)
, ((mod1Mask .|. shiftMask, xK_k ), windows W.swapUp)
, ((mod1Mask , xK_g ), goToSelected defaultGSConfig)
, ((mod1Mask , xK_h ), sendMessage Shrink)
, ((mod1Mask , xK_l ), sendMessage Expand)
, ((mod1Mask .|. shiftMask, xK_h ), sendMessage MirrorShrink)
, ((mod1Mask .|. shiftMask, xK_l ), sendMessage MirrorExpand)
, ((mod1Mask , xK_t ), withFocused $ windows . W.sink)
, ((mod1Mask , xK_i ), sendMessage (IncMasterN 1))
, ((mod1Mask , xK_d ), sendMessage (IncMasterN (-1)))
, ((mod1Mask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((mod4Mask , xK_q ), spawn "xmonad --recompile; xmonad --restart")
, ((mod1Mask , xK_p ), shellPrompt defaultXPConfig)
, ((0 , 0x1008ff13 ), spawn "amixer -q set Master 2dB+")
, ((0 , 0x1008ff11 ), spawn "amixer -q set Master 2dB-")
, ((0 , 0x1008ff12 ), spawn "amixer -q set Master toggle")
, ((0 , 0x1008ff16 ), spawn "mocp --prev")
, ((0 , 0x1008ff17 ), spawn "mocp --next")
, ((0 , 0x1008ff14 ), spawn "mocp --toggle-pause")
, ((mod1Mask , xK_Print ), spawn "scrot -e 'mv $f ~/Screenshots'")
]
++
[((m .|. mod1Mask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
++
[((m .|. mod1Mask, 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)]]
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod1Mask, button1), (\w -> focus w >> mouseMoveWindow w
>> windows W.shiftMaster))
, ((mod1Mask, button2), (\w -> focus w >> windows W.shiftMaster))
, ((mod1Mask, button3), (\w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster))
]
myLayout = avoidStruts $ layoutHints (simpleTabbed ||| tall ||| simplestFloat ||| Mirror tall ||| Full)
where
tall = ResizableTall nmaster delta ratio []
nmaster = 1
delta = 3/100
ratio = 1/2
myManageHook :: ManageHook
myManageHook = composeAll
[ className =? "mplayer2" --> doShift "1:pr0n"
, className =? "Firefox" --> doShift "2:irc"]
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | Config { font = "-misc-ohsnap.icons-medium-r-normal--11-79-100-100-c-60-iso8859-1"
, bgColor = "#080808"
, fgColor = "#404040"
, border = FullBM 0
, borderColor = "#151515"
, position = Top
, lowerOnStart = True
, commands = [ Run Network "wlan0" ["-L","50","-H","500","--low","#4779b3","--normal","#4779b3","--high","#bf85cc","-t","<dev> <tx> Kb/s"] 8
, Run DiskU [("/home","/home <fc=#87af5f><usedbar></fc>")] ["-f","å","-b","°"] 300
, Run Cpu ["-L","10","-H","75","--low","#87af5f","--normal","#C7F09F","--high","#d75f5f","-t","³ <total>"] 5
, Run Memory ["-L","180","-H","500","--low","#2b7694","--normal","#2b7694","--high","#53a6a6","-t","Î <used>/<total>"] 5
, Run Date "%H:%M" "date" 30
, Run StdinReader
, Run Com "amixer get Master | awk '/Mono: Playback/ {print $4}'" [] "vol" 30
, Run Com "mpc current|tail -n1" [] "br" 15
, Run Com "cat /home/simon/.logs/irssi_pipe|tail -n1" [] "irssi" 15
]
, sepChar = "%"
, alignSep = "}{"
, template = " %StdinReader%}{%wlan0% [%irssi%] %cpu% %memory% ê %br% <fc=#87af5f>Å</fc> %vol% | %disku% <fc=#4779b3>·</fc> %date% "
}
|
x