From 7a8801c0cf5e69cd5ee887126dd0294316f88b42 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 10 Jan 2021 01:27:33 -0500 Subject: Add the pinebook to the status bar and backlight script --- bin/backlight | 6 ++++-- bin/status-bar | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'bin') 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')|"\ -- cgit v1.2.3