Initial commit

This commit is contained in:
2020-04-23 14:50:36 +02:00
commit 0c743950ac
47 changed files with 3838 additions and 0 deletions

View 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}%"

View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo $(curl -s https://ipinfo.io/ip)

View 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