diff options
| author | jao <jao@gnu.org> | 2018-12-01 19:13:08 +0000 | 
|---|---|---|
| committer | jao <jao@gnu.org> | 2018-12-01 19:13:08 +0000 | 
| commit | 1cc4f0c1924e20fad7018307c549cee445afbaf7 (patch) | |
| tree | 2354f077dcb885e13b3b8dec8cfd44952b83f5a3 /src | |
| parent | 836bcb7286275969ce4b22ad130384652c5821e8 (diff) | |
| download | xmobar-config-1cc4f0c1924e20fad7018307c549cee445afbaf7.tar.gz xmobar-config-1cc4f0c1924e20fad7018307c549cee445afbaf7.tar.bz2 | |
Directory layout directly usable by xmobar executable
Diffstat (limited to 'src')
| -rw-r--r-- | src/MPD.hs | 27 | ||||
| -rw-r--r-- | src/Mpris.hs | 20 | ||||
| -rw-r--r-- | src/Top.hs | 46 | ||||
| -rw-r--r-- | src/lib/Bottom.hs (renamed from src/Bottom.hs) | 0 | ||||
| -rw-r--r-- | src/lib/Config.hs (renamed from src/Config.hs) | 0 | 
5 files changed, 93 insertions, 0 deletions
| diff --git a/src/MPD.hs b/src/MPD.hs new file mode 100644 index 0000000..d237867 --- /dev/null +++ b/src/MPD.hs @@ -0,0 +1,27 @@ +import Xmobar +import Config (palette) +import qualified Bottom (config) + +mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t" +          , " <lapsed> <fc=seashell3><fn=1><bar></fn></fc>"] 10 + +autoMPD = AutoMPD [ "-T", "160", "-E", "...", "-W", "10", "-t" +                  , "<length> <ppos>/<plength> \ +                    \<fn=0><fc=darkolivegreen><title></fc></fn> \ +                    \<fn=0><album></fn> \ +                    \<fn=0><fc=dodgerblue4><artist></fc> \ +                    \<fc=burlywood4><composer></fc> <date></fn>"] + + +config p = (Bottom.config [(Run mpd), (Run autoMPD)] p) { +  template =  "|kbd||default:Master| |default:Capture| \ +              \|mpd| |autompd| {} |mbox| \ +              \|EGPH| \ +              \|diskio| |disku| · |bright| · |coretemp| \ +              \|memory| · |uptime| |b0| " +  , additionalFonts = ["xft:Hack-7"] +  , textOffsets = [17] +  } + +main :: IO () +main = palette >>= xmobar . config diff --git a/src/Mpris.hs b/src/Mpris.hs new file mode 100644 index 0000000..09c155d --- /dev/null +++ b/src/Mpris.hs @@ -0,0 +1,20 @@ +import Xmobar +import Config (palette) +import qualified Bottom (config) + +mpris = +  Mpris2 "spotify" -- "clementine" -- +         ["-t", " <tracknumber>\ +                \ <title> <fc=sienna4><artist></fc>\ +                \ <album> <length>" +         , "-T", "180", "-E", "...", "-M", "100", "-x", ""] 10 + +config p = (Bottom.config [Run mpris] p) { +  template =  "|kbd||default:Master| |default:Capture| \ +              \|mpris2| {} |mbox| \ +              \|EGPH| \ +              \|diskio| |disku| · |bright| · |coretemp| \ +              \|memory| · |uptime| |b0| " +  } +main :: IO () +main = palette >>= xmobar . config diff --git a/src/Top.hs b/src/Top.hs new file mode 100644 index 0000000..c14b56a --- /dev/null +++ b/src/Top.hs @@ -0,0 +1,46 @@ +import Xmobar +import Config + +topProc p = TopProc (p <~> ["-t" , "<mboth3>  <mboth2>  <mboth1> \ +                                   \· <both3>  <both2>  <both1>" +                           , "-w", "10", "-L" , "10", "-H", "80"]) 15 + +wireless p = Wireless "wlan0" (p <~> ["-t" , "<essid> <quality>" +                                     , "-W", "5", "-M", "15" , "-m", "2" +                                     , "-L", "20", "-H", "80"]) 20 + +multiCPU p = MultiCpu (p <~> ["-t", "<autototal>" +                             , "-S", "on", "-b", " ", "-f", "*" +                             , "-c", " " , "-L", "30", "-H", "70" +                             , "-p", "3", "-a", "l"]) 10 + +cpuFreq p = CpuFreq (p <~> ["-t" , "<cpu0> <cpu1> <cpu2> <cpu3>" +                           , "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"]) 50 + +dynNetwork p = DynNetwork (p <~> ["-t", "↑ <tx> ↓ <rx>" +                                 , "-L", "20", "-H", "1024000" +                                 , "-m", "5", "-W", "10", "-S", "Off"]) 10 + +network p = Network "tun0" ["-t", "<dev>:", "-x", ""] 20 + +config p = (baseConfig p) { +  position = Static {xpos=1, ypos=1, width=1920, height=24} +  , textOffset = 16 +  , commands = [ Run (topProc p) +               , Run (wireless p) +               , Run (multiCPU p) +               , Run (cpuFreq p) +               , Run (dynNetwork p) +               , Run (network p) +               , Run XMonadLog +               , Run (DateZone "%H" "en_US" "US/Pacific" "laTime" 10) +               , Run (Date "%R" "datetime" 10) +               ] +  , template = " |top| {|XMonadLog|}\ +               \ |cpufreq| |multicpu|  |dynnetwork|\ +               \   <action=`wicd-client -n`>|tun0||wlan0wi|</action>\ +               \   |datetime| |laTime| " +} + +main :: IO () +main = palette >>= xmobar . config diff --git a/src/Bottom.hs b/src/lib/Bottom.hs index 1c70548..1c70548 100644 --- a/src/Bottom.hs +++ b/src/lib/Bottom.hs diff --git a/src/Config.hs b/src/lib/Config.hs index 94b9211..94b9211 100644 --- a/src/Config.hs +++ b/src/lib/Config.hs | 
