add display status
This commit is contained in:
parent
4d08c12db7
commit
b3aaf792a5
1 changed files with 30 additions and 2 deletions
|
@ -2,10 +2,10 @@
|
|||
|
||||
#DATE=$(while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done)
|
||||
DATE=$(date +'%Y-%m-%d %k:%M')
|
||||
|
||||
BATTERY=$(upower --enumerate|grep battery)
|
||||
POWER="| $(upower -i $BATTERY|grep percentage|awk '{print $2}')"
|
||||
BSTATE=$(upower -i $BATTERY|grep state|awk '{print $2}')
|
||||
|
||||
# fully-charged 🔌
|
||||
# charging ⚡
|
||||
# discharging 🔋
|
||||
|
@ -24,6 +24,34 @@ case "$BSTATE" in
|
|||
;;
|
||||
esac
|
||||
|
||||
SSHDSTATUS=$(systemctl is-active ssh)
|
||||
if [[ $SSHDSTATUS == "active" ]];
|
||||
then
|
||||
SSHWARN="⚠️ |"
|
||||
else
|
||||
SSHWARN=""
|
||||
fi
|
||||
|
||||
source $HOME/.config/sway/displays.sh
|
||||
# swaymsg -t get_outputs
|
||||
# LAPTOP="eDP-1"
|
||||
# EXTERNAL="HDMI-A-1"
|
||||
LAPSTAT=$(swaymsg -t get_outputs -r|jq --arg DISP "$LAPTOP" '.[] | select(.name==$DISP) | .active')
|
||||
if [[ $LAPSTAT == "true" ]];
|
||||
then
|
||||
L=" 💻"
|
||||
else
|
||||
L=""
|
||||
fi
|
||||
EXTSTAT=$(swaymsg -t get_outputs -r|jq --arg DISP "$EXTERNAL" '.[] | select(.name==$DISP) | .active')
|
||||
if [[ $EXTSTAT == "true" ]];
|
||||
then
|
||||
E=" 🖥️"
|
||||
else
|
||||
E=""
|
||||
fi
|
||||
DISPSTAT="$E$L"
|
||||
|
||||
# weather (https://github.com/chubin/wttr.in)
|
||||
# add %l for location
|
||||
WCACHE=~/.cache/thrrgilag/wttr
|
||||
|
@ -58,4 +86,4 @@ then
|
|||
MTEXT=""
|
||||
fi
|
||||
|
||||
echo "$MTEXT $WEATHER $POWER $STATE $DATE |"
|
||||
echo "$MTEXT $WEATHER $DISPSTAT $POWER $STATE $DATE | $SSHWARN"
|
||||
|
|
Loading…
Reference in a new issue