2022-07-06 08:41:00 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-08-15 01:42:52 +02:00
|
|
|
# TODO Start Pyradio if not started
|
|
|
|
# TODO check if theme is writeable (users themes)
|
|
|
|
# TODO Save as new theme
|
|
|
|
|
2022-07-06 08:41:00 +02:00
|
|
|
me="colorizer-pyradio -s"
|
|
|
|
|
2022-08-15 01:42:52 +02:00
|
|
|
THEMERC=~/.config/pyradio/themes/mbcolors.pyradio-theme
|
|
|
|
|
2022-07-06 08:41:00 +02:00
|
|
|
case "$LANG" in
|
|
|
|
pl*)
|
|
|
|
GENERATEFROMWP="Generuj z kolorów tapety..."
|
|
|
|
LIGHTBG="Jasne tło"
|
|
|
|
DARKBG="Ciemne tło"
|
2022-08-15 01:42:52 +02:00
|
|
|
SETCOLORS="Ustaw kolory..."
|
2022-07-06 08:41:00 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
GENERATEFROMWP="Generate from wallpaper colors..."
|
|
|
|
LIGHTBG="Light Background"
|
|
|
|
DARKBG="Dark Background"
|
2022-08-15 01:42:52 +02:00
|
|
|
SETCOLORS="Set colors individually..."
|
2022-07-06 08:41:00 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2022-08-15 01:42:52 +02:00
|
|
|
getvalues () {
|
|
|
|
read S SFG SBG<<< "$(grep '^Stations ' ${THEMERC})"
|
|
|
|
read AS1 AS2 ASFG<<< "$(grep '^Active Station ' ${THEMERC})"
|
|
|
|
read SB1 SB2 SBFG SBBG<<< "$(grep '^Status Bar ' ${THEMERC})"
|
|
|
|
read NC1 NC2 NCFG NCBG<<< "$(grep '^Normal Cursor ' ${THEMERC})"
|
|
|
|
read AC1 AC2 ACFG ACBG<<< "$(grep '^Active Cursor ' ${THEMERC})"
|
|
|
|
read EC1 EC2 ECFG ECBG<<< "$(grep '^Edit Cursor ' ${THEMERC})"
|
|
|
|
read EF1 EF2 EFFG<<< "$(grep '^Extra Func ' ${THEMERC})"
|
|
|
|
read PURL1 PURL2 PURLFG<<< "$(grep '^PyRadio URL ' ${THEMERC})"
|
|
|
|
read MB1 MB2 MBFG<<< "$(grep '^Messages Border ' ${THEMERC})"
|
2022-07-06 08:41:00 +02:00
|
|
|
|
2022-08-15 01:42:52 +02:00
|
|
|
}
|
|
|
|
getvalues
|
2022-07-06 08:41:00 +02:00
|
|
|
|
|
|
|
out+=("^sep(Colorize PyRadio)")
|
|
|
|
out+=("^sep($GENERATEFROMWP)")
|
|
|
|
out+=("$LIGHTBG,w2theme pyradio light;$me")
|
|
|
|
out+=("$DARKBG,w2theme pyradio dark;$me")
|
2022-08-15 01:42:52 +02:00
|
|
|
out+=("^sep($SETCOLORS)")
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBG' fgcolor='$SFG'> AbCd </span></tt> Stations,^checkout(stations)")
|
|
|
|
out2+=("^tag(stations)")
|
|
|
|
out2+=("^sep(Stations)")
|
|
|
|
out2+=("Stations Text,^pipe(mbclr '$SFG' prtctl stations_txt 'Stations Text' '$me')")
|
|
|
|
out2+=("Stations Background,^pipe(mbclr '$SBG' prtctl stations_bg 'Stations Background' '$me')")
|
|
|
|
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBG' fgcolor='$ASFG'> AbCd </span></tt> Active Station (text),^pipe(mbclr '$ASFG' prtctl active_station ACTIVE_STATION '$me')")
|
|
|
|
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$NCBG' fgcolor='$NCFG'> AbCd </span></tt> Normal Cursor,^checkout(normalcursor)")
|
|
|
|
out2+=("^tag(normalcursor)")
|
|
|
|
out2+=("^sep(Normal Cursor)")
|
|
|
|
out2+=("Normal Cursor Text,^pipe(mbclr '$NCFG' prtctl normal_cursor_txt 'Normal Cursor Text' '$me')")
|
|
|
|
out2+=("Normal Cursor Background,^pipe(mbclr '$NCBG' prtctl normal_cursor_bg 'Normal Cursor Background' '$me')")
|
|
|
|
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$ACBG' fgcolor='$ACFG'> AbCd </span></tt> Active Cursor,^checkout(activecursor)")
|
|
|
|
out2+=("^tag(activecursor)")
|
|
|
|
out2+=("^sep(Active Cursor)")
|
|
|
|
out2+=("Active Cursor Text,^pipe(mbclr '$ACFG' prtctl active_cursor_txt 'Active Cursor Text' '$me')")
|
|
|
|
out2+=("Active Cursor Background,^pipe(mbclr '$ACBG' prtctl active_cursor_bg 'Active Cursor Background' '$me')")
|
|
|
|
|
|
|
|
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$ECBG' fgcolor='$ECFG'> AbCd </span></tt> Edit Cursor,^checkout(editcursor)")
|
|
|
|
out2+=("^tag(editcursor)")
|
|
|
|
out2+=("^sep(Edit Cursor)")
|
|
|
|
out2+=("Edit Cursor Text,^pipe(mbclr '$ECFG' prtctl edit_cursor_txt 'Edit Cursor Text' '$me')")
|
|
|
|
out2+=("Edit Cursor Background,^pipe(mbclr '$ECBG' prtctl edit_cursor_bg 'Edit Cursor Background' '$me')")
|
|
|
|
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBBG' fgcolor='$SBFG'> AbCd </span></tt> Status Bar,^checkout(statusbar)")
|
|
|
|
out2+=("^tag(statusbar)")
|
|
|
|
out2+=("^sep(Status Bar)")
|
|
|
|
out2+=("Status Bar Text,^pipe(mbclr '$SBFG' prtctl status_bar_txt 'Status Bar Text' '$me')")
|
|
|
|
out2+=("Status Bar Background,^pipe(mbclr '$SBBG' prtctl status_bar_bg 'Status Bar Background' '$me')")
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBG' fgcolor='$EFFG'> AbCd </span></tt> Extra Func,^pipe(mbclr '$EFFG' prtctl extra_func EXTRA_FUNC '$me')")
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBG' fgcolor='$PURLFG'> AbCd </span></tt> PyRadio URL,^pipe(mbclr '$PURLFG' prtctl pyradio_url 'PyRadio URL' '$me')")
|
|
|
|
out+=("<tt><span weight='bold' bgcolor='$SBG' fgcolor='$MBFG'> AbCd </span></tt> Messages Border,^pipe(mbclr '$MBFG' prtctl messages_border 'Messages Border' '$me')")
|
2022-07-06 08:41:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
### RUN
|
|
|
|
if [[ "$1" == "-s" ]]; then
|
|
|
|
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
|
|
|
. $HOME/.config/mabox/mabox.conf
|
|
|
|
|
|
|
|
out+=("^sep()")
|
|
|
|
out+=(" ⮜ Back to Colorizer,colorizer -s")
|
|
|
|
|
|
|
|
if [[ $panels_heightpos == "top" ]]; then
|
|
|
|
MENU_VALIGN="top"
|
|
|
|
MENU_MARGIN_Y=${panels_topmargin:-0}
|
|
|
|
elif [[ $panels_heightpos == "bottom" ]]; then
|
|
|
|
MENU_VALIGN="bottom"
|
|
|
|
MENU_MARGIN_Y=${panels_topmargin:-0}
|
|
|
|
else
|
|
|
|
MENU_VALIGN="center"
|
|
|
|
fi
|
|
|
|
MENU_HALIGN="left"
|
|
|
|
jgmenu_icon_size=0
|
|
|
|
menu_margin_x=${submenu_spacing:-0}
|
|
|
|
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
|
|
|
[ -z $jgmenu_use_borders ] && menu_border=0
|
|
|
|
JGWIDTH=$((jgtools_padding + 278 + jgtools_padding))
|
|
|
|
MENU_PADDING_TOP=$((jgtools_padding + 158))
|
|
|
|
|
|
|
|
#WALLPAPER
|
|
|
|
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
|
|
|
|
WALLPAPER=${WALLPATH##*/}
|
|
|
|
THUMBDIR="$HOME/.config/mabox/wallthumbs"
|
|
|
|
mkdir -p ${THUMBDIR}
|
|
|
|
THUMB="${THUMBDIR}/${WALLPAPER}.png"
|
|
|
|
if [[ ! -f "$THUMB" ]]
|
|
|
|
then
|
|
|
|
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
|
|
|
|
fi
|
|
|
|
|
|
|
|
#TEMP POSITION:
|
|
|
|
MENU_VALIGN="top"
|
|
|
|
MENU_MARGIN_Y="60"
|
|
|
|
mkconfigfile
|
|
|
|
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
|
|
@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB}
|
|
|
|
#@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png
|
2022-08-15 01:42:52 +02:00
|
|
|
@rect,,$((jgtools_padding + 144)),$((jgtools_padding + 122)),120,30,4,left,top,#FFFFFF 60,#222222 80,
|
|
|
|
@text,,$((jgtools_padding + 150)),$((jgtools_padding + 122)),120,30,0,left,top,#FFFFFF,${WINCLR}, <b>PyRadio</b>
|
|
|
|
|
2022-07-06 08:41:00 +02:00
|
|
|
$(printf '%s\n' "${out[@]}")
|
|
|
|
$(printf '%s\n' "${out2[@]}")
|
|
|
|
EOF
|
|
|
|
|
|
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf '%s\n' "${out[@]}"
|
2022-08-15 01:42:52 +02:00
|
|
|
printf '%s\n' "${out2[@]}"
|
2022-07-06 08:41:00 +02:00
|
|
|
|