remove minimization stuff, cleanup

This commit is contained in:
Leon Kowarschick 2020-04-01 12:02:59 +02:00
parent 1fdc27f2c5
commit 504274e9a2
3 changed files with 36 additions and 44 deletions

View file

@ -1,6 +1,8 @@
{-# Language ScopedTypeVariables, LambdaCase #-} {-# Language ScopedTypeVariables, LambdaCase #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-binds #-}
-- Imports -------------------------------------------------------- {{{ -- Imports -------------------------------------------------------- {{{
module Config (main) where module Config (main) where
import qualified Rofi import qualified Rofi
@ -29,8 +31,8 @@ import qualified XMonad.Hooks.EwmhDesktops as Ewmh
import XMonad.Hooks.SetWMName (setWMName) import XMonad.Hooks.SetWMName (setWMName)
import XMonad.Layout.Gaps import XMonad.Layout.Gaps
import XMonad.Layout.LayoutCombinators ((|||)) import XMonad.Layout.LayoutCombinators ((|||))
import XMonad.Layout.NoBorders -- for fullscreen without borders import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile -- for resizeable tall layout import XMonad.Layout.ResizableTile
import XMonad.Layout.MouseResizableTile import XMonad.Layout.MouseResizableTile
import XMonad.Layout.Spacing (spacingRaw, Border(..), toggleWindowSpacingEnabled) import XMonad.Layout.Spacing (spacingRaw, Border(..), toggleWindowSpacingEnabled)
import XMonad.Layout.Renamed (renamed, Rename(Replace)) import XMonad.Layout.Renamed (renamed, Rename(Replace))
@ -47,11 +49,13 @@ import qualified XMonad.Util.XSelection as XSel
-- Minimize stuff -- Minimize stuff
import XMonad.Layout.Minimize import XMonad.Layout.Minimize
import qualified XMonad.Layout.BoringWindows as BoringWindows import qualified XMonad.Layout.BoringWindows as BoringWindows
import XMonad.Actions.Minimize
import XMonad.Actions.WindowBringer
import XMonad.Actions.Commands import XMonad.Actions.Commands
-- }}} -- }}}
{-# ANN module "HLint: ignore Redundant $" #-}
{-# ANN module "HLint: ignore Redundant bracket" #-}
{-# ANN module "HLint: ignore Move brackets to avoid $" #-}
-- Values -------------------- {{{ -- Values -------------------- {{{
myModMask = mod4Mask myModMask = mod4Mask
@ -104,10 +108,10 @@ aqua = "#8ec07c"
--layoutHints . --layoutHints .
myLayout = avoidStruts . BoringWindows.boringWindows . minimize . smartBorders . toggleLayouts Full . layoutHintsToCenter $ layouts myLayout = avoidStruts . BoringWindows.boringWindows . minimize . smartBorders . toggleLayouts Full . layoutHintsToCenter $ layouts
where where
layouts =((rename "Tall" $ onlyGaps $ mouseResizableTile {draggerType = dragger}) -- ResizableTall 1 (3/100) (1/2) [] layouts =((rename "Bsp" $ spacingAndGaps $ borderResize $ emptyBSP)
||| (rename "Tall" $ onlyGaps $ mouseResizableTile {draggerType = dragger}) -- ResizableTall 1 (3/100) (1/2) []
||| (rename "Horizon" $ onlyGaps $ mouseResizableTileMirrored {draggerType = dragger}) -- Mirror $ ResizableTall 1 (3/100) (3/4) [] ||| (rename "Horizon" $ onlyGaps $ mouseResizableTileMirrored {draggerType = dragger}) -- Mirror $ ResizableTall 1 (3/100) (3/4) []
||| (rename "Row" $ spacingAndGaps $ zoomRow) ||| (rename "Row" $ spacingAndGaps $ zoomRow))
||| (rename "Bsp" $ spacingAndGaps $ borderResize $ emptyBSP))
-- ||| (rename "threeCol" $ spacingAndGaps $ ThreeColMid 1 (3/100) (1/2)) -- ||| (rename "threeCol" $ spacingAndGaps $ ThreeColMid 1 (3/100) (1/2))
-- ||| (rename "spiral" $ spacingAndGaps $ spiral (9/21)) -- ||| (rename "spiral" $ spacingAndGaps $ spiral (9/21))
-- ||| (rename "spiral" $ spiral (6/7))) -- ||| (rename "spiral" $ spiral (6/7)))
@ -148,23 +152,33 @@ myStartupHook = do
-- Keymap --------------------------------------- {{{ -- Keymap --------------------------------------- {{{
-- Default mappings that need to be removed removedKeys :: [String] -- Default mappings that need to be removed
removedKeys = ["M-S-c", "M-S-q"] removedKeys :: [String]
removedKeys = ["M-S-c", "M-S-q", "M-h", "M-l"]
myKeys :: [(String, X ())] myKeys :: [(String, X ())]
myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave) myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave)
, ("M-C-j", sendMessage MirrorShrink >> sendMessage ExpandSlave) , ("M-C-j", sendMessage MirrorShrink >> sendMessage ExpandSlave)
, ("M-C-h", sendMessage Shrink)
, ("M-C-l", sendMessage Expand)
, ("M-+", sendMessage zoomIn) , ("M-+", sendMessage zoomIn)
, ("M--", sendMessage zoomOut) , ("M--", sendMessage zoomOut)
, ("M-#", sendMessage zoomReset) , ("M-#", sendMessage zoomReset)
, ("M-f", toggleFullscreen) , ("M-f", toggleFullscreen)
--, ("M-h", Nav2d.windowGo L False)
--, ("M-l", Nav2d.windowGo R False)
--, ("M-j", Nav2d.windowGo D False)
--, ("M-k", Nav2d.windowGo U False)
, ("M-S-C-c", kill1) , ("M-S-C-c", kill1)
, ("M-S-C-q", io $ exitSuccess) , ("M-S-C-q", io exitSuccess)
-- Binary space partitioning -- Binary space partitioning
, ("M-<Backspace>", sendMessage $ Swap) , ("M-<Backspace>", sendMessage Swap)
, ("M-M1-<Backspace>", sendMessage $ Rotate) , ("M-M1-<Backspace>", sendMessage Rotate)
-- Media -- Media
, ("<XF86AudioRaiseVolume>", spawn "amixer sset Master 5%+") , ("<XF86AudioRaiseVolume>", spawn "amixer sset Master 5%+")
@ -182,15 +196,6 @@ myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave )
, ("M-e", Rofi.promptRunCommand def specialCommands) , ("M-e", Rofi.promptRunCommand def specialCommands)
, ("M-C-e", Rofi.promptRunCommand def =<< defaultCommands ) , ("M-C-e", Rofi.promptRunCommand def =<< defaultCommands )
, ("M-o", Rofi.promptRunCommand def withSelectionCommands) , ("M-o", Rofi.promptRunCommand def withSelectionCommands)
-- Minimization
, ("M-k", BoringWindows.focusUp)
, ("M-j", BoringWindows.focusDown)
, ("M-ü", withFocused minimizeWindow)
, ("M-S-ü", withLastMinimized maximizeWindow)
, ("M-C-ü", promptRestoreWindow)
, ("M1-<Tab>", cycleMinimizedWindow)
] ++ generatedMappings ] ++ generatedMappings
where where
generatedMappings :: [(String, X ())] generatedMappings :: [(String, X ())]
@ -201,25 +206,12 @@ myKeys = [ ("M-C-k", sendMessage MirrorExpand >> sendMessage ShrinkSlave )
| wsp <- map show [1..9 :: Int] | wsp <- map show [1..9 :: Int]
] ]
bspMappings = concat bspMappings = concat
[ [ ("M-M1-" ++ key, sendMessage $ ExpandTowards dir) [ [ ("M-C-M1-" ++ key, sendMessage $ ExpandTowards dir)
, ("M-S-M1-" ++ key, Nav2d.windowGo dir False) , ("M-M1-" ++ key, Nav2d.windowGo dir False)
, ("M-C-M1-" ++ key, Nav2d.windowSwap dir False) , ("M-S-M1-" ++ key, Nav2d.windowSwap dir False)
] ]
| (key, dir) <- [("h", L), ("j", D), ("k", U), ("l", R) ] | (key, dir) <- [("h", L), ("j", D), ("k", U), ("l", R) ]
] ]
cycleMinimizedWindow :: X ()
cycleMinimizedWindow = withLastMinimized $ \window -> do
withFocused minimizeWindow
maximizeWindowAndFocus window
promptRestoreWindow = do
wm <- windowMap
shownWindows <- withMinimized (\minimizedWindows -> pure $ M.filter (`elem` minimizedWindows) wm)
win <- Rofi.promptSimple def (M.keys shownWindows)
whenJust (M.lookup win wm) (\w -> maximizeWindow w >> (windows $ bringWindow w))
toggleFullscreen :: X () toggleFullscreen :: X ()
toggleFullscreen = do toggleFullscreen = do
sendMessage ToggleLayout -- toggle fullscreen layout sendMessage ToggleLayout -- toggle fullscreen layout

Binary file not shown.