From c300eff998d758bf867abbb7f39bf6fdfecf7a2e Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 4 Nov 2022 23:58:06 +0000 Subject: cleanups and unused code removed --- src/Bottom.hs | 11 ----------- src/Emacs.hs | 10 ++++------ src/Single.hs | 48 +++++++++++++++++++++++++----------------------- src/Sway.hs | 17 ++++++----------- 4 files changed, 35 insertions(+), 51 deletions(-) delete mode 100644 src/Bottom.hs (limited to 'src') 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 = " " - ++ "· " - args = ["-t", template, "-w", "12", "-L" , "10", "-H", "80"] +topProcL p s = TopProc (p <~> args) 15 + where temp | s = " · " + | otherwise = " " + ++ "· " + args = ["-t", temp, "-w", "12", "-L" , "10", "-H", "80"] diskIOS p = DiskIO [("/", " ")] (diskArgs p) 10 @@ -16,18 +17,18 @@ memory' = Memory args 20 where template = " " args = ["-t", template , "-p", "2", "-d", "1", "--", "--scale", "1024"] -master on off p = Volume "default" "Master" (args ++ ("--":ext)) 10 - where args = ["-t", " "] - 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| " ++ "" - ++ " |wg-mullvad||tun0||wlp164s0wi|" + ++ " |wg-mullvad||tun0||wlp164s0wi|" ++ "" ++ " |dynnetwork| " ++ "" ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|" ++ "" - ++ " |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 = " ° " ++ fn 5 "🌫" ++ " " + } 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| " + ++ " " ++ "" ++ " |wg-mullvad||tun0||wlp164s0wi|" ++ "" ++ " |dynnetwork| " + ++ "" ++ "" ++ " |default:Master| " ++ fn 7 "\xf130" ++ " |default:Capture|" ++ " " ++ "|mpd|" + ++ "" ++ " |EGPH| " ++ " {} " ++ "|multicpu| " ++ "|multicoretemp| " ++ " |top| " + ++ "" ++ fni "☸" ++ " |memory| " ++ " |diskio| |disku| " + ++ "" ++ " |datetime| " ++ " |laTime| " } where dimi = fc (pDim p) -- cgit v1.2.3