diff options
| author | Josh Rahm <rahm@google.com> | 2020-02-03 15:00:23 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2020-02-03 15:00:23 -0700 |
| commit | e3b47c680b20aab1e703ce0525364244422c27e8 (patch) | |
| tree | e5739ea41f403e48d4d47860f1efb337b4dfc3d0 /src | |
| parent | a153456b06a06db97735284a0d7496017799807a (diff) | |
| download | rde-e3b47c680b20aab1e703ce0525364244422c27e8.tar.gz rde-e3b47c680b20aab1e703ce0525364244422c27e8.tar.bz2 rde-e3b47c680b20aab1e703ce0525364244422c27e8.zip | |
More minor aesthetic changes to XMobar
Diffstat (limited to 'src')
| -rw-r--r-- | src/Internal/Keys.hs | 3 | ||||
| -rw-r--r-- | src/Internal/Marking.hs | 30 | ||||
| -rw-r--r-- | src/Main.hs | 5 |
3 files changed, 22 insertions, 16 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 8ec06b6..3d0df0c 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -27,7 +27,8 @@ newKeys = zip ['1'..] (XMonad.workspaces config) gotoWorkspace :: Char -> X () - gotoWorkspace ch = + gotoWorkspace ch = do + saveLastMark markContext mapM_ (windows . W.greedyView) (Map.lookup ch workspacesByInt) in diff --git a/src/Internal/Marking.hs b/src/Internal/Marking.hs index 352131b..e5cf696 100644 --- a/src/Internal/Marking.hs +++ b/src/Internal/Marking.hs @@ -54,24 +54,26 @@ markCurrentWindow (MarkContext ioref) mark = do saveMarkState =<< liftIO (readIORef ioref) -jumpToLast :: MarkContext -> X () -jumpToLast (MarkContext ioref) = do +saveLastMark :: MarkContext -> X () +saveLastMark (MarkContext ioref) = withFocused $ \win -> do - m <- markLast <$> (liftIO $ readIORef ioref) - liftIO $ modifyIORef ioref (\state -> state { markLast = Just win }) - mapM_ focus m + liftIO $ modifyIORef ioref (\state -> state { markLast = Just win }) + +jumpToLast :: MarkContext -> X () +jumpToLast ctx@(MarkContext ioref) = do + m <- markLast <$> (liftIO $ readIORef ioref) + saveLastMark ctx + mapM_ focus m saveMarkState =<< liftIO (readIORef ioref) jumpToMark :: MarkContext -> Mark -> X () -jumpToMark (MarkContext ioref) mark = do - withFocused $ \win -> do - MarkState {markStateMap = m} <- liftIO $ readIORef ioref - case Map.lookup mark m of - Nothing -> return () - Just w -> do - liftIO $ modifyIORef ioref $ \state -> - state { markLast = Just win } - focus w +jumpToMark ctx@(MarkContext ioref) mark = do + MarkState {markStateMap = m} <- liftIO $ readIORef ioref + case Map.lookup mark m of + Nothing -> return () + Just w -> do + saveLastMark ctx + focus w saveMarkState =<< liftIO (readIORef ioref) diff --git a/src/Main.hs b/src/Main.hs index 6989d60..98fb384 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -11,6 +11,8 @@ import XMonad.Hooks.ManageHelpers import Text.Printf import Internal.Keys +import Internal.LayoutDraw + main = do -- Execute some commands. @@ -34,6 +36,7 @@ main = do , className =? "Tilda" --> doFloat , className =? "MPlayer" --> doFloat , className =? "mpv" --> doFloat + , className =? "gnubby_ssh_prompt" --> doFloat ] } let toggleStructsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b) @@ -45,7 +48,7 @@ main = do ppCurrent = xmobarColor "#ffffff" "red" . printf "%s" , ppVisible = xmobarColor "#8888ff" "" . printf "%s" , ppHidden = xmobarColor "#888888" "" . printf "%s" - , ppWsSep = " · " + , ppWsSep = "<fn=1><fc=#808080> · </fc></fn>" , ppTitle = xmobarColor "#8888ff" "" . printf "%s" . (printf "<fn=1>%s</fn>" :: String -> String) |