Initial commit
This commit is contained in:
27
.config/polybar/scripts/battery.sh
Executable file
27
.config/polybar/scripts/battery.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
## config
|
||||
|
||||
full=80
|
||||
low=20
|
||||
|
||||
############################
|
||||
|
||||
red='%{F#f00}'
|
||||
green='%{F#0f0}'
|
||||
end='%{F-}'
|
||||
# hack to put a little space between the lightning and the percentage
|
||||
smallspace='%{T4} %{T-}'
|
||||
|
||||
bat="$(cat /sys/class/power_supply/BAT0/capacity)"
|
||||
ac="$(cat /sys/class/power_supply/AC/online)"
|
||||
|
||||
# display in red when under $low and no charger is connected
|
||||
[ "$bat" -gt "$low" ] || [ "$ac" -eq 1 ] || color="$red"
|
||||
# display in green when over $full and a charger is connected
|
||||
[ "$bat" -lt "$full" ] || [ "$ac" -eq 0 ] || color="$green"
|
||||
|
||||
prefix=" "
|
||||
[ "$ac" -eq 0 ] || prefix="⚡"
|
||||
|
||||
echo "${color}${prefix}${smallspace}${bat}%"
|
||||
3
.config/polybar/scripts/pub-ipv4.sh
Executable file
3
.config/polybar/scripts/pub-ipv4.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo $(curl -s https://ipinfo.io/ip)
|
||||
13
.config/polybar/scripts/running-vpn.sh
Executable file
13
.config/polybar/scripts/running-vpn.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
connection="$(nmcli con show --active | awk '$3 == "vpn" { print $1 }')"
|
||||
if [ -n "$connection" ]; then
|
||||
echo "VPN: $connection"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# [o] is a hack to not grep the grep-command
|
||||
# see: https://stackoverflow.com/questions/9375711/more-elegant-ps-aux-grep-v-grep
|
||||
! ps ax | grep -q "[o]penvpn" || echo -n "VPN"
|
||||
|
||||
echo
|
||||
Reference in New Issue
Block a user