Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env runhugs +l
- --
- -- xmonad.hs
- -- Copyright (C) 2017 Felix Molero <fmolero69@gmail.com>
- --
- -- Distributed under terms of the GPLv3+ license.
- -- Xmonad V 0.13
- --
- -- IMPORTS MODULES:
- import XMonad
- import XMonad.Hooks.DynamicLog
- import XMonad.Hooks.EwmhDesktops
- import XMonad.Hooks.ManageDocks
- import XMonad.Util.Run(spawnPipe)
- import XMonad.Util.SpawnOnce
- import Data.Monoid
- import System.Exit
- import qualified XMonad.StackSet as W
- import qualified Data.Map as M
- -- Funciones principales
- myModMask = mod4Mask
- myFocusFollowsMouse :: Bool
- myFocusFollowsMouse = True
- myTerminal = "termite"
- myBar = "date '+%a %d %b %Y %I:%M:%P' && LANG=es_VE.utf-8 xmobar ~/.xmobarrc"
- myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
- myNormalBorderColor = "#404040"
- myFocusedBorderColor = "#989898"
- myBorderWidth = 1
- myKeys conf@(XConfig {XMonad.modMask = modm} ) = M.fromList $
- --toggleStrutsKey XConfig {XMonad.modMask = modm} = (modMask, xK_b)
- ---------------------------------------------------------------------------
- ------------------------ Atajos de teclados -------------------------------
- ---------------------------------------------------------------------------
- ---------------------- Lanzador de útilidades -----------------------------
- [ (( modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
- , (( modm, xK_g ), spawn "gmrun")
- , (( modm, xK_Return ), spawn $ XMonad.terminal conf)
- ----------------------- Lanzador de aplicaciones ---------------------------
- , (( modm, xK_F1 ), spawn "firefox" )
- , (( modm, xK_F2 ), spawn "thunar" )
- , (( modm, xK_F3 ), spawn "mousepad" )
- , (( modm .|. shiftMask, xK_F1 ), spawn "palemoon" )
- , (( modm .|. shiftMask, xK_F2 ), spawn "gimp" )
- , (( modm .|. shiftMask, xK_F3 ), spawn "inkscape" )
- ---------------------- Control de música [MPC] ------------------------------
- , (( modm, xK_p ), spawn "mpc toggle" )
- , (( modm, xK_s ), spawn "mpc stop" )
- , (( modm, xK_b ), spawn "mpc prev" )
- , (( modm, xK_n ), spawn "mpc next" )
- , (( modm, xK_plus ), spawn "mpc volume +3")
- , (( modm, xK_minus ), spawn "mpc volume -3")
- --------------------- Control de volumen -----------------------------------
- , (( modm .|. shiftMask, xK_plus ), spawn "amixer set Master 5%+ unmute")
- , (( modm .|. shiftMask, xK_minus ), spawn "amixer set Master 5%- unmute")
- , (( modm .|. shiftMask, xK_m ), spawn "amixer set Master toggle" )
- --------------------- Funcionalidad del xmonad -----------------------------
- , (( modm, xK_r ), spawn "xmonad --recompile; xmonad --restart")
- , (( modm, xK_e ), io (exitWith ExitSuccess))
- , (( modm .|. shiftMask, xK_q ), kill )
- , (( modm .|. shiftMask, xK_r ), refresh)
- , (( modm, xK_Tab ), windows W.focusDown)
- , (( modm, xK_j ), windows W.focusDown)
- , (( modm, xK_k ), windows W.focusUp)
- , (( modm .|. shiftMask, xK_m ), windows W.focusMaster)
- , (( modm .|. shiftMask, xK_Return ), windows W.swapMaster)
- , (( modm .|. shiftMask, xK_j ), windows W.swapDown)
- , (( modm .|. shiftMask, xK_k ), windows W.swapUp)
- , (( modm, xK_h ), sendMessage Shrink)
- , (( modm, xK_l ), sendMessage Expand)
- , (( modm, xK_t ), withFocused $ windows . W.sink)
- , (( modm, xK_comma ), sendMessage (IncMasterN 1)) -- Inc
- -- , (( modm, xK_comma ), sendMessage (IncMasterN 1))
- : , (( modm, xK_period ), sendMessage (IncMasterN (-1)))
- , (( modm .|. shiftMask, xK_b ), sendMessage ToggleStruts)
- ]
- ++
- --
- -- mod-[1..9], Switch to workspace N
- --
- -- mod-[1..9], Switch to workspace N
- -- mod-shift-[1..9], Move client to workspace N
- --
- [((m .|. modm, k), windows $ f i)
- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
- ++
- --
- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
- -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
- --
- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
- -------------------------------------------------------------------------------
- -- Mouse bindings: default actions bound to mouse events
- --
- myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
- -- mod-button1, Set the window to floating mode and move by dragging
- [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
- >> windows W.shiftMaster))
- -- mod-button2, Raise the window to the top of the stack
- , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
- -- mod-button3, Set the window to floating mode and resize by dragging
- , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
- >> windows W.shiftMaster))
- -- you may also bind events to the mouse scroll wheel (button4 and button5)
- ]
- -------------------------------------------------------------------------------
- myLayout = tiled ||| Mirror tiled ||| Full
- 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
- -------------------------------------------------------------------------------
- -- myManageHook = composeAll
- -- [ className =? "MPlayer" --> doFloat
- -- , className =? "Gimp" --> doFloat
- -- , resource =? "desktop_window" --> doIgnore
- -- , resource =? "kdesktop" --> doIgnore ]
- -------------------------------------------------------------------------------
- myStartupHook = do
- spawnOnce "mpd"
- spawnOnce "compton -cCGb"
- spawnOnce "thunar --daemon"
- spawnOnce "feh --bg-scale ~/.background/xmonad2.png"
- spawnOnce "conky -d; sleep 1 && transset-df .5 -n Conky"
- -------------------------------------------------------------------------------
- myManageHook = manageDocks <+> manageHook defaultConfig
- myLayoutHook = avoidStruts $ layoutHook defaultConfig
- myEventHook = docksEventHook <+> handleEventHook
- defaultConfig <+> fullscreenEventHook
- myLogHook = dynamicLogWithPP xmobarPP
- { ppOutput = hPutStrLn xmproc
- , ppTitle = xmobarColor "darkorange" "" . shorten 50
- , ppUrgent = xmobarColor "darkred" "" . wrap "[" "]"
- , ppCurrent = xmobarColor "darkorange" ""
- , ppVisible = xmobarColor "#404040" ""
- }
- -------------------------------------------------------------------------------
- main = xmonad =<< statusBar myBar toggleStrutsKey myDefConfig
- --defaults = defaultConfig
- myDefConfig = defaultConfig
- -- Keys bindings
- { keys = myKeys
- , mouseBindings = myMouseBindings
- -- Simple stuff
- , modMask = myModMask
- , terminal = myTerminal
- , workspaces = myWorkspaces
- , borderWidth = myBorderWidth
- , focusFollowsMouse = myFocusFollowsMouse
- , normalBorderColor = myNormalBorderColor
- , focusedBorderColor = myFocusedBorderColor
- -- Hooks, layouts
- , logHook = myLogHook
- , layoutHook = myLayoutHook
- , manageHook = myManageHook
- , startupHook = myStartupHook
- , handleEventHook = myEventHook
- }
Add Comment
Please, Sign In to add comment