aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-04-15 23:55:35 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-04-15 23:55:35 -0600
commit7a5051f7955a8b4e69b2c28b5a9b34f9730e21f0 (patch)
tree27eb1b5f660bfedea78ce0b26f52aede2460fa96 /src/Main.hs
parent588e87efb099927fda713380e5bf64e8c7f1fdcd (diff)
downloadrde-7a5051f7955a8b4e69b2c28b5a9b34f9730e21f0.tar.gz
rde-7a5051f7955a8b4e69b2c28b5a9b34f9730e21f0.tar.bz2
rde-7a5051f7955a8b4e69b2c28b5a9b34f9730e21f0.zip
Make history much, much more reliable.
This time history is being done using a hook to keep track of history. This means I don't have to manually call pushHistory every time I focus a new window.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 56c66f5..edce3fb 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -11,6 +11,7 @@ import XMonad.Layout.Fullscreen (fullscreenEventHook)
import System.Environment (setEnv)
import Data.Monoid
import qualified Data.Map as Map
+import Text.Printf
import Rahm.Desktop.Swallow
import Rahm.Desktop.Windows
@@ -20,6 +21,8 @@ import Rahm.Desktop.Layout
import Rahm.Desktop.Logger
import Rahm.Desktop.DMenu (menuCommandString)
import Rahm.Desktop.RebindKeys
+import Rahm.Desktop.Hooks.WindowChange
+import Rahm.Desktop.History
import qualified XMonad as X
import qualified XMonad.StackSet as W
@@ -35,8 +38,8 @@ main = do
xmobar <- spawnXMobar
- (=<<) X.xmonad $
- applyKeys $ ewmh $ docks $ def
+ (=<<) X.xmonad $
+ applyKeys $ withLocationChangeHook historyHook $ ewmh $ docks $ def
{ terminal = "alacritty"
, modMask = mod3Mask
, borderWidth = 2
@@ -75,6 +78,10 @@ main = do
}
+changeHook :: Location -> Location -> X ()
+changeHook l1 l2 = do
+ logs $ printf "Change %s -> %s" (show l1) (show l2)
+
doCenterFloat :: ManageHook
doCenterFloat =
ask >>= \w -> doF . W.float w . centerRect . snd =<< liftX (floatLocation w)