Show screen brightness in xmobar

21d06373c49382cf3950e103b2f1a8b1e19cc046
Alexis Sellier committed ago 1 parent ce95b86c
.xmobarrc +2 -1
11 11
                  , Run MultiCpu   [ "--template", "<total0>% <total1>% <total2>% <total3>%", "-w", "3" ] 50
12 12
                  , Run Memory     [ "--template", "<used>/<available> MB" ] 50
13 13
                  , Run Date       "%a %b %d %Y %H:%M:%S" "date" 10
14 14
                  , Run DiskU      [("/", "<used>/<size>"), ("/home", "<used>/<size>")] [] 20
15 15
                  , Run Com        "xmobar-dropbox-status" [] "dropbox" 10
16 +
                  , Run Com        "xmobar-brightness" [] "brightness" 10
16 17
                  , Run Com        "seedbox-status" [] "seedbox" 10
17 18
                  , Run CoreTemp   [ "--template", "<core0>° <core1>°" ] 50
18 19
                  , Run Wireless   "wlp58s0" [ "--template", "☎ <essid>/<quality>"] 10
19 20
                  , Run Battery    [ "--template", "⌁ <left>%" ] 100
20 21
                  , Run StdinReader
21 22
                  ]
22 23
     , sepChar = "%"
23 24
     , alignSep = "}{"
24 -
     , template = "%StdinReader%  }{┊ %battery% ┊ %wlp58s0wi% ┊ %seedbox% ┊ %dropbox% ┊ %multicpu% · %memory% · %disku% · %dynnetwork% ┊ <fc=#aaaaaa>%date%</fc> "
25 +
     , template = "%StdinReader%  }{┊ %brightness% ┊ %battery% ┊ %wlp58s0wi% ┊ %seedbox% ┊ %dropbox% ┊ %multicpu% · %memory% · %disku% · %dynnetwork% ┊ <fc=#aaaaaa>%date%</fc> "
25 26
}
bin/xmobar-brightness added +10 -0
1 +
#!/bin/sh
2 +
3 +
max=$(cat ~/settings/max-brightness)
4 +
actual=$(cat ~/settings/actual-brightness)
5 +
ratio=$(($max / $actual))
6 +
bars=$(($ratio * 5))
7 +
8 +
printf "☀ $(($ratio * 100))%%"
9 +
10 +