1
0
Fork 0
mirror of https://github.com/Horhik/dotfiles.git synced 2024-11-29 03:21:31 +00:00

update xmonad config

This commit is contained in:
horhik 2020-09-05 01:12:48 +03:00
parent d75b36b562
commit daabd93bfa

View file

@ -49,6 +49,8 @@ yellowColor = "#f1fa8c"
myTerminal = "alacritty" myTerminal = "alacritty"
myEditor = "nvim" myEditor = "nvim"
myMainDisplay = "eDP-1"
mySecondDisplay = "HDMI-1"
myFocusFollowsMouse :: Bool myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True myFocusFollowsMouse = True
myClickJustFocuses :: Bool myClickJustFocuses :: Bool
@ -56,7 +58,8 @@ myClickJustFocuses = False
myBorderWidth = 4 myBorderWidth = 4
superKey = mod4Mask superKey = mod4Mask
myModMask = superKey myModMask = superKey
myWorkspaces = ["home","web","code","test","tkr","task","edit", "chat","book"] -- myWorkspaces = ["home 1","web 2","code 3","test 4","tkr 5","task 6","edit 7", "chat 8","book 9"]
myWorkspaces = ["I","II","III","IV","V","VI","VII", "VIII","IX"]
-- Border colors for unfocused and focused windows, respectively. -- Border colors for unfocused and focused windows, respectively.
-- --
@ -150,7 +153,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- flameshot gui -- flameshot gui
, ((modm .|. shiftMask, xK_s ), spawn "flameshot gui") , ((modm .|. shiftMask, xK_s ), spawn "flameshot gui")
-- change lang -- change lang
, ((controlMask , xK_space ), spawn "xkb-switch -n") , ((controlMask , xK_space ), spawn "setxkbmap -layout fi,ru,us; xkb-switch -n")
-- toggle fullscreen -- toggle fullscreen
, ((mod4Mask .|. shiftMask, xK_f), sendMessage ToggleStruts) , ((mod4Mask .|. shiftMask, xK_f), sendMessage ToggleStruts)
@ -231,7 +234,7 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
-- --
defaultGapSize = 5 defaultGapSize = 5
defaultGaps = gaps [(U,defaultGapSize), (R,defaultGapSize), (D, defaultGapSize), (L, defaultGapSize)] defaultGaps = gaps [(U,defaultGapSize), (R,defaultGapSize), (D, defaultGapSize), (L, defaultGapSize)]
defaultSpaces = spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True defaultSpaces = spacingRaw True (Border 5 5 5 5) True (Border 5 5 5 5) True
spacesAndGaps = defaultSpaces . defaultGaps spacesAndGaps = defaultSpaces . defaultGaps
myLayout = smartBorders . avoidStruts $ spacesAndGaps $ tiled ||| Mirror tiled ||| Full myLayout = smartBorders . avoidStruts $ spacesAndGaps $ tiled ||| Mirror tiled ||| Full
@ -268,11 +271,19 @@ myManageHook = (composeAll
, className =? "Gimp" --> doFloat , className =? "Gimp" --> doFloat
, title =? "Media viewer" --> doFloat -- Telegram image viewer , title =? "Media viewer" --> doFloat -- Telegram image viewer
, className =? "TerminalDropdown" --> doFloat , className =? "TerminalDropdown" --> doFloat
, className =? "Nemo" --> doCenter
, title =? "dropdown" --> doFloat , title =? "dropdown" --> doFloat
, resource =? "desktop_window" --> doIgnore , resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore , resource =? "kdesktop" --> doIgnore
]) ])
<+> namedScratchpadManageHook myScratchpads <+> namedScratchpadManageHook myScratchpads
where
doCenter = customFloating $ W.RationalRect l t w h
where
h = 0.6 -- height, 50%
w = 0.6 -- width, 50%
t = (1 - h) / 2 -- bottom edge
l = (1 - w) / 2 -- centered left/right
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Scratchpads | ----------------------------------------------------- -- | Scratchpads | -----------------------------------------------------
@ -283,9 +294,9 @@ myScratchpads = [
, NS "anki" spawnAnki findAnki manageAnki , NS "anki" spawnAnki findAnki manageAnki
] ]
where where
classTerm = "terminal-dropdown" classTerm = "TerminalDropdown"
titleTerm = "!dropdown!" titleTerm = "!dropdown!"
spawnTerm = "alacritty -t " ++ titleTerm spawnTerm = "alacritty -t " ++ titleTerm ++ " --class " ++ classTerm
findTerm = title =? titleTerm findTerm = title =? titleTerm
manageTerm = customFloating $ W.RationalRect l t w h manageTerm = customFloating $ W.RationalRect l t w h
where where
@ -327,14 +338,15 @@ myEventHook = mempty
-- --
xbb = backgroundColor -- xmobar background color xbb = backgroundColor -- xmobar background color
myLogHook xmproc = dynamicLogWithPP $ xmobarPP { -- XMobar myLogHook (xmproc0, xmproc1) = dynamicLogWithPP $ xmobarPP { -- XMobar
ppOutput = hPutStrLn xmproc ppOutput = \x -> hPutStrLn xmproc0 x
>> hPutStrLn xmproc1 x
, ppTitle = xmobarColor orangeColor "" . shorten 40 , ppTitle = xmobarColor orangeColor "" . shorten 40
, ppLayout = xmobarColor purpleColor "" , ppLayout = xmobarColor purpleColor ""
, ppCurrent = xmobarColor greenColor "" . wrap "(" ")" , ppCurrent = xmobarColor greenColor "" . wrap "(" ")"
, ppUrgent = xmobarColor redColor "" . wrap "[" "]" , ppUrgent = xmobarColor redColor "" . wrap "[" "]"
, ppHidden = xmobarColor foregroundColor "" . noScratchPad , ppHidden = xmobarColor foregroundColor "" . noScratchPad
, ppVisible = xmobarColor orangeColor "" , ppVisible = xmobarColor orangeColor "" . wrap "(" ")"
, ppSep = xmobarColor foregroundColor "" "}-----{" , ppSep = xmobarColor foregroundColor "" "}-----{"
, ppWsSep = "}-{" , ppWsSep = "}-{"
, ppOrder = \(ws:l:t:ex) -> [ws]++ex++[t,l] -- {workspaces}-{title}--{layout} , ppOrder = \(ws:l:t:ex) -> [ws]++ex++[t,l] -- {workspaces}-{title}--{layout}
@ -355,10 +367,11 @@ myStartupHook = do
spawnOnce "variety &" spawnOnce "variety &"
-- spawnOnce "compton --config ~/.config/compton/compton.conf &" -- spawnOnce "compton --config ~/.config/compton/compton.conf &"
spawnOnce "picom &" spawnOnce "picom &"
spawnOnce "setxkbmap -layout us,ru" spawnOnce "setxkbmap -layout us,fi,ru; "
spawnOnce "$HOME/Scripts/startup/touchpad.sh" spawnOnce "$HOME/Scripts/startup/touchpad.sh"
spawnOnce "sh ssh-agent bash ; ssh-add ~/.ssh/arch" spawnOnce "sh ssh-agent bash ; ssh-add ~/.ssh/arch"
spawnOnce "xautolock -time 25 -locker 'i3lock-fancy' &" spawnOnce ("xrandr --output "++ mySecondDisplay ++ " --above " ++ myMainDisplay)
spawnOnce "xautolock -time 25 -locker 'i3lock-fancy' -notify 24 -notifier 'xkb-switch -s us' &"
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up. -- Now run xmonad with all the defaults we set up.
@ -366,8 +379,9 @@ myStartupHook = do
-- Run xmonad with the settings you specify. No need to modify this. -- Run xmonad with the settings you specify. No need to modify this.
-- --
main = do main = do
xmproc <- spawnPipe "xmobar -d ~/.config/xmobar/config.hs" bar0 <- spawnPipe "xmobar -x 0 -d ~/.config/xmobar/config.hs"
xmonad $ docks $ defaults xmproc bar1 <- spawnPipe "xmobar -x 1 ~/.config/xmobar/config_second.hs"
xmonad $ docks $ defaults (bar0, bar1)
-- A structure containing your configuration settings, overriding -- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will -- fields in the default config. Any you don't override, will
@ -375,7 +389,7 @@ main = do
-- --
-- No need to modify this. -- No need to modify this.
-- --
defaults xmproc = def { defaults (bar0, bar1) = def {
-- simple stuff -- simple stuff
terminal = myTerminal, terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse, focusFollowsMouse = myFocusFollowsMouse,
@ -394,7 +408,7 @@ defaults xmproc = def {
layoutHook = myLayout, layoutHook = myLayout,
manageHook = myManageHook, manageHook = myManageHook,
handleEventHook = myEventHook, handleEventHook = myEventHook,
logHook = myLogHook xmproc, logHook = myLogHook (bar0, bar1),
startupHook = myStartupHook startupHook = myStartupHook
} }