huge change in xmonad

- added copy window feature
- keybindings are set in the "myKeys" variable
- only one "qualified" instance of StackSet
- a variable that dictates my workspaces (needed in the myKeys definition)
main
hashirama 2024-07-13 02:28:18 +00:00
parent 3888160cb1
commit a6de086c3b
1 changed files with 48 additions and 29 deletions

View File

@ -6,7 +6,7 @@ import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.StackSet as W -- float purposes
import XMonad.Actions.MouseResize
@ -25,7 +25,7 @@ import XMonad.Util.SpawnOnce (spawnOnce)
-- run or raise
import XMonad.Actions.WindowGo (raiseMaybe, runOrRaise)
import XMonad.ManageHook (className)
import XMonad.StackSet (RationalRect(..))
--
import XMonad.Layout.Decoration
@ -36,7 +36,6 @@ import XMonad.Actions.PerWindowKeys
import XMonad.Actions.FindEmptyWorkspace
import XMonad.Layout.Grid
import XMonad.Layout.PerScreen (ifWider)
import XMonad.StackSet
import XMonad.Layout
import XMonad.Layout.Reflect
import XMonad.Layout.WindowArranger
@ -45,8 +44,10 @@ import XMonad.Layout.WindowArranger
import Data.List (find)
import XMonad.Actions.EasyMotion (selectWindow)
import XMonad.Actions.FocusNth (swapNth)
import qualified XMonad.StackSet as W
import XMonad.Layout.LimitWindows
import XMonad.Actions.CopyWindow
import qualified XMonad.StackSet as W
@ -57,26 +58,18 @@ main = xmonad
. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
$ myConfig
workspacen :: [String]
workspacen = ["ws1", "ws2", "ws3", "ws4", "ws5", "ws6", "ws7", "ws8", "ws9", "ws10"]
myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
, layoutHook = windowArrange myLayout -- Use custom layouts
, terminal = "kitty"
, focusedBorderColor = "#000000"
, manageHook = myManageHook -- Match on certain windows
, startupHook = do
-- other startup commands
-- spawnOnce "xrandr --output DisplayPort-0 --mode 1366x768 --pos 1366x0 --rotate left --output HDMI-A-0 --primary --mode 1366x768 --pos 0x0 --rotate normal --output DVI-D-0 --off"
spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768 --pos 0x0 --rotate normal"
spawnOnce "xrdb /home/hashirama/.Xresources"
spawnOnce "/home/hashirama/.local/bin/rotate_wallpapers.sh"
spawnOnce "picom -b"
spawnOnce "polybar top-monitor-1"
spawnOnce "fcitx5 -d -r"
spawnOnce "emacs --daemon"
}
`additionalKeysP`
myKeys =
[ (otherModMasks ++ "M-" ++ key, action tag)
| (tag, key) <- zip workspacen (words "1 2 3 4 5 6 7 8 9 0")
, (otherModMasks, action) <-
[ ("z-" , windows . W.greedyView)
, ("S-", windows . W.shift)
, ("C-", windows .copy)
]
] ++
[ ("M-d", spawn "rofi -show run")
, ("M-s", spawn "bash -c dictpopup")
, ("M-S-e", spawn "flameshot full --path=/mnt/Data/mpv-screenshots/screenshots/light_novels")
@ -101,6 +94,32 @@ myConfig = def
, ("M-v", easySwap)
]
myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
, layoutHook = windowArrange myLayout -- Use custom layouts
, terminal = "kitty"
, focusedBorderColor = "#000000"
, workspaces = workspacen
, manageHook = myManageHook -- Match on certain windows
, startupHook = do
-- other startup commands
-- spawnOnce "xrandr --output DisplayPort-0 --mode 1366x768 --pos 1366x0 --rotate left --output HDMI-A-0 --primary --mode 1366x768 --pos 0x0 --rotate normal --output DVI-D-0 --off"
spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768 --pos 0x0 --rotate normal"
spawnOnce "xrdb /home/hashirama/.Xresources"
spawnOnce "/home/hashirama/.local/bin/rotate_wallpapers.sh"
spawnOnce "picom -b"
spawnOnce "polybar top-monitor-1"
spawnOnce "fcitx5 -d -r"
spawnOnce "emacs --daemon"
}
`additionalKeysP` myKeys
easySwap :: X ()
easySwap = do
win <- selectWindow def