diff --git a/conky-bat/index.js b/conky-bat/index.js index 93e2b44..feb1b95 100755 --- a/conky-bat/index.js +++ b/conky-bat/index.js @@ -7,9 +7,22 @@ linuxBattery().then(batteries => { batteries.forEach(battery => { var color = battery.warningLevel !== 'none' ? '#ff0000' : '#eee8d5'; var stateSymbol = battery.state === 'charging' ? '↑' : '↓'; + switch (battery.state) { + case 'charging': + stateSymbol = '↑'; + break; + case 'fully-charged': + stateSymbol = 'F'; + break; + case 'discharging': + stateSymbol = '↓'; + break; + default: + + } var timeLeft = battery.timeToFull || battery.timeToEmpty || ''; var text = `%{F${color}}${battery.percentage} ${stateSymbol} ${timeLeft}%{F-}`; - console.log(text); + process.stdout.write(text); }); }); diff --git a/conkyrc b/conkyrc index 405b21b..678fe40 100644 --- a/conkyrc +++ b/conkyrc @@ -33,4 +33,4 @@ override_utf8_locale yes use_spacer left TEXT -%{c} load: ${loadavg 1} ${loadavg 2} ${loadavg 3} | ram: ${memperc}% | swap: ${swapperc} | processes: ${processes} | ${if_up wlp3s0} wlan:${wireless_link_qual_perc wlp3s0}% ${wireless_essid wlp3s0} ↓${downspeed wlp3s0} ↑${upspeed wlp3s0} |$endif ${if_up enp0s25:} lan: ↓${downspeed wlp3s0} ↑${upspeed wlp3s0} |$endif bat ${exec $HOME/.config/herbstluftwm/conky-bat/index.js} +%{c} load: ${loadavg 1} ${loadavg 2} ${loadavg 3} | ram: ${memperc}% | swap: ${swapperc} | processes: ${processes} | ${if_up wlan0} wlan:${wireless_link_qual_perc wlan0}% ${wireless_essid wlan0} ↓${downspeed wlan0} ↑${upspeed wlan0} |$endif ${if_up enp0s25:} lan: ↓${downspeed wlan0} ↑${upspeed wlan0} |$endif bat ${exec $HOME/.config/herbstluftwm/conky-bat/index.js} diff --git a/statusbar.sh b/statusbar.sh index 403484e..3d6c751 100755 --- a/statusbar.sh +++ b/statusbar.sh @@ -51,5 +51,6 @@ panelGeometry=${geometry[2]}x${statusbar_height}+${x}+${y} | lemonbar \ -g $panelGeometry \ -f "$font" \ + -f '-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1' \ -B $GRUVBOX_DARK1 -F $GRUVBOX_LIGHT0 \ -u 2