47 lines
836 B
Bash
Executable file
47 lines
836 B
Bash
Executable file
#!/bin/sh
|
|
# speedwm_status
|
|
# status bar manager for speedwm/stellar
|
|
|
|
STATUSBAR="speedwm-stellar" # should be stellar
|
|
IN_ARGS="$@" # arguments
|
|
LOADTEXT="Loading" # load text
|
|
|
|
mkdir -p $HOME/.config/speedwm/
|
|
|
|
case "$1" in
|
|
"-h")
|
|
echo "speedwm_status - stellar launcher"
|
|
echo ""
|
|
echo "-r Restart stellar"
|
|
echo "No arguments Run stellar"
|
|
echo ""
|
|
echo "See speedwm-help for more information."
|
|
exit 0
|
|
;;
|
|
"-r") pkill "$STATUSBAR" ; sleep 2 ; statusfunc
|
|
;;
|
|
esac
|
|
|
|
# run status
|
|
rstatus() {
|
|
while true; do
|
|
$STATUSBAR $IN_ARGS > /tmp/statusbar-log
|
|
done
|
|
}
|
|
|
|
# run loop
|
|
statusfunc() {
|
|
if pgrep -x $STATUSBAR > /dev/null; then
|
|
clear
|
|
printf "Status bar is already running, continuing loop."
|
|
sleep 3
|
|
else
|
|
speedwm -s "$LOADTEXT"
|
|
rstatus
|
|
fi
|
|
|
|
statusfunc
|
|
}
|
|
|
|
statusfunc
|