Last active
February 12, 2024 16:50
-
-
Save mikkun/75e82eabd35883efbb5af653901f97c9 to your computer and use it in GitHub Desktop.
My xmonad and xmobar configuration files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- vim: set filetype=haskell: | |
Config | |
{ font = "Noto Sans CJK JP Bold 9" | |
, additionalFonts = ["Symbola 9"] | |
, bgColor = "#3d3846" | |
, fgColor = "#ffffff" | |
, border = FullB | |
, borderColor = "#3d3846" | |
, borderWidth = 4 | |
, position = TopH 20 | |
, commands = | |
[ Run StdinReader | |
, Run Alsa | |
"default" | |
"Master" | |
[ "-t" | |
, "<volumestatus>" | |
, "-S" | |
, "True" | |
, "--" | |
, "-O" | |
, "<fc=#ffffff><fn=1>π</fn> </fc>" | |
, "-o" | |
, "<fn=1>π</fn> <fc=#c2c7b9>[off]</fc>" | |
, "" | |
] | |
, Run BatteryP | |
["AC", "CMB1"] | |
[ "-t" | |
, "<acstatus>" | |
, "-L" | |
, "20" | |
, "-H" | |
, "80" | |
, "-l" | |
, "#fd4d5e" | |
, "-h" | |
, "#02b2a1" | |
, "--" | |
, "-O" | |
, "<fc=#ffffff><fn=1>π</fn> </fc><left><fc=#ffffff>%</fc>" | |
, "-i" | |
, "<fc=#ffffff><fn=1>π</fn> </fc><left><fc=#ffffff>%</fc>" | |
, "-o" | |
, "<fc=#ffffff><fn=1>π</fn> </fc><left><fc=#ffffff>% - <fn=1>β³</fn> <timeleft></fc>" | |
] | |
50 | |
, Run Com ".xmonad/fcitx-state.sh" [] "fcitx" 5 | |
, Run ComX | |
"/usr/bin/cut" | |
["-c", "-2", "/sys/class/hwmon/hwmon2/temp1_input"] | |
"<fc=#fd4d5e>NA</fc>" | |
"drivetemp" | |
50 | |
, Run CoreTemp ["-t", "<core0>", "-H", "80", "-h", "#fd4d5e"] 50 | |
, Run Date "%F (%a) %T" "date" 10 | |
, Run DynNetwork ["-t", "| <fn=1>π</fn> <dev>"] 50 | |
] | |
, sepChar = "%" | |
, alignSep = "}{" | |
, template = | |
" %StdinReader% }{ %dynnetwork% | %alsa:default:Master% | %battery% | %fcitx% | %date% | CPU:%coretemp%Β°C/HDD:%drivetemp%Β°C " | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ "$(fcitx-remote)" = "2" ] && echo "γ" || echo "οΌ‘" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Actions.NoBorders | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.EwmhDesktops | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Layout.Magnifier | |
import XMonad.Layout.NoBorders | |
import XMonad.Layout.ThreeColumns | |
import XMonad.Util.EZConfig (additionalKeysP) | |
import System.Posix.Env (putEnv) | |
main :: IO () | |
main = do | |
putEnv "_JAVA_AWT_WM_NONREPARENTING=1" | |
xmonad . ewmhFullscreen . ewmh =<< | |
statusBar "xmobar" myXmobarPP toggleStrutsKey myConfig | |
where | |
toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym) | |
toggleStrutsKey XConfig {modMask = m} = (m, xK_b) | |
myConfig = | |
def | |
{ modMask = mod4Mask | |
, borderWidth = 4 | |
, focusedBorderColor = "#fd4d5e" | |
, normalBorderColor = "#c2c7b9" | |
, terminal = "uxterm" | |
, workspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 "] | |
, layoutHook = myLayout | |
, manageHook = myManageHook | |
, startupHook = myStartupHook | |
} `additionalKeysP` | |
[ ("<XF86AudioMute>", spawn "amixer set Master toggle") | |
, ("<XF86AudioLowerVolume>", spawn "amixer set Master 5%-") | |
, ("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+") | |
, ("M-C-b", spawn "firefox") | |
, ("M-C-e", spawn "emacs") | |
, ("M-C-f", spawn "thunar") | |
, ("M-C-p", spawn "xfce4-appfinder") | |
, ("M-C-t", spawn "xfce4-terminal --show-menubar --hide-toolbar") | |
, ("M-S-b", withFocused toggleBorder) | |
] | |
myLayout = tiled ||| Mirror tiled ||| noBorders Full ||| threeCol | |
where | |
threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio | |
tiled = Tall nmaster delta ratio | |
nmaster = 1 | |
ratio = 1 / 2 | |
delta = 3 / 100 | |
myManageHook :: ManageHook | |
myManageHook = | |
composeAll | |
[ className =? "Gimp" --> doFloat | |
, className =? "UXTerm" --> doSideFloat SE | |
, className =? "Xfce4-appfinder" --> doCenterFloat | |
, isDialog --> doCenterFloat | |
] | |
{- | |
cd ~/.xmonad && | |
curl -Os https://xmonad.org/images/logo.svg && | |
convert -background white \ | |
-gravity center \ | |
-extent 1280x800 \ | |
-density 96 \ | |
-units PixelsPerInch \ | |
-strip \ | |
logo.svg logo.png | |
-} | |
myStartupHook :: X () | |
myStartupHook = do | |
spawn "amixer set Master 20%" | |
spawn "feh --bg-fill --no-fehbg ~/.xmonad/logo.png" | |
spawn "nm-applet --sm-disable" | |
spawn "xfce4-power-manager" | |
myXmobarPP :: PP | |
myXmobarPP = | |
xmobarPP | |
{ ppOrder = \(ws:l:t:_) -> [ws, l, t] | |
, ppSep = " | " | |
, ppCurrent = xmobarColor "#ffffff" "#fd4d5e" | |
, ppHidden = xmobarColor "#fd4d5e" "#ffffff" | |
, ppHiddenNoWindows = xmobarColor "#3d3846" "#ffffff" | |
, ppUrgent = xmobarColor "#ffffff" "#02b2a1" | |
, ppTitle = xmobarColor "#fd4d5e" "" | |
, ppTitleSanitize = xmobarStrip | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment