Browse Source

Window transparency, new promote history, cycle history

master
Peter J. Jones 1 month ago
parent
commit
9416eb9919
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
3 changed files with 33 additions and 4 deletions
  1. 5
    3
      src/XMonad/Local/Keys.hs
  2. 26
    1
      src/XMonad/Local/Log.hs
  3. 2
    0
      xmonadrc.hs

+ 5
- 3
src/XMonad/Local/Keys.hs View File

@@ -26,12 +26,14 @@ import qualified XMonad.StackSet as W
26 26
 -- Package: xmonad-contrib.
27 27
 import XMonad.Actions.CopyWindow (kill1)
28 28
 import XMonad.Actions.CycleSelectedLayouts (cycleThroughLayouts)
29
+import XMonad.Actions.CycleWorkspaceByScreen (cycleWorkspaceOnCurrentScreen)
29 30
 import XMonad.Actions.DynamicProjects (switchProjectPrompt, lookupProject, switchProject)
30 31
 import XMonad.Actions.GroupNavigation (Direction (..), nextMatch)
31 32
 import XMonad.Actions.Navigation2D
32 33
 import XMonad.Actions.PhysicalScreens (onNextNeighbour, onPrevNeighbour)
33 34
 import XMonad.Actions.Promote (promote)
34 35
 import XMonad.Actions.RotSlaves (rotSlavesUp, rotSlavesDown)
36
+import XMonad.Actions.SwapPromote (swapHybrid)
35 37
 import XMonad.Actions.TagWindows (addTag, delTag, withTagged)
36 38
 import XMonad.Actions.UpdatePointer (updatePointer)
37 39
 import XMonad.Hooks.ManageDocks (ToggleStruts(..))
@@ -53,7 +55,7 @@ import XMonad.Local.Layout (selectLayoutByName)
53 55
 import XMonad.Local.Music (radioPrompt)
54 56
 import qualified XMonad.Local.Prompt as Local
55 57
 import XMonad.Local.Tagging
56
-import XMonad.Local.Workspaces (asKey, viewPrevWS, scratchPads)
58
+import XMonad.Local.Workspaces (asKey, scratchPads)
57 59
 
58 60
 --------------------------------------------------------------------------------
59 61
 -- Join all the key maps into a single list and send it through @mkKeymap@.
@@ -119,7 +121,7 @@ windowKeys _ =
119 121
   , ("M-M1-k",  windowSwap U False)
120 122
   , ("M-<U>",   rotSlavesUp)
121 123
   , ("M-<D>",   rotSlavesDown)
122
-  , ("M-m",     promote) -- Promote current window to master.
124
+  , ("M-m",     whenX (swapHybrid False) promote) -- Promote current window to master.
123 125
 
124 126
   -- Resizing Windows:
125 127
   , ("M-C-h",   sendMessage Shrink)
@@ -177,7 +179,7 @@ windowTagKeys _ =
177 179
 -- Keys for manipulating workspaces.
178 180
 workspaceKeys :: XConfig Layout -> [(String, X ())]
179 181
 workspaceKeys _ =
180
-  [ ("M-'",       viewPrevWS)
182
+  [ ("M-'",       cycleWorkspaceOnCurrentScreen [xK_Super_L] xK_apostrophe xK_semicolon)
181 183
   , ("M-<Space>", switchProjectPrompt  Local.promptConfig)
182 184
   , ("M-f",       lookupProject "agenda"   >>= maybe (return ()) switchProject)
183 185
   , ("M-g",       lookupProject "browsers" >>= maybe (return ()) switchProject)

+ 26
- 1
src/XMonad/Local/Log.hs View File

@@ -13,8 +13,33 @@ module XMonad.Local.Log (logHook) where
13 13
 --------------------------------------------------------------------------------
14 14
 import XMonad hiding (logHook)
15 15
 import XMonad.Actions.GroupNavigation (historyHook)
16
+import XMonad.Actions.SwapPromote (masterHistoryHook)
17
+import XMonad.Hooks.WorkspaceHistory (workspaceHistoryHook)
18
+
19
+import XMonad.Hooks.FadeWindows
20
+  ( FadeHook
21
+  , fadeWindowsLogHook
22
+  , transparency
23
+  , opaque
24
+  , isUnfocused
25
+  , isFloating
26
+  )
16 27
 
17 28
 --------------------------------------------------------------------------------
18 29
 -- | XMonad @logHook@.
19 30
 logHook :: X ()
20
-logHook = historyHook
31
+logHook =
32
+  historyHook <>
33
+  workspaceHistoryHook <>
34
+  masterHistoryHook <>
35
+  fadeWindowsLogHook fadeHook
36
+
37
+--------------------------------------------------------------------------------
38
+-- | Control the opacity of windows.  The list is processed from the
39
+-- bottom up.
40
+fadeHook :: FadeHook
41
+fadeHook = composeAll
42
+  [ opaque
43
+  , isUnfocused --> transparency 0.3
44
+  , isFloating  --> transparency 0.0
45
+  ]

+ 2
- 0
xmonadrc.hs View File

@@ -19,6 +19,7 @@ import XMonad.Config.Desktop (desktopConfig)
19 19
 import XMonad.Hooks.ManageDocks (avoidStruts)
20 20
 import XMonad.Hooks.UrgencyHook hiding (urgencyConfig)
21 21
 import XMonad.Util.NamedScratchpad (namedScratchpadManageHook)
22
+import XMonad.Hooks.FadeWindows (fadeWindowsEventHook)
22 23
 
23 24
 --------------------------------------------------------------------------------
24 25
 import qualified XMonad.Local.Action as Local
@@ -41,6 +42,7 @@ config = desktopConfig
41 42
                          Local.manageHook
42 43
 
43 44
   , handleEventHook    = handleEventHook desktopConfig <>
45
+                         fadeWindowsEventHook <>
44 46
                          Local.handleEventHook
45 47
 
46 48
   , logHook            = logHook desktopConfig <>

Loading…
Cancel
Save