1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
| import XMonad import System.IO import XMonad.Actions.CycleWS import XMonad.Actions.SimpleDate import XMonad.Actions.Submap import XMonad.Actions.NoBorders import XMonad.Actions.FloatKeys import XMonad.Actions.WithAll import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.InsertPosition import XMonad.Util.EZConfig import qualified XMonad.StackSet as W import qualified Data.Map as M import XMonad.Layout.NoBorders import XMonad.Layout.Spacing import XMonad.Layout.ResizableTile import XMonad.Layout.Maximize import XMonad.Layout.Minimize import XMonad.Layout.Hidden import XMonad.Layout.ToggleLayouts import XMonad.Layout.NoFrillsDecoration import XMonad.Layout.WindowNavigation import XMonad.Prompt import XMonad.Prompt.Window import XMonad.Prompt.AppLauncher as AL import XMonad.Hooks.WorkspaceHistory import XMonad.Layout.Accordion
import XMonad.ManageHook import XMonad.Util.NamedScratchpad
import XMonad.Layout.CenteredMaster import XMonad.Layout.Grid
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.SubLayouts
import XMonad.Layout.Tabbed import XMonad.Layout.Simplest
main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig myBar = "polybar" myPP = xmobarPP { ppCurrent = xmobarColor "#7CFF00" "" . wrap "[" "]" , ppOrder = \(ws:l:t:_) -> [ws] , ppTitle = (\str -> "") }
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b) myConfig = defaultConfig { modMask = mod4Mask , terminal = myTerminal , focusFollowsMouse = False , mouseBindings = myMouseBindings , layoutHook = myLayoutHook , focusedBorderColor="#1d2935" , normalBorderColor="#1d2935" , logHook = workspaceHistoryHook , manageHook = myManageHook <+> manageHook defaultConfig <+> insertPosition End Newer <+> namedScratchpadManageHook myScratchPads }`additionalKeys` myKeys myTerminal = "xterm" myManageHook = composeAll [ className =? "netease-cloud-music" , className =? "Gimp" , className =? "mplayer" , manageDocks ]
myLayoutHook = hiddenWindows $ maximizeWithPadding 0 $ minimize $ windowNavigation $ noFrillsDeco shrinkText topBarTheme $ addTabs shrinkText myTabTheme $ spacingWithEdge 5 $ subLayout [0,1,2] (Simplest) $ (toggleLayouts ( centerMaster Grid ) ( ResizableTall 1 (1/100) (1/2) [] ) ||| (noBorders Full) ||| Accordion )
topBarTheme = def { activeColor = "#FF7F24" , activeBorderColor = "#FF7F24" , activeTextColor = "#FF7F24" , inactiveColor = "#00868B" , inactiveBorderColor = "#00868B" , inactiveTextColor = "#00868B" , urgentColor = "#9AFF9A" , urgentBorderColor = "#9AFF9A" , urgentTextColor = "#C1C1C1" , decoHeight = 4 } myTabTheme = def { activeColor = "#FF7F24" , inactiveColor = "#00868B" , activeBorderColor = "#FF7F24" , inactiveBorderColor = "#00868B" , activeTextColor = "#FF7F24" , inactiveTextColor = "#00868B" , urgentColor = "#9AFF9A" , urgentBorderColor = "#9AFF9A" , urgentTextColor = "#C1C1C1" , decoHeight = 8 }
myKeys = [ ((mod4Mask, xK_F11),spawn "amixer set Master 5%-") , ((mod4Mask, xK_F12), spawn "amixer set Master 5%+") , ((mod4Mask, xK_F9 ), spawn "xbacklight -dec 2") , ((mod4Mask, xK_F10), spawn "xbacklight -inc 2") , ((0 , 0x1008ff13), spawn "amixer set Master 5%+ unmute") , ((0 , 0x1008ff11), spawn "amixer set Master 5%- unmute") , ((mod4Mask, xK_F6), spawn "xinput disable 14") , ((mod4Mask, xK_n ), spawn "mate-terminal") , ((mod4Mask, xK_r ), spawn "rofi -show drun -theme Adapta-Nokto.rasi") , ((mod4Mask .|. shiftMask, xK_z), spawn "betterlockscreen ~/Picture/background/healer.jpg -l -b 1 dim")
, ((mod4Mask, xK_l), sendMessage $ Go R) , ((mod4Mask, xK_h), sendMessage $ Go L) , ((mod4Mask .|. mod1Mask, xK_i ), sendMessage MirrorShrink) , ((mod4Mask .|. mod1Mask, xK_o ), sendMessage MirrorExpand) , ((mod4Mask .|. mod1Mask, xK_h ), sendMessage Shrink) , ((mod4Mask .|. mod1Mask, xK_l ), sendMessage Expand) , ((mod4Mask .|. shiftMask, xK_m), windows W.swapMaster) , ((mod4Mask, xK_y), withFocused hideWindow) , ((mod4Mask .|. shiftMask, xK_y), popOldestHiddenWindow) , ((mod4Mask, xK_g ), withFocused toggleBorder) , ((mod4Mask, xK_f ), withFocused (sendMessage . maximizeRestore)) , ((mod4Mask, xK_w ), toggleWS) , ((mod4Mask, xK_t), sendMessage ToggleLayout) , ((mod4Mask, xK_BackSpace), kill)
, ((mod4Mask .|. shiftMask, xK_g ), windowPrompt def { autoComplete = Just 500000 } Goto allWindows) , ((mod4Mask .|. shiftMask, xK_b ), windowPrompt def { autoComplete = Just 500000 } Bring allWindows)
, ((mod4Mask, xK_u ), namedScratchpadAction myScratchPads "terminal" ) , ((mod4Mask, xK_p ), namedScratchpadAction myScratchPads "topTerm" )
, ((mod4Mask , xK_s), submap . M.fromList $ [ ((0, xK_j), nextWS) , ((0, xK_k), prevWS) , ((0, xK_l), shiftToNext) , ((0, xK_h ), shiftToPrev) , ((0, xK_f), AL.launchApp def "firefox") , ((0, xK_m), spawn "amixer set Master toggle") , ((0, xK_p), spawn "flameshot &") , ((0, xK_t), sinkAll) , ((0, xK_BackSpace), killAll) , ((0, xK_c), sendMessage ToggleLayout) , ((0, xK_i), namedScratchpadAction myScratchPads "bottomLeftTerm" ) , ((0, xK_o), namedScratchpadAction myScratchPads "bottomRightTerm" ) , ((0, xK_n), namedScratchpadAction myScratchPads "leftTerm" ) ])
, ((mod4Mask , xK_d), submap . M.fromList $ [ ((0 , xK_h), sendMessage $ pullGroup L) , ((0 , xK_l), sendMessage $ pullGroup R) , ((0 , xK_k), sendMessage $ pullGroup U) , ((0 , xK_j), sendMessage $ pullGroup D) , ((0 , xK_m), withFocused (sendMessage . MergeAll)) , ((0 , xK_u), withFocused (sendMessage . UnMerge)) , ((0 , xK_period), onGroup W.focusUp') , ((0 , xK_comma), onGroup W.focusDown') ]) ]
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w)) , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm , NS "topTerm" spawnTerm1 findTerm1 manageTerm1 , NS "bottomLeftTerm" spawnTerm2 findTerm2 manageTerm2 , NS "bottomRightTerm" spawnTerm3 findTerm3 manageTerm3 , NS "leftTerm" spawnTerm4 findTerm4 manageTerm4 ] where spawnTerm = myTerminal ++ " -name centerTerm" findTerm = resource =? "centerTerm" manageTerm = customFloating $ W.RationalRect l t w h where h = 0.85 w = 0.9 t = 0.07 l = 0.05
spawnTerm1 = myTerminal ++ " -name popupterm" findTerm1 = resource =? "popupterm" manageTerm1 = customFloating $ W.RationalRect l t w h where h = 0.2 w = 1.0 t = 0.02 l = 0.0
spawnTerm2 = "urxvt" ++ " -name blterm" findTerm2 = resource =? "blterm" manageTerm2 = customFloating $ W.RationalRect l t w h where h = 0.05 w = 0.5 t = 0.95 l = 0 spawnTerm3 = "urxvt" ++ " -name brterm" findTerm3 = resource =? "brterm" manageTerm3 = customFloating $ W.RationalRect l t w h where h = 0.05 w = 0.5 t = 0.95 l = 0.5 spawnTerm4 = "urxvt" ++ " -name topcterm" findTerm4 = resource =? "topcterm" manageTerm4 = customFloating $ W.RationalRect l t w h where h = 0.03 w = 0.6 t = 0.03 l = 0.2
|