Permalink
Browse files

well working bluetileConfig with some cleanup

  • Loading branch information...
1 parent c394c6b commit f78142715570b872974b48a419bb7ef0f5611559 Jens Petersen committed Feb 3, 2012
Showing with 60 additions and 61 deletions.
  1. +60 −61 xmonad/xmonad.hs
View
@@ -2,23 +2,22 @@ import XMonad hiding ( (|||) )
import XMonad.Layout hiding ( (|||) )
import XMonad.Layout.BorderResize
import XMonad.Layout.BoringWindows
---import XMonad.Layout.ButtonDecoration
+import XMonad.Layout.ButtonDecoration
import XMonad.Layout.Decoration
---import XMonad.Layout.DecorationAddons
---import XMonad.Layout.DraggingVisualizer
+import XMonad.Layout.DecorationAddons
+import XMonad.Layout.DraggingVisualizer
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.Maximize
import XMonad.Layout.Minimize
import XMonad.Layout.MouseResizableTile
import XMonad.Layout.Named
import XMonad.Layout.NoBorders
import XMonad.Layout.TwoPane
---import XMonad.Layout.PositionStoreFloat
---import XMonad.Layout.WindowSwitcherDecoration
+import XMonad.Layout.PositionStoreFloat
+import XMonad.Layout.WindowSwitcherDecoration
---import XMonad.Actions.BluetileCommands
import XMonad.Actions.CycleWS
---import XMonad.Actions.FindEmptyWorkspace
+import XMonad.Actions.FindEmptyWorkspace
import XMonad.Actions.GroupNavigation
import XMonad.Actions.PhysicalScreens
import XMonad.Actions.Promote
@@ -28,14 +27,15 @@ import XMonad.Actions.Promote
--import XMonad.Hooks.CurrentWorkspaceOnTop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
-import XMonad.Hooks.FloatNext
-import XMonad.Hooks.ManageDocks
+--import XMonad.Hooks.FloatNext
+import XMonad.Hooks.ManageDocks (avoidStruts)
--import XMonad.Hooks.PositionStoreHooks
import XMonad.Hooks.RestoreMinimized
import XMonad.Hooks.ServerMode
--import XMonad.Hooks.WorkspaceByPos
-import XMonad.Config.Desktop
+import XMonad.Config.Bluetile
+import XMonad.Config.Gnome (gnomeRun)
import XMonad.Util.EZConfig
--import XMonad.Util.Replace
@@ -53,8 +53,6 @@ import System.Taffybar.XMonadLog (dbusLog)
import Web.Encodings (encodeHtml)
-changeBacklight = "xbacklight -time 20 -steps 2 "
-
myMouseBindings :: XConfig Layout -> M.Map (KeyMask, Button) (Window -> X ())
myMouseBindings (XConfig {XMonad.modMask = modMask'}) = M.fromList $
-- mod-button1 %! Move a floated window by dragging
@@ -73,59 +71,68 @@ isFloating w = do
ws <- gets windowset
return $ M.member w (W.floating ws)
-layout = desktopLayoutModifiers $ noBorders Full ||| TwoPane (3/100) (1/2) ||| tiled ||| Mirror tiled
- where
- -- default tiling algorithm partitions the screen into two panes
- tiled = Tall nmaster delta ratio
-
- -- The default number of windows in the master pane
- nmaster = 1
-
- -- Default proportion of screen occupied by master pane
- ratio = 1/2
-
- -- Percent of screen to increment by when resizing panes
- delta = 3/100
+bluetileLayout = avoidStruts $ minimize $ boringWindows $ (
+ named "Floating" floating |||
+ named "Tiled1" tiled1 |||
+ named "Tiled2" tiled2 |||
+ named "Fullscreen" fullscreen
+ )
+ where
+ floating = floatingDeco $ maximize $ borderResize $ positionStoreFloat
+ tiled1 = tilingDeco $ maximize $ mouseResizableTile { isMirrored = True }
+ tiled2 = tilingDeco $ maximize $ mouseResizableTile
+ fullscreen = tilingDeco $ maximize $ smartBorders Full
+ tilingDeco l = windowSwitcherDecorationWithButtons shrinkText bluetileTheme (draggingVisualizer l)
+ floatingDeco l = buttonDeco shrinkText bluetileTheme l
+ bluetileTheme = defaultThemeWithButtons { activeColor = "SteelBlue3"
+ , activeTextColor = "white"
+ , activeBorderColor = "SteelBlue2"
+ , inactiveColor = "gray88"
+ , inactiveTextColor = "black"
+ , inactiveBorderColor = "gray84"
+ , fontName = "xft:Sans:size=11"
+ }
myConfig =
- desktopConfig
- { modMask = mod4Mask, -- logo key
- manageHook = floatNextHook <+> manageDocks,
- layoutHook = layout,
- logHook = ewmhDesktopsLogHook <+> historyHook,
- handleEventHook = ewmhDesktopsEventHook
- `mappend` restoreMinimizedEventHook,
--- workspaces = ["1".."9"],
+ bluetileConfig
+ { layoutHook = bluetileLayout,
+ logHook = logHook bluetileConfig <+> historyHook,
keys = \cfg -> mkKeymap cfg (myKeymap cfg),
mouseBindings = myMouseBindings,
- focusFollowsMouse = True,
- focusedBorderColor = "#ff5500",
- terminal = "gnome-terminal"
+ focusedBorderColor = "gray",
+ normalBorderColor = "gray"
}
+spawnEmpty cmd = viewEmptyWorkspace >> spawn cmd
+
myKeymap c =
- [ ("M-b", nextMatchOrDo History (className =? "Google-chrome") (spawn "google-chrome"))
- , ("M-c", nextMatchOrDo History (className =? "Xchat-gnome") (spawn "xchat-gnome"))
- , ("M-e", nextMatchOrDo History (className =? "Emacs") (spawn "emacs"))
- , ("M-t", nextMatchOrDo History (className =? "Gnome-terminal") (spawn "gnome-terminal"))
- , ("M-v", nextMatchOrDo History (className =? "Virt-manager") (spawn "virt-manager"))
- , ("M-f", withFocused $ windows . (\w -> W.float w (W.RationalRect 0.4 0.4 0.6 0.6)))
- , ("M-S-f", withFocused $ windows . W.sink)
+ [ ("M-a", sendMessage $ JumpToLayout "Floating")
+ , ("M-s", sendMessage $ JumpToLayout "Tiled1")
+ , ("M-d", sendMessage $ JumpToLayout "Tiled2")
+ , ("M-f", sendMessage $ JumpToLayout "Fullscreen")
+ , ("M-m", withFocused minimizeWindow)
+ , ("M-S-m", sendMessage RestoreNextMinimizedWin)
+ , ("M-z", withFocused (sendMessage . maximizeRestore))
+ , ("M-b", nextMatchOrDo History (className =? "Google-chrome") (spawnEmpty "google-chrome"))
+ , ("M-c", nextMatchOrDo History (className =? "Xchat-gnome") (spawnEmpty "xchat-gnome"))
+ , ("M-e", nextMatchOrDo History (className =? "Emacs") (spawnEmpty "emacs"))
+ , ("M-t", nextMatchOrDo History (className =? "Gnome-terminal") (spawnEmpty "gnome-terminal"))
+ , ("M-v", nextMatchOrDo History (className =? "Virt-manager") (spawnEmpty "virt-manager"))
+
+ , ("M-g", gnomeRun)
, ("M-S-k", kill)
, ("M-l", nextMatch History (return True))
, ("M-S-l", spawn "xflock4")
- , ("M-m", windows W.focusMaster)
- , ("M-n", refresh)
+ , ("M-n", viewEmptyWorkspace)
+ , ("M-S-n", tagToEmptyWorkspace)
, ("M-q", spawn "xmonad --recompile; xmonad --restart")
, ("M-S-q", io (exitWith ExitSuccess))
- , ("M-u", floatNext True)
+ , ("M-r", refresh)
+ , ("M-S-t", spawn $ terminal c)
, ("M-x", spawn "gmrun")
- , ("M-S-x", spawn "xfce4-appfinder")
- , ("<XF86MonBrightnessDown>", spawn "xbacklight -10")
- , ("<XF86MonBrightnessUp>", spawn "xbacklight +10")
- , ("M-<Tab>", nextMatchWithThis Forward className)
- , ("M-S-<Tab>", windows W.focusDown)
- , ("M-<Return>", spawn $ terminal c)
+ , ("M-S-x", spawnEmpty "gmrun")
+ , ("M-<Tab>", windows W.focusDown)
+ , ("M-S-<Tab>", nextMatchWithThis Forward className)
, ("M-<Space>", sendMessage NextLayout)
, ("M-S-<Space>", setLayout $ XMonad.layoutHook c)
, ("M--", sendMessage Shrink)
@@ -137,17 +144,9 @@ myKeymap c =
[(m ++ "M-<F" ++ show n ++ ">", windows $ f w)
| (w, n) <- zip (XMonad.workspaces c) [1..9]
, (f, m) <- [(W.view, ""), (W.shift, "S-")]]
--- ++
--- [("M-" ++ show (n+1) , focusNth n) | n <- [0..8]]
++
[(m ++ "M-" ++ key, f sc)
| (key, sc) <- zip ["<Up>", "<Down>"] [0..]
, (f, m) <- [(viewScreen, ""), (sendToScreen, "S-")]]
-taffyPP = defaultPP { ppCurrent = wrap "<span foreground=\"red\">" "</span>"
- , ppTitle = (wrap "<b>" "</b>") . encodeHtml . shorten 90 }
-
-
-main = do
- dbusSess <- connectSession
- xmonad myConfig { logHook = logHook myConfig <+> dbusLog dbusSess taffyPP }
+main = xmonad myConfig

0 comments on commit f781427

Please sign in to comment.