Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The following is required for the configuration of GridSelect
- {-# LANGUAGE NoMonomorphismRestriction #-}
- -- The first three imports are for the viewShift manageHook; see below.
- import Control.Monad (liftM2)
- import qualified Data.Map as M
- import qualified XMonad.StackSet as W
- import XMonad
- --import XMonad.Actions.DynamicWorkspaces
- import XMonad.Actions.GridSelect
- --import XMonad.Actions.NoBorders
- import XMonad.Hooks.InsertPosition
- import XMonad.Layout.Combo
- import XMonad.Layout.DragPane
- import XMonad.Layout.LayoutCombinators hiding ( (|||) )
- import XMonad.Layout.MouseResizableTile
- import XMonad.Layout.NoBorders
- import XMonad.Layout.SimpleDecoration
- import XMonad.Layout.Tabbed
- import XMonad.Layout.WindowNavigation
- import XMonad.Prompt
- import XMonad.Prompt.XMonad
- import XMonad.Util.EZConfig
- import XMonad.Util.Scratchpad
- import System.IO
- -------------------------------------------------
- -- Theme Settings
- -------------------------------------------------
- myActiveBGColor = "#333333"
- myInactiveBGColor = "#000000"
- myUrgentBGColor = "#ff0000"
- myActiveBorderColor = "#0077ff"
- myInactiveBorderColor = "#555555"
- myActiveTabBorderColor = myInactiveBorderColor
- myInactiveTabBorderColor = myActiveBGColor
- myUrgentTabBorderColor = myUrgentTextColor
- myActiveTextColor = myActiveBorderColor
- myInactiveTextColor = myInactiveBorderColor
- myUrgentTextColor = "#ffffff"
- myFontName = "drift"
- myDecoHeight = 15
- myDecoWidth = 1024
- -- Window Decoration Config (in simpleDecoration layout)
- mySDConfig = defaultTheme { activeColor = myActiveBGColor
- , inactiveColor = myInactiveBGColor
- , urgentColor = myUrgentBGColor
- , activeBorderColor = myActiveTabBorderColor
- , inactiveBorderColor = myInactiveTabBorderColor
- , urgentBorderColor = myUrgentTabBorderColor
- , activeTextColor = myActiveTextColor
- , inactiveTextColor = myInactiveTextColor
- , urgentTextColor = myUrgentTextColor
- , fontName = myFontName
- , decoHeight = myDecoHeight
- , decoWidth = myDecoWidth
- }
- -- Dmenu Config
- myDmenuRun = "dmenu_run -i -b -fn '" ++ myFontName ++ "' -nb '"
- ++ myInactiveBGColor ++ "' -nf '"
- ++ myInactiveTextColor ++ "' -sb '"
- ++ myActiveBGColor ++ "' -sf '"
- ++ myActiveTextColor ++ "'"
- -- Colorizer for GridSelect
- myColorizer = colorRangeFromClassName
- (0x00,0x00,0x00) -- lowest inactive bg
- (0x22,0x22,0x22) -- highest inactive bg
- (0x33,0x33,0x33) -- active bg
- (0x55,0x55,0x55) -- inactive fg
- (0x00,0x77,0xff) -- active fg
- where black = minBound
- white = maxBound
- -- GridSelect Config
- myGSConfig colorizer = (buildDefaultGSConfig colorizer) { gs_cellheight = 30
- , gs_cellwidth = 300
- , gs_font = myFontName
- }
- -- Tab Config (For tabbed layout)
- myTabConfig = defaultTheme { activeColor = myActiveBGColor
- , inactiveColor = myInactiveBGColor
- , urgentColor = myUrgentBGColor
- , activeBorderColor = myActiveTabBorderColor
- , inactiveBorderColor = myInactiveTabBorderColor
- , activeTextColor = myActiveTextColor
- , inactiveTextColor = myInactiveTextColor
- , urgentTextColor = myUrgentTextColor
- , fontName = myFontName
- , decoHeight = myDecoHeight
- }
- -- Twmnc Config (twmn is a notification program for tiling window managers. Below is a pop-up statusbar which only comes when called.
- -- It depends on a program called 'status', but it could also take the output of conky or similar.)
- myTwmnOptions = "--fn " ++ myFontName ++ " --pos bottom_right --bg '"
- ++ myActiveBGColor ++ "' --fg '"
- ++ myActiveTextColor ++ "'"
- myTwmnStatus = "twmnc -d 5000 -c \"$(status)\" " ++ myTwmnOptions
- -- XMonad Prompt Config
- myXPConfig = defaultXPConfig { font = myFontName
- , bgColor = myInactiveBGColor
- , fgColor = myInactiveTextColor
- , fgHLight = myActiveTextColor
- , bgHLight = myActiveBGColor
- , borderColor = myActiveTabBorderColor
- , promptBorderWidth = myBorderWidth
- , position = Bottom
- , height = myDecoHeight
- }
- -------------------------------------------------
- -- Other Settings
- -------------------------------------------------
- -- Borders
- myBorderWidth = 1
- myFocusedBorderColor = myActiveBorderColor
- myNormalBorderColor = myInactiveBorderColor
- -- Layouts
- myLayoutHook = noBorders (tabbed shrinkText myTabConfig) |||
- simpleDeco shrinkText mySDConfig (mouseResizableTile) |||
- --windowNavigation (combineTwo (dragPane Vertical 0.9 0.6) (tabbed shrinkText myTabConfig) (tabbed shrinkText myTabConfig))
- (simpleDeco shrinkText mySDConfig Full) *||* (tabbed shrinkText myTabConfig)
- --(tabbed shrinkText myTabConfig) *||* (simpleDeco shrinkText mySDConfig Full)
- -- Hooks
- newManageHook = insertPosition End Newer <+> myManageHook
- myManageHook = composeAll [ className =? "luakit" --> viewShift "2:www"
- , className =? "Firefox" --> viewShift "2:www"
- ]
- where viewShift = doF . liftM2 (.) W.greedyView W.shift
- -- Miscellaneous
- myModMask = mod4Mask
- myBrowser = "lk"
- myFirefox = "twmnc -c 'Starting Firefox...' & ff"
- myTerminal = "urxvtcd -e tmauto"
- myOtherTerminal = "urxvtcd"
- myTwmnd = "if [ -z $(pgrep twmnd) ] ; then (twmnd &) ; fi"
- myWorkspaces = [ "1:term"
- , "2:www"
- , "3:misc1"
- , "4:misc2"
- ]
- -- Main Function
- main = do
- spawn myTwmnd
- xmonad $ defaultConfig
- { focusedBorderColor = myFocusedBorderColor
- , normalBorderColor = myNormalBorderColor
- , layoutHook = myLayoutHook
- , manageHook = newManageHook
- , modMask = myModMask
- , terminal = myTerminal
- , workspaces = myWorkspaces
- }
- `additionalKeys`
- [ ((myModMask, xK_b), spawn myBrowser)
- , ((myModMask .|. shiftMask, xK_b), spawn myTwmnStatus)
- , ((myModMask, xK_f), spawn myFirefox)
- , ((myModMask, xK_g), goToSelected $ myGSConfig myColorizer)
- , ((myModMask .|. shiftMask, xK_g), bringSelected $ myGSConfig myColorizer)
- , ((myModMask, xK_p), xmonadPrompt myXPConfig)
- -- , ((myModMask, xK_w), selectWorkspace myXPConfig)
- , ((myModMask, xK_x), spawn myDmenuRun)
- , ((myModMask, xK_Left), sendMessage $ Go L)
- , ((myModMask, xK_Right), sendMessage $ Go R)
- , ((myModMask .|. controlMask, xK_Left), sendMessage Shrink)
- , ((myModMask .|. controlMask, xK_Right), sendMessage Expand)
- , ((myModMask .|. controlMask, xK_Return), spawn myOtherTerminal)
- ]
- `removeKeys`
- [ (myModMask, xK_e)
- , (myModMask, xK_h)
- , (myModMask, xK_l)
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement