Revamp status bar. This may break existing status bar configurations

unfortunately, but it is worth it
This commit is contained in:
speediegq 2022-10-01 20:29:41 +02:00
parent 1acf68aa9b
commit 23c2e26fdd

601
status
View file

@ -17,15 +17,12 @@
# changed there. Otherwise, carefully edit the file and recompile speedwm!
# General settings
USEWAL=true # Use Pywal if possible (true/false)
RUNONCE=false # Only run status bar once (true/false)
REFRESHDELAY=1 # How long delay in seconds between each reload (int)
REFRESHDELAY=1 # How long delay in seconds between each reload (num)
DATEBINDIR="/bin/" # Directory where your 'date' binary is. Default should be fine for most people
SETMETHOD="xsetroot -name" # Method used to set the status bar
SEP="❰" # Separator to use. Alternative separators: "❰", "<", "|"
COLORFG=true # Color foreground (true/false)
COLORBG=false # Color background (true/false)
USEBUILTINCOL=true # Use built in speedwm colors (col_status<num>). This also supports Pywal. (true/false)
CHARLIMIT=auto # Limit characters to CHARLIMIT. Enter false to not have a limit. Enter auto to use xdpyinfo. (num/auto/false)
# Status bar modules
@ -58,21 +55,32 @@ ITEM11_ICON=" " # Icon for ITEM11
ITEM1_DISPLAY_USED="true" # Display used RAM or not (true/false)
ITEM1_DISPLAY_TOTAL="true" # Display total RAM or not (true/false)
ITEM1_DISPLAY_SEPARATOR="true" # Display separator between USED and TOTAL (true/false)
ITEM1_SEPARATOR="/" # Separator between USED and TOTAL (char)
ITEM1_SEPARATOR="/" # Separator between USED and TOTAL (text)
ITEM2_DISPLAY_FULL="false" # Display full time (Hour, Minute, Second) (true/false)
ITEM2_DISPLAY_HOURS="true" # Display hours (true/false)
ITEM2_DISPLAY_MINUTES="true" # Display minutes (true/false)
ITEM2_DISPLAY_SECONDS="false" # Display seconds (true/false)
ITEM2_DISPLAY_SEPARATOR_1="true" # Display separator between hour and minute (true/false)
ITEM2_DISPLAY_SEPARATOR_2="true" # Display separator between minute and second (true/false)
ITEM2_SEPARATOR1=":" # Separator between hour and minute (char)
ITEM2_SEPARATOR2=":" # Separator between minute and second (char)
# Format
# Format to display the time in
#
# @h - Hour
# @m - Minute
# @s - Second
#
# Example: @h:@m
ITEM2_FORMAT="@h:@m"
# Format
# Format to display the date in
#
# @d - Day
# @m - Month
# @y - Year
#
# Example: @d/@m/@y
ITEM3_FORMAT="@d/@m/@y"
ITEM4_SHOW_MUTE="true" # Show mute status (true/false)
ITEM4_MUTE_TEXT="(Muted)" # Text to display when muted (char)
ITEM4_MUTE_TEXT="(Muted)" # Text to display when muted (text)
ITEM8_FORMAT_C="true" # Format temperature in Celsius (true/false)
ITEM8_FORMAT_CELSIUS="true" # Format temperature in Celsius (true/false)
ITEM9_BACKEND="auto" # Backend for the music status (cmus/mocp/auto)
ITEM9_DISPLAY_ARTIST="true" # Display artist or not (true/false)
@ -82,40 +90,29 @@ 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)
ITEM9_HIDE_EMPTY_ARTIST="true" # Hide empty artist (true/false)
ITEM9_HIDE_EMPTY_TITLE="true" # Hide empty title (true/false)
ITEM9_HIDE_EMPTY_ALBUM="true" # Hide empty album (true/false)
ITEM9_HIDE_EMPTY_GENRE="true" # Hide empty genre (true/false)
ITEM9_HIDE_EMPTY_FILE="true" # Hide empty file (true/false)
ITEM9_HIDE_EMPTY_TT="true" # Hide empty total time (true/false)
ITEM9_HIDE_EMPTY_TE="true" # Hide empty time elapsed (true/false)
ITEM9_PRE_FILE="" # Text to display before the filename
ITEM9_POST_FILE="" # Text to display after the filename
ITEM9_PRE_ARTIST="" # Text to display before the artist
ITEM9_POST_ARTIST="" # Text to display after the artist
ITEM9_PRE_TITLE="" # Text to display before the title
ITEM9_POST_TITLE="" # Text to display after the title
ITEM9_PRE_ALBUM="from " # Text to display before the album
ITEM9_POST_ALBUM="" # Text to display after the album
ITEM9_PRE_GENRE="(" # Text to display before the genre
ITEM9_POST_GENRE=")" # Text to display after the genre
ITEM9_PRE_TE="[" # Text to display before the time elapsed.
ITEM9_POST_TE=" /" # Text to display after the time elapsed.
ITEM9_PRE_TT=" " # Text to display before the total time.
ITEM9_POST_TT="]" # Text to display before the total time.
ITEM9_TT_TE_NO_SPACING="true" # No spacing between time elapsed and total time (true/false)
ITEM9_TE_REVERSE="true" # Reverse time elapsed (replace with time left) (true/false)
ITEM9_SEPARATOR="-" # Separator between ARTIST, TITLE and ALBUM
# Format
# 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]"
ITEM11_SHOW_CHARGING_STATUS=true # Show 'Charging', 'Not charging' or 'Fully charged' status after the percentage. (true/false)
ITEM11_DISCHARGING_TEXT="Not charging" # Text when not charging (char)
ITEM11_CHARGING_TEXT="Charging" # Text when charging (char)
ITEM11_FULL_TEXT="Fully charged" # Text when fully charged (char)
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)
# Systray options
HIDE_STATUS_SYSTRAY=true # Hide the status when a systray is running (true/false)
SYSTRAY="trayer" # Systray to use (<systray executable>).
STATUS_WHEN_HIDDEN="" # Status to print when status is hidden (char)
STATUS_WHEN_HIDDEN="" # Status to print when status is hidden (text)
# Order of colors and items in the status bar
PRINT() {
@ -164,98 +161,9 @@ $BSETCOLORCMD14\
# Default colorscheme, for when pywal is not enabled or available.
# I recommend using Vim, vim-plugin and colorizer so that you can actually see the colors.
SETCOLORS() {
# Foreground/Text colors
FCOLOR1=#131210
FCOLOR2=#bf616a
FCOLOR3=#A16F9D
FCOLOR4=#68ABAA
FCOLOR5=#A89F93
FCOLOR6=#D3A99B
FCOLOR7=#AFC9AC
FCOLOR8=#eae1cb
FCOLOR9=#a39d8e
FCOLOR10=#6D5E8E
FCOLOR11=#A16F9D
FCOLOR12=#D3A99B
FCOLOR13=#AFC9AC
FCOLOR14=#eae1cb
FCOLOR15=#6D5E8E
# Background colors
BCOLOR1=#222222
BCOLOR2=#222222
BCOLOR3=#222222
BCOLOR4=#222222
BCOLOR5=#222222
BCOLOR6=#222222
BCOLOR7=#222222
BCOLOR8=#222222
BCOLOR9=#222222
BCOLOR10=#222222
BCOLOR11=#222222
BCOLOR12=#222222
BCOLOR13=#222222
BCOLOR14=#222222
BCOLOR15=#222222
# Compatibility with old status configurations.
COLOR1=$FCOLOR1
COLOR2=$FCOLOR2
COLOR3=$FCOLOR3
COLOR4=$FCOLOR4
COLOR5=$FCOLOR5
COLOR6=$FCOLOR6
COLOR7=$FCOLOR7
COLOR8=$FCOLOR8
COLOR9=$FCOLOR9
COLOR10=$FCOLOR10
COLOR11=$FCOLOR11
COLOR12=$FCOLOR12
COLOR13=$FCOLOR13
COLOR14=$FCOLOR14
COLOR15=$FCOLOR15
}
# Add colors to status2d compatible variable to use with xsetroot later.
SETCOLORS_CMD() {
if [ "$COLORFG" = "true" ]; then
FSETCOLORCMD1="^c${FCOLOR1}^"
FSETCOLORCMD2="^c${FCOLOR2}^"
FSETCOLORCMD3="^c${FCOLOR3}^"
FSETCOLORCMD4="^c${FCOLOR4}^"
FSETCOLORCMD5="^c${FCOLOR5}^"
FSETCOLORCMD6="^c${FCOLOR6}^"
FSETCOLORCMD7="^c${FCOLOR7}^"
FSETCOLORCMD8="^c${FCOLOR8}^"
FSETCOLORCMD9="^c${FCOLOR9}^"
FSETCOLORCMD10="^c${FCOLOR10}^"
FSETCOLORCMD11="^c${FCOLOR11}^"
FSETCOLORCMD12="^c${FCOLOR12}^"
FSETCOLORCMD13="^c${FCOLOR13}^"
FSETCOLORCMD14="^c${FCOLOR14}^"
FSETCOLORCMD15="^c${FCOLOR15}^"
fi
if [ "$COLORBG" = "true" ]; then
BSETCOLORCMD1="^b${BCOLOR1}^"
BSETCOLORCMD2="^b${BCOLOR2}^"
BSETCOLORCMD3="^b${BCOLOR3}^"
BSETCOLORCMD4="^b${BCOLOR4}^"
BSETCOLORCMD5="^b${BCOLOR5}^"
BSETCOLORCMD6="^b${BCOLOR6}^"
BSETCOLORCMD7="^b${BCOLOR7}^"
BSETCOLORCMD8="^b${BCOLOR8}^"
BSETCOLORCMD9="^b${BCOLOR9}^"
BSETCOLORCMD10="^b${BCOLOR10}^"
BSETCOLORCMD11="^b${BCOLOR11}^"
BSETCOLORCMD12="^b${BCOLOR12}^"
BSETCOLORCMD13="^b${BCOLOR13}^"
BSETCOLORCMD14="^b${BCOLOR14}^"
BSETCOLORCMD15="^b${BCOLOR15}^"
fi
if [ "$USEBUILTINCOL" = "true" ]; then
if [ "$COLORFG" = "true" ]; then
FSETCOLORCMD1="^C1^"
FSETCOLORCMD2="^C2^"
@ -291,53 +199,8 @@ SETCOLORS_CMD() {
BSETCOLORCMD14="^B14^"
BSETCOLORCMD15="^B15^"
fi
fi
}
# Grab colors from pywal if possible
# For example, 1,1p means the first line
SETCOLORS_WAL() {
if [ "$USEWAL" = "true" ]; then
if [ -e "$HOME/.cache/wal/colors" ]; then
# Foreground colors
FCOLOR1=$(sed -n 1,1p $HOME/.cache/wal/colors)
FCOLOR2=$(sed -n 2,2p $HOME/.cache/wal/colors)
FCOLOR3=$(sed -n 3,3p $HOME/.cache/wal/colors)
FCOLOR4=$(sed -n 4,4p $HOME/.cache/wal/colors)
FCOLOR5=$(sed -n 5,5p $HOME/.cache/wal/colors)
FCOLOR6=$(sed -n 6,6p $HOME/.cache/wal/colors)
FCOLOR7=$(sed -n 7,7p $HOME/.cache/wal/colors)
FCOLOR8=$(sed -n 8,8p $HOME/.cache/wal/colors)
FCOLOR9=$(sed -n 9,9p $HOME/.cache/wal/colors)
FCOLOR10=$(sed -n 10,10p $HOME/.cache/wal/colors)
FCOLOR11=$(sed -n 11,11p $HOME/.cache/wal/colors)
FCOLOR12=$(sed -n 12,12p $HOME/.cache/wal/colors)
FCOLOR13=$(sed -n 13,13p $HOME/.cache/wal/colors)
FCOLOR14=$(sed -n 14,14p $HOME/.cache/wal/colors)
FCOLOR15=$(sed -n 15,15p $HOME/.cache/wal/colors)
# Background colors
BCOLOR1=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR2=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR3=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR4=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR5=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR6=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR7=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR8=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR9=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR10=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR11=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR12=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR13=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR14=$(sed -n 1,1p $HOME/.cache/wal/colors)
BCOLOR15=$(sed -n 1,1p $HOME/.cache/wal/colors)
USINGWAL=true
fi
fi
}
# End of configuration
#########################################################################
# Set bindir
@ -358,9 +221,7 @@ if [ -e "$HOME/.config/speedwm-de/status/config" ]; then
. $HOME/.config/speedwm-de/status/config && echo "Loaded configuration file"
else
touch $HOME/.config/speedwm-de/status/config && echo "Created configuration file"
printf "USEWAL=$USEWAL # Use Pywal if possible (true/false)" > $HOME/.config/speedwm-de/status/config
printf "\nRUNONCE=$RUNONCE # Only run status bar once (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nREFRESHDELAY=$REFRESHDELAY # How long delay in seconds between each reload (int)" >> $HOME/.config/speedwm-de/status/config
printf "\nREFRESHDELAY=$REFRESHDELAY # How long delay in seconds between each reload (num)" >> $HOME/.config/speedwm-de/status/config
printf "\nSEP='$SEP' # Separator to use. Alternative separators: '❰', '<', '|'" >> $HOME/.config/speedwm-de/status/config
printf "\nCHARLIMIT=$CHARLIMIT # Limit characters to CHARLIMIT. Enter false to not have a limit. Enter auto to use xdpyinfo. (num/auto/false)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nENABLE_ITEM1=$ENABLE_ITEM1 # Enable RAM usage (true/false)" >> $HOME/.config/speedwm-de/status/config
@ -388,18 +249,12 @@ else
printf "\n\nITEM1_DISPLAY_USED="true" # Display used RAM or not (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM1_DISPLAY_TOTAL="true" # Display total RAM or not (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM1_DISPLAY_SEPARATOR="true" # Display separator between USED and TOTAL (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM1_SEPARATOR='$ITEM1_SEPARATOR' # Separator between USED and TOTAL (char)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM2_DISPLAY_FULL=$ITEM2_DISPLAY_FULL # Display full time (Hour, Minute, Second) (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_DISPLAY_HOURS=$ITEM2_DISPLAY_HOURS # Display hours (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_DISPLAY_MINUTES=$ITEM2_DISPLAY_MINUTES # Display minutes (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_DISPLAY_SECONDS=$ITEM2_DISPLAY_SECONDS # Display seconds (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_DISPLAY_SEPARATOR_1=$ITEM2_DISPLAY_SEPARATOR_1 # Display separator between hour and minute (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_DISPLAY_SEPARATOR_2=$ITEM2_DISPLAY_SEPARATOR_2 # Display separator between minute and second (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_SEPARATOR1='$ITEM2_SEPARATOR1' # Separator between hour and minute (char)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM2_SEPARATOR2='$ITEM2_SEPARATOR2' # Separator between minute and second (char)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM1_SEPARATOR='$ITEM1_SEPARATOR' # Separator between USED and TOTAL (text)" >> $HOME/.config/speedwm-de/status/config
printf "\n# Format\n# Format to display the time in\n#\n# @h - Hour\n# @m - Minute\n# @s - Second\n#\n# Example: @h:@m:@s\nITEM2_FORMAT='$ITEM2_FORMAT'" >> $HOME/.config/speedwm-de/status/config
printf "\n# Format\n# Format to display the date in\n#\n# @d - Day\n# @m - Month\n# @y - Year\n#\n# Example: @d/@m/@y\nITEM3_FORMAT='$ITEM3_FORMAT'" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM4_SHOW_MUTE=$ITEM4_SHOW_MUTE # Show mute status (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM4_MUTE_TEXT='$ITEM4_MUTE_TEXT' # Text to display when muted (char)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM8_FORMAT_C=$ITEM8_FORMAT_C # Format temperature in Celsius (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM4_MUTE_TEXT='$ITEM4_MUTE_TEXT' # Text to display when muted (text)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM8_FORMAT_CELSIUS=$ITEM8_FORMAT_CELSIUS # Format temperature in Celsius (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM9_BACKEND=$ITEM9_BACKEND # Backend for the music status (cmus/mocp/auto)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_DISPLAY_ARTIST=$ITEM9_DISPLAY_ARTIST # Display artist or not (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_DISPLAY_TITLE=$ITEM9_DISPLAY_TITLE # Display title or not (true/false)" >> $HOME/.config/speedwm-de/status/config
@ -408,80 +263,23 @@ else
printf "\nITEM9_DISPLAY_FILE=$ITEM9_DISPLAY_FILE # Display filename or not. This option will disable everything else. Path and file extension will be cut. (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_DISPLAY_TIMEELAPSED=$ITEM9_DISPLAY_TIMEELAPSED # Display time elapsed or not (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_DISPLAY_TIMETOTAL=$ITEM9_DISPLAY_TIMETOTAL # Display total time or not (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_FILE='$ITEM9_PRE_FILE' # Text to display before the filename" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_FILE='$ITEM9_POST_FILE' # Text to display after the filename" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_ARTIST='$ITEM9_PRE_ARTIST' # Text to display before the artist" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_ARTIST='$ITEM9_POST_ARTIST' # Text to display after the artist" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_TITLE='$ITEM9_PRE_TITLE' # Text to display before the title" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_TITLE='$ITEM9_POST_TITLE' # Text to display after the title" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_ALBUM='$ITEM9_PRE_ALBUM' # Text to display before the album" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_ALBUM='$ITEM9_POST_ALBUM' # Text to display after the album" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_GENRE='$ITEM9_PRE_GENRE' # Text to display before the genre" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_GENRE='$ITEM9_POST_GENRE' # Text to display after the genre" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_TE='$ITEM9_PRE_TE' # Text to display before the time elapsed." >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_TE='$ITEM9_POST_TE' # Text to display after the time elapsed." >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_PRE_TT='$ITEM9_PRE_TT' # Text to display before the total time." >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_POST_TT='$ITEM9_POST_TT' # Text to display before the total time." >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_TT_TE_NO_SPACING=$ITEM9_TT_TE_NO_SPACING # No spacing between time elapsed and total time (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_TE_REVERSE=$ITEM9_TE_REVERSE # Reverse time elapsed (replace with current time) (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_ARTIST=$ITEM9_HIDE_EMPTY_ARTIST # Hide empty artist (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_TITLE=$ITEM9_HIDE_EMPTY_ARTIST # Hide empty title (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_ALBUM=$ITEM9_HIDE_EMPTY_ALBUM # Hide empty album (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_GENRE=$ITEM9_HIDE_EMPTY_GENRE # Hide empty genre (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_TT=$ITEM9_HIDE_EMPTY_TT # Hide empty total time (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_HIDE_EMPTY_TE=$ITEM9_HIDE_EMPTY_TE # Hide empty time elapsed (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM9_SEPARATOR='$ITEM9_SEPARATOR' # Separator between ARTIST, TITLE and ALBUM" >> $HOME/.config/speedwm-de/status/config
printf "\n# Format\n# Format to display the music status in\n#\n# @a - Artist\n# @t - Title\n# @g - Genre\n# @ab - Album\n# @tt - Total time\n# @te - Time elapsed\n#\n# Example: @a - @t from @ab (@g) [@te/@tt]\nITEM9_FORMAT='$ITEM9_FORMAT'" >> $HOME/.config/speedwm-de/status/config
printf "\n\nITEM11_SHOW_CHARGING_STATUS=$ITEM11_SHOW_CHARGING_STATUS # Show 'Charging', 'Not charging' or 'Fully charged' status after the percentage. (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM11_CHARGING_TEXT='$ITEM11_CHARGING_TEXT' # Text when charging (char)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM11_FULL_TEXT='$ITEM11_FULL_TEXT' # Text when fully charged (char)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM11_CHARGING_TEXT='$ITEM11_CHARGING_TEXT' # Text when charging (text)" >> $HOME/.config/speedwm-de/status/config
printf "\nITEM11_FULL_TEXT='$ITEM11_FULL_TEXT' # Text when fully charged (text)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nHIDE_STATUS_SYSTRAY=$HIDE_STATUS_SYSTRAY # Hide the status when a systray is running (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nSYSTRAY=$SYSTRAY # Systray to use (<systray executable>)" >> $HOME/.config/speedwm-de/status/config
printf "\nSTATUS_WHEN_HIDDEN=$STATUS_WHEN_HIDDEN # Status to print when status is hidden (char)" >> $HOME/.config/speedwm-de/status/config
printf "\nSTATUS_WHEN_HIDDEN=$STATUS_WHEN_HIDDEN # Status to print when status is hidden (text)" >> $HOME/.config/speedwm-de/status/config
printf "\nCOLORFG=$COLORFG # Color foreground (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nCOLORBG=$COLORBG # Color background (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\nUSEBUILTINCOL=$USEBUILTINCOL # Use built in speedwm colors (col_status<num>). This also supports Pywal. (true/false)" >> $HOME/.config/speedwm-de/status/config
printf "\n\nFCOLOR1=$FCOLOR1 # Color for ITEM1 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR2=$FCOLOR2 # Color for ITEM2 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR3=$FCOLOR3 # Color for ITEM3 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR6=$FCOLOR6 # Color for ITEM6 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR7=$FCOLOR7 # Color for ITEM7 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR8=$FCOLOR8 # Color for ITEM8 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR9=$FCOLOR9 # Color for ITEM9 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR10=$FCOLOR10 # Color for ITEM10 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR11=$FCOLOR11 # Color for ITEM11 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR12=$FCOLOR12 # Color for ITEM12 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR13=$FCOLOR13 # Color for ITEM13 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR14=$FCOLOR14 # Color for ITEM14 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nFCOLOR15=$FCOLOR15 # Color for ITEM15 text (hex color)\n" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR1=$BCOLOR1 # Color for ITEM1 text (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR2=$BCOLOR2 # Color for ITEM2 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR3=$BCOLOR3 # Color for ITEM3 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR6=$BCOLOR6 # Color for ITEM6 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR7=$BCOLOR7 # Color for ITEM7 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR8=$BCOLOR8 # Color for ITEM8 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR9=$BCOLOR9 # Color for ITEM9 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR10=$BCOLOR10 # Color for ITEM10 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR11=$BCOLOR11 # Color for ITEM11 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR12=$BCOLOR12 # Color for ITEM12 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR13=$BCOLOR13 # Color for ITEM13 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR14=$BCOLOR14 # Color for ITEM14 background (hex color)" >> $HOME/.config/speedwm-de/status/config
printf "\nBCOLOR15=$BCOLOR15 # Color for ITEM15 background (hex color)\n" >> $HOME/.config/speedwm-de/status/config
fi
}
SLEEPTIME=$REFRESHDELAY # Compatibility with old configurations
# Set it to /usr/bin if it was not possible to get it through /usr/share/speedwm-bindir
case "$BINDIR" in
"") BINDIR="/usr/bin" ;;
esac
# Check if muted, for use with volume status bar. Unmute if muted.
case "$MUTED" in
"") MUTED=false ;;
"true") MUTED=false ;;
esac
# Systray stuff
PRINT_SYSTRAY() {
if [ "$SYSTRAY" = "trayer" ]; then
@ -533,56 +331,56 @@ PRINT_SYSTRAY() {
# Truncate item 11
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD11=""
fi
# Truncate item 10
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD10=""
# Truncate item 10
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD10=""
fi
# Truncate item 9
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD9=""
# Truncate item 9
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD9=""
fi
# Truncate item 8
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD8=""
# Truncate item 7
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD7=""
# Truncate item 6
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD6=""
# Truncate item 5
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD5=""
# Truncate item 8
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD8=""
fi
# Truncate item 7
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD7=""
fi
# Truncate item 6
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD6=""
fi
# Truncate item 5
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD5=""
fi
# Truncate item 4
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD4=""
fi
# Truncate item 3
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD3=""
fi
# Truncate item 2
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD2=""
fi
# Truncate item 1
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD1=""
# Truncate item 4
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD4=""
# Truncate item 3
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD3=""
# Truncate item 2
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD2=""
# Truncate item 1
if [ "$(printf $ITEMCMD1$ITEMCMD2$ITEMCMD3$ITEMCMD4$ITEMCMD5$ITEMCMD6$ITEMCMD7$ITEMCMD8$ITEMCMD9$ITEMCMD10$ITEMCMD11 | wc -c)" -gt "$CHARS" ]; then
ITEMCMD1=""
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
@ -643,40 +441,10 @@ ITEM1() {
ITEM2() {
if [ "$ENABLE_ITEM2" = "true" ]; then
if [ -e "${DATEBINDIR}date" ]; then
if [ "$ITEM2_DISPLAY_FULL" != "true" ]; then
# Hour
if [ "$ITEM2_DISPLAY_HOURS" = "true" ]; then
HOURS="$(date +%H)"
fi
# Minute
if [ "$ITEM2_DISPLAY_MINUTES" = "true" ]; then
MINUTES="$(date +%M)"
fi
# Seconds
if [ "$ITEM2_DISPLAY_SECONDS" = "true" ]; then
SECONDS="$(date +%S)"
fi
# Separator between hour and minute
if [ "$ITEM2_DISPLAY_SEPARATOR_1" = "true" ]; then
if [ "$ITEM2_DISPLAY_MINUTES" = "true" ]; then
SEPARATOR1=$ITEM2_SEPARATOR1
fi
fi
# Separator between minute and second
if [ "$ITEM2_DISPLAY_SEPARATOR_2" = "true" ]; then
if [ "$ITEM2_DISPLAY_SECONDS" = "true" ]; then
SEPARATOR2=$ITEM2_SEPARATOR2
fi
fi
echo "$SEP $ITEM2_ICON $HOURS$SEPARATOR1$MINUTES$SEPARATOR2$SECONDS"
else
echo "$SEP $ITEM2_ICON $(date +%T)"
fi
HOURS="$(date +%H)"
MINUTES="$(date +%M)"
SECONDS="$(date +%S)"
echo "$SEP $ITEM2_ICON $ITEM2_FORMAT" | sed "s|@h|$HOURS|; s|@m|$MINUTES|; s|@s|$SECONDS|"
fi
fi
}
@ -685,7 +453,11 @@ ITEM2() {
ITEM3() {
if [ "$ENABLE_ITEM3" = "true" ]; then
if [ -e "${DATEBINDIR}date" ]; then
echo "$SEP $ITEM3_ICON $(date +%d/%m/%Y)"
DAY="$(date +%d)"
MONTH="$(date +%m)"
YEAR="$(date +%Y)"
echo "$SEP $ITEM3_ICON $ITEM3_FORMAT" | sed "s|@d|$DAY|; s|@m|$MONTH|; s|@y|$YEAR|"
fi
fi
}
@ -753,7 +525,7 @@ ITEM7() {
ITEM8() {
if [ "$ENABLE_ITEM8" = "true" ]; then
if [ -e "${BINDIR}sensors" ]; then
if [ "$ITEM8_FORMAT_C" = "true" ]; then
if [ "$ITEM8_FORMAT_CELSIUS" = "true" ]; then
echo "$SEP $ITEM8_ICON $(sensors | grep temp1 | awk '{ print $2 }')"
else
echo "$SEP $ITEM8_ICON $(sensors -f | grep temp1 | awk '{ print $2 }')"
@ -778,95 +550,50 @@ ITEM9() {
if [ -e "${BINDIR}mocp" ]; then
if [ "$(echo $(mocp -Q %file))" != "" ]; then
# reverse time elapsed (?)
if [ "$ITEM9_TE_REVERSE" = "true" ]; then
TECMD="tl"
else
TECMD="ct"
fi
# filename
if [ "$ITEM9_DISPLAY_FILE" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_FILE" = "true" ]; then
if [ "$(mocp -Q %file | head -n 1)" != "" ]; then
echo "$SEP $ITEM9_ICON $ITEM9_PRE_FILE$(basename "$(mocp -Q %file)" | sed 's|\(.*\)[.].*|\1|')$ITEM9_POST_FILE"
fi
fi
else
# artist
if [ "$ITEM9_DISPLAY_ARTIST" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_ARTIST" = "true" ]; then
if [ "$(mocp -Q %artist | head -n 1)" != "" ]; then
data="$ITEM9_PRE_ARTIST$(printf "$data $(mocp -Q %artist) $ITEM9_SEPARATOR")$ITEM9_POST_ARTIST"
MUSIC_ARTIST="$(mocp -Q %artist)"
fi
else
data="$ITEM9_PRE_ARTIST$(printf "$data $(mocp -Q %artist) $ITEM9_SEPARATOR")$ITEM9_POST_ARTIST"
fi
fi
# title
if [ "$ITEM9_DISPLAY_TITLE" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TITLE" = "true" ]; then
if [ "$(mocp -Q %song | head -n 1)" != "" ]; then
data="$ITEM9_PRE_TITLE$(printf "$data $(mocp -Q %song)")$ITEM9_POST_TITLE"
MUSIC_SONG="$(mocp -Q %song)"
fi
else
data="$ITEM9_PRE_TITLE$(printf "$data $(mocp -Q %song)")$ITEM9_POST_TITLE"
fi
fi
# album
if [ "$ITEM9_DISPLAY_ALBUM" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_ALBUM" = "true" ]; then
if [ "$(mocp -Q %album | head -n 1)" != "" ]; then
data="$(printf "$data $ITEM9_PRE_ALBUM$(mocp -Q %album)$ITEM9_POST_ALBUM")"
MUSIC_ALBUM="$(mocp -Q %album)"
fi
else
data="$(printf "$data $ITEM9_PRE_ALBUM$(mocp -Q %album)$ITEM9_POST_ALBUM")"
fi
fi
# time elapsed
if [ "$ITEM9_DISPLAY_TIMEELAPSED" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TE" = "true" ]; then
if [ "$(mocp -Q %tl | head -n 1)" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TE$(mocp -Q %$TECMD)$ITEM9_POST_TE")"
MUSIC_TIMEELAPSED="$(mocp -Q %ct)"
fi
else
data="$(printf "$data $ITEM9_PRE_TE$(mocp -Q %$TECMD)$ITEM9_POST_TE")"
fi
fi
# total time
if [ "$ITEM9_TT_TE_NO_SPACING" = "false" ]; then
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TT" = "true" ]; then
if [ "$(mocp -Q %tt | head -n 1)" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TT$(mocp -Q %tt)$ITEM9_POST_TT")"
fi
else
data="$(printf "$data $ITEM9_PRE_TT$(mocp -Q %tt)$ITEM9_POST_TT")"
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$(mocp -Q %tt | head -n 1)" != "" ]; then
MUSIC_TIMETOTAL="$(mocp -Q %tt)"
fi
fi
else
# total time without spacing
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TT" = "true" ]; then
if [ "$(mocp -Q %tt | head -n 1)" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TT$(mocp -Q %tt)$ITEM9_POST_TT")"
fi
else
data="$(printf "$data$ITEM9_PRE_TT$(mocp -Q %tt)$ITEM9_POST_TT")"
fi
fi
fi
data="$(printf "$ITEM9_FORMAT" | sed "s|@ab|$MUSIC_ALBUM|; s|@t|$MUSIC_SONG|; s|@g||; s|@a|$MUSIC_ARTIST|; s|@tt|$MUSIC_TIMETOTAL|; s|@te|$MUSIC_TIMEELAPSED|; s| ||g")"
# actually print it
echo "$SEP $ITEM9_ICON $data"
fi
@ -884,89 +611,47 @@ ITEM9() {
# artist
if [ "$ITEM9_DISPLAY_ARTIST" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_ARTIST" = "true" ]; then
if [ "$(cmus-remote -C status | grep "tag artist")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_ARTIST$(cmus-remote -C status | grep "tag artist" | sed "s/tag artist //g")$ITEM9_POST_ARTIST $ITEM9_SEPARATOR")"
MUSIC_ARTIST="$(cmus-remote -C status | grep "tag artist" | sed "s/tag artist //g")"
fi
else
data="$(printf "$data $ITEM9_PRE_ARTIST$(cmus-remote -C status | grep "tag artist" | sed "s/tag artist //g")$ITEM9_POST_ARTIST $ITEM9_SEPARATOR")"
fi
fi
# title
if [ "$ITEM9_DISPLAY_TITLE" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TITLE" = "true" ]; then
if [ "$(cmus-remote -C status | grep "tag title")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TITLE$(cmus-remote -C status | grep "tag title" | sed "s/tag title //g")$ITEM9_POST_TITLE")"
MUSIC_SONG="$(cmus-remote -C status | grep "tag title" | sed "s/tag title //g")"
fi
else
data="$(printf "$data $ITEM9_PRE_TITLE$(cmus-remote -C status | grep "tag title" | sed "s/tag title //g")$ITEM9_POST_TITLE")"
fi
fi
# album
if [ "$ITEM9_DISPLAY_ALBUM" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_ALBUM" = "true" ]; then
if [ "$(cmus-remote -C status | grep "tag album")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_ALBUM$(cmus-remote -C status | grep "tag album" | head -n 1 | sed "s/tag album //g")$ITEM9_POST_ALBUM")"
MUSIC_ALBUM="$(cmus-remote -C status | grep "tag album" | head -n 1 | sed "s/tag album //g")"
fi
else
data="$(printf "$data $ITEM9_PRE_ALBUM$(cmus-remote -C status | grep "tag album" | head -n 1 | sed "s/tag album //g")$ITEM9_POST_ALBUM")"
fi
fi
# genre
if [ "$ITEM9_DISPLAY_GENRE" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_GENRE" = "true" ]; then
if [ "$(cmus-remote -C status | grep "tag genre")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_GENRE$(cmus-remote -C status | grep "tag genre" | sed "s/tag genre //g")$ITEM9_POST_GENRE")"
MUSIC_GENRE="$(cmus-remote -C status | grep "tag genre" | sed "s/tag genre //g")"
fi
else
data="$(printf "$data $ITEM9_PRE_GENRE$(cmus-remote -C status | grep "tag genre" | sed "s/tag genre //g")$ITEM9_POST_GENRE")"
fi
fi
# time elapsed
if [ "$ITEM9_DISPLAY_TIMEELAPSED" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TE" = "true" ]; then
if [ "$(cmus-remote -Q | grep position | sed "s/position //g")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TE$(cmus-remote -Q | grep position | sed "s/position //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TE")"
MUSIC_TIMEELAPSED="$(cmus-remote -Q | grep position | sed "s/position //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")"
fi
else
data="$(printf "$data $ITEM9_PRE_TE$(cmus-remote -Q | grep position | sed "s/position //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TE")"
fi
fi
# total time
if [ "$ITEM9_TT_TE_NO_SPACING" = "false" ]; then
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TT" = "true" ]; then
if [ "$(cmus-remote -Q | grep duration | sed "s/duration //g")" != "" ]; then
data="$(printf "$data $ITEM9_PRE_TT$(cmus-remote -Q | grep duration | sed "s/duration //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TT")"
fi
else
data="$(printf "$data $ITEM9_PRE_TT$(cmus-remote -Q | grep duration | sed "s/duration //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TT")"
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$(cmus-remote -Q | grep duration | sed "s/duration //g")" != "" ]; then
MUSIC_TIMETOTAL="$(cmus-remote -Q | grep duration | sed "s/duration //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")"
fi
fi
else
# total time without spacing
if [ "$ITEM9_DISPLAY_TIMETOTAL" = "true" ]; then
if [ "$ITEM9_HIDE_EMPTY_TT" = "true" ]; then
if [ "$(cmus-remote -Q | grep duration | sed "s/duration //g")" != "" ]; then
data="$(printf "$data$ITEM9_PRE_TT$(cmus-remote -Q | grep duration | sed "s/duration //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TT")"
fi
else
data="$(printf "$data$ITEM9_PRE_TT$(cmus-remote -Q | grep duration | sed "s/duration //g" | awk '{printf "%02d:%02d:%02d",$0/3600,$0%3600/60,$0%60}' | sed "s/00://")$ITEM9_POST_TT")"
fi
fi
fi
data="$(printf "$ITEM9_FORMAT" | sed "s|@ab|$MUSIC_ALBUM|; s|@t|$MUSIC_SONG|; s|@g|$MUSIC_GENRE|; s|@a|$MUSIC_ARTIST|; s|@tt|$MUSIC_TIMETOTAL|; s|@te|$MUSIC_TIMEELAPSED|; s| ||g")"
# actually print it
if [ "$data" != "" ]; then
@ -1009,43 +694,17 @@ ITEM11() {
fi
}
# base
BASE() {
# Determine whether or not
if [ "$USEWAL" = "true" ]; then
if [ "$USINGWAL" = "true" ]; then
if [ "$COLOR1" != "$(sed 1,1p $HOME/.cache/wal/colors)" ]; then
SETCOLORS_WAL && SETCOLORS_CMD
fi
fi
fi
# Run once if set to false (useful for maybe a shell)
case "$RUNONCE" in
"false") PRINT_SYSTRAY && sleep $REFRESHDELAY ;;
"true") exit 0 ;;
esac
PRINT_SYSTRAY
sleep $REFRESHDELAY
BASE
}
# Set base colors
SETCOLORS
# Use pywal once if possible
USE_PYWAL_COLORS() {
if [ -e "${BINDIR}xsetroot" ]; then
if [ -e "${BINDIR}xrdb" ]; then
if [ "$USEWAL" = "true" ]; then
command -v wal > /dev/null && SETCOLORS_WAL
fi
fi
fi
}
LOADCONFIG
USE_PYWAL_COLORS
SETCOLORS_CMD
PRINT_SYSTRAY
BASE
echo "status: Stopped printing."
exit 0