New xmonad with xmobar. Fresh!
This commit is contained in:
parent
56a18b51bd
commit
8813466f77
3 changed files with 533 additions and 235 deletions
|
@ -15,6 +15,11 @@ module Solarized
|
||||||
, blue
|
, blue
|
||||||
, cyan
|
, cyan
|
||||||
, green
|
, green
|
||||||
|
, background
|
||||||
|
, backgroundhl
|
||||||
|
, foreground
|
||||||
|
, foregroundhl
|
||||||
|
, foregroundll
|
||||||
) where
|
) where
|
||||||
|
|
||||||
base03 = "#002b36"
|
base03 = "#002b36"
|
||||||
|
@ -34,3 +39,8 @@ blue = "#268bd2"
|
||||||
cyan = "#3aa198"
|
cyan = "#3aa198"
|
||||||
green = "#859900"
|
green = "#859900"
|
||||||
|
|
||||||
|
foregroundhl = base1
|
||||||
|
foreground = base0
|
||||||
|
foregroundll = base01
|
||||||
|
backgroundhl = base02
|
||||||
|
background = base03
|
||||||
|
|
37
xmobarrc
Normal file
37
xmobarrc
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
Config {
|
||||||
|
font = "xft:Fira Code:style=Regular:size=9"
|
||||||
|
, template = " %StdinReader%}{%battery% <fc=#2AA198>•</fc> %date% "
|
||||||
|
, commands =
|
||||||
|
[ Run StdinReader
|
||||||
|
, Run Date "%F %a <fc=#2AA198>•</fc> %T" "date" 10
|
||||||
|
, Run Battery [ "--template", "<leftvbar> <left>%<fc=#2AA198>/</fc><timeleft> <fc=#2AA198>• <acstatus> • <watts>W</fc>"
|
||||||
|
, "-L", "25"
|
||||||
|
, "-H", "35"
|
||||||
|
, "-l", "#FF0000"
|
||||||
|
, "-n", "#FFFF00"
|
||||||
|
, "--"
|
||||||
|
, "-O", "ac on"
|
||||||
|
, "-i", "ac idle"
|
||||||
|
, "-o", "ac off"
|
||||||
|
] 50
|
||||||
|
]
|
||||||
|
, bgColor = "#002b36"
|
||||||
|
, fgColor = "#839496"
|
||||||
|
, border = BottomB
|
||||||
|
, borderWidth = 5
|
||||||
|
, borderColor = "#859900"
|
||||||
|
, position = TopSize L 100 29
|
||||||
|
, textOffset = 16
|
||||||
|
, additionalFonts = [ "xft:DejaVu Sans Mono:style=Regular:size=9" ]
|
||||||
|
-- , sepChar
|
||||||
|
-- , alignSep
|
||||||
|
-- , iconOffset
|
||||||
|
-- , allDesktops
|
||||||
|
-- , overrideRedirect
|
||||||
|
-- , pickBroadest
|
||||||
|
-- , hideOnStart
|
||||||
|
-- , lowerOnStart
|
||||||
|
-- , persistent
|
||||||
|
-- , iconRoot
|
||||||
|
-- , alpha
|
||||||
|
}
|
721
xmonad.hs
721
xmonad.hs
|
@ -1,257 +1,508 @@
|
||||||
import Codec.Binary.UTF8.String
|
-- My xmonad configuration, based on the example.hs of the xmonad project
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
-- including best practises.
|
||||||
import LemonBar
|
-- https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Config/Example.hs
|
||||||
import qualified Solarized as S
|
|
||||||
import qualified Data.Map as M
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
import qualified XMonad.StackSet as W
|
|
||||||
|
module Main (main) where
|
||||||
|
|
||||||
|
import Data.Ratio ((%))
|
||||||
|
import Data.List (sort, isSuffixOf)
|
||||||
|
import Text.EditDistance
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import System.IO
|
|
||||||
import Text.Printf
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.CycleWS
|
import XMonad.Actions.CycleWS
|
||||||
import XMonad.Config.Desktop
|
import XMonad.Config.Desktop
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
import XMonad.Hooks.EwmhDesktops
|
|
||||||
import XMonad.Hooks.ManageDocks
|
|
||||||
import XMonad.Hooks.ManageHelpers
|
import XMonad.Hooks.ManageHelpers
|
||||||
import XMonad.Layout.IndependentScreens
|
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
||||||
import XMonad.Layout.LayoutCombinators hiding ( (|||) )
|
import XMonad.Layout.ResizableTile (ResizableTall(..))
|
||||||
import XMonad.Layout.Reflect
|
import XMonad.Layout.Spacing
|
||||||
|
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
|
||||||
import XMonad.Prompt
|
import XMonad.Prompt
|
||||||
import XMonad.Prompt.Shell(shellPrompt)
|
import XMonad.Prompt.ConfirmPrompt
|
||||||
import XMonad.Util.Font
|
import XMonad.Prompt.Shell
|
||||||
import XMonad.Util.Loggers
|
import XMonad.Util.EZConfig
|
||||||
-- import XMonad.Util.Run
|
import qualified Solarized as S
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
main = do
|
-- Contructors imports
|
||||||
spawn bar
|
import XMonad.Core (XConfig)
|
||||||
xmonad $ docks $ ewmh desktopConfig
|
import XMonad.Hooks.ManageDocks (AvoidStruts)
|
||||||
{ manageHook = myManageHook <+> manageDocks <+> manageHook defaultConfig
|
import XMonad.Layout.LayoutModifier (ModifiedLayout)
|
||||||
, layoutHook = myLayout
|
|
||||||
, logHook = maLogouk
|
wkspcs :: [String]
|
||||||
, modMask = mod4Mask -- Rebind to Logo key
|
-------- ["●", "◕", "◑", "◔", "◯", "◐", "◒", "◓", "☦", "λ"]
|
||||||
, workspaces = ["●", "◕", "◑", "◔", "◯", "◐", "◒", "◓", "☦"]
|
wkspcs = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ"]
|
||||||
, borderWidth = 0
|
|
||||||
, keys = myKeys
|
barPP = def
|
||||||
, terminal = "/run/current-system/sw/bin/kitty"
|
{ ppCurrent = xmobarColor' S.orange
|
||||||
, handleEventHook = handleEventHook defaultConfig <+> fullscreenEventHook
|
, ppVisible = xmobarColor' S.yellow -- other screen
|
||||||
|
, ppHidden = xmobarColor' S.foreground -- other workspaces with windows
|
||||||
|
, ppHiddenNoWindows = xmobarColor' S.foregroundll -- other workspaces
|
||||||
|
, ppSep = " "
|
||||||
|
, ppLayout = printLayout
|
||||||
|
, ppTitle = printTitle
|
||||||
|
}
|
||||||
|
where xmobarColor' fg = xmobarColor fg S.base03
|
||||||
|
|
||||||
|
printLayout s | "Mirror ResizableTall" `isSuffixOf` s = "[ — ]"
|
||||||
|
printLayout s | "ResizableTall" `isSuffixOf` s = "[ | ]"
|
||||||
|
printLayout "Full" = "[ F ]"
|
||||||
|
printLayout l = "[" ++ l ++ "]"
|
||||||
|
|
||||||
|
printTitle t = let t' = shorten 120 t
|
||||||
|
in xmobarColor' S.foregroundll "« "
|
||||||
|
++ xmobarColor' S.foregroundhl t'
|
||||||
|
++ xmobarColor' S.foregroundll " »"
|
||||||
|
|
||||||
|
bar :: LayoutClass l Window => XConfig l -> IO (XConfig (ModifiedLayout AvoidStruts l))
|
||||||
|
bar conf = statusBar "xmobar /home/eeva/.xmonad/xmobarrc" barPP hideBarsKey conf
|
||||||
|
where hideBarsKey XConfig{modMask = modm} = (modm, xK_b)
|
||||||
|
|
||||||
|
myConfig = desktopConfig
|
||||||
|
{ modMask = mod4Mask -- Use the "Win" key for the mod key
|
||||||
|
, manageHook = myManageHook <+> manageHook desktopConfig
|
||||||
|
, layoutHook = desktopLayoutModifiers $ myLayouts
|
||||||
|
, logHook = dynamicLogString def >>= xmonadPropLog
|
||||||
|
, terminal = "/run/current-system/sw/bin/kitty"
|
||||||
|
, workspaces = wkspcs
|
||||||
|
, normalBorderColor = S.base03
|
||||||
|
, focusedBorderColor = S.violet
|
||||||
|
, borderWidth = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
sym "Tall" = "|"
|
`additionalKeysP` -- Add some extra key bindings:
|
||||||
sym "Mirror Tall" = "-"
|
[ ("M-S-q", confirmPrompt myXPConfig "exit" (io exitSuccess))
|
||||||
sym "Full" = "F"
|
, ("<XF86MonBrightnessDown>", spawn "/run/current-system/sw/bin/xbacklight -10")
|
||||||
sym _ = "◓"
|
, ("<XF86MonBrightnessUp>", spawn "/run/current-system/sw/bin/xbacklight +10")
|
||||||
|
, ("M-<Delete>", kill)
|
||||||
|
, ("M-<Down>", windows W.focusDown)
|
||||||
|
, ("M-<Esc>", sendMessage (Toggle "Full"))
|
||||||
|
, ("M-<Left>", prevWS)
|
||||||
|
, ("M-<Right>", nextWS)
|
||||||
|
, ("M-<Tab>", toggleWS)
|
||||||
|
, ("M-<Up>", windows W.focusUp)
|
||||||
|
, ("M-S-<Delete>", spawn "/run/current-system/sw/bin/i3lock-fancy -g -p")
|
||||||
|
, ("M-S-<Left>", shiftToPrev >> prevWS)
|
||||||
|
, ("M-S-<Right>", shiftToNext >> nextWS)
|
||||||
|
, ("M-p", fuzzyPrompt myXPConfig)
|
||||||
|
, ("<Tab>-b", sendMessage (Toggle "Full"))
|
||||||
|
]
|
||||||
|
|
||||||
maLogouk = dynamicLogWithPP $ defaultPP
|
`additionalKeys`-- Add some more (automatic) key bindings:
|
||||||
{ ppOutput = printToFile
|
[ ((mod4Mask .|. mask, key), windows $ actionWith tag)
|
||||||
, ppCurrent = LemonBar.color S.orange S.base03 . LemonBar.underline -- . sym
|
| (tag, key) <- zip wkspcs [ xK_F1 .. ]
|
||||||
, ppVisible = LemonBar.color S.yellow S.base03 . LemonBar.underline -- . sym
|
, (mask, actionWith) <- zip [ 0, shiftMask ] [ W.view, W.shift ] ]
|
||||||
, ppHidden = LemonBar.color S.base2 S.base03 . LemonBar.underline -- . sym
|
|
||||||
, ppHiddenNoWindows = LemonBar.color S.base01 S.base03 -- . sym
|
myLayouts = smartBorders $ toggleLayouts (noBorders Full) others
|
||||||
, ppLayout = sym
|
where
|
||||||
, ppTitle = LemonBar.fColor S.violet . shorten 70
|
resizableTall = ResizableTall 1 (2 % 1) (1/2) []
|
||||||
, ppSep = " "
|
others = smartSpacingWithEdge 5 $ resizableTall ||| (Mirror resizableTall)
|
||||||
|
|
||||||
|
myXPConfig = def
|
||||||
|
{ position = Top
|
||||||
|
, alwaysHighlight = True
|
||||||
|
, bgColor = S.magenta
|
||||||
|
, bgHLight = S.base0
|
||||||
|
, borderColor = S.magenta
|
||||||
|
, defaultText = ""
|
||||||
|
, fgColor = S.base02
|
||||||
|
, fgHLight = S.base03
|
||||||
|
, font = "xft:Fira Code:style=Regular:size=9"
|
||||||
|
, height = 24
|
||||||
|
, promptBorderWidth = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
printToFile :: String -> IO ()
|
-- Use the `xprop' tool to get the info you need for these matches.
|
||||||
printToFile s = do
|
-- For className, use the second value that xprop gives you.
|
||||||
h <- openFile "/tmp/monitors/xmonad" WriteMode
|
myManageHook = composeOne
|
||||||
hPutStrLn h $ decodeString s
|
[ className =? "mpv" -?> doFullFloat <+> (doShift $ last wkspcs)
|
||||||
-- xxxxxxxxxxxx
|
, className =? "Pavucontrol" -?> doShift $ wkspcs !! 7
|
||||||
-- v----------------|
|
, className =? "qutebrowser" -?> doShift $ wkspcs !! 5
|
||||||
-- Hacky hack to fix the broken fix of dynamicLogWithPP
|
, isDialog -?> doCenterFloat
|
||||||
hClose h
|
|
||||||
|
|
||||||
myManageHook = composeAll
|
-- Move transient windows to their parent:
|
||||||
[ className =? "float" --> doCenterFloat
|
, transience
|
||||||
, manageDocks ]
|
]
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
-- Finally:
|
||||||
-- LogHook. Dynamically outputs logs nicely formatted for dzen2
|
main = xmonad =<< bar myConfig
|
||||||
--
|
|
||||||
-- myLogHook h = dynamicLogWithPP $ defaultPP {
|
|
||||||
-- ppCurrent = dzenColor "#cb4b16" "#eee8d5",
|
|
||||||
-- ppVisible = dzenColor "#657b83" "#eee8d5",
|
|
||||||
-- ppHiddenNoWindows = dzenColor "#93a1a1" "#eee8d5",
|
|
||||||
-- ppLayout = dzenColor "#6c71c4" "#eee8d5",
|
|
||||||
-- ppTitle = (dzenColor "#cb4b16" "") . (fixedWidth 256),
|
|
||||||
-- ppSep = " ",
|
|
||||||
-- ppWsSep = " ",
|
|
||||||
-- ppOutput = hPutStrLn h
|
|
||||||
-- }
|
|
||||||
-- where
|
|
||||||
-- fixedWidth n l = take (n+5) $ l ++ (cycle ".")
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
-- StatusBar. Call lemonbar
|
|
||||||
bar = printf
|
|
||||||
"pkill lemonbar; /home/eeva/bin/mkstatus.sh | \
|
|
||||||
\ lemonbar -g 1919x24+0+0 \
|
|
||||||
\ -f '%s' \
|
|
||||||
\ -f '%s' \
|
|
||||||
\ -u %d -B '%s' -F '%s' -U '%s'"
|
|
||||||
--"tewi:style=Regular:antialias=false:autohint=false"
|
|
||||||
"Iosevka:size=10"
|
|
||||||
"DejaVu Sans Mono:size=10"
|
|
||||||
(2 :: Int)
|
|
||||||
S.base03
|
|
||||||
S.base0
|
|
||||||
S.violet
|
|
||||||
|
|
||||||
myLayout = (avoidStruts $ tiled ||| Mirror tiled) ||| Full
|
-- Slightly taken from
|
||||||
where
|
-- https://mail.haskell.org/pipermail/xmonad/2010-October/010671.html
|
||||||
tiled = Tall 1 (3/100) (1/2)
|
data FuzzySpawn = FuzzySpawn deriving (Read, Show)
|
||||||
|
instance XPrompt FuzzySpawn where showXPrompt _ = "Run: "
|
||||||
|
fuzzyPrompt config = do
|
||||||
|
cmds <- io getCommands
|
||||||
|
let compl s
|
||||||
|
| null s = []
|
||||||
|
| otherwise = let weight c = levenshteinDistance defaultEditCosts s c
|
||||||
|
in map snd $ take 20 $ sort $ map (\c -> (weight c,c)) cmds
|
||||||
|
mkXPrompt FuzzySpawn config (return . compl) spawn
|
||||||
|
|
||||||
-- Prompt config
|
--- import qualified Data.Map as Map
|
||||||
myXPConfig = defaultXPConfig {
|
--- import XMonad
|
||||||
position = Top,
|
--- import XMonad.Util.EZConfig
|
||||||
promptBorderWidth = 5,
|
--- import XMonad.Layout.Tabbed
|
||||||
font = "xft:tewi:style=Regular:antialias=false:autohint=false",
|
--- import XMonad.Hooks.ManageDocks
|
||||||
height = 24,
|
--- import XMonad.Hooks.DynamicLog
|
||||||
borderColor = S.base03,
|
--- import XMonad.Layout.NoBorders
|
||||||
bgHLight = S.base02,
|
--- import XMonad.Actions.SwapWorkspaces
|
||||||
fgHLight = S.magenta,
|
--- import XMonad.Prompt
|
||||||
bgColor = S.base03,
|
--- import XMonad.Prompt.Shell
|
||||||
fgColor = S.base0,
|
---
|
||||||
defaultText = ""
|
--- -- Solarized colours.
|
||||||
}
|
--- activeBackColor = "#073642"
|
||||||
|
--- --activeForeColor = "#93A1A1" -- base1
|
||||||
|
--- activeForeColor = "#EEE8D5" -- base2
|
||||||
|
--- passiveForeColor = "#2AA198"
|
||||||
|
---
|
||||||
|
--- yoTabbed = tabbed shrinkText $ def
|
||||||
|
--- { fontName = "xft:Hack:size=10"
|
||||||
|
--- , activeBorderColor = activeForeColor
|
||||||
|
--- , activeTextColor = activeForeColor
|
||||||
|
--- , activeColor = activeBackColor
|
||||||
|
--- , inactiveBorderColor = "#555555"
|
||||||
|
--- , inactiveTextColor = "#555555"
|
||||||
|
--- , inactiveColor = "#000000"
|
||||||
|
--- }
|
||||||
|
--- simpleTall = Tall 1 (1/100) (1/2)
|
||||||
|
--- yoLayouts = smartBorders $ (Mirror simpleTall ||| simpleTall ||| yoTabbed)
|
||||||
|
---
|
||||||
|
--- yoPromptXP = def
|
||||||
|
--- { bgColor = activeBackColor
|
||||||
|
--- , borderColor = activeForeColor
|
||||||
|
--- , fgColor = activeForeColor
|
||||||
|
--- , fgHLight = "#073642"
|
||||||
|
--- , bgHLight = "#859900"
|
||||||
|
--- , promptKeymap = emacsLikeXPKeymap
|
||||||
|
--- , font = "xft:Hack:size=12"
|
||||||
|
--- }
|
||||||
|
---
|
||||||
|
--- yoConfig = def
|
||||||
|
--- { terminal = "termite"
|
||||||
|
--- , modMask = mod4Mask
|
||||||
|
--- , focusedBorderColor = activeForeColor
|
||||||
|
--- , layoutHook = yoLayouts
|
||||||
|
--- }
|
||||||
|
--- `additionalKeysP`
|
||||||
|
--- [ ( "M-<Return>", spawn $ "emacs")
|
||||||
|
---
|
||||||
|
--- , ("<XF86AudioMute>", spawn "pamixer -t")
|
||||||
|
--- , ("M-<F5>" , spawn "pamixer -d 1")
|
||||||
|
--- , ("M-<F6>" , spawn "pamixer -i 1")
|
||||||
|
---
|
||||||
|
--- , ("M-<F7>" , spawn "xbacklight -dec 5")
|
||||||
|
--- , ("M-<F8>" , spawn "xbacklight -inc 5")
|
||||||
|
---
|
||||||
|
--- , ("M-<F9>" , spawn "setxkbmap dvorak")
|
||||||
|
--- , ("M-<F10>", spawn "setxkbmap fr" )
|
||||||
|
--- , ("M-<F11>", spawn "setxkbmap ru" )
|
||||||
|
--- , ("M-<F12>", spawn "setxkbmap ro" )
|
||||||
|
---
|
||||||
|
--- , ("M-C-<Right>", swapTo Next)
|
||||||
|
--- , ("M-C-<Left>" , swapTo Prev)
|
||||||
|
---
|
||||||
|
--- , ("M-r", shellPrompt yoPromptXP)
|
||||||
|
--- ]
|
||||||
|
--- `removeKeysP`
|
||||||
|
--- [ "M-q" ]
|
||||||
|
---
|
||||||
|
--- yoXmobarPP = def
|
||||||
|
--- { ppCurrent = xmobarColor' activeForeColor . activePad
|
||||||
|
--- , ppVisible = xmobarColor' activeForeColor -- other screen
|
||||||
|
--- , ppHidden = xmobarColor' passiveForeColor -- other workspaces with windows
|
||||||
|
--- , ppHiddenNoWindows = xmobarColor' activeBackColor -- other workspaces
|
||||||
|
--- , ppSep = " "
|
||||||
|
--- , ppLayout = printLayout
|
||||||
|
--- , ppTitle = printTitle
|
||||||
|
--- }
|
||||||
|
--- where xmobarColor' fg = xmobarColor fg "#000000"
|
||||||
|
---
|
||||||
|
--- printLayout "Tall" = "[|]"
|
||||||
|
--- printLayout "Mirror Tall" = "[—]"
|
||||||
|
--- printLayout "Tabbed Simplest" = "[□]"
|
||||||
|
--- printLayout l = "[" ++ l ++ "]"
|
||||||
|
---
|
||||||
|
--- printTitle t = let t' = shorten 120 t
|
||||||
|
--- in xmobarColor' passiveForeColor "[ "
|
||||||
|
--- ++ xmobarColor' passiveForeColor t'
|
||||||
|
--- ++ xmobarColor' passiveForeColor " ]"
|
||||||
|
---
|
||||||
|
--- activePad s = xmobarColor' bracketColor " >"
|
||||||
|
--- ++ s
|
||||||
|
--- ++ xmobarColor' bracketColor "< "
|
||||||
|
--- bracketColor = "#B58900"
|
||||||
|
---
|
||||||
|
--- xmobarCmd = "xmobar /home/scolobb/.xmonad/xmobarrc"
|
||||||
|
---
|
||||||
|
--- main = do
|
||||||
|
--- spawn "stalonetray --geometry 5x1+1000 --icon-size 20 -bg '#000000'"
|
||||||
|
--- spawn "nm-applet"
|
||||||
|
--- spawn "seafile-applet"
|
||||||
|
--- spawn "syndaemon"
|
||||||
|
--- xmonad =<< statusBar xmobarCmd yoXmobarPP hideBarsKey yoConfig
|
||||||
|
--- where hideBarsKey XConfig{modMask = modm} = (modm, xK_b)
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
-- Key bindings. Add, modify or remove key bindings here.
|
|
||||||
--
|
|
||||||
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|
||||||
[
|
|
||||||
-- launch dmenu
|
|
||||||
--((modm, xK_p), spawn "dmenu_run -b -l 3")
|
|
||||||
-- launch prompt
|
|
||||||
((modm, xK_p), shellPrompt myXPConfig)
|
|
||||||
|
|
||||||
-- close focused window
|
|
||||||
, ((modm, xK_Delete), kill)
|
|
||||||
|
|
||||||
-- Rotate through the available layout algorithms
|
--- import Codec.Binary.UTF8.String
|
||||||
, ((modm, xK_space ), sendMessage NextLayout)
|
--- import Graphics.X11.ExtraTypes.XF86
|
||||||
--, ((modm .|. shiftMask xK_Tab ), sendMessage PreviousLayout)
|
--- import LemonBar
|
||||||
|
--- import qualified Solarized as S
|
||||||
-- Reset the layouts on the current workspace to default
|
--- import qualified Data.Map as M
|
||||||
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
--- import qualified XMonad.StackSet as W
|
||||||
|
--- import System.Exit
|
||||||
-- Resize viewed windows to the correct size
|
--- import System.IO
|
||||||
, ((modm, xK_n ), refresh)
|
--- import Text.Printf
|
||||||
|
--- import XMonad
|
||||||
-- Move focus to the master window
|
--- import XMonad.Actions.CycleWS
|
||||||
, ((modm, xK_m ), windows W.focusMaster )
|
--- import XMonad.Config.Desktop
|
||||||
|
--- import XMonad.Hooks.DynamicLog
|
||||||
-- Swap the focused window and the master window
|
--- import XMonad.Hooks.EwmhDesktops
|
||||||
, ((modm, xK_BackSpace), windows W.swapMaster)
|
--- import XMonad.Hooks.ManageDocks
|
||||||
|
--- import XMonad.Hooks.ManageHelpers
|
||||||
-- Move focus to the next window
|
--- import XMonad.Layout.IndependentScreens
|
||||||
, ((modm, xK_j ), windows W.focusDown)
|
--- import XMonad.Layout.LayoutCombinators hiding ( (|||) )
|
||||||
, ((modm, xK_Down ), windows W.focusDown)
|
--- import XMonad.Layout.Reflect
|
||||||
|
--- import XMonad.Prompt
|
||||||
-- Move focus to the previous window
|
--- import XMonad.Prompt.Shell(shellPrompt)
|
||||||
, ((modm, xK_k ), windows W.focusUp )
|
--- import XMonad.Util.Font
|
||||||
, ((modm, xK_Up ), windows W.focusUp)
|
--- import XMonad.Util.Loggers
|
||||||
|
--- -- import XMonad.Util.Run
|
||||||
-- Swap the focused window with the next window
|
---
|
||||||
, ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
--- main = do
|
||||||
, ((modm .|. shiftMask, xK_Down ), windows W.swapDown )
|
--- spawn bar
|
||||||
|
--- xmonad $ docks $ ewmh desktopConfig
|
||||||
-- Swap the focused window with the previous window
|
--- { manageHook = myManageHook <+> manageDocks <+> manageHook defaultConfig
|
||||||
, ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
--- , layoutHook = myLayout
|
||||||
, ((modm .|. shiftMask, xK_Up ), windows W.swapUp )
|
--- , logHook = maLogouk
|
||||||
|
--- , modMask = mod4Mask -- Rebind to Logo key
|
||||||
-- Shrink the master area
|
--- , workspaces = ["●", "◕", "◑", "◔", "◯", "◐", "◒", "◓", "☦"]
|
||||||
, ((modm, xK_h ), sendMessage Shrink)
|
--- , borderWidth = 0
|
||||||
|
--- , keys = myKeys
|
||||||
-- Expand the master area
|
--- , terminal = "/run/current-system/sw/bin/kitty"
|
||||||
, ((modm, xK_l ), sendMessage Expand)
|
--- , handleEventHook = handleEventHook defaultConfig <+> fullscreenEventHook
|
||||||
|
--- }
|
||||||
-- Move to next Workspace
|
---
|
||||||
, ((modm, xK_Right ), nextWS)
|
--- sym "Tall" = "|"
|
||||||
|
--- sym "Mirror Tall" = "-"
|
||||||
-- Move to previous Workspace
|
--- sym "Full" = "F"
|
||||||
, ((modm, xK_Left ), prevWS)
|
--- sym _ = "◓"
|
||||||
|
---
|
||||||
-- Move focused window to next Workspace
|
--- maLogouk = dynamicLogWithPP $ defaultPP
|
||||||
, ((modm .|. shiftMask, xK_Right ), shiftToNext >> nextWS)
|
--- { ppOutput = printToFile
|
||||||
|
--- , ppCurrent = LemonBar.color S.orange S.base03 . LemonBar.underline -- . sym
|
||||||
-- Move focused window to previous Workspace
|
--- , ppVisible = LemonBar.color S.yellow S.base03 . LemonBar.underline -- . sym
|
||||||
, ((modm .|. shiftMask, xK_Left ), shiftToPrev >> prevWS)
|
--- , ppHidden = LemonBar.color S.base2 S.base03 . LemonBar.underline -- . sym
|
||||||
|
--- , ppHiddenNoWindows = LemonBar.color S.base01 S.base03 -- . sym
|
||||||
-- Cycle between windows
|
--- , ppLayout = sym
|
||||||
, ((modm , xK_Tab ), toggleWS)
|
--- , ppTitle = LemonBar.fColor S.violet . shorten 70
|
||||||
|
--- , ppSep = " "
|
||||||
-- Push window back into tiling
|
--- }
|
||||||
, ((modm, xK_t ), withFocused $ windows . W.sink)
|
---
|
||||||
|
--- printToFile :: String -> IO ()
|
||||||
-- Increment the number of windows in the master area
|
--- printToFile s = do
|
||||||
, ((modm , xK_comma ), sendMessage (IncMasterN 1))
|
--- h <- openFile "/tmp/monitors/xmonad" WriteMode
|
||||||
|
--- hPutStrLn h $ decodeString s
|
||||||
-- Deincrement the number of windows in the master area
|
--- -- xxxxxxxxxxxx
|
||||||
, ((modm , xK_period), sendMessage (IncMasterN (-1)))
|
--- -- v----------------|
|
||||||
|
--- -- Hacky hack to fix the broken fix of dynamicLogWithPP
|
||||||
-- close focused window
|
--- hClose h
|
||||||
, ((modm .|. shiftMask, xK_c ), kill)
|
---
|
||||||
|
--- myManageHook = composeAll
|
||||||
-- Swap the focused window and the master window
|
--- [ className =? "float" --> doCenterFloat
|
||||||
, ((modm, xK_Return), windows W.swapMaster)
|
--- , manageDocks ]
|
||||||
|
---
|
||||||
-- run my terminal
|
--- ------------------------------------------------------------------------
|
||||||
, ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
--- -- LogHook. Dynamically outputs logs nicely formatted for dzen2
|
||||||
|
--- --
|
||||||
-- lock my session
|
--- -- myLogHook h = dynamicLogWithPP $ defaultPP {
|
||||||
--, ((modm .|. shiftMask, xK_Delete), spawn "/usr/bin/sxlock -f \"-*-ubuntu mono-*-r-*-*-*-*-*-*-*-*-*-*\"")
|
--- -- ppCurrent = dzenColor "#cb4b16" "#eee8d5",
|
||||||
, ((modm .|. shiftMask, xK_Delete), spawn "/run/current-system/sw/bin/i3lock-fancy -g -p")
|
--- -- ppVisible = dzenColor "#657b83" "#eee8d5",
|
||||||
|
--- -- ppHiddenNoWindows = dzenColor "#93a1a1" "#eee8d5",
|
||||||
-- quit xmonad
|
--- -- ppLayout = dzenColor "#6c71c4" "#eee8d5",
|
||||||
, ((modm .|. shiftMask, xK_q), io (exitWith ExitSuccess))
|
--- -- ppTitle = (dzenColor "#cb4b16" "") . (fixedWidth 256),
|
||||||
|
--- -- ppSep = " ",
|
||||||
-- Raise volume (XF86XK_AudioRaiseVolume)
|
--- -- ppWsSep = " ",
|
||||||
, ((0 , xF86XK_AudioRaiseVolume), spawn "/home/eeva/prefix/bin/volume up")
|
--- -- ppOutput = hPutStrLn h
|
||||||
|
--- -- }
|
||||||
-- Lower volume (XF86XK_AudioLowerVolume)
|
--- -- where
|
||||||
, ((0 , xF86XK_AudioLowerVolume), spawn "/home/eeva/prefix/bin/volume down")
|
--- -- fixedWidth n l = take (n+5) $ l ++ (cycle ".")
|
||||||
|
---
|
||||||
-- Mute volume (xF86XK_AudioMute)
|
---
|
||||||
, ((0 , xF86XK_AudioMute), spawn "/home/eeva/prefix/bin/volume toggle")
|
--- ------------------------------------------------------------------------
|
||||||
|
--- -- StatusBar. Call lemonbar
|
||||||
-- Playlist play (xK_F7)
|
--- bar = printf
|
||||||
, ((0 , xK_F7), spawn "/usr/bin/notify-send \"Current song\" \"$(mpc -h ~/.config/mpd/mpd.socket | head -n 1)\"")
|
--- "pkill lemonbar; /home/eeva/bin/mkstatus.sh | \
|
||||||
|
--- \ lemonbar -g 1919x24+0+0 \
|
||||||
-- Playlist play (xK_F8)
|
--- \ -f '%s' \
|
||||||
, ((0 , xK_F8), spawn "/home/eeva/prefix/bin/playlist toggle")
|
--- \ -f '%s' \
|
||||||
|
--- \ -u %d -B '%s' -F '%s' -U '%s'"
|
||||||
-- Playlist stop (xK_F9)
|
--- --"tewi:style=Regular:antialias=false:autohint=false"
|
||||||
, ((0 , xK_F9), spawn "/home/eeva/prefix/bin/playlist stop")
|
--- "Iosevka:size=10"
|
||||||
|
--- "DejaVu Sans Mono:size=10"
|
||||||
-- Launch App (XF86XK_Launch1)
|
--- (2 :: Int)
|
||||||
, ((0 , xF86XK_Launch1), spawn "/usr/bin/firefox")
|
--- S.base03
|
||||||
|
--- S.base0
|
||||||
-- Adjust Brightness up (xF86XK_MonBrightnessUp)
|
--- S.violet
|
||||||
, ((0 , xF86XK_MonBrightnessUp), spawn "/run/current-system/sw/bin/xbacklight +10")
|
---
|
||||||
|
--- myLayout = (avoidStruts $ tiled ||| Mirror tiled) ||| Full
|
||||||
-- Adjust Brightness down (xF86XK_MonBrightnessDown)
|
--- where
|
||||||
, ((0 , xF86XK_MonBrightnessDown), spawn "/run/current-system/sw/bin/xbacklight -10")
|
--- tiled = Tall 1 (3/100) (1/2)
|
||||||
]
|
---
|
||||||
++
|
--- -- Prompt config
|
||||||
|
--- myXPConfig = defaultXPConfig {
|
||||||
--
|
--- position = Top,
|
||||||
-- mod-[1..9], Switch to workspace N
|
--- promptBorderWidth = 5,
|
||||||
--
|
--- font = "xft:tewi:style=Regular:antialias=false:autohint=false",
|
||||||
-- mod-[1..9], Switch to workspace N
|
--- height = 24,
|
||||||
-- mod-shift-[1..9], Move client to workspace N
|
--- borderColor = S.base03,
|
||||||
--
|
--- bgHLight = S.base02,
|
||||||
[((m .|. modm, k), windows $ f i)
|
--- fgHLight = S.magenta,
|
||||||
| (i, k) <- zip (XMonad.workspaces conf) [xK_F1 .. xK_F9]
|
--- bgColor = S.base03,
|
||||||
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
--- fgColor = S.base0,
|
||||||
++
|
--- defaultText = ""
|
||||||
|
--- }
|
||||||
--
|
---
|
||||||
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
--- ------------------------------------------------------------------------
|
||||||
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
--- -- Key bindings. Add, modify or remove key bindings here.
|
||||||
--
|
--- --
|
||||||
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
--- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||||
| (key, sc) <- zip [xK_z, xK_e, xK_r] [0..]
|
--- [
|
||||||
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
--- -- launch dmenu
|
||||||
|
--- --((modm, xK_p), spawn "dmenu_run -b -l 3")
|
||||||
|
--- -- launch prompt
|
||||||
|
--- ((modm, xK_p), shellPrompt myXPConfig)
|
||||||
|
---
|
||||||
|
--- -- close focused window
|
||||||
|
--- , ((modm, xK_Delete), kill)
|
||||||
|
---
|
||||||
|
--- -- Rotate through the available layout algorithms
|
||||||
|
--- , ((modm, xK_space ), sendMessage NextLayout)
|
||||||
|
--- --, ((modm .|. shiftMask xK_Tab ), sendMessage PreviousLayout)
|
||||||
|
---
|
||||||
|
--- -- Reset the layouts on the current workspace to default
|
||||||
|
--- , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
||||||
|
---
|
||||||
|
--- -- Resize viewed windows to the correct size
|
||||||
|
--- , ((modm, xK_n ), refresh)
|
||||||
|
---
|
||||||
|
--- -- Move focus to the master window
|
||||||
|
--- , ((modm, xK_m ), windows W.focusMaster )
|
||||||
|
---
|
||||||
|
--- -- Swap the focused window and the master window
|
||||||
|
--- , ((modm, xK_BackSpace), windows W.swapMaster)
|
||||||
|
---
|
||||||
|
--- -- Move focus to the next window
|
||||||
|
--- , ((modm, xK_j ), windows W.focusDown)
|
||||||
|
--- , ((modm, xK_Down ), windows W.focusDown)
|
||||||
|
---
|
||||||
|
--- -- Move focus to the previous window
|
||||||
|
--- , ((modm, xK_k ), windows W.focusUp )
|
||||||
|
--- , ((modm, xK_Up ), windows W.focusUp)
|
||||||
|
---
|
||||||
|
--- -- Swap the focused window with the next window
|
||||||
|
--- , ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
||||||
|
--- , ((modm .|. shiftMask, xK_Down ), windows W.swapDown )
|
||||||
|
---
|
||||||
|
--- -- Swap the focused window with the previous window
|
||||||
|
--- , ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
||||||
|
--- , ((modm .|. shiftMask, xK_Up ), windows W.swapUp )
|
||||||
|
---
|
||||||
|
--- -- Shrink the master area
|
||||||
|
--- , ((modm, xK_h ), sendMessage Shrink)
|
||||||
|
---
|
||||||
|
--- -- Expand the master area
|
||||||
|
--- , ((modm, xK_l ), sendMessage Expand)
|
||||||
|
---
|
||||||
|
--- -- Move to next Workspace
|
||||||
|
--- , ((modm, xK_Right ), nextWS)
|
||||||
|
---
|
||||||
|
--- -- Move to previous Workspace
|
||||||
|
--- , ((modm, xK_Left ), prevWS)
|
||||||
|
---
|
||||||
|
--- -- Move focused window to next Workspace
|
||||||
|
--- , ((modm .|. shiftMask, xK_Right ), shiftToNext >> nextWS)
|
||||||
|
---
|
||||||
|
--- -- Move focused window to previous Workspace
|
||||||
|
--- , ((modm .|. shiftMask, xK_Left ), shiftToPrev >> prevWS)
|
||||||
|
---
|
||||||
|
--- -- Cycle between windows
|
||||||
|
--- , ((modm , xK_Tab ), toggleWS)
|
||||||
|
---
|
||||||
|
--- -- Push window back into tiling
|
||||||
|
--- , ((modm, xK_t ), withFocused $ windows . W.sink)
|
||||||
|
---
|
||||||
|
--- -- Increment the number of windows in the master area
|
||||||
|
--- , ((modm , xK_comma ), sendMessage (IncMasterN 1))
|
||||||
|
---
|
||||||
|
--- -- Deincrement the number of windows in the master area
|
||||||
|
--- , ((modm , xK_period), sendMessage (IncMasterN (-1)))
|
||||||
|
---
|
||||||
|
--- -- close focused window
|
||||||
|
--- , ((modm .|. shiftMask, xK_c ), kill)
|
||||||
|
---
|
||||||
|
--- -- Swap the focused window and the master window
|
||||||
|
--- , ((modm, xK_Return), windows W.swapMaster)
|
||||||
|
---
|
||||||
|
--- -- run my terminal
|
||||||
|
--- , ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
||||||
|
---
|
||||||
|
--- -- lock my session
|
||||||
|
--- --, ((modm .|. shiftMask, xK_Delete), spawn "/usr/bin/sxlock -f \"-*-ubuntu mono-*-r-*-*-*-*-*-*-*-*-*-*\"")
|
||||||
|
--- , ((modm .|. shiftMask, xK_Delete), spawn "/run/current-system/sw/bin/i3lock-fancy -g -p")
|
||||||
|
---
|
||||||
|
--- -- quit xmonad
|
||||||
|
--- , ((modm .|. shiftMask, xK_q), io (exitWith ExitSuccess))
|
||||||
|
---
|
||||||
|
--- -- Raise volume (XF86XK_AudioRaiseVolume)
|
||||||
|
--- , ((0 , xF86XK_AudioRaiseVolume), spawn "/home/eeva/prefix/bin/volume up")
|
||||||
|
---
|
||||||
|
--- -- Lower volume (XF86XK_AudioLowerVolume)
|
||||||
|
--- , ((0 , xF86XK_AudioLowerVolume), spawn "/home/eeva/prefix/bin/volume down")
|
||||||
|
---
|
||||||
|
--- -- Mute volume (xF86XK_AudioMute)
|
||||||
|
--- , ((0 , xF86XK_AudioMute), spawn "/home/eeva/prefix/bin/volume toggle")
|
||||||
|
---
|
||||||
|
--- -- Playlist play (xK_F7)
|
||||||
|
--- , ((0 , xK_F7), spawn "/usr/bin/notify-send \"Current song\" \"$(mpc -h ~/.config/mpd/mpd.socket | head -n 1)\"")
|
||||||
|
---
|
||||||
|
--- -- Playlist play (xK_F8)
|
||||||
|
--- , ((0 , xK_F8), spawn "/home/eeva/prefix/bin/playlist toggle")
|
||||||
|
---
|
||||||
|
--- -- Playlist stop (xK_F9)
|
||||||
|
--- , ((0 , xK_F9), spawn "/home/eeva/prefix/bin/playlist stop")
|
||||||
|
---
|
||||||
|
--- -- Launch App (XF86XK_Launch1)
|
||||||
|
--- , ((0 , xF86XK_Launch1), spawn "/usr/bin/firefox")
|
||||||
|
---
|
||||||
|
--- -- Adjust Brightness up (xF86XK_MonBrightnessUp)
|
||||||
|
--- , ((0 , xF86XK_MonBrightnessUp), spawn "/run/current-system/sw/bin/xbacklight +10")
|
||||||
|
---
|
||||||
|
--- -- Adjust Brightness down (xF86XK_MonBrightnessDown)
|
||||||
|
--- , ((0 , xF86XK_MonBrightnessDown), spawn "/run/current-system/sw/bin/xbacklight -10")
|
||||||
|
--- ]
|
||||||
|
--- ++
|
||||||
|
---
|
||||||
|
--- --
|
||||||
|
--- -- mod-[1..9], Switch to workspace N
|
||||||
|
--- --
|
||||||
|
--- -- mod-[1..9], Switch to workspace N
|
||||||
|
--- -- mod-shift-[1..9], Move client to workspace N
|
||||||
|
--- --
|
||||||
|
--- [((m .|. modm, k), windows $ f i)
|
||||||
|
--- | (i, k) <- zip (XMonad.workspaces conf) [xK_F1 .. xK_F9]
|
||||||
|
--- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
||||||
|
--- ++
|
||||||
|
---
|
||||||
|
--- --
|
||||||
|
--- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
||||||
|
--- -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
||||||
|
--- --
|
||||||
|
--- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
||||||
|
--- | (key, sc) <- zip [xK_z, xK_e, xK_r] [0..]
|
||||||
|
--- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
||||||
|
|
Loading…
Reference in a new issue