summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-11-04 23:58:06 +0000
committerjao <jao@gnu.org>2022-11-04 23:58:06 +0000
commitc300eff998d758bf867abbb7f39bf6fdfecf7a2e (patch)
treefcf0641ea3a35db733fd31504e5312029edb3f63 /src
parent07c093c9b351466e60b93692c7d05b949bd71b0c (diff)
downloadxmobar-config-c300eff998d758bf867abbb7f39bf6fdfecf7a2e.tar.gz
xmobar-config-c300eff998d758bf867abbb7f39bf6fdfecf7a2e.tar.bz2
cleanups and unused code removed
Diffstat (limited to 'src')
-rw-r--r--src/Bottom.hs11
-rw-r--r--src/Emacs.hs10
-rw-r--r--src/Single.hs48
-rw-r--r--src/Sway.hs17
4 files changed, 35 insertions, 51 deletions
diff --git a/src/Bottom.hs b/src/Bottom.hs
deleted file mode 100644
index 92e2d3e..0000000
--- a/src/Bottom.hs
+++ /dev/null
@@ -1,11 +0,0 @@
-import Xmobar
-import Config
-import qualified Music
-
-import System.Environment (getArgs)
-
-
-main :: IO ()
-main = do
- args <- getArgs
- palette >>= configFromArgs . Music.config "spotify" >>= xmobar
diff --git a/src/Emacs.hs b/src/Emacs.hs
index adbe13c..5c6cb26 100644
--- a/src/Emacs.hs
+++ b/src/Emacs.hs
@@ -70,10 +70,8 @@ weath st p =
18000
config p = (baseConfig p) {
- position = TopSize C 100 (defaultHeight - 2)
- , textOutput = True
- , textOutputFormat = Ansi
- , font = "xft:DejaVu Sans Mono-8"
+ position = TopSize C 100 22
+ , font = "Hack 10"
, commands = [ Run (topProcL p)
, Run (batt0 p)
, Run (cpu p)
@@ -94,8 +92,8 @@ config p = (baseConfig p) {
, Run (weath "EGPH" p)
]
, template = " |batt0| "
- -- ++ " 🖧 |wg-mullvad||tun0||wlp164s0wi|"
- ++ " |wg-mullvad||tun0||wlp164s0wi|"
+ ++ " 🖧 |wg-mullvad||tun0||wlp164s0wi|"
+ -- ++ " |wg-mullvad||tun0||wlp164s0wi|"
++ " |dynnetwork| "
++ " |default:Master| 🎙️ |default:Capture|"
++ " |EGPH|"
diff --git a/src/Single.hs b/src/Single.hs
index 44dd6f7..e7ecee6 100644
--- a/src/Single.hs
+++ b/src/Single.hs
@@ -2,10 +2,11 @@ import Xmobar
import Config
import Monitors
-topProcL p = TopProc (p <~> args) 15
- where template = "<both1> <both2> <both3> <both4> "
- ++ "· <mboth1> <mboth2> <mboth3> <mboth4>"
- args = ["-t", template, "-w", "12", "-L" , "10", "-H", "80"]
+topProcL p s = TopProc (p <~> args) 15
+ where temp | s = "<both1> <both2> <both3> · <mboth1> <mboth2> <mboth3>"
+ | otherwise = "<both1> <both2> <both3> <both4> "
+ ++ "· <mboth1> <mboth2> <mboth3> <mboth4>"
+ args = ["-t", temp, "-w", "12", "-L" , "10", "-H", "80"]
diskIOS p = DiskIO [("/", "<read> <write>")] (diskArgs p) 10
@@ -16,18 +17,18 @@ memory' = Memory args 20
where template = "<used> <available>"
args = ["-t", template , "-p", "2", "-d", "1", "--", "--scale", "1024"]
-master on off p = Volume "default" "Master" (args ++ ("--":ext)) 10
- where args = ["-t", "<status> <volume>"]
- ext = ["-C", pForeground p, "-c", "sienna4", "-O", on, "-o", off]
-
config p = (baseConfig p) {
- position = TopSize C 100 (defaultHeight - 2)
- , textOffset = offset
- , textOffsets = [offset - 1, offset - 1, offset + 2 , offset, offset + 1]
- , bgColor = if pIsLight p then "gray94" else "black"
- , alpha = 255
+ position = TopSize C 100 24
+ , bgColor = if pIsLight p then "#f0f0f0" else "black"
+ , alpha = 233
, border = FullB
- , commands = [ Run (topProcL p)
+ , textOffsets = []
+ , textOffset = 0
+ , iconOffset = 0
+ -- , font = "Source Code Pro, Noto Color Emoji Regular 9, Italic 9"
+ -- , font = "DejaVu Sans Mono, Noto Color Emoji 9, Regular 9"
+ , font = "Hack, Noto Color Emoji Regular 9, Light 9"
+ , commands = [ Run (topProcL p isXmonad)
, Run (load p)
, Run (iconBatt p)
, Run (cpuBars p)
@@ -40,26 +41,29 @@ config p = (baseConfig p) {
, Run (dynNetwork p)
, Run (vpnMark "wg-mullvad")
, Run tun0
- , Run (master (dimi "\xf025") (dimi "\xf131") p)
+ , Run (masterVol p)
, Run captureVol
, Run laTime
, Run localTime
, Run (cpuFreq' p)
- , Run (weather' wt "EGPH" p)
+ , Run (weather "EGPH" p)
+ -- , Run nmmail
] ++ extraCmds
, template = trayT
++ " |batt0| "
++ "<action=`toggle-app.sh nm-applet`>"
- ++ " |wg-mullvad||tun0||wlp164s0wi|"
+ ++ " <fc=#000000>|wg-mullvad||tun0||wlp164s0wi|</fc>"
++ "</action>"
++ " |dynnetwork| "
++ "<action=`toggle-app.sh pasystray`>"
++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|"
++ "</action>"
- ++ " |EGPH| "
+ ++ " |EGPH|"
+ -- ++ fc "sienna4" " |mail|"
+ ++ " |kbd|"
+ ++ "{"
++ eLog p
- ++ " {} "
- ++ "|kbd|"
+ ++ "}"
++ " |multicpu|"
++ " |cpufreq|"
++ " |multicoretemp|"
@@ -68,9 +72,7 @@ config p = (baseConfig p) {
++ dimi "\xf0a0" ++ "|diskio| |disku| "
++ " |datetime| "
++ " |laTime| "
- } where dimi = fc "grey50" . fn 7
- offset = defaultHeight - 8
- wt = "<skyConditionS> <tempC>° <windKmh>" ++ fn 5 "🌫" ++ " <weather>"
+ } where dimi = fc "grey40" . fn 1
isXmonad = pWm p == Just "xmonad"
trayT = if isXmonad then "|tray|" else ""
eLog p = if isXmonad then "|XMonadLog|" else fc (pHigh p) "|elog|"
diff --git a/src/Sway.hs b/src/Sway.hs
index 4c197ab..5c7ecc2 100644
--- a/src/Sway.hs
+++ b/src/Sway.hs
@@ -21,21 +21,11 @@ mprisx client width =
, "-T", show width
, "-E", "…", "-M", "100", "-x", ""] 40
-
-nmmail = NotmuchMail "mail" [MailItem "" "" "tag:new"] 100
-
config p = (baseConfig p) {
position = TopSize C 100 (defaultHeight - 1)
, textOutput = True
, textOutputFormat = Swaybar
, font = "Source Code Pro Medium 9"
- , additionalFonts = [ "xft:Symbola 9"
- , "xft:Symbola 10"
- , "xft:Symbola 11"
- , "xft:Symbola 11"
- , "xft:DejaVu Sans Mono 9"
- , "xft:FontAwesome 10"
- , "xft:FontAwesome 9"]
, bgColor = "#ffffffc0"
, fgColor = "#000000"
, border = FullB
@@ -61,24 +51,29 @@ config p = (baseConfig p) {
, Run (PipeReader ":/tmp/emacs.status" "estat")
, Run nmmail
]
- , template = fc "#a0522d" "|mail| |estat|"
+ , template = fc "#a0522d" "|mail| |estat| "
++ " |batt0| "
+ ++ " "
++ "<action=`toggle-app.sh nm-applet --indicator`>"
++ " |wg-mullvad||tun0||wlp164s0wi|"
++ "</action>"
++ " |dynnetwork| "
+ ++ "<hspace=3/>"
++ "<action=`toggle-app.sh pavucontrol`>"
++ " |default:Master| "
++ fn 7 "\xf130" ++ " |default:Capture|"
++ "</action> "
++ "|mpd|"
+ ++ "<hspace=3/>"
++ " |EGPH| "
++ " {} <hspace=3/>"
++ "|multicpu| "
++ "|multicoretemp| "
++ " |top| "
+ ++ "<hspace=1/>"
++ fni "☸" ++ " |memory| "
++ " |diskio| |disku| "
+ ++ "<hspace=3/>"
++ " |datetime| "
++ " |laTime| "
} where dimi = fc (pDim p)