about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exe/Main.hs61
-rw-r--r--src/lib/XMonad/Custom/Bindings.hs2
-rw-r--r--src/lib/XMonad/Custom/Config.hs54
-rw-r--r--src/lib/XMonad/Custom/Misc.hs2
-rw-r--r--src/lib/XMonad/Custom/Navigation.hs6
-rw-r--r--src/lib/XMonad/Custom/Startup.hs4
-rw-r--r--src/lib/XMonad/Custom/Workspaces.hs9
7 files changed, 70 insertions, 68 deletions
diff --git a/src/exe/Main.hs b/src/exe/Main.hs
index 3a57650..7b08f2a 100644
--- a/src/exe/Main.hs
+++ b/src/exe/Main.hs
@@ -1,6 +1,6 @@
 -- |
 -- Module                  : Main
--- Description             : Entrypoint
+-- Description             : Application entrypoint
 -- Copyright               : (c) Azat Bahawi 2018-2021
 -- SPDX-License-Identifier : GPL-3.0-or-later
 -- Maintainer              : azahi@teknik.io
@@ -10,61 +10,8 @@
 
 module Main where
 
-import           XMonad                         ( Default(def)
-                                                , XConfig
-                                                  ( borderWidth
-                                                  , clickJustFocuses
-                                                  , focusFollowsMouse
-                                                  , focusedBorderColor
-                                                  , handleEventHook
-                                                  , keys
-                                                  , layoutHook
-                                                  , manageHook
-                                                  , modMask
-                                                  , mouseBindings
-                                                  , normalBorderColor
-                                                  , startupHook
-                                                  , terminal
-                                                  , workspaces
-                                                  )
-                                                , xmonad
-                                                )
-import           XMonad.Actions.DynamicProjects ( dynamicProjects )
-import           XMonad.Actions.Navigation2D    ( withNavigation2DConfig )
-import qualified XMonad.Custom.Bindings        as C
-import qualified XMonad.Custom.Event           as C
-import qualified XMonad.Custom.Layout          as C
-import qualified XMonad.Custom.Manage          as C
-import qualified XMonad.Custom.Misc            as C
-import qualified XMonad.Custom.Navigation      as C
-import qualified XMonad.Custom.Projects        as C
-import qualified XMonad.Custom.Startup         as C
-import qualified XMonad.Custom.Theme           as C
-import qualified XMonad.Custom.Workspaces      as C
-import           XMonad.Hooks.EwmhDesktops      ( ewmh )
-import           XMonad.Hooks.ManageDocks       ( docks )
-import           XMonad.Layout.Fullscreen       ( fullscreenSupport )
+import           XMonad
+import           XMonad.Custom.Config
 
 main :: IO ()
-main =
-  xmonad
-    $ ewmh
-    $ fullscreenSupport
-    $ docks
-    $ withNavigation2DConfig C.navigation
-    $ dynamicProjects C.projects
-    $ def { borderWidth        = C.border
-          , workspaces         = C.workspaces
-          , layoutHook         = C.layoutHook
-          , terminal           = C.term C.applications
-          , normalBorderColor  = C.colorN
-          , focusedBorderColor = C.colorF
-          , modMask            = C.modMask
-          , keys               = C.keys
-          , startupHook        = C.startupHook
-          , mouseBindings      = C.mouseBindings
-          , manageHook         = C.manageHook
-          , handleEventHook    = C.handleEventHook
-          , focusFollowsMouse  = False
-          , clickJustFocuses   = False
-          }
+main = myConfig >>= xmonad
diff --git a/src/lib/XMonad/Custom/Bindings.hs b/src/lib/XMonad/Custom/Bindings.hs
index 208ccdf..807be4f 100644
--- a/src/lib/XMonad/Custom/Bindings.hs
+++ b/src/lib/XMonad/Custom/Bindings.hs
@@ -57,7 +57,7 @@ import           XMonad.Util.NamedScratchpad
 import           XMonad.Util.WorkspaceCompare
 
 modMask :: KeyMask
-modMask = mod4Mask
+modMask = controlMask
 
 directions :: [Direction2D]
 directions = [D, U, L, R]
diff --git a/src/lib/XMonad/Custom/Config.hs b/src/lib/XMonad/Custom/Config.hs
new file mode 100644
index 0000000..84f4069
--- /dev/null
+++ b/src/lib/XMonad/Custom/Config.hs
@@ -0,0 +1,54 @@
+{-# OPTIONS_GHC -Wno-missing-signatures #-}
+
+-- |
+-- Module                  : XMonad.Custom.Config
+-- Description             : Configuration entrypoint to be passed to executable
+-- Copyright               : (c) Azat Bahawi 2018-2021
+-- SPDX-License-Identifier : GPL-3.0-or-later
+-- Maintainer              : azahi@teknik.io
+-- Stability               : experimental
+-- Portability             : non-portable
+--
+
+module XMonad.Custom.Config
+    ( myConfig
+    ) where
+
+import           Flow
+import           XMonad
+import           XMonad.Actions.Navigation2D
+import qualified XMonad.Custom.Bindings        as C
+import qualified XMonad.Custom.Event           as C
+import qualified XMonad.Custom.Layout          as C
+import qualified XMonad.Custom.Manage          as C
+import qualified XMonad.Custom.Misc            as C
+import qualified XMonad.Custom.Navigation      as C
+import qualified XMonad.Custom.Theme           as C
+import qualified XMonad.Custom.Workspaces      as C
+import           XMonad.Hooks.EwmhDesktops
+import           XMonad.Hooks.ManageDocks
+import           XMonad.Hooks.UrgencyHook
+import           XMonad.Layout.IndependentScreens
+
+myConfig = do
+    screens <- countScreens
+    def { borderWidth        = C.border
+        , workspaces         = C.myWorkspaces screens
+        , layoutHook         = C.layoutHook
+        , terminal           = C.term C.applications
+        , normalBorderColor  = C.colorN
+        , focusedBorderColor = C.colorF
+        , modMask            = C.modMask
+        , keys               = C.keys
+        , mouseBindings      = C.mouseBindings
+        , manageHook         = C.manageHook
+        , handleEventHook    = C.handleEventHook
+        , focusFollowsMouse  = False
+        , clickJustFocuses   = False
+        }
+        |> withUrgencyHook (borderUrgencyHook C.red1)
+        |> withNavigation2DConfig C.myNavigation2DConfig
+        |> ewmh
+        |> ewmhFullscreen
+        |> docks
+        |> (return :: a -> IO a)
diff --git a/src/lib/XMonad/Custom/Misc.hs b/src/lib/XMonad/Custom/Misc.hs
index b9901b4..355df91 100644
--- a/src/lib/XMonad/Custom/Misc.hs
+++ b/src/lib/XMonad/Custom/Misc.hs
@@ -31,6 +31,6 @@ applications = Applications { browser = "qutebrowser"
                             , mixer   = "pulsemixer"
                             , notify  = "notify-send"
                             , player  = "ncmpcpp"
-                            , term    = "urxvtc"
+                            , term    = "xterm"
                             , top     = "htop"
                             }
diff --git a/src/lib/XMonad/Custom/Navigation.hs b/src/lib/XMonad/Custom/Navigation.hs
index 2646db4..cf96ab7 100644
--- a/src/lib/XMonad/Custom/Navigation.hs
+++ b/src/lib/XMonad/Custom/Navigation.hs
@@ -9,13 +9,13 @@
 --
 
 module XMonad.Custom.Navigation
-  ( navigation
+  ( myNavigation2DConfig
   ) where
 
 import           XMonad.Actions.Navigation2D
 
-navigation :: Navigation2DConfig
-navigation = def
+myNavigation2DConfig :: Navigation2DConfig
+myNavigation2DConfig = def
   { defaultTiledNavigation = hybridOf sideNavigation centerNavigation
   , floatNavigation        = hybridOf lineNavigation centerNavigation
   , layoutNavigation       = [("Full", centerNavigation)]
diff --git a/src/lib/XMonad/Custom/Startup.hs b/src/lib/XMonad/Custom/Startup.hs
index f2415ea..935d08f 100644
--- a/src/lib/XMonad/Custom/Startup.hs
+++ b/src/lib/XMonad/Custom/Startup.hs
@@ -50,8 +50,8 @@ addEWMHFullscreen = do
 
 startupHook :: X ()
 startupHook = do
-  spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/top.hs" "xmobarTop"
-  spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/bot.hs" "xmobarBot"
+  -- spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/top.hs" "xmobarTop"
+  -- spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/bot.hs" "xmobarBot"
   docksStartupHook
   addEWMHFullscreen
   setDefaultCursor xC_left_ptr
diff --git a/src/lib/XMonad/Custom/Workspaces.hs b/src/lib/XMonad/Custom/Workspaces.hs
index ba2a1e7..43d8aa2 100644
--- a/src/lib/XMonad/Custom/Workspaces.hs
+++ b/src/lib/XMonad/Custom/Workspaces.hs
@@ -9,10 +9,11 @@
 --
 
 module XMonad.Custom.Workspaces
-  ( workspaces
+  ( myWorkspaces
   ) where
 
-import           XMonad.Core             hiding ( workspaces )
+import           XMonad.Core
+import           XMonad.Layout.IndependentScreens
 
-workspaces :: [WorkspaceId]
-workspaces = map show [1 .. 9 :: Int]
+myWorkspaces :: ScreenId -> [PhysicalWorkspace]
+myWorkspaces = flip withScreens $ map show [1 .. 9 :: Int]

Consider giving Nix/NixOS a try! <3