Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Ratio ((%))
- import XMonad
- import System.IO
- import XMonad.Hooks.ManageHelpers
- import XMonad.Hooks.ManageDocks
- import XMonad.Util.EZConfig (additionalKeys, additionalMouseBindings,
- removeMouseBindings, removeKeys)
- import XMonad.Layout.Monitor
- import XMonad.Layout.LayoutModifier
- import XMonad.Layout.NoBorders
- import XMonad.Layout.PerWorkspace (onWorkspace, onWorkspaces)
- import XMonad.Layout.SimpleFloat
- import XMonad.Layout.ShowWName
- import XMonad.Layout.HintedGrid
- import XMonad.Actions.Promote
- import qualified XMonad.Actions.FlexibleManipulate as Flex
- import XMonad.Actions.RotSlaves
- import XMonad.Actions.CycleWS
- import qualified XMonad.StackSet as W
- clock = monitor {
- prop = ClassName "trayer"
- , rect = Rectangle 0 0 1 1
- , persistent = True
- , visible = False
- , name = "trayer"
- }
- customLayout = ModifiedLayout clock
- -- $ smartBorders
- $ showWName
- $ onWorkspace "a" tiled
- $ Full ||| Mirror tiled ||| tiled
- where
- tiled = Tall 1 (5 % 100) (3 % 4)
- myWorkspaces = [c:"" | c<-"aoeuidhtns"]
- main = do
- xmonad $ defaultConfig
- { borderWidth = 2
- , terminal = "urxvt"
- , normalBorderColor = "#cccccc"
- , focusedBorderColor = "#cd8b00"
- , modMask = mod4Mask
- , manageHook = composeAll
- [ resource =? "trayer" --> doIgnore
- , title =? "Keyboard" --> doIgnore
- -- , className =? "Gimp" --> doFloat
- ] <+> manageMonitor clock <+> manageHook defaultConfig
- , layoutHook = customLayout
- , workspaces = myWorkspaces
- } `additionalKeys`
- [ ((mod4Mask, xK_l), broadcastMessage (ToggleMonitorNamed "trayer") >> refresh)
- , ((mod4Mask, xK_p), sendMessage Shrink)
- , ((mod4Mask, xK_y), sendMessage Expand)
- , ((mod4Mask, xK_g), spawn "dmenu_run")
- , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
- , ((0, xK_Print), spawn "scrot")
- , ((mod4Mask, xK_F11), spawn "showflash.sh")
- , ((mod4Mask, xK_F12), spawn "gnome-screensaver-command --lock")
- , ((mod4Mask, xK_Tab), promote)
- -- , ((mod4Mask .|. shiftMask, xK_Tab), rotSlavesUp)
- , ((mod4Mask, xK_b), sendMessage ToggleStruts)
- , ((mod4Mask, xK_z), nextScreen)
- , ((mod4Mask, xK_v), withFocused $ windows . W.sink)
- ]
- `additionalKeys`
- -- mod-[1..9] %! Switch to workspace N
- -- mod-shift-[1..9] %! Move client to workspace N
- [((m .|. mod4Mask, k), windows $ f i)
- | (i, k) <- zip myWorkspaces [xK_a, xK_o, xK_e, xK_u, xK_i, xK_d, xK_h, xK_t, xK_n, xK_s]
- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
- `additionalMouseBindings`
- [ ((mod4Mask, button1), (\w -> focus w >> Flex.mouseWindow Flex.discrete w))
- ] `removeMouseBindings`
- [ (mod4Mask, button3)
- ] -- `removeKeys`
- -- [ (mod4Mask, xK_Tab)
- -- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement