Have DWM status call status with a parameter.
This commit is contained in:
@@ -2,64 +2,8 @@
|
|||||||
# 2025-11-10 Hyperling
|
# 2025-11-10 Hyperling
|
||||||
# Icons: https://fontawesome.com/v4/cheatsheet/
|
# Icons: https://fontawesome.com/v4/cheatsheet/
|
||||||
|
|
||||||
source "`which volume.function`"
|
source "`which status.function`"
|
||||||
source "`which battery.function`"
|
|
||||||
source "`which storage.function`"
|
|
||||||
|
|
||||||
function datetime {
|
|
||||||
date +"%Y-%m-%d %H:%M:%S"
|
|
||||||
}
|
|
||||||
function dwm-status {
|
function dwm-status {
|
||||||
cmd="xsetroot -name "
|
status-display --dwm
|
||||||
if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then
|
|
||||||
cmd="echo"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "`storage-root`" == "`storage-home`" ]]; then
|
|
||||||
function dwm-status-storage {
|
|
||||||
echo "`storage-root-dwm`)"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
function dwm-status-storage {
|
|
||||||
echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
battery=""; storage=""; volume=""; datetime="";
|
|
||||||
userhost="`whoami`@`hostname`"
|
|
||||||
while true; do
|
|
||||||
# Reset Variables
|
|
||||||
if [[ $datetime == *"00" ]]; then
|
|
||||||
unset battery
|
|
||||||
unset storage
|
|
||||||
fi
|
|
||||||
if [[ $datetime != "`datetime`" ]]; then
|
|
||||||
unset volume
|
|
||||||
unset datetime
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set Variables
|
|
||||||
if [[ -z $battery ]]; then
|
|
||||||
battery="`battery-display`"
|
|
||||||
fi
|
|
||||||
if [[ -z $storage ]]; then
|
|
||||||
storage="`dwm-status-storage`"
|
|
||||||
fi
|
|
||||||
if [[ -z $volume ]]; then
|
|
||||||
volume="`volume-display`"
|
|
||||||
fi
|
|
||||||
if [[ -z $datetime ]]; then
|
|
||||||
datetime="`datetime`"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Display Variables
|
|
||||||
readout="$readout $battery"
|
|
||||||
readout="$readout | $storage"
|
|
||||||
readout="$readout | $volume"
|
|
||||||
readout="$readout | $userhost"
|
|
||||||
readout="$readout | $datetime"
|
|
||||||
$cmd "$readout"
|
|
||||||
readout=""
|
|
||||||
sleep 0.2
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
alias status="dwm-status --test"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user