diff options
author | jao <jao@gnu.org> | 2022-08-09 00:37:41 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-08-09 00:37:41 +0100 |
commit | 01094993c9dc2e78044f96b7a1bfbd9e6e0fee82 (patch) | |
tree | 259cdb403ed32a0c8f0e9e3fd13e831d60f118fb | |
parent | 2b75f89cd3afcb1d461c129a4d45042314f61d2c (diff) | |
download | xmobar-config-01094993c9dc2e78044f96b7a1bfbd9e6e0fee82.tar.gz xmobar-config-01094993c9dc2e78044f96b7a1bfbd9e6e0fee82.tar.bz2 |
xmobar-emacs, for emacs' tab bar
-rw-r--r-- | src/Emacs.hs | 93 | ||||
-rw-r--r-- | xmobar-config.cabal | 27 |
2 files changed, 110 insertions, 10 deletions
diff --git a/src/Emacs.hs b/src/Emacs.hs new file mode 100644 index 0000000..553b782 --- /dev/null +++ b/src/Emacs.hs @@ -0,0 +1,93 @@ +import Xmobar +import Config +import Monitors +import Music (mpris, gpmd, mpdt) + +topProcL p = TopProc (p <~> args) 15 + where template = "<both1> <both2> <both3> ยท <mboth1> <mboth2> <mboth3>" + args = ["-t", template, "-w", "12", "-L" , "10", "-H", "80"] + +diskIOS p = DiskIO [("/", "โ<read> โ<write>")] (diskArgs p) 10 + +cpuFreq' p = CpuFreq (p <~> args) 50 + where args = ["-t" , "<avg>" , "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"] + +memory' = Memory args 20 + where template = "<used> <available>" + args = ["-t", template , "-p", "2", "-d", "1", "--", "--scale", "1024"] + +master p = Volume "default" "Master" (args ++ ("--":ext)) 10 + where args = ["-t", "<status> <volume>"] + ext = ["-C", pForeground p, "-c", "sienna4", "-O", "๐ผ", "-o", "๐"] + +capture = Volume "default" "Capture" ["-t", "<volume>"] 10 + +weath st p = + WeatherX st + [ ("", "") + , ("clear", "๐ฃ") + , ("sunny", fc (pHigh p) "๐ฃ") + , ("fair", "๐ฃ") + , ("mostly clear", "๐ค") + , ("mostly sunny", "๐ค") + , ("partly sunny", "โ
") + , ("obscured", "๐") -- ๐ซ + , ("fog", "๐") -- ๐ซ + , ("foggy", "๐") -- ๐ซ + , ("cloudy", "โ๏ธ") + , ("overcast", "โ๏ธ") + , ("partly cloudy", "โ
") + , ("mostly cloudy", "โ๏ธ") + , ("considerable cloudiness", "โ") + , ("light rain", "๐ง") + , ("rain", "โ") + , ("ice crystals", "โ") + , ("light snow", "๐จ") + , ("snow", "โ") + ] + (mkArgs p ["-t", "<skyConditionS> <tempC>ยฐ <weather>" + , "-L", "10", "-H", "25" , "-T", "25", "-E", ".."] + ["-w", ""]) + 18000 + +config p = (baseConfig p) { + position = TopSize C 100 (defaultHeight - 2) + , font = "xft:DejaVu Sans Mono-8" + , commands = [ Run (topProcL p) + , Run (batt p) + , Run (cpu p) + , Run (cpuFreq' p) + , Run memory' + , Run (diskU p) + , Run (diskIOS p) + , Run (kbd p) + , Run (coreTemp p) + , Run (wireless p "wlp164s0") + , Run (dynNetwork p) + , Run (vpnMark "wg-mullvad") + , Run tun0 + , Run (master p) + , Run capture + , Run laTime + , Run localTime + , Run (weath "EGPH" p) + ] + , template = " |batt0|" + ++ " |EGPH| " + ++ " |wg-mullvad||tun0||wlp164s0wi|" + ++ " |dynnetwork| " + ++ " |default:Master| ๐ช |default:Capture|" + ++ " {} " + ++ "|kbd|" + ++ " |cpufreq|" + ++ " |multicpu|" + ++ " |multicoretemp|" + ++ " |top| " + ++ " โ |memory| " + ++ " |diskio| ๐ซ|disku| " -- ๐ ๐ด + ++ " |datetime| " + ++ "|laTime| " + } + +main :: IO () +main = palette >>= configFromArgs . config >>= xmobar diff --git a/xmobar-config.cabal b/xmobar-config.cabal index d219a8d..d6554f5 100644 --- a/xmobar-config.cabal +++ b/xmobar-config.cabal @@ -20,13 +20,6 @@ library other-modules: Paths_xmobar_config default-language: Haskell2010 -executable xmobar-top - main-is: Top.hs - hs-source-dirs: src - ghc-options: -rtsopts -with-rtsopts=-V0 -threaded - build-depends: base, xmobar, xmobar-config - default-language: Haskell2010 - executable xmobar-exwm main-is: TopC.hs hs-source-dirs: src @@ -34,13 +27,27 @@ executable xmobar-exwm build-depends: base, xmobar, xmobar-config default-language: Haskell2010 -executable xmobar-bottom - main-is: Bottom.hs +executable xmobar-emacs + main-is: Emacs.hs hs-source-dirs: src - ghc-options: -rtsopts -with-rtsopts=-V0 -threaded + ghc-options: -rtsopts -with-rtsopts=-V0 -threaded build-depends: base, xmobar, xmobar-config default-language: Haskell2010 +-- executable xmobar-top +-- main-is: Top.hs +-- hs-source-dirs: src +-- ghc-options: -rtsopts -with-rtsopts=-V0 -threaded +-- build-depends: base, xmobar, xmobar-config +-- default-language: Haskell2010 + +-- executable xmobar-bottom +-- main-is: Bottom.hs +-- hs-source-dirs: src +-- ghc-options: -rtsopts -with-rtsopts=-V0 -threaded +-- build-depends: base, xmobar, xmobar-config +-- default-language: Haskell2010 + executable xmobar-sway main-is: Sway.hs hs-source-dirs: src |