summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-03 05:13:21 +0000
committerjao <jao@gnu.org>2022-02-03 05:13:21 +0000
commit68c061b359184a3a60dc084d1526af5704f3bc52 (patch)
treeacee8690e7c8b455ce3df3a05eb69ddd62689e8d
parent0516604a56af2c148bc36d5fbfa6b45c43542afe (diff)
downloadxmobar-config-68c061b359184a3a60dc084d1526af5704f3bc52.tar.gz
xmobar-config-68c061b359184a3a60dc084d1526af5704f3bc52.tar.bz2
xmobar-sway
-rw-r--r--src/Sway.hs72
-rw-r--r--src/TopC.hs2
-rw-r--r--xmobar-config.cabal8
3 files changed, 79 insertions, 3 deletions
diff --git a/src/Sway.hs b/src/Sway.hs
new file mode 100644
index 0000000..2129e20
--- /dev/null
+++ b/src/Sway.hs
@@ -0,0 +1,72 @@
+import Xmobar
+import Config
+import Monitors
+
+memoratio = Memory ["-t","<usedratio>%", "-p", "2", "-W", "3"] 20
+
+topProcL p = TopProc (p <~> ["-t"
+ , memTemp
+ ++ " · <mboth1> <mboth2> <mboth3> <mboth4>"
+ , "-w", "12", "-L" , "10", "-H", "80"]) 15
+ where memTemp = if pIsLight p
+ then "<both1> <both2> <both3> <both4>"
+ else "<both1> <both2> <both3>"
+
+diskIOS p = DiskIO [("/", "<total>"), ("/home", "<total>")] (diskArgs p) 10
+
+mpd a p i = MPDX [ "-W", "12", "-t", "<statei> <remaining>"
+ , "--", "-p", p, "-P", "\xf144", "-Z",fni i, "-S", fni i] 20 a
+
+mpdMon = mpd "mpd" "6600" "\xf001"
+mopMon = mpd "mopidy" "6669" "\xf1bc"
+
+config p = (baseConfig p) {
+ position = TopSize C 100 (defaultHeight - 1)
+ , textOutput = True
+ , textOutputFormat = Pango
+ , bgColor = "#efefef"
+ , border = FullB
+ , commands = [ Run (topProcL p)
+ , Run (iconBatt p)
+ , Run mpdMon
+ , if pIsLight p then Run (cpu p) else Run (cpuBars p)
+ , Run memoratio
+ , Run (diskU p)
+ , Run (diskIOS p)
+ , Run brightness
+ , Run (kbd p)
+ , Run (coreTemp p)
+ , Run (wireless p "wlp164s0")
+ , Run (dynNetwork p)
+ , Run (vpnMark "wg-mullvad")
+ , Run tun0
+ , Run (masterVol p)
+ , Run captureVol
+ , Run laTime
+ , Run localTime
+ , Run w -- LEGE, LEBL, KCV0
+ ]
+ , template = "|batt0| "
+ ++ dimi "\xf26c" ++ " |bright| "
+ ++ "<action=`toggle-app.sh nm-applet`>"
+ ++ " |wg-mullvad||tun0||wlp164s0wi|"
+ ++ "</action>"
+ ++ " |dynnetwork| "
+ ++ "<action=`toggle-app.sh pasystray`>"
+ ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|"
+ ++ "</action> "
+ ++ "|mpd|"
+ ++ " |EGPH| "
+ ++ " {} <hspace=10/>"
+ ++ "|multicpu| "
+ ++ "|multicoretemp| "
+ ++ " |top| "
+ ++ " " ++ fni "\xf0c9" ++ " |memory| "
+ ++ " |diskio| |disku| "
+ ++ " |datetime| "
+ ++ "|laTime| "
+ } where dimi = fc (pDim p) . fni
+ w = weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p
+
+main :: IO ()
+main = palette >>= configFromArgs . config >>= xmobar
diff --git a/src/TopC.hs b/src/TopC.hs
index c447270..f9472da 100644
--- a/src/TopC.hs
+++ b/src/TopC.hs
@@ -64,11 +64,9 @@ config p = (baseConfig p) {
++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|"
++ "</action> "
++ "|mpd|"
--- ++ " |mopidy|"
++ " |EGPH| "
++ fc (pHigh p) "|elog|"
++ " {} "
--- ++ "|mail|"
++ "|kbd| "
++ "|multicpu| "
++ "|multicoretemp| "
diff --git a/xmobar-config.cabal b/xmobar-config.cabal
index c99b799..d219a8d 100644
--- a/xmobar-config.cabal
+++ b/xmobar-config.cabal
@@ -3,7 +3,7 @@ version: 0.1
description: xmobar configs
author: jao
maintainer: jao@gnu.org
-copyright: 2018, 2019, 2020 Jose A Ortega Ruiz
+copyright: 2018, 2019, 2020, 2022 Jose A Ortega Ruiz
license: GPL-3
build-type: Simple
cabal-version: >= 1.10
@@ -41,3 +41,9 @@ executable xmobar-bottom
build-depends: base, xmobar, xmobar-config
default-language: Haskell2010
+executable xmobar-sway
+ main-is: Sway.hs
+ hs-source-dirs: src
+ ghc-options: -rtsopts -with-rtsopts=-V0 -threaded
+ build-depends: base, xmobar, xmobar-config
+ default-language: Haskell2010