repositories
/
dotfiles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
432c2b1
)
fix bar for desktop
author
Mart Lubbers
<mart@martlubbers.net>
Wed, 21 Nov 2018 08:35:20 +0000
(09:35 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Wed, 21 Nov 2018 08:35:20 +0000
(09:35 +0100)
x/.local/bin/bar
patch
|
blob
|
history
diff --git
a/x/.local/bin/bar
b/x/.local/bin/bar
index
f210c49
..
bc01c54
100755
(executable)
--- a/
x/.local/bin/bar
+++ b/
x/.local/bin/bar
@@
-1,10
+1,12
@@
#!/bin/sh
#!/bin/sh
-for f in /sys/class/power_supply/BAT*/uevent; do
- eval $(grep -v " " "$f")
- bat="$bat⚡$((POWER_SUPPLY_CHARGE_NOW*100/POWER_SUPPLY_CHARGE_FULL))% ($POWER_SUPPLY_STATUS) | "
-done
+if stat -t /sys/class/power_supply/BAT*/uevent >/dev/null 2>&1; then
+ for f in /sys/class/power_supply/BAT*/uevent; do
+ eval $(grep -v " " "$f")
+ bat="$bat⚡$((POWER_SUPPLY_CHARGE_NOW*100/POWER_SUPPLY_CHARGE_FULL))% ($POWER_SUPPLY_STATUS) | "
+ done
+fi
-for int in $(ip link show | grep -Po '(?<=.: )
\S
+(?=:)'); do
+for int in $(ip link show | grep -Po '(?<=.: )
[A-Za-z0-9]
+(?=:)'); do
if [ $(ip addr show dev $int | grep -Po "(?<=link/)\S+ ") = "ether" ]; then
net="$net$int: "
if /sbin/iwconfig $int >/dev/null 2>&1; then
if [ $(ip addr show dev $int | grep -Po "(?<=link/)\S+ ") = "ether" ]; then
net="$net$int: "
if /sbin/iwconfig $int >/dev/null 2>&1; then