experimenting with xmonad/xmobar
This commit is contained in:
parent
8ea71ee2ba
commit
5b41f4664a
7 changed files with 148 additions and 6 deletions
|
@ -38,7 +38,7 @@ window:
|
|||
padding:
|
||||
x: 10
|
||||
y: 7
|
||||
opacity: 0.85
|
||||
opacity: 1
|
||||
|
||||
mouse:
|
||||
hide_when_typing: true
|
||||
|
|
|
@ -17,6 +17,8 @@ cp ~/bin/spawn-alacritty ./x
|
|||
cp ~/bin/quitconf ./x
|
||||
cp ~/bin/battery ./x
|
||||
cp ~/bin/startdwm ./x
|
||||
cp ~/.config/xmobar/xmobar.hs ./xmobar
|
||||
cp ~/.config/xmonad/xmonad.hs ./xmonad
|
||||
cp ~/.config/VSCodium/User/settings.json ./vscode
|
||||
|
||||
# other config files
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"editor.inlineSuggest.enabled": true,
|
||||
"window.menuBarVisibility": "toggle",
|
||||
"window.menuBarVisibility": "hidden",
|
||||
"telemetry.telemetryLevel": "off",
|
||||
"telemetry.enableTelemetry": false,
|
||||
"java.import.gradle.enabled": true,
|
||||
|
||||
"workbench.colorCustomizations": {
|
||||
"statusBarItem.remoteBackground": "#79740e",
|
||||
"statusBar.debuggingBackground": "#d65d0e"
|
||||
"statusBar.debuggingBackground": "#d65d0e",
|
||||
},
|
||||
"editor.fontFamily": "'JetBrains Mono'",
|
||||
"java.configuration.runtimes": [
|
||||
|
@ -74,5 +74,8 @@
|
|||
"debug.onTaskErrors": "showErrors",
|
||||
"explorer.confirmDelete": false,
|
||||
"window.zoomLevel": 1,
|
||||
"errorLens.messageMaxChars": 200
|
||||
"avdmanager.sdkPath": "/home/bryson/.android/sdk",
|
||||
"avdmanager.executable": "/home/bryson/.android/sdk/tools/bin/avdmanager",
|
||||
"avdmanager.sdkManager": "/home/bryson/.android/sdk/tools/bin/sdkmanager",
|
||||
"haskell.manageHLS": "GHCup"
|
||||
}
|
|
@ -1,2 +1,4 @@
|
|||
Xcursor.theme: Adwaita
|
||||
Xcursor.size: 24
|
||||
Sxiv.background: #3c3836
|
||||
Sxiv.foreground: #fbf1c7
|
||||
|
|
|
@ -56,7 +56,7 @@ light -S 30 &
|
|||
# pacmd set-sink-volume alsa_output.pci-0000_03_00.6.HiFi__hw_Generic_1__sink 0 &
|
||||
|
||||
# set up wallpaper
|
||||
feh --bg-fill ~/Pictures/Wallpapers/unsplash-beach.jpg
|
||||
feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox.png &
|
||||
|
||||
# apply Xresources
|
||||
xrdb -merge ~/.Xresources
|
||||
|
@ -83,5 +83,7 @@ fi
|
|||
|
||||
# start dwm
|
||||
redshift &
|
||||
xmobar &
|
||||
xset r rate 300 80
|
||||
exec /home/bryson/bin/startdwm
|
||||
#exec /home/bryson/bin/startdwm
|
||||
exec $HOME/.cache/xmonad/xmonad-x86_64-linux
|
||||
|
|
34
xmobar/xmobar.hs
Normal file
34
xmobar/xmobar.hs
Normal file
|
@ -0,0 +1,34 @@
|
|||
import Xmobar
|
||||
|
||||
config :: Config
|
||||
config =
|
||||
defaultConfig
|
||||
{ overrideRedirect = False
|
||||
, font = "xft:JetBrains Mono NF:style=medium:size=9"
|
||||
, bgColor = "#3c3836"
|
||||
, fgColor = "#ebdbb2"
|
||||
, position = TopW L 120
|
||||
, commands = [ Run $ Cpu
|
||||
[ "-L", "30"
|
||||
, "-H", "70"
|
||||
, "--high" , "#fb4934"
|
||||
, "--normal", "#fabd2f"
|
||||
] 10
|
||||
, Run $ Alsa "default" "Master"
|
||||
[ "--template", "<volumestatus>"
|
||||
, "--suffix" , "True"
|
||||
, "--"
|
||||
, "--on", ""
|
||||
]
|
||||
, Run $ Memory ["--template", "Mem: <usedratio>%"] 10
|
||||
, Run $ Swap [] 10
|
||||
, Run $ Date "%a %D <fc=#458588>%I:%M %p</fc>" "date" 10
|
||||
, Run XMonadLog
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%XMonadLog% }{ %alsa:default:Master% | %cpu% | %memory% * %swap% | %date% "
|
||||
}
|
||||
|
||||
main :: IO()
|
||||
main = xmobar config
|
99
xmonad/xmonad.hs
Normal file
99
xmonad/xmonad.hs
Normal file
|
@ -0,0 +1,99 @@
|
|||
import XMonad
|
||||
import System.Exit (exitSuccess)
|
||||
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Util.Cursor
|
||||
|
||||
import XMonad.Util.EZConfig
|
||||
import XMonad.Util.Loggers
|
||||
import XMonad.Util.Ungrab
|
||||
|
||||
import XMonad.Layout.ThreeColumns
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Actions.CycleWS
|
||||
import XMonad.Layout.Renamed
|
||||
import XMonad.Layout.Spacing
|
||||
|
||||
main :: IO ()
|
||||
main = xmonad
|
||||
. ewmh
|
||||
. ewmhFullscreen
|
||||
. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
|
||||
$ myConfig
|
||||
|
||||
myConfig = def
|
||||
{ modMask = mod4Mask -- Rebind Mod to the Super key
|
||||
, layoutHook = myLayout
|
||||
, manageHook = myManageHook
|
||||
, startupHook = setDefaultCursor xC_left_ptr
|
||||
, workspaces = myWorkspaces
|
||||
, borderWidth = 2
|
||||
, normalBorderColor = "#3c3836"
|
||||
, focusedBorderColor = "#928374"
|
||||
}
|
||||
`additionalKeysP`
|
||||
[ ("M-S-<Escape>", spawn "slock")
|
||||
, ("M-<PrintScreen>", unGrab *> spawn "screenshot" )
|
||||
, ("M-S-f", spawn "librewolf-bin" )
|
||||
, ("M-S-k", spawn "keepassxc" )
|
||||
, ("M-S-<Return>", spawn "spawn-alacritty")
|
||||
, ("M-p", spawn "dmenu_run_history" )
|
||||
, ("M-<F1>", spawn "volmute")
|
||||
, ("M-<F2>", spawn "voldown")
|
||||
, ("M-<F3>", spawn "volup")
|
||||
, ("M-<F7>", spawn "brightness-down")
|
||||
, ("M-<F8>", spawn "brightness-up")
|
||||
, ("M-<F11>", spawn "screenshot")
|
||||
, ("M-<Tab>", toggleWS)
|
||||
, ("M-S-<Backspace>", io exitSuccess)
|
||||
, ("M-S-q", spawn "true")
|
||||
]
|
||||
|
||||
myWorkspaces = [ "!", "@", "#", "$", "%", "^", "&", "*", "(" ]
|
||||
|
||||
myLayout = tiled ||| full ||| threeCol
|
||||
where
|
||||
threeCol = renamed [Replace "ThreeCol"] $ spacing 2 $ ThreeColMid nmaster delta ratio
|
||||
tiled = renamed [Replace "Tall"] $ spacing 2 $ Tall nmaster delta ratio
|
||||
full = renamed [Replace "Full"] $ spacing 2 $ Full
|
||||
nmaster = 1 -- Default number of windows in the master pane
|
||||
ratio = 6/10 -- Default proportion of screen occupied by master pane
|
||||
delta = 2/100 -- Percent of screen to increment by when resizing panes
|
||||
|
||||
myManageHook :: ManageHook
|
||||
myManageHook = composeAll
|
||||
[ className =? "Gimp" --> doFloat
|
||||
, isDialog --> doFloat
|
||||
]
|
||||
|
||||
myXmobarPP :: PP
|
||||
myXmobarPP = def
|
||||
{ ppSep = magenta " • "
|
||||
, ppTitleSanitize = xmobarStrip
|
||||
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
|
||||
, ppHidden = white . wrap " " ""
|
||||
, ppHiddenNoWindows = lowWhite . wrap " " ""
|
||||
, ppUrgent = red . wrap (yellow "!") (yellow "!")
|
||||
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
|
||||
, ppExtras = [logTitles formatFocused formatUnfocused]
|
||||
}
|
||||
where
|
||||
formatFocused = wrap (white "[") (white "]") . green . ppWindow
|
||||
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . lowWhite . ppWindow
|
||||
|
||||
-- | Windows should have *some* title, which should not not exceed a
|
||||
-- sane length.
|
||||
ppWindow :: String -> String
|
||||
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 80
|
||||
|
||||
blue, lowWhite, magenta, red, white, yellow :: String -> String
|
||||
magenta = xmobarColor "#d3869b" ""
|
||||
blue = xmobarColor "#83a598" ""
|
||||
white = xmobarColor "#ebdbb2" ""
|
||||
yellow = xmobarColor "#fabd2f" ""
|
||||
red = xmobarColor "#fb4934" ""
|
||||
green = xmobarColor "#b8bb26" ""
|
||||
lowWhite = xmobarColor "#a89984" ""
|
Loading…
Add table
Reference in a new issue