Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------------
- -- ~/.xmonad/xmonad.hs
- -- validate syntax: xmonad --recompile
- {-# LANGUAGE NoMonomorphismRestriction #-}
- ------------------------------------------------------------------------
- -- Import -------------------------------------------------
- --import XMonad -- XMonad
- import XMonad hiding ( (|||) )
- import qualified XMonad.StackSet as W -- Keys
- import qualified Data.Map as M -- Keys
- import System.Exit -- Exit
- import XMonad.Hooks.DynamicLog -- Xmobar
- import XMonad.Hooks.UrgencyHook -- Urgent
- import XMonad.Hooks.InsertPosition -- Focus windows
- import XMonad.Hooks.ManageHelpers -- Helper functions
- import XMonad.Hooks.ManageDocks -- App workspace
- import XMonad.Hooks.EwmhDesktops
- import XMonad.Hooks.FadeInactive(setOpacity)
- import XMonad.Layout.ResizableTile -- Rezise
- import XMonad.Layout.Tabbed -- Tab
- import XMonad.Layout.Named -- Named
- import XMonad.Layout.SubLayouts -- Sub layouts
- import XMonad.Layout.Simplest -- Simple Layout
- import XMonad.Layout.WindowNavigation -- Windows navigator
- import XMonad.Layout.LayoutHints
- import XMonad.Layout.LayoutModifier
- import XMonad.Layout.NoBorders
- import XMonad.Layout.Spacing
- import XMonad.Layout.Reflect
- import XMonad.Layout.IM
- import XMonad.Layout.ComboP
- import XMonad.Layout.TwoPane
- import XMonad.Layout.Named
- import XMonad.Layout.LayoutCombinators
- import XMonad.Layout.PerWorkspace
- import XMonad.Actions.GridSelect -- Grid
- import XMonad.Actions.CopyWindow -- Copy window to workspace
- import XMonad.Actions.WindowGo -- RunOrRaise, etc
- import XMonad.Actions.FloatKeys
- import XMonad.Actions.Commands
- import XMonad.Prompt
- import XMonad.Prompt.Shell
- import XMonad.Util.NamedScratchpad
- import XMonad.Config.Kde
- import XMonad.ManageHook
- import XMonad.Util.Run
- -- подключаем библиотеки X11
- import Foreign.C.Types (CLong)
- --import XMonad.Layout.BoringWindows --
- import Data.List
- import qualified Data.Map as M
- import Data.Monoid
- import Graphics.X11
- import Graphics.X11.Xlib.Extras
- import System.Exit
- import System.IO
- -----------------------------------------------------------
- scratchpads = [
- NS "scratchpad" "~/bin/scratchpad" (resource =? "scratchpad") defaultFloating ,
- NS "stardict" "stardict" (className =? "Stardict")
- (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
- ] where role = stringProperty "WM_WINDOW_ROLE"
- -- Main -------------------------------------------------------
- main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig
- myConfig = ewmh defaultConfig
- { terminal = "urxvt"
- , borderWidth = 1
- , modMask = mod4Mask
- , normalBorderColor = myNormalBorderColor
- , focusedBorderColor = myFocusedBorderColor
- , keys = myKeys
- , layoutHook = myLayout
- , manageHook = myManage <+> manageMenus <+> manageDialogs
- , workspaces = myWorkspaces
- -- , logHook = dynamicLogWithPP $ myDzenPP dzen
- }
- ---------------------------------------------------------------
- -- Bar ---------
- myBar = "xmobar"
- --myBar = "dzen2"
- ----------------
- ------------------------------------------------------------------
- -- Custom Bar ------------------------------------------------
- myPP = xmobarPP { ppCurrent = xmobarColor "#6587a8" ""
- , ppUrgent = xmobarColor "#fab20c" "" . wrap "[" "]"
- , ppTitle = xmobarColor "#afafaf" "" . shorten 40
- , ppSep = xmobarColor "#6587a8" "" " >> "
- }
- -----------------------------------------------------------------------
- -- Fonts and colours ------------------------------------
- -- Color, font and iconpath definitions:
- myFont = "-xos4-terminus-medium-r-normal-*-14-*-*-*-c-*-iso10646-1"
- myIconDir = "/home/neg/.dzen"
- myDzenFGColor = "#555555"
- myDzenBGColor = "#222222"
- myNormalFGColor = "#ffffff"
- myNormalBGColor = "#0f0f0f"
- myNormalBorderColor = "#202020"
- myFocusedBorderColor = "#404040"
- myFocusedFGColor = "#f0f0f0"
- myFocusedBGColor = "#333333"
- myUrgentFGColor = "#0099ff"
- myUrgentBGColor = "#0077ff"
- myIconFGColor = "#777777"
- myIconBGColor = "#0f0f0f"
- mySeperatorColor = "#555555"
- ------------------------------------------------------------------
- -- XPConfig conf ----------------------------------------
- myXPConfig = defaultXPConfig
- {
- --font = "-elite-laptop-bold-r-normal--28-280-72-72-c-140-koi8-r"
- font = "xft:Terminus"
- , bgColor = "#000000"
- , fgColor = "#ffffff"
- , fgHLight = "#ffffff"
- , bgHLight = "#00ffff"
- , borderColor = "#000000"
- , promptBorderWidth = 1
- , position = Bottom
- , height = 32
- , historySize = 100
- --, historyFilter = ""
- --, promptKeymap = ""
- --, completionKey = ""
- --, defaultText = ""
- --, autoComplete = "KeySym"
- --, showCompletionOnTab = ""
- }
- ------------------------------------------------------------
- -- 4. Additional ManageHooks
- ------------------------------------------------------------
- manageConkeror :: ManageHook
- manageConkeror =
- className =? "Conkeror"
- --> composeOne
- [ ("*" `isPrefixOf`) `fmap` title -?> doF W.focusDown
- , stringProperty "WM_WINDOW_ROLE" =? "console" -?> doFlopDown ]
- manageDocs :: ManageHook
- manageDocs = composeOne
- [ className =? c -?> doShift "4:docs"
- | c <- [ "Xpdf"
- , "Zathura"
- ]]
- -- liftX lifts a normal X action into a Query (as expected by -->)
- -- idHook ensures the proper return type
- manageEmacs :: ManageHook
- manageEmacs =
- className =? "Emacs"
- --> (ask >>= doF . \w -> (copyWindow w "3:emacs"))
- <+> (ask >>= \w -> liftX (setOpacity w 0.9) >> idHook)
- manageGimp :: ManageHook
- manageGimp =
- className =? "Gimp"
- --> (doShift "8:gimp")
- <+> composeOne
- [ stringProperty "WM_WINDOW_ROLE" =? "gimp-image-window"
- -?> doCenterFloat
- , stringProperty "WM_WINDOW_ROLE" =? "gimp-image-new"
- -?> doCenterFloat
- , stringProperty "WM_WINDOW_ROLE" =? "gimp-dock"
- -?> doTopRightFloat
- , stringProperty "WM_WINDOW_ROLE" =? "gimp-toolbox"
- -?> doTopLeftFloat
- , stringProperty "WM_WINDOW_ROLE" =? "gimp-toolbox-color-dialog"
- -?> doBottomRightFloat
- , return True -?> doFloat ]
- manageImages :: ManageHook
- manageImages = composeOne
- [ className =? c
- -?> doTopLeftFloat
- <+> (ask >>= doF . \w -> (copyWindow w "5:images"))
- | c <- [ "feh"
- , "Display"
- ]]
- manageTerm :: ManageHook
- manageTerm = composeOne
- [ className =? c
- -?> (ask >>= \w -> liftX (setOpacity w 0.9) >> idHook)
- <+> (ask >>= doF . \w -> (copyWindow w "7:term"))
- | c <- [ "URxvt"
- , "XTerm"
- ]]
- manageTransient :: ManageHook
- manageTransient =
- composeAll
- [ (className =? "Xmessage"
- --> doCenterFloat
- <+> (ask >>= \w -> liftX (setOpacity w 0.7) >> idHook))
- , (stringProperty "WM_NAME" =? "xine Panel"
- --> doBottomRightFloat
- <+> (ask >>= \w -> liftX (setOpacity w 0.7) >> idHook))
- ]
- manageVideo :: ManageHook
- manageVideo = composeOne
- [ className =? c -?> (ask >>= doF . \w -> (copyWindow w "6:video"))
- | c <- [ "MPlayer"
- , "xine"
- ]]
- manageWeb :: ManageHook
- manageWeb = composeOne
- [ className =? c -?> (ask >>= doF . \w -> (copyWindow w "2:web"))
- | c <- [ "Conkeror"
- , "Dillo"
- , "Firefox"
- ]]
- ------------------------------------------------------------
- -- 5. ManageHook Helpers
- ------------------------------------------------------------
- doFlopDown :: ManageHook
- doFlopDown = doF (W.focusUp . W.swapDown)
- doTopRightFloat :: ManageHook
- doTopRightFloat = ask
- >>= \w -> doF . W.float w . position . snd
- =<< liftX (floatLocation w)
- where
- position (W.RationalRect _ _ w h) = W.RationalRect (1-w) 0.03 w h
- doTopLeftFloat :: ManageHook
- doTopLeftFloat = ask
- >>= \w -> doF . W.float w . position . snd
- =<< liftX (floatLocation w)
- where
- position (W.RationalRect _ _ w h) = W.RationalRect 0 0.03 w h
- doBottomRightFloat :: ManageHook
- doBottomRightFloat = ask
- >>= \w -> doF . W.float w . position . snd
- =<< liftX (floatLocation w)
- where
- position (W.RationalRect _ _ w h) = W.RationalRect (1-w) (1-h) w h
- doBottomLeftFloat :: ManageHook
- doBottomLeftFloat = ask
- >>= \w -> doF . W.float w . position . snd
- =<< liftX (floatLocation w)
- where
- position (W.RationalRect _ _ w h) = W.RationalRect 0 (1-h) w h
- ------------------------------------------------------------------
- -- Workspaces ----------------------------------------------
- myWorkspaces = ["1:term", "2:web", "3:book", "4:media", "7:other"]
- ------------------------------------------------------------------
- -- <grid-select>
- myColorizer = colorRangeFromClassName
- (0x00,0x00,0x00) -- lowest inactive bg
- (0xBB,0xAA,0xFF) -- highest inactive bg
- (0x88,0x66,0xAA) -- active bg
- (0xBB,0xBB,0xBB) -- inactive fg
- (0x00,0x00,0x00) -- active fg
- where
- black = minBound
- white = maxBound
- --myGSConfig colorizer = (buildDefaultGSConfig myColorizer)
- -- { gs_cellheight = 50
- -- , gs_cellwidth = 200
- -- , gs_cellpadding = 10
- -- , gs_font = "xft:Terminus"
- -- }
- ------------------------------------------------------------------
- --Layouts --------------------------------------------------
- ------------------------------------------------------------------
- myLayout = avoidStruts $ windowNavigation $ addTabs shrinkText myTheme $ spacing 6 $
- tall ||| mtall ||| term
- where
- rt = ResizableTall 1 (3/100) (1/2) []
- tall = named "Tall" $ subLayout [0,1,2] (Simplest) $ rt
- mtall = named "Mirror" $ subLayout [0,1,2] (Simplest) $ Mirror rt
- term_rt = ResizableTall 1 (3/100) (1/4) []
- term = named "term" $ reflectHoriz $ combineTwoP (term_rt) (mtall) (Simplest) (ClassName "Kopete")
- fullscreenLayout = named "fullscreen" $ noBorders Full
- ------------------------------------------------------------------
- -- Manage ----------------------------------------------------
- ------------------------------------------------------------------
- myManage = namedScratchpadManageHook scratchpads <+> manageDocks
- <+> composeAll [ isFullscreen --> doFullFloat
- , className =? "Thunar" --> doFloat
- , className =? "Gimp-2.6" --> doFloat
- , className =? "MPlayer" --> doFloat
- , resource =? "MainTerminal" --> doShift "1:term"
- -- , transience'
- , className =? "Firefox" --> doShift "2:web"
- , className =? "Gimp-2.6" --> doShift "4:media"
- , className =? "Gimp-2.6" --> doShift "4:media"
- , className =? "Okular" --> doShift "3:book"
- ]
- -------------------------------------------------------------------------
- -- Whether focus follows the mouse pointer.
- --myFocusFollowsMouse :: Bool
- --myFocusFollowsMouse = False
- -------------------------------------------------------------------------
- ------------------------------------------------------------------
- -- Custom Tab----------------------------------------------
- -- Theme options:
- ------------------------------------------------------------------
- myTheme = defaultTheme
- { activeColor = "#222222"
- , inactiveColor = "#000000"
- , urgentColor = "#110000"
- , activeBorderColor = "#222222"
- , inactiveBorderColor = "#000000"
- , urgentBorderColor = "#cc0000"
- , activeTextColor = "#aaaaaa"
- , inactiveTextColor = "#888888"
- , urgentTextColor = "#cc0000"
- , fontName = "" ++ myFont ++ ""
- -- , decoWidth = "29"
- -- , decoHeight = "29"
- }
- -----------------------------------------------------------
- ------------------------------------------------------------------
- -- Statusbar options:
- ------------------------------------------------------------------
- --myStatusBar = "xmobar"
- myStatusBar = "dzen2 -x '0' -y '0' -h '16' -w '1300' -ta 'l' -fg '" ++ myNormalFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
- --myTopBar = "conky -c .conkytop | dzen2 -x '1300' -y '0' -h '16' -w '620' -ta 'r' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
- --myMPDBar = "conky -c .conkympd | dzen2 -x '0' -y '1184' -h '16' -w '1600' -ta 'l' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
- --myHDDBar = "conky -c .conkyhdd | dzen2 -x '1600' -y '1184' -h '16' -w '320' -ta 'r' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
- -- Urgency hint options:
- myUrgencyHook = withUrgencyHook dzenUrgencyHook
- { args = ["-x", "0", "-y", "1184", "-h", "16", "-w", "1366", "-ta", "r", "-expand", "l", "-fg", "" ++ myUrgentFGColor ++ "", "-bg", "" ++ myNormalBGColor ++ "", "-fn", "" ++ myFont ++ ""] }
- ------------------------------------------------------------------
- -------------------- menuhook --------------------
- ------------------------------------------------------------------
- getProp :: Atom -> Window -> X (Maybe [CLong])
- getProp a w = withDisplay $ \dpy -> io $ getWindowProperty32 dpy a w
- checkAtom name value = ask >>= \w -> liftX $ do
- a <- getAtom name
- val <- getAtom value
- mbr <- getProp a w
- case mbr of
- Just [r] -> return $ elem (fromIntegral r) [val]
- _ -> return False
- checkDialog = checkAtom "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_DIALOG"
- checkMenu = checkAtom "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_MENU"
- manageMenus = checkMenu --> doFloat
- manageDialogs = checkDialog --> doFloat
- -- Grid -------------------------------------------
- myGSConfig = defaultGSConfig { gs_cellwidth = 160 }
- ---------------------------------------------------
- -- Keys ------------------------------------------------------------
- toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
- ------------------------------------------------------------------
- -- Launch and Kill -----------------------------------------------
- ------------------------------------------------------------------
- [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
- , ((modm, xK_l), sendMessage $ Go R)
- , ((modm, xK_h), sendMessage $ Go L)
- , ((modm, xK_k), sendMessage $ Go U)
- , ((modm, xK_j), sendMessage $ Go D)
- -- , ((modm, xK_grave), shellPrompt myXPConfig)
- -- , ((0 , 0x1008ff33), spawn "thunar")
- -- , ((0 , 0x1008ff32), spawn "urxvt -e ncmpcpp")
- -- , ((0 , 0x1008ff19), spawn "thunderbird")
- -- , ((0 , 0x1008ff2a), spawn "oblogout")
- , ((modm, xK_BackSpace), spawn "exe=`dmenu_path | dmenu -fn 'snap-7' -b -nb '#151515' -nf '#919191' -sb '#151515' -sf '#c98f0a' ` && eval \"exec $exe\"")
- , ((modm , xK_w), runOrRaiseNext "firefox" (className =? "Firefox"))
- , ((modm , xK_e), runOrRaiseNext "kopete" (className =? "Kopete"))
- , ((modm , xK_o), runOrRaiseNext "okular" (className =? "Okular"))
- , ((modm , xK_x), runOrRaise "/home/neg/bin/urxvt" (resource =? "MainTerminal"))
- -- , ((modm , xK_x), runOrRaise "
- , ((modm , xK_F4 ), spawn "eject")
- , ((modm .|. shiftMask, xK_c ), kill1) -- @@ Close the focused window
- -- , ((modm .|. shiftMask, xK_c ), kill)
- , ((modm , xK_s), namedScratchpadAction scratchpads "scratchpad")
- , ((modm , xK_d), namedScratchpadAction scratchpads "stardict")
- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- -- Print -----------------------------------------------------------------------------------
- , ((0, xK_Print ), spawn "scrot -e 'mv $f ~/Pantallazos/ 2>/dev/null'")
- --------------------------------------------------------------------------------------------
- -- Vol ----------------------------------------------------------------
- , ((0 , 0x1008ff13), spawn "amixer sset Master 5%+")
- , ((0 , 0x1008ff11), spawn "amixer sset Master 5%-")
- -----------------------------------------------------------------------
- -- Mpd ----------------------------------------------------
- , ((0 , 0x1008ff14), spawn "mpc toggle")
- , ((0 , 0x1008ff15), spawn "mpc stop")
- , ((0 , 0x1008ff16), spawn "mpc prev")
- , ((0 , 0x1008ff17), spawn "mpc next")
- -----------------------------------------------------------
- -- Grid --------------------------------------------------------
- , ((modm, xK_g ), goToSelected myGSConfig)
- ----------------------------------------------------------------
- -- Layouts -----------------------------------------------------
- , ((modm, xK_space ), sendMessage NextLayout)
- , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
- ---------------------------------------------------------------------------
- -- Sub Layout ------------------------------------------------------------
- , ((modm .|. controlMask, xK_Left), sendMessage $ pullGroup L)
- , ((modm .|. controlMask, xK_Right), sendMessage $ pullGroup R)
- , ((modm .|. controlMask, xK_Up), sendMessage $ pullGroup U)
- , ((modm .|. controlMask, xK_Down), sendMessage $ pullGroup D)
- , ((modm .|. controlMask, xK_m), withFocused (sendMessage . MergeAll))
- , ((modm .|. controlMask, xK_u), withFocused (sendMessage . UnMerge))
- , ((modm .|. controlMask, xK_period), onGroup W.focusUp')
- , ((modm .|. controlMask, xK_comma), onGroup W.focusDown')
- -------------------------------------------------------------------------
- -- Resize viewed windows to the correct size ---
- , ((modm, xK_n ), refresh)
- -- Copying window to all
- , ((modm, xK_v ), windows copyToAll) -- @@ Make focused window always visible
- ------------------------------------------------
- -- Move focus ---------------------------------------------------------
- , ((modm, xK_Tab ), windows W.focusDown)
- -- , ((modm, xK_j ), windows W.focusDown)
- -- , ((modm, xK_k ), windows W.focusUp )
- , ((modm, xK_m ), windows W.focusMaster)
- , ((modm, xK_t ), withFocused $ windows . W.sink)
- -----------------------------------------------------------------------
- -- Swap focused ---------------------------------------------
- , ((modm, xK_Return), windows W.swapMaster)
- , ((modm .|. shiftMask, xK_Down ), windows W.swapDown )
- , ((modm .|. shiftMask, xK_Up ), windows W.swapUp )
- -------------------------------------------------------------
- -- Resizing -------------------- --------------------------------
- , ((modm, xK_Left ), sendMessage Shrink)
- , ((modm, xK_Right ), sendMessage Expand)
- , ((modm, xK_Down ), sendMessage MirrorShrink)
- , ((modm, xK_Up ), sendMessage MirrorExpand)
- -----------------------------------------------------------------
- -- Increment/Deincrement the number of windows in the master area ----
- -- , ((modm , xK_comma ), sendMessage (IncMasterN 1))
- -- , ((modm , xK_period), sendMessage (IncMasterN (-1)))
- ----------------------------------------------------------------------
- -- Quit/Restart xmonad --------------------------------------------------------------
- -- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
- , ((modm .|. shiftMask, xK_r ), spawn "xmonad --recompile; xmonad --restart")
- -- , ((modm .|. xK_apostrophe ), spawn "xmonad --recompile; xmonad --restart")
- -- , ((modm , xK_i), spawn "env GTK2_RC_FILES=$HOME/.themes/Clearlooks-DarkBlue/gtk-2.0/gtkrc inkscape")
- -- , ((modm , xK_o), spawn "env GTK2_RC_FILES=$HOME/.themes/Clearlooks-DarkBlue/gtk-2.0/gtkrc openoffice.org")
- -- , ((modm , xK_d), spawn "date +'%Y-%m-%d %H:%M' | osd_cat -p bottom -A center -s 2 -c '#a10a30' -f '-xos4-terminus-medium-r-normal-*-140-*-*-*-c-*-iso10646-1'")
- -- , ((modm .|. shiftMask, xK_d), spawn "date +'%H:%M' | osd_cat -p middle -A center -s 2 -c '#a10a30' -f '-xos4-terminus-medium-r-normal-*-140-*-*-*-c-*-iso10646-1'")
- -- , ((modm , xK_g), spawn "gimp")
- -- , ((modm , xK_k), spawn "k3b")
- -- , ((modm , xK_x), spawn "xbmc")
- -- , ((modm , xK_v), spawn "virtualbox")
- -- , ((modm , xK_n), spawn "nicotine")
- -- , ((modm , xK_m), spawn "gmpc")
- -- , ((modm , xK_Print), spawn "scrot screen_%Y-%m-%d.png -d 1") -- take screenshot
- , ((mod1Mask .|. controlMask, xK_Home), spawn "mpc toggle") -- play/pause song
- , ((mod1Mask .|. controlMask, xK_End), spawn "mpc stop") -- stop playback
- , ((mod1Mask .|. controlMask, xK_Prior), spawn "mpc prev") -- previous song
- , ((mod1Mask .|. controlMask, xK_Next), spawn "mpc next") -- next song
- , ((mod1Mask .|. controlMask, xK_z), spawn "mpc volume -5")
- , ((mod1Mask .|. controlMask, xK_x), spawn "mpc volume +5")
- , ((mod1Mask, xK_Tab), windows W.focusDown) -- move focus to the next window
- , ((mod1Mask, xK_j), windows W.focusDown) -- move focus to the next window
- , ((mod1Mask, xK_k), windows W.focusUp) -- move focus to the previous window
- , ((mod1Mask, xK_m), windows W.swapMaster) -- swap the focused window and the master window
- , ((mod1Mask .|. shiftMask, xK_1), sendMessage (IncMasterN 1)) -- increment the number of windows in the master area
- , ((mod1Mask .|. shiftMask, xK_2), sendMessage (IncMasterN (-1))) -- deincrement the number of windows in the master area
- , ((mod1Mask, xK_Return), windows W.focusMaster) -- move focus to the master window
- -- , ((mod1Mask, xK_f), sendMessage NextLayout) -- rotate through the available layout algorithms
- , ((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp) -- move focus to the previous window
- , ((mod1Mask .|. shiftMask, xK_h), sendMessage Shrink) -- shrink the master area
- , ((mod1Mask .|. shiftMask, xK_j), windows W.swapDown) -- swap the focused window with the next window
- , ((mod1Mask .|. shiftMask, xK_k), windows W.swapUp) -- swap the focused window with the previous window
- , ((mod1Mask .|. shiftMask, xK_l), sendMessage Expand) -- expand the master area
- , ((mod1Mask .|. shiftMask, xK_Return), focusUrgent) -- move focus to urgent window
- --, ((modMask .|. shiftMask, xK_Left), withFocused (keysResizeWindow (-30,0) (0,0))) -- shrink floated window horizontally by 50 pixels
- --, ((modMask .|. shiftMask, xK_Right), withFocused (keysResizeWindow (30,0) (0,0))) -- expand floated window horizontally by 50 pixels
- --, ((modMask .|. shiftMask, xK_Up), withFocused (keysResizeWindow (-30,-30) (0,0))) -- shrink floated window by 50 pixels
- --, ((modMask .|. shiftMask, xK_Down), withFocused (keysResizeWindow (30,30) (0,0))) -- expand floated window by 50 pixels
- -- , ((mod1Mask .|. controlMask, xK_q), io (exitWith ExitSuccess)) -- quit xmonad
- -- , ((mod1Mask .|. controlMask, xK_r), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart") -- restart xmonad
- , ((mod1Mask .|. controlMask, xK_d), withFocused $ windows . W.sink) -- push window back into tiling
- -- , ((mod1Mask .|. controlMask, xK_f), setLayout $ XMonad.layoutHook conf) -- reset the layouts on the current workspace to default
- -- , ((mod1Mask .|. controlMask, xK_Left), withFocused (keysMoveWindow (-30,0))) -- move floated window 10 pixels left
- -- , ((mod1Mask .|. controlMask, xK_Right), withFocused (keysMoveWindow (30,0))) -- move floated window 10 pixels right
- -- , ((mod1Mask .|. controlMask, xK_Up), withFocused (keysMoveWindow (0,-30))) -- move floated window 10 pixels up
- -- , ((mod1Mask .|. controlMask, xK_Down), withFocused (keysMoveWindow (0,30))) -- move floated window 10 pixels down
- ]
- ++
- [((m .|. modm, k), windows $ f i)
- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 ..]
- , (f, m) <- [(W.view, 0), (W.shift, shiftMask), (copy, shiftMask .|. controlMask)]]
- -- dynamicLog pretty printer for dzen:
- --myPP h = defaultPP
- -- { ppCurrent = wrap ("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myNormalFGColor ++ ")") "^fg()^bg()^p()" . \wsId -> dropIx wsId
- -- , ppVisible = wrap ("^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myNormalFGColor ++ ")") "^fg()^bg()^p()" . \wsId -> dropIx wsId
- -- , ppHidden = wrap ("^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId -- don't use ^fg() here!!
- -- --, ppHiddenNoWindows = wrap ("^fg(" ++ myDzenFGColor ++ ")^bg()^p()^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . \wsId -> dropIx wsId
- -- , ppHiddenNoWindows = \wsId -> if wsId `notElem` staticWs then "" else wrap ("^fg(" ++ myDzenFGColor ++ ")^bg()^p()^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . dropIx $ wsId
- -- , ppUrgent = wrap (("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myUrgentFGColor ++ ")")) "^fg()^bg()^p()" . \wsId -> dropIx wsId
- -- , ppSep = " "
- -- , ppWsSep = " "
- -- , ppTitle = dzenColor ("" ++ myNormalFGColor ++ "") "" . wrap "< " " >"
- -- , ppLayout = dzenColor ("" ++ myNormalFGColor ++ "") "" .
- -- (\x -> case x of
- -- "Hinted Full" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-full.xbm)"
- -- "Hinted ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-tall-right.xbm)"
- -- "Hinted Mirror ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-mirror-bottom.xbm)"
- -- --"Hinted combining Tabbed Bottom Simplest and Full with DragPane Vertical 0.1 0.8" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
- -- "Hinted combining Tabbed Bottom Simplest and Full with TwoPane using Not (Role \"gimp-toolbox\")" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
- -- _ -> x
- -- )
- -- , ppOutput = hPutStrLn h
- -- }
- -- where
- -- dropIx wsId = if (':' `elem` wsId) then drop 2 wsId else wsId
- -- staticWs = ["1:irc", "2:www", "3:music", "4:misc", "5:xbmc"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement