content: --
  -- xmonad example config file for xmonad-0.9
  --
  -- A template showing all available configuration hooks,
  -- and how to override the defaults in your own xmonad.hs conf file.
  --
  -- Normally, you'd only override those defaults you care about.
  --
  -- NOTE: Those updating from earlier xmonad versions, who use
  -- EwmhDesktops, safeSpawn, WindowGo, or the simple-status-bar
  -- setup functions (dzen, xmobar) probably need to change
  -- xmonad.hs, please see the notes below, or the following
  -- link for more details:
  --
  -- http://www.haskell.org/haskellwiki/Xmonad/Notable_changes_since_0.8
  --
  
  import XMonad
  import Data.Monoid
  import System.Exit
  import XMonad.Actions.CycleWS
  import XMonad.Actions.GridSelect
  import XMonad.Actions.PhysicalScreens
  import XMonad.Layout.NoBorders
  import XMonad.Layout.Grid
  import XMonad.Layout.Dwindle
  import XMonad.Actions.NoBorders
  import XMonad.Util.Dmenu
  import XMonad.Util.EZConfig
  import XMonad.Hooks.SetWMName
  import XMonad.Hooks.EwmhDesktops
  
  import qualified XMonad.StackSet as W
  import qualified Data.Map        as M
  
  -- The preferred terminal program, which is used in a binding below and by
  -- certain contrib modules.
  --
  myTerminal      = "gnome-terminal"
  --myTerminal      = "cool-retro-term"
  
  -- Whether focus follows the mouse pointer.
  myFocusFollowsMouse :: Bool
  myFocusFollowsMouse = True
  
  -- Width of the window border in pixels.
  --
  myBorderWidth   = 0
  
  -- modMask lets you specify which modkey you want to use. The default
  -- is mod1Mask ("left alt").  You may also consider using mod3Mask
  -- ("right alt"), which does not conflict with emacs keybindings. The
  -- "windows key" is usually mod4Mask.
  --
  myModMask       = mod1Mask
  
  -- NOTE: from 0.9.1 on numlock mask is set automatically. The numlockMask
  -- setting should be removed from configs.
  --
  -- You can safely remove this even on earlier xmonad versions unless you
  -- need to set it to something other than the default mod2Mask, (e.g. OSX).
  --
  -- The mask for the numlock key. Numlock status is "masked" from the
  -- current modifier status, so the keybindings will work with numlock on or
  -- off. You may need to change this on some systems.
  --
  -- You can find the numlock modifier by running "xmodmap" and looking for a
  -- modifier with Num_Lock bound to it:
  --
  -- > $ xmodmap | grep Num
  -- > mod2        Num_Lock (0x4d)
  --
  -- Set numlockMask = 0 if you don't have a numlock key, or want to treat
  -- numlock status separately.
  --
  -- myNumlockMask   = mod2Mask -- deprecated in xmonad-0.9.1
  ------------------------------------------------------------
  
  
  -- The default number of workspaces (virtual screens) and their names.
  -- By default we use numeric strings, but any string may be used as a
  -- workspace name. The number of workspaces is determined by the length
  -- of this list.
  --
  -- A tagging example:
  --
  -- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
  --
  myWorkspaces    = ["1"]
  
  -- Border colors for unfocused and focused windows, respectively.
  
  ------------------------------------------------------------------------
  -- Key bindings. Add, modify or remove key bindings here.
  --
  myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
  
      -- launch a terminal
      [
      -- comment this out later
      ((modm,               xK_x     ), spawn "gmrun")
      ,((modm,               xK_9     ), spawn "xkill")
      ,((modm,               xK_f     ), spawn "firefox")
      ,((modm,               xK_i     ), spawn "sudo systemctl start da")
      ,((modm,               xK_o     ), spawn "sudo systemctl stop da")
      ,((modm,               xK_r     ), spawn "sudo systemctl restart da")
  
      ]
  
  ------------------------------------------------------------------------
  -- Layouts:
  
  -- You can specify and transform your layouts by modifying these values.
  -- If you change layout bindings be sure to use 'mod-shift-space' after
  -- restarting (with 'mod-q') to reset your layout state to the new
  -- defaults, as xmonad preserves your old layout settings by default.
  --
  -- * NOTE: XMonad.Hooks.EwmhDesktops users must remove the obsolete
  -- ewmhDesktopsLayout modifier from layoutHook. It no longer exists.
  -- Instead use the 'ewmh' function from that module to modify your
  -- defaultConfig as a whole. (See also logHook, handleEventHook, and
  -- startupHook ewmh notes.)
  --
  -- The available layouts.  Note that each layout is separated by |||,
  -- which denotes layout choice.
  --
  myLayout = Grid
    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
  
  ------------------------------------------------------------------------
  -- Window rules:
  
  -- Execute arbitrary actions and WindowSet manipulations when managing
  -- a new window. You can use this to, for example, always float a
  -- particular program, or have a client always appear on a particular
  -- workspace.
  --
  -- To find the property name associated with a program, use
  -- > xprop | grep WM_CLASS
  -- and click on the client you're interested in.
  --
  -- To match on the WM_NAME, you can use 'title' in the same way that
  -- 'className' and 'resource' are used below.
  --
  myManageHook = composeAll
      [
           resource  =? "conky" --> doFloat
           , resource  =? "xeyes" --> doIgnore
           , resource  =? "yad" --> doFloat
  
      ]
  
  ------------------------------------------------------------------------
  -- Event handling
  
  -- Defines a custom handler function for X Events. The function should
  -- return (All True) if the default handler is to be run afterwards. To
  -- combine event hooks use mappend or mconcat from Data.Monoid.
  --
  -- * NOTE: EwmhDesktops users should use the 'ewmh' function from
  -- XMonad.Hooks.EwmhDesktops to modify their defaultConfig as a whole.
  -- It will add EWMH event handling to your custom event hooks by
  -- combining them with ewmhDesktopsEventHook.
  --
  --myEventHook = mempty
  
  ------------------------------------------------------------------------
  -- Status bars and logging
  
  -- Perform an arbitrary action on each internal state change or X event.
  -- See the 'XMonad.Hooks.DynamicLog' extension for examples.
  --
  --
  -- * NOTE: EwmhDesktops users should use the 'ewmh' function from
  -- XMonad.Hooks.EwmhDesktops to modify their defaultConfig as a whole.
  -- It will add EWMH logHook actions to your custom log hook by
  -- combining it with ewmhDesktopsLogHook.
  --
  myLogHook = return ()
  
  ------------------------------------------------------------------------
  -- Startup hook
  
  -- Perform an arbitrary action each time xmonad starts or is restarted
  -- with mod-q.  Used by, e.g., XMonad.Layout.PerWorkspace to initialize
  -- per-workspace layout choices.
  --
  -- By default, do nothing.
  --
  -- * NOTE: EwmhDesktops users should use the 'ewmh' function from
  -- XMonad.Hooks.EwmhDesktops to modify their defaultConfig as a whole.
  -- It will add initialization of EWMH support to your custom startup
  -- hook by combining it with ewmhDesktopsStartup.
  --
  --myStartupHook = return ()
  myStartupHook = do
          spawn "~/.xmonad_autostart.sh"
          setWMName "LG3D"
  
  ------------------------------------------------------------------------
  -- Now run xmonad with all the defaults we set up.
  
  -- Run xmonad with the settings you specify. No need to modify this.
  --
  main = xmonad defaults
  
  
  
  -- A structure containing your configuration settings, overriding
  -- fields in the default config. Any you don't override, will
  -- use the defaults defined in xmonad/XMonad/Config.hs
  --
  -- No need to modify this.
  --
  defaults = defaultConfig {
        -- simple stuff
          terminal           = myTerminal,
          focusFollowsMouse  = myFocusFollowsMouse,
          borderWidth        = myBorderWidth,
          modMask            = myModMask,
          -- numlockMask deprecated in 0.9.1
          -- numlockMask        = myNumlockMask,
          workspaces         = myWorkspaces,
  
        -- key bindings
          keys               = myKeys,
  
        -- hooks, layouts
          --layoutHook         = myLayout,
          layoutHook         = smartBorders myLayout,
          manageHook         = myManageHook,
          handleEventHook    = fullscreenEventHook <+> removeBordersEventHook,
          logHook            = myLogHook,
          startupHook        = myStartupHook
      }
  
  
  removeBordersEventHook :: Event -> X All
  removeBordersEventHook ev = do
      whenX (className =? "albert" `runQuery` w) $ withDisplay $ \d ->
          io $ setWindowBorderWidth d w 0
      return (All True)
      where
          w = ev_window ev
  