2022-08-21 11:53:18 +02:00
|
|
|
#!/bin/sh
|
2022-10-25 19:23:36 +02:00
|
|
|
# stellar - Status bar for speedwm
|
|
|
|
#
|
2022-08-21 11:53:18 +02:00
|
|
|
# Written by speedie.gq in POSIX sh for https://speedie.gq/speedwm
|
|
|
|
# Licensed under the GNU GPLv3 free software license.
|
|
|
|
#
|
|
|
|
# NOTE: Anything in the DISPLAY function will be printed to your status bar.
|
|
|
|
# This means stdout will be printed regardless.
|
|
|
|
# You can output to /dev/null to silence most commands.
|
|
|
|
#
|
|
|
|
# Once you're done editing, run 'make clean install'.
|
|
|
|
#
|
|
|
|
# CONFIG
|
|
|
|
# This is the configuration for the status bar
|
|
|
|
#
|
|
|
|
# I highly recommend editing ~/.config/speedwm-de/status/config instead though
|
2022-10-01 21:41:25 +02:00
|
|
|
# All settings can be changed there. Otherwise, carefully edit the file and recompile speedwm!
|
2022-08-27 21:49:51 +02:00
|
|
|
|
2022-10-20 23:03:18 +02:00
|
|
|
if [ ! -e "$HOME/.config/speedwm-de/status/config" ]; then
|
|
|
|
cat <<EOF > ~/.config/speedwm-de/status/config
|
|
|
|
# status configuration
|
|
|
|
|
2022-08-21 11:53:18 +02:00
|
|
|
# General settings
|
2022-10-01 20:29:41 +02:00
|
|
|
REFRESHDELAY=1 # How long delay in seconds between each reload (num)
|
2022-08-21 11:53:18 +02:00
|
|
|
DATEBINDIR="/bin/" # Directory where your 'date' binary is. Default should be fine for most people
|
2022-10-15 02:22:19 +02:00
|
|
|
SETMETHOD="speedwm -s" # Method used to set the status bar
|
2022-10-01 21:41:25 +02:00
|
|
|
SEPARATOR="❰" # Separator to use. Alternative separators: "❰", "<", "|"
|
2022-08-21 11:53:18 +02:00
|
|
|
COLORFG=true # Color foreground (true/false)
|
|
|
|
COLORBG=false # Color background (true/false)
|
2022-10-20 15:29:43 +02:00
|
|
|
CLICKABLE=true # Enable clickability (Requires dwm with statuscmd or speedwm) (true/false)
|
2022-09-01 23:00:34 +02:00
|
|
|
CHARLIMIT=auto # Limit characters to CHARLIMIT. Enter false to not have a limit. Enter auto to use xdpyinfo. (num/auto/false)
|
2022-10-01 21:41:25 +02:00
|
|
|
ITEM_ORDER="@2 @3 @11 @4 @1 @6 @8 @5 @9 @7 @10" # Item order. @1 means item 1, @6 means item 6 and so on. (text)
|
2022-08-21 11:53:18 +02:00
|
|
|
|
|
|
|
# Status bar modules
|
|
|
|
# Set to true/false to enable/disable.
|
|
|
|
# Keep in mind, if the dependencies are not installed, then they will not be used regardless of what the option is set to.
|
|
|
|
ENABLE_ITEM1=true # Enable RAM usage (true/false)
|
|
|
|
ENABLE_ITEM2=true # Enable Time (HH:MM) (true/false)
|
|
|
|
ENABLE_ITEM3=true # Enable Date (DD/MM/YY) (true/false)
|
|
|
|
ENABLE_ITEM4=true # Enable Volume/Mute status (<perc>%) (true/false)
|
|
|
|
ENABLE_ITEM5=true # Enable Weather (true/false)
|
|
|
|
ENABLE_ITEM6=true # Enable Network Traffic (<num>B/s (true/false)
|
|
|
|
ENABLE_ITEM7=true # Enable dfmpeg status (true/false)
|
|
|
|
ENABLE_ITEM8=true # Enable CPU temp (true/false)
|
|
|
|
ENABLE_ITEM9=true # Enable music status (true/false)
|
|
|
|
ENABLE_ITEM10=false # Enable newsboat unread (true/false)
|
|
|
|
ENABLE_ITEM11=true # Enable battery percentage and charging status (true/false)
|
|
|
|
|
2022-10-20 23:10:48 +02:00
|
|
|
ITEM1_ICON=" " # Icon for ITEM1
|
|
|
|
ITEM2_ICON=" " # Icon for ITEM2
|
2022-08-26 23:02:14 +02:00
|
|
|
ITEM3_ICON=" " # Icon for ITEM3
|
|
|
|
ITEM4_ICON=" " # Icon for ITEM4
|
2022-10-20 23:10:48 +02:00
|
|
|
ITEM5_ICON=" " # Icon for ITEM5
|
2022-08-26 23:02:14 +02:00
|
|
|
ITEM6_ICON=" " # Icon for ITEM6
|
2022-10-20 23:10:48 +02:00
|
|
|
ITEM7_ICON=" " # Icon for ITEM7
|
|
|
|
ITEM8_ICON=" " # Icon for ITEM8
|
2022-08-26 23:02:14 +02:00
|
|
|
ITEM9_ICON=" " # Icon for ITEM9
|
2022-10-20 23:10:48 +02:00
|
|
|
ITEM10_ICON=" " # Icon for ITEM10
|
2022-08-26 23:02:14 +02:00
|
|
|
ITEM11_ICON=" " # Icon for ITEM11
|
2022-08-21 11:53:18 +02:00
|
|
|
|
2022-10-01 22:24:19 +02:00
|
|
|
# RAM format
|
2022-10-01 21:41:25 +02:00
|
|
|
# Format to display the RAM status in
|
|
|
|
#
|
|
|
|
# @u - Used RAM
|
|
|
|
# @t - Total RAM
|
|
|
|
#
|
|
|
|
# Example: @u/@t
|
|
|
|
ITEM1_FORMAT="@u/@t"
|
2022-09-08 11:50:50 +02:00
|
|
|
|
2022-10-01 22:24:19 +02:00
|
|
|
# Time format
|
2022-10-01 20:29:41 +02:00
|
|
|
# Format to display the time in
|
|
|
|
#
|
|
|
|
# @h - Hour
|
|
|
|
# @m - Minute
|
|
|
|
# @s - Second
|
|
|
|
#
|
|
|
|
# Example: @h:@m
|
|
|
|
ITEM2_FORMAT="@h:@m"
|
|
|
|
|
2022-10-01 22:24:19 +02:00
|
|
|
# Date format
|
2022-10-01 20:29:41 +02:00
|
|
|
# Format to display the date in
|
|
|
|
#
|
|
|
|
# @d - Day
|
|
|
|
# @m - Month
|
|
|
|
# @y - Year
|
|
|
|
#
|
|
|
|
# Example: @d/@m/@y
|
|
|
|
ITEM3_FORMAT="@d/@m/@y"
|
2022-09-25 15:45:58 +02:00
|
|
|
|
2022-09-03 22:16:27 +02:00
|
|
|
ITEM4_SHOW_MUTE="true" # Show mute status (true/false)
|
2022-10-01 20:29:41 +02:00
|
|
|
ITEM4_MUTE_TEXT="(Muted)" # Text to display when muted (text)
|
2022-09-03 22:16:27 +02:00
|
|
|
|
2022-10-01 21:41:25 +02:00
|
|
|
ITEM7_RECORDING_TEXT="Recording" # Text to display when recording (text)
|
|
|
|
|
2022-10-01 20:29:41 +02:00
|
|
|
ITEM8_FORMAT_CELSIUS="true" # Format temperature in Celsius (true/false)
|
2022-09-08 14:32:13 +02:00
|
|
|
|
2022-08-21 11:53:18 +02:00
|
|
|
ITEM9_BACKEND="auto" # Backend for the music status (cmus/mocp/auto)
|
2022-09-25 15:45:58 +02:00
|
|
|
ITEM9_DISPLAY_ARTIST="true" # Display artist or not (true/false)
|
|
|
|
ITEM9_DISPLAY_TITLE="true" # Display title or not (true/false)
|
|
|
|
ITEM9_DISPLAY_ALBUM="true" # Display album or not (true/false)
|
|
|
|
ITEM9_DISPLAY_GENRE="true" # Display genre or not (true/false)
|
|
|
|
ITEM9_DISPLAY_TIMEELAPSED="true" # Display time elapsed or not. If you use this, you will probably want the delay set pretty low. (true/false)
|
|
|
|
ITEM9_DISPLAY_TIMETOTAL="true" # Display total time or not (true/false_
|
|
|
|
ITEM9_DISPLAY_FILE="false" # Display filename or not. This option will disable everything else. Path and file extension will be cut. (true/false)
|
2022-10-01 20:29:41 +02:00
|
|
|
|
2022-10-01 22:24:19 +02:00
|
|
|
# Music format
|
2022-10-01 20:29:41 +02:00
|
|
|
# Format to display the music status in
|
|
|
|
#
|
|
|
|
# @a - Artist
|
|
|
|
# @t - Title
|
|
|
|
# @g - Genre
|
|
|
|
# @ab - Album
|
|
|
|
# @tt - Total time
|
|
|
|
# @te - Time elapsed
|
|
|
|
#
|
|
|
|
# Example: @a - @t from @ab (@g) [@te/@tt]
|
|
|
|
ITEM9_FORMAT="@a - @t from @ab (@g) [@te/@tt]"
|
2022-08-21 11:53:18 +02:00
|
|
|
|
2022-10-01 21:41:25 +02:00
|
|
|
ITEM10_TEXT="unread articles!" # Text to display next to unread article count (text)
|
|
|
|
|
2022-08-30 12:08:08 +02:00
|
|
|
ITEM11_SHOW_CHARGING_STATUS=true # Show 'Charging', 'Not charging' or 'Fully charged' status after the percentage. (true/false)
|
2022-10-01 20:29:41 +02:00
|
|
|
ITEM11_DISCHARGING_TEXT="Not charging" # Text when not charging (text)
|
|
|
|
ITEM11_CHARGING_TEXT="Charging" # Text when charging (text)
|
|
|
|
ITEM11_FULL_TEXT="Fully charged" # Text when fully charged (text)
|
2022-10-20 23:03:18 +02:00
|
|
|
EOF
|
|
|
|
. $HOME/.config/speedwm-de/status/config && echo "Created configuration file"
|
|
|
|
else
|
|
|
|
. $HOME/.config/speedwm-de/status/config && echo "Loaded configuration file"
|
|
|
|
fi
|
2022-08-30 12:08:08 +02:00
|
|
|
|
2022-10-01 21:41:25 +02:00
|
|
|
#########################################################################
|
|
|
|
|
2022-10-20 15:29:43 +02:00
|
|
|
# set version
|
|
|
|
if [ -e "/usr/share/speedwm/speedwm-version" ]; then
|
|
|
|
VER="$(cat /usr/share/speedwm/speedwm-version)"
|
|
|
|
else
|
|
|
|
VER="1.0"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# set status
|
|
|
|
setstatus() {
|
|
|
|
$SETMETHOD "$@"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
# set loading status
|
|
|
|
setloading() {
|
|
|
|
$SETMETHOD "Loading"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
# print data
|
2022-10-21 13:35:02 +02:00
|
|
|
print() {
|
2022-10-20 15:29:43 +02:00
|
|
|
setstatus "$(printf "$ITEMS_TEXT")"
|
2022-08-21 11:53:18 +02:00
|
|
|
}
|
|
|
|
|
2022-10-20 15:29:43 +02:00
|
|
|
# set status2d compatible colors
|
2022-10-21 13:35:02 +02:00
|
|
|
setcolors2d() {
|
2022-08-21 11:53:18 +02:00
|
|
|
if [ "$COLORFG" = "true" ]; then
|
|
|
|
FSETCOLORCMD1="^C1^"
|
|
|
|
FSETCOLORCMD2="^C2^"
|
|
|
|
FSETCOLORCMD3="^C3^"
|
|
|
|
FSETCOLORCMD4="^C4^"
|
|
|
|
FSETCOLORCMD5="^C5^"
|
|
|
|
FSETCOLORCMD6="^C6^"
|
|
|
|
FSETCOLORCMD7="^C7^"
|
|
|
|
FSETCOLORCMD8="^C8^"
|
|
|
|
FSETCOLORCMD9="^C9^"
|
|
|
|
FSETCOLORCMD10="^C10^"
|
|
|
|
FSETCOLORCMD11="^C11^"
|
|
|
|
FSETCOLORCMD12="^C12^"
|
|
|
|
FSETCOLORCMD13="^C13^"
|
|
|
|
FSETCOLORCMD14="^C14^"
|
|
|
|
FSETCOLORCMD15="^C15^"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$COLORBG" = "true" ]; then
|
|
|
|
BSETCOLORCMD1="^B1^"
|
|
|
|
BSETCOLORCMD2="^B2^"
|
|
|
|
BSETCOLORCMD3="^B3^"
|
|
|
|
BSETCOLORCMD4="^B4^"
|
|
|
|
BSETCOLORCMD5="^B5^"
|
|
|
|
BSETCOLORCMD6="^B6^"
|
|
|
|
BSETCOLORCMD7="^B7^"
|
|
|
|
BSETCOLORCMD8="^B8^"
|
|
|
|
BSETCOLORCMD9="^B9^"
|
|
|
|
BSETCOLORCMD10="^B10^"
|
|
|
|
BSETCOLORCMD11="^B11^"
|
|
|
|
BSETCOLORCMD12="^B12^"
|
|
|
|
BSETCOLORCMD13="^B13^"
|
|
|
|
BSETCOLORCMD14="^B14^"
|
|
|
|
BSETCOLORCMD15="^B15^"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-10-20 15:29:43 +02:00
|
|
|
# remove old data
|
2022-09-01 23:15:06 +02:00
|
|
|
rm -f /tmp/itest
|
|
|
|
rm -f /tmp/wstatus
|
2022-10-08 14:36:30 +02:00
|
|
|
rm -f /tmp/iscelsius
|
2022-09-01 23:15:06 +02:00
|
|
|
|
2022-08-21 11:53:18 +02:00
|
|
|
mkdir -p $HOME/.config/speedwm-de/status
|
|
|
|
|
2022-10-21 13:35:02 +02:00
|
|
|
printf "Loaded $0 $VER\n---\n"
|
2022-10-01 21:41:25 +02:00
|
|
|
|
2022-08-21 11:53:18 +02:00
|
|
|
# Set it to /usr/bin if it was not possible to get it through /usr/share/speedwm-bindir
|
|
|
|
case "$BINDIR" in
|
2022-10-25 19:23:36 +02:00
|
|
|
"") BINDIR="$(dirname $(command -v speedwm_status))/" ;;
|
2022-08-21 11:53:18 +02:00
|
|
|
esac
|
|
|
|
|
2022-10-21 13:35:02 +02:00
|
|
|
# RAM usage
|
|
|
|
ITEM1() {
|
|
|
|
module_ram --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_ram" ]; then
|
|
|
|
cat /tmp/module_ram
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Time
|
|
|
|
ITEM2() {
|
|
|
|
module_time --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_time" ]; then
|
|
|
|
cat /tmp/module_time
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Date
|
|
|
|
ITEM3() {
|
|
|
|
module_date --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_date" ]; then
|
|
|
|
cat /tmp/module_date
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Volume
|
|
|
|
ITEM4() {
|
|
|
|
module_vol --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_vol" ]; then
|
|
|
|
cat /tmp/module_vol
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Weather
|
|
|
|
ITEM5() {
|
|
|
|
module_weather --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_weather" ]; then
|
|
|
|
cat /tmp/module_weather
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Network traffic
|
|
|
|
ITEM6() {
|
|
|
|
module_net --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_net" ]; then
|
|
|
|
cat /tmp/module_net
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Dfmpeg status
|
|
|
|
ITEM7() {
|
|
|
|
module_dfmpeg --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_dfmpeg" ]; then
|
|
|
|
cat /tmp/module_dfmpeg
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# CPU temp
|
|
|
|
ITEM8() {
|
|
|
|
module_temp --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_temp" ]; then
|
|
|
|
cat /tmp/module_temp
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# mocp/cmus status
|
|
|
|
ITEM9() {
|
|
|
|
module_music --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_music" ]; then
|
|
|
|
cat /tmp/module_music
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Newsboat unreads
|
|
|
|
ITEM10() {
|
|
|
|
module_news --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_news" ]; then
|
|
|
|
cat /tmp/module_news
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Battery percentage/charging status
|
|
|
|
ITEM11() {
|
|
|
|
module_bat --print &
|
|
|
|
|
|
|
|
if [ -e "/tmp/module_bat" ]; then
|
|
|
|
cat /tmp/module_bat
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set text variables that we can print later
|
|
|
|
ptext() {
|
2022-08-28 01:47:41 +02:00
|
|
|
# Output of commands
|
|
|
|
# We're doing this so we can manipulate them easily for various reasons.
|
2022-10-21 13:35:02 +02:00
|
|
|
itemcmd1="$(echo "$(ITEM1)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd2="$(echo "$(ITEM2)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd3="$(echo "$(ITEM3)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd4="$(echo "$(ITEM4)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd5="$(echo "$(ITEM5)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd6="$(echo "$(ITEM6)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd7="$(echo "$(ITEM7)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd8="$(echo "$(ITEM8)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd9="$(echo "$(ITEM9)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd10="$(echo "$(ITEM10)" | sed ':a;N;$!ba;s/\n//g')"
|
|
|
|
itemcmd11="$(echo "$(ITEM11)" | sed ':a;N;$!ba;s/\n//g')"
|
2022-08-31 15:28:33 +02:00
|
|
|
|
2022-10-01 21:41:25 +02:00
|
|
|
# Add colors to them
|
2022-10-21 13:35:02 +02:00
|
|
|
itemcmd1="$FSETCOLORCMD7$BSETCOLORCMD7$itemcmd1"
|
|
|
|
itemcmd2="$FSETCOLORCMD11$BSETCOLORCMD11$itemcmd2"
|
|
|
|
itemcmd3="$FSETCOLORCMD10$BSETCOLORCMD10$itemcmd3"
|
|
|
|
itemcmd4="$FSETCOLORCMD8$BSETCOLORCMD8$itemcmd4"
|
|
|
|
itemcmd5="$FSETCOLORCMD3$BSETCOLORCMD3$itemcmd5"
|
|
|
|
itemcmd6="$FSETCOLORCMD6$BSETCOLORCMD6$itemcmd6"
|
|
|
|
itemcmd7="$FSETCOLORCMD5$BSETCOLORCMD5$itemcmd7"
|
|
|
|
itemcmd8="$FSETCOLORCMD4$BSETCOLORCMD4$itemcmd8"
|
|
|
|
itemcmd9="$FSETCOLORCMD2$BSETCOLORCMD2$itemcmd9"
|
|
|
|
itemcmd10="$FSETCOLORCMD9$BSETCOLORCMD9$itemcmd10"
|
|
|
|
itemcmd11="$FSETCOLORCMD8$BSETCOLORCMD8$itemcmd11"
|
2022-10-01 21:41:25 +02:00
|
|
|
|
2022-10-20 15:29:43 +02:00
|
|
|
# Clickability
|
|
|
|
if [ "$CLICKABLE" = "true" ]; then
|
2022-10-21 13:35:02 +02:00
|
|
|
ITEMS_TEXT="$(echo "$ITEM_ORDER" | sed "s|@10|\x10$itemcmd10|; s|@11|\x11$itemcmd11|; s|@1|\x01$itemcmd1|; s|@2|\x02$itemcmd2|; s|@3|\x03$itemcmd3|; s|@4|\x04$itemcmd4|; s|@5|\x05$itemcmd5|; s|@6|\x06$itemcmd6|; s|@7|\x07$itemcmd7|; s|@8|\x08$itemcmd8|; s|@9|\x09$itemcmd9|; s|%|%%|g")"
|
2022-10-20 15:29:43 +02:00
|
|
|
else
|
2022-10-21 13:35:02 +02:00
|
|
|
ITEMS_TEXT="$(echo "$ITEM_ORDER" | sed "s|@10|$itemcmd10|; s|@11|$itemcmd11|; s|@1|$itemcmd1|; s|@2|$itemcmd2|; s|@3|$itemcmd3|; s|@4|$itemcmd4|; s|@5|$itemcmd5|; s|@6|$itemcmd6|; s|@7|$itemcmd7|; s|@8|$itemcmd8|; s|@9|$itemcmd9|; s|%|%%|g")"
|
2022-10-20 15:29:43 +02:00
|
|
|
fi
|
2022-10-01 21:41:25 +02:00
|
|
|
|
2022-09-10 19:43:52 +02:00
|
|
|
# Auto-get character limit based on screen resolution
|
|
|
|
# This is pretty hacky, but it works as a default.
|
|
|
|
# Setting this to "false" is recommended if you've got a big monitor
|
|
|
|
# I think the first three numbers of your screen resolution times 1.5 is a good max.
|
|
|
|
# I've got a 1366x768 12 inch ThinkPad so I decided to implement this.
|
|
|
|
# If anyone has a better method, please PR.
|
2022-08-31 15:28:33 +02:00
|
|
|
if [ "$CHARLIMIT" = "auto" ]; then
|
2022-09-10 19:43:52 +02:00
|
|
|
command -v xdpyinfo > /dev/null && \
|
2022-09-25 15:45:58 +02:00
|
|
|
RES="$(xdpyinfo | awk '/dimensions/ {print $2}' | sed 's/.x....*//g; s/[^0-9]*//g')"
|
2022-10-19 10:36:53 +02:00
|
|
|
CHARS="$(expr "$RES" "*" "1")"
|
2022-09-10 19:43:52 +02:00
|
|
|
|
2022-08-31 15:28:33 +02:00
|
|
|
if [ "$CHARS" = "" ]; then
|
|
|
|
CHARS=false
|
|
|
|
fi
|
|
|
|
elif [ "$CHARLIMIT" != "false" ]; then
|
|
|
|
CHARS=$CHARLIMIT
|
|
|
|
else
|
|
|
|
CHARS=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CHARS" != "false" ]; then
|
|
|
|
# Truncate item 11
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd11=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 10
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd10=""
|
2022-08-31 15:28:33 +02:00
|
|
|
|
2022-10-01 20:29:41 +02:00
|
|
|
# Truncate item 9
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd9=""
|
2022-08-31 15:28:33 +02:00
|
|
|
|
2022-10-01 20:29:41 +02:00
|
|
|
# Truncate item 8
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd8=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 7
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd7=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 6
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd6=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 5
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd5=""
|
2022-08-31 15:28:33 +02:00
|
|
|
|
2022-10-01 20:29:41 +02:00
|
|
|
# Truncate item 4
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd4=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 3
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd3=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 2
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd2=""
|
2022-10-01 20:29:41 +02:00
|
|
|
|
|
|
|
# Truncate item 1
|
2022-10-21 13:35:02 +02:00
|
|
|
if [ "$(printf $itemcmd1$itemcmd2$itemcmd3$itemcmd4$itemcmd5$itemcmd6$itemcmd7$itemcmd8$itemcmd9$itemcmd10$itemcmd11 | wc -c)" -gt "$CHARS" ]; then
|
|
|
|
itemcmd1=""
|
2022-10-01 20:29:41 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2022-08-31 15:28:33 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-10-21 13:35:02 +02:00
|
|
|
print
|
2022-10-02 15:34:11 +02:00
|
|
|
pgrep -x speedwm > /dev/null || exit 1
|
2022-08-21 11:53:18 +02:00
|
|
|
}
|
|
|
|
|
2022-10-01 20:29:41 +02:00
|
|
|
# base
|
2022-10-21 13:35:02 +02:00
|
|
|
base() {
|
|
|
|
ptext
|
2022-10-01 20:29:41 +02:00
|
|
|
sleep $REFRESHDELAY
|
2022-10-21 13:35:02 +02:00
|
|
|
base
|
2022-08-21 11:53:18 +02:00
|
|
|
}
|
|
|
|
|
2022-10-20 15:29:43 +02:00
|
|
|
setloading
|
|
|
|
|
2022-10-21 13:35:02 +02:00
|
|
|
setcolors2d
|
|
|
|
ptext
|
|
|
|
base
|
2022-08-21 11:53:18 +02:00
|
|
|
|
2022-10-21 13:35:02 +02:00
|
|
|
printf "$0: Stopped printing."
|
2022-08-21 11:53:18 +02:00
|
|
|
exit 0
|