diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-01-10 01:27:33 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-01-10 01:27:33 -0500 |
| commit | 7a8801c0cf5e69cd5ee887126dd0294316f88b42 (patch) | |
| tree | 074e6bfd282cbdbce13f712343996bce77835930 /bin | |
| parent | 3f705fd9ff7b937a077231a65ba7888096303816 (diff) | |
| download | dotfiles-7a8801c0cf5e69cd5ee887126dd0294316f88b42.tar.gz dotfiles-7a8801c0cf5e69cd5ee887126dd0294316f88b42.tar.xz | |
Add the pinebook to the status bar and backlight script
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/backlight | 6 | ||||
| -rwxr-xr-x | bin/status-bar | 18 |
2 files changed, 22 insertions, 2 deletions
diff --git a/bin/backlight b/bin/backlight index 4df3636..00cf00b 100755 --- a/bin/backlight +++ b/bin/backlight @@ -2,8 +2,10 @@ set -e set -x # Note the trailing slash -# base="/sys/class/backlight/amdgpu_bl0/" -base="/sys/class/backlight/intel_backlight/" +base="/sys/class/backlight/amdgpu_bl0/" +# base="/sys/class/backlight/intel_backlight/" +# pinebook +# base="/sys/class/backlight/backlight/" _backlight="${base}brightness" _max="${base}max_brightness" _max="$(cat "$_max" | awk '{print $1/100;}')" diff --git a/bin/status-bar b/bin/status-bar index 7a82c9a..5a5eba1 100755 --- a/bin/status-bar +++ b/bin/status-bar @@ -44,6 +44,12 @@ network_info() { } +pine_batt_status() { + cat \ + /sys/class/power_supply/axp20x-battery/capacity \ + /sys/class/power_supply/axp20x-battery/status +} + batt_status() { # sudo tlp-stat -b | awk 'BEGIN{ORS=" "} /\/status/{print $3}/^Charge/{print $3}'; cat /sys/class/power_supply/BAT0/capacity @@ -90,6 +96,18 @@ sensors | sed -n '/^k10/,/^$/p' | awk '/^Tctl/{print $2}' \ | sed -e's/+//g' -e's/\.[0-9][^0-9]*$//g' } +pine_Temp() { + sensors | sed -n -e 's/^temp1[ \t:]*//p' | sed 1q +} + +pine_status_line() { +echo \ +"Batt: $(pine_batt_status)|"\ +"Temp: $(pine_Temp)|"\ +"$(network_info)|"\ +"$(date '+%m.%d.%Y %H:%M:%S')" +} + status_line() { echo \ "Temp: $(sensors | sed -n 's/^temp1:[\t ]*//p' | sed 's/ *//g' | sed 1q | tr -d '\n')|"\ |
