Skip to content

Instantly share code, notes, and snippets.

@jebenexer
Forked from correl/taffybar.hs
Last active August 29, 2015 14:27
Show Gist options
  • Save jebenexer/6353ed776b34a2f59f40 to your computer and use it in GitHub Desktop.
Save jebenexer/6353ed776b34a2f59f40 to your computer and use it in GitHub Desktop.
Xmonad Configuration
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, lowerOnStart = True
, commands = [ Run Weather "KLOM" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Battery ["-L", "15", "-H", "50", "--low", "red", "--high", "green", "--normal", "yellow"] 10
, Run Date "%a %b %_d %l:%M" "date" 10
, Run Com "/home/croush/bin/gmail_checker.rb" [] "gmail" 600
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% * %swap% | %battery% <fc=#ee9a00>%date%</fc> %gmail% | %KLOM%"
}
{-# LANGUAGE OverloadedStrings #-}
import XMonad
import XMonad.Actions.CopyWindow
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Spacing
import XMonad.Layout.NoBorders
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.EwmhDesktops
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys, additionalKeysP)
import System.IO
import XMonad.Actions.PhysicalScreens
myManageHook = composeAll
[ resource =? "Do" --> doIgnore
, className =? "Gimp" --> doFloat
, className =? "Vncviewer" --> doFloat
, title =? "Magic Launcher" --> doFloat
, title =? "Ediff" --> doFloat
, title =? "Minecraft 1.7.10"--> doShift "9:minecraft"
, title =? "Minecraft 1.7.10"--> doFloat
, title =? "Yakuake" --> doFloat
]
myBorderWidth = 10
myWorkspaces = ["1:dev", "2:chat", "3:web", "4", "5", "6", "7", "8", "9:minecraft"]
defaultLayout = tiled ||| Mirror tiled ||| Full
where
tiled = spacing 5 $ Tall nmaster delta ratio
nmaster = 1
ratio = 3/5
delta = 5/100
mediaLayout = noBorders $ Full
myLayout = onWorkspace "9:minecraft" mediaLayout $ defaultLayout
main = do
xmproc <- spawnPipe "xmobar ~/.xmonad/xmobarrc"
xmonad $ ewmh defaultConfig
{ manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
<+> manageHook defaultConfig
, handleEventHook = handleEventHook defaultConfig <+> fullscreenEventHook
, layoutHook = smartSpacing 15 $ avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, startupHook = setWMName "LG3D"
{-, modMask = mod4Mask -- Rebind Mod to the Windows key-}
{-, handleEventHook = fullScreenEventHook-}
, workspaces = myWorkspaces
, modMask = mod4Mask
, terminal = "konsole"
} `additionalKeys`
[((mod4Mask .|. mask, key), f sc)
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, mask) <- [(viewScreen, 0), (sendToScreen, shiftMask)]]
`additionalKeys`
[((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
, ((mod4Mask, xK_k), windows W.focusDown) -- %! Move focus to the next window
, ((mod4Mask, xK_j), windows W.focusUp ) -- %! Move focus to the previous window
, ((mod4Mask, xK_a), onPrevNeighbour W.view)
, ((mod4Mask, xK_o), onNextNeighbour W.view)
, ((mod4Mask .|. shiftMask, xK_a), onPrevNeighbour W.shift)
, ((mod4Mask .|. shiftMask, xK_o), onNextNeighbour W.shift)
, ((mod4Mask .|. shiftMask, xK_l ), spawn "slock")
, ((mod1Mask, xK_v ), windows copyToAll) -- @@ Make focused window always visible
, ((mod1Mask .|. shiftMask, xK_v ), killAllOtherCopies) -- @@ Toggle window state back
]
#!/bin/bash
xrdb -merge .Xresources
#trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 15 --height 12 --transparent true --tint 0x000000 &
trayer --edge top --align right --SetDockType true --SetPartialStrut true \
--expand true --width 10 --transparent true --tint 0x191970 --height 12 &
gnome-screensaver&
gnome-settings-daemon&
if [ -x /usr/bin/gnome-power-manager ] ; then
sleep 1
gnome-power-manager&
fi
if [ -x /usr/bin/nm-applet ] ; then
nm-applet --sm-disable &
fi
kmix --keepvisibility
ubuntuone-launch
dropbox start
nitrogen --start
#xcompmgr -c &
exec xmonad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment