121 lines
3.1 KiB
Bash
Executable File
121 lines
3.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# jgwallpapergenerate - submenu to generate wallpapers
|
|
#
|
|
|
|
case $LANG in
|
|
pl*)
|
|
TITLE="Generator tapet (ImageMagick)"
|
|
RANDCOLORS="Losowe kolory"
|
|
PICKCOLORS="Wybór kolorów..."
|
|
WALLPAPERMENU="Menu Tapety"
|
|
RANDOMEFFECT="Losowy efekt"
|
|
SOLID="<b>Jednolity</b> kolor"
|
|
BLURRED="<b>Rozmycie</b>"
|
|
LINEAR="Gradient <b>liniowy</b>"
|
|
RADIAL="Gradient <b>promieniowy</b>"
|
|
TWISTED="<b>Skręcony</b> gradient "
|
|
BILINEAR="Gradient <b>dwuliniowy</b>"
|
|
PLASMA="<b>Plazma</b>"
|
|
ONECOLOR="(jeden kolor)"
|
|
TWOCOLORS="(dwa kolory)"
|
|
FOURCOLORS="(cztery kolory)"
|
|
IMAGES="Wygenerowane obrazy"
|
|
OPENDIR="Otwórz katalog"
|
|
EMPTYDIR="Opróżnij katalog"
|
|
SIZE="rozmiar"
|
|
;;
|
|
*)
|
|
TITLE="Wallpaper Generator (ImageMagick)"
|
|
RANDCOLORS="Random colors"
|
|
PICKCOLORS="Pick colors..."
|
|
WALLPAPERMENU="Wallpapers Menu"
|
|
RANDOMEFFECT="Random effect"
|
|
SOLID="<b>Solid</b> color"
|
|
BLURRED="<b>Blurred</b>"
|
|
LINEAR="<b>Linear</b> gradient"
|
|
RADIAL="<b>Radial</b> gradient"
|
|
TWISTED="<b>Twisted</b> gradient"
|
|
BILINEAR="<b>Bilinear</b> gradient"
|
|
PLASMA="<b>Plasma</b>"
|
|
ONECOLOR="(pick one color)"
|
|
TWOCOLORS="(pick two colors)"
|
|
FOURCOLORS="(pick four colors)"
|
|
IMAGES="Generated images"
|
|
OPENDIR="Open directory"
|
|
EMPTYDIR="Empty directory"
|
|
SIZE="size"
|
|
;;
|
|
esac
|
|
|
|
. $HOME/.config/mabox/mabox.conf
|
|
DIR="$(xdg-user-dir PICTURES)/mb-canvas"
|
|
files="$(ls ${DIR}|wc -l)"
|
|
du="$(du -sh ${DIR}|awk '{print $1}')"
|
|
me="jgwallpapergenerate -s"
|
|
|
|
|
|
|
|
out+=("^sep($TITLE)")
|
|
out+=("^sep($RANDCOLORS)")
|
|
out+=("$RANDOMEFFECT,mb-canvas -Ra;$me")
|
|
out+=("^sep()")
|
|
out+=("$SOLID,mb-canvas -Ras;$me")
|
|
out+=("$BLURRED,mb-canvas -RaB;$me")
|
|
out+=("$LINEAR,mb-canvas -Ral;$me")
|
|
out+=("$RADIAL,mb-canvas -Rar;$me")
|
|
out+=("$TWISTED,mb-canvas -Rat;$me")
|
|
out+=("$BILINEAR,mb-canvas -Rab;$me")
|
|
out+=("$PLASMA,mb-canvas -Rap;$me")
|
|
out+=("^sep($PICKCOLORS)")
|
|
out+=("$SOLID $ONECOLOR,mb-canvas -as;$me")
|
|
out+=("$LINEAR $TWOCOLORS,mb-canvas -al;$me")
|
|
out+=("$RADIAL $TWOCOLORS,mb-canvas -ar;$me")
|
|
out+=("$TWISTED $TWOCOLORS,mb-canvas -at;$me")
|
|
out+=("$BILINEAR $FOURCOLORS,mb-canvas -ab;$me")
|
|
if [ "$files" -gt "0" ]; then
|
|
out+=("\"\"\"^sep($IMAGES: $files - $SIZE: ${du})\"\"\"")
|
|
out+=("$OPENDIR,xdg-open $DIR")
|
|
out+=("$EMPTYDIR,rm ${DIR}/*.png;$me")
|
|
fi
|
|
|
|
|
|
### RUN
|
|
if [[ "$1" == "-s" ]]; then
|
|
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
|
. $HOME/.config/mabox/mabox.conf
|
|
|
|
out+=("^sep()")
|
|
out+=(" ⮜ $WALLPAPERMENU,jgwallpaperchanger -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_PADDING_TOP=${jgtools_padding:-0}
|
|
MENU_HALIGN="left"
|
|
jgmenu_icon_size=0
|
|
JGWIDTH=40
|
|
menu_margin_x=${submenu_spacing:-0}
|
|
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
|
[ -z $jgmenu_use_borders ] && menu_border=0
|
|
|
|
mkconfigfile
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
$(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[@]}"
|
|
printf '%s\n' "${out2[@]}"
|