#!/bin/bash
-function music {
- song=$([ "$(mpc | wc -l)" = "1" ] && echo "[stopped]" || echo $(mpc | head -1))
- status=$(mpc | grep -o "\[p.*\]")
- echo -ne "♪: $song$status | "
-}
-
-function net {
- cat /run/network/ifstate | grep -q $1 && echo "$2 | "
-}
-
-function volume {
- volume=$(amixer | grep -A4 Master | grep -o "[0-9]\{1,3\}%\|\[off\]")
- echo -ne "♬: $volume | "
-}
-
-function temp {
- temp=$(sensors|grep temp1|head -1|awk '{print $2}')
- echo -ne "⚠: $temp | "
-}
-
-function battery {
- pa="/sys/class/power_supply/BAT0"
- power=$(echo "$(cat $pa/charge_now)*100/$(cat $pa/charge_full)" | bc)
- charge=""
- if [ "$(cat $pa/status)" = "Charging" ]; then
- charge="(C)"
- fi
- echo -ne "⚡: $power%$charge | "
-}
-
-while [ 1 ]; do
- echo "$(music)$(volume)$(net wlan0 W)$(net eth0 E)$(net usb0 U)$(temp)$(battery)$(date +%y-%m-%d\ %H:%M)"
- sleep 5
+while true;
+do
+ date
+ sleep 1
done