diff --git a/README.org b/README.org index 98ec112..bdfc5f0 100644 --- a/README.org +++ b/README.org @@ -229,8 +229,8 @@ These default keybindings are left for reference, but are not actually used in m ++ [ -- dwm-like add/remove window to/from all workspaces - ("S-C-a", windows copyToAll) -- copy window to all workspaces - , ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces + ("M-S-C-a", windows copyToAll) -- copy window to all workspaces + , ("M-S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces -- modify tiled window size , ("M-a", sendMessage MirrorShrink) -- decrease vertical window size @@ -239,10 +239,19 @@ These default keybindings are left for reference, but are not actually used in m -- toggle struts for xmobar , ("M-s", sendMessage ToggleStruts) - -- switch directly to a layout + -- switch directly to a layout with and without flattening floating windows , ("M-f", sendMessage $ JumpToLayout "Full") + , ("M-S-f", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Full"]) , ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall") + , ("M-S-t", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Spacing ResizableTall"]) , ("M-g", sendMessage $ JumpToLayout "Spacing Grid") + , ("M-S-g", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Spacing Grid"]) -- launch rofi , ("M-p", spawn "rofi -show combi") @@ -271,6 +280,10 @@ These default keybindings are left for reference, but are not actually used in m , ("M-C-S-l", spawn "light-locker-command --lock") -- lock , ("M-C-S-s", spawn "systemctl suspend") -- suspend + -- close focused window + , ("M-S-c", kill) -- regular kill + , ("M-C-S-c", spawn "xkill") -- force kill + -- toggle compositor , ("M-", spawn "/home/sravan/.config/picom/toggle_picom.sh") @@ -348,10 +361,20 @@ which denotes layout choice. #+begin_src haskell myManageHook = composeAll - [ className =? "MPlayer" --> doFloat - , className =? "Gimp" --> doFloat - , resource =? "desktop_window" --> doIgnore - , resource =? "kdesktop" --> doIgnore ] + [ className =? "MPlayer" --> doFloat + , className =? "Gimp" --> doFloat + , resource =? "desktop_window" --> doIgnore + , resource =? "kdesktop" --> doIgnore + , title =? "Picture in picture" --> doFloat + ] + #+end_src + + Automatically place floating windows using ~myPlacement~. + +Smart placement with a preference for putting windows near the center of the screen, and with 16px gaps at the top and bottom of the screen where no window will be placed. + + #+begin_src haskell + myPlacement = withGaps (16,0,16,0) (smart (0.5,0.5)) #+end_src * Event Handling @@ -423,7 +446,7 @@ Run xmonad with the settings you specify. No need to modify this. xmproc <- spawnPipe "xmobar -x 0 /home/sravan/.xmonad/xmobar.config" -- launches xmobar as a dock xmonad $ ewmh desktopConfig - { manageHook = manageDocks <+> manageHook desktopConfig + { manageHook = manageDocks <+> myManageHook <+> placeHook myPlacement <+> manageHook desktopConfig , startupHook = myStartupHook , layoutHook = myLayout , borderWidth = myBorderWidth diff --git a/xmonad.hs b/xmonad.hs index e5f7e3d..e7cecaa 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -57,8 +57,8 @@ myKeys = ++ [ -- dwm-like add/remove window to/from all workspaces - ("S-C-a", windows copyToAll) -- copy window to all workspaces - , ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces + ("M-S-C-a", windows copyToAll) -- copy window to all workspaces + , ("M-S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces -- modify tiled window size , ("M-a", sendMessage MirrorShrink) -- decrease vertical window size @@ -67,10 +67,19 @@ myKeys = -- toggle struts for xmobar , ("M-s", sendMessage ToggleStruts) - -- switch directly to a layout + -- switch directly to a layout with and without flattening floating windows , ("M-f", sendMessage $ JumpToLayout "Full") + , ("M-S-f", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Full"]) , ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall") + , ("M-S-t", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Spacing ResizableTall"]) , ("M-g", sendMessage $ JumpToLayout "Spacing Grid") + , ("M-S-g", sequence_ + [ withFocused $ windows . W.sink + , sendMessage $ JumpToLayout "Spacing Grid"]) -- launch rofi , ("M-p", spawn "rofi -show combi") @@ -99,6 +108,10 @@ myKeys = , ("M-C-S-l", spawn "light-locker-command --lock") -- lock , ("M-C-S-s", spawn "systemctl suspend") -- suspend + -- close focused window + , ("M-S-c", kill) -- regular kill + , ("M-C-S-c", spawn "xkill") -- force kill + -- toggle compositor , ("M-", spawn "/home/sravan/.config/picom/toggle_picom.sh") @@ -142,10 +155,14 @@ myLayout = monocle = noBorders (Full) myManageHook = composeAll - [ className =? "MPlayer" --> doFloat - , className =? "Gimp" --> doFloat - , resource =? "desktop_window" --> doIgnore - , resource =? "kdesktop" --> doIgnore ] + [ className =? "MPlayer" --> doFloat + , className =? "Gimp" --> doFloat + , resource =? "desktop_window" --> doIgnore + , resource =? "kdesktop" --> doIgnore + , title =? "Picture in picture" --> doFloat + ] + +myPlacement = withGaps (16,0,16,0) (smart (0.5,0.5)) myStartupHook = do -- System Restore Processes @@ -176,7 +193,7 @@ main = do xmproc <- spawnPipe "xmobar -x 0 /home/sravan/.xmonad/xmobar.config" -- launches xmobar as a dock xmonad $ ewmh desktopConfig - { manageHook = manageDocks <+> manageHook desktopConfig + { manageHook = manageDocks <+> myManageHook <+> placeHook myPlacement <+> manageHook desktopConfig , startupHook = myStartupHook , layoutHook = myLayout , borderWidth = myBorderWidth