Skip to content

Commit

Permalink
--parse: exclude all known switches
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jun 6, 2022
1 parent fc1e98b commit 12ceb6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install/acc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,12 @@ parse_switches() {
*) continue;;
esac

i=${i#/sys/class/power_supply/}

# exclude all known switches
! grep -q "$i " $1 || continue

i="$(echo "$i $n" | grep -Eiv 'brightness|curr|online|present|runtime|status|temp|volt|wakeup|[^pP]reset|daemon|calibrat|init|resistance|capacitance|shutdown|parallel|cycle|shutdown|reboot|nvram|count' \
| sed 's|^/.*/power_supply/||')"
i="$(echo "$i $n" | grep -Eiv 'brightness|curr|online|present|runtime|status|temp|volt|wakeup|[^pP]reset|daemon|calibrat|init|resistance|capacitance|shutdown|parallel|cycle|shutdown|reboot|nvram|count')"

[ -z "$i" ] || echo "$i"

Expand Down

0 comments on commit 12ceb6a

Please sign in to comment.