diff options
| -rwxr-xr-x | auto-displays.sh | 2 | ||||
| -rwxr-xr-x | bang.sh | 12 | ||||
| -rwxr-xr-x | bat | 16 | ||||
| -rwxr-xr-x | through-vpn.sh | 11 |
4 files changed, 41 insertions, 0 deletions
diff --git a/auto-displays.sh b/auto-displays.sh new file mode 100755 index 0000000..7372649 --- /dev/null +++ b/auto-displays.sh @@ -0,0 +1,2 @@ +#!/bin/sh +DISPLAY=:0 xrandr --auto @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +FILE=/usr/share/orage/sounds/Spo.wav + +if [ ! -f "$FILE" ] ; then + echo "No sound file: $FILE" + exit 1 +fi + +aplay --quiet "$FILE" @@ -0,0 +1,16 @@ +#!/bin/bash + +ac_online=$(cat /sys/class/power_supply/AC/online) + +if [ "x$ac_online" = "x1" ] ; then + echo "On power" +fi + +for bat in /sys/class/power_supply/BAT? ; do + status=$(cat "$bat/status") + energy_full=$(cat "$bat/energy_full") + energy_now=$(cat "$bat/energy_now") + current_charge=$(bc <<< "scale=2; $energy_now / $energy_full * 100") + + printf '%s: %.0f%%\n' $(basename $bat) $current_charge +done diff --git a/through-vpn.sh b/through-vpn.sh new file mode 100755 index 0000000..7e9e1ee --- /dev/null +++ b/through-vpn.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Add host to through-vpn address list. +# + +if [ $# -eq 0 ] ; then + echo 'First argument must be host name.' + exit 1 +fi + +ssh riga "/ip firewall address-list add address=$1 list=through-vpn" |
