wallpaper menu upd

This commit is contained in:
Daniel Napora 2023-05-30 19:42:51 +02:00
parent 916557d052
commit 48c2883d7f

View File

@ -2,6 +2,7 @@
# jgwallpaperchanger - dynamic menu (or submenu) to configure/set wallpapers
#
#SLIDESHOW CONF
CONFIG_DIR="$HOME/.config/mbwallpaper"
CONFIG_FILE="$CONFIG_DIR/mbwallpaper.conf"
WALLPAPERS_LIST="$CONFIG_DIR/wplist"
@ -23,17 +24,40 @@ fi
# read config variables from file
source <(grep = $CONFIG_FILE)
COLORIZER_CONF="$HOME/.config/colorizer/colorizer.conf"
source ${COLORIZER_CONF}
#WP_DIRS
CNF_FILE="$HOME/.config/mabox/wallp_dirs.conf"
if [ ! -f $CNF_FILE ]; then
cat <<EOF > ${CNF_FILE}
# User wallpapers directories - one per line
# Used by "Choose wallpaper" PCmanFM wrapper
# Set wallpapers using context (right click) menu in file manager
~/wallpapers/
EOF
fi
lclick(){
pcmanwp
}
main(){
case $LANG in
pl*)
TITLE="Zmieniacz tapet"
NITROGEN="Nitrogen"
WALLPAPERS="Tapety"
RANDWALL="Losowa tapeta"
EDIT_WPDIRS="Edytuj katalogi z tapetami"
GENERATOR="Generuj (ImageMagick)..."
CHOOSE="Wybierz tapetę..."
SLIDESHOW="Pokaz slajdów"
STARTS="Uruchom Pokaz slajdów <small>(<i>zatrzymany</i>)</small>"
STOPS="Zatrzymaj Pokaz slajdów <small>(<i>działający</i>)</small>"
STOPS="Zatrzymaj Pokaz slajdów <small>(<i>działający - interwał: $interval sek.</i>)</small>"
CONF="Konfiguracja"
WALLDIR="Katalog z tapetami"
INTERVAL="Interwał slajdów"
@ -41,17 +65,32 @@ case $LANG in
EDITCONF="Edytuj plik konfiguracyjny"
OPENDIR="Otwórz katalog z tapetami"
LEFTPANEL="Lewy panel"
OBTHEME="Motyw Openbox"
MENUPANELS="Menu i Panele"
AUTOGEN_THEMES="Autogenerowanie motywów?"
GENERATETHEMES="Generować motywy po zmianie tapety?"
GENOB="Pokolorować Dekoracje Okien?"
GENMENU="Pokolorować menu i panele?"
GENCONKY="Pokolorować Conky?"
GENPYRADIO="Pokolorować PyRadio?"
YES="Tak"
NO="Nie"
YESC="<b>Tak</b> <i>(kliknij aby wyłączyć)</i>"
NOC="<b>Nie</b> <i>(kliknij aby włączyć)</i>"
LIGHTBG="<b>light</b> - jasne tło"
DARKBG="<b>dark</b> - ciemne tło"
;;
*)
TITLE="Wallpaper Changer"
NITROGEN="Nitrogen"
WALLPAPERS="Wallpapers"
RANDWALL="Random Wallpaper"
EDIT_WPDIRS="Edit Wallpaper dirs"
GENERATOR="Generate (ImageMagick)..."
CHOOSE="Choose Wallpaper..."
SLIDESHOW="Slideshow"
STARTS="Start Slideshow <small>(<i>stopped</i>)</small>"
STOPS="Stop Slideshow <small>(<i>running</i>)</small>"
STOPS="Stop Slideshow <small>(<i>running - interval: $interval sec.</i>)</small>"
CONF="Configuration"
WALLDIR="Images dir"
INTERVAL="Slideshow Interval"
@ -59,6 +98,20 @@ case $LANG in
EDITCONF="Edit config file"
OPENDIR="Open wallpaper directory"
LEFTPANEL="Left panel"
OBTHEME="Openbox Theme"
MENUPANELS="Menus/Panels"
AUTOGEN_THEMES="<b>Auto theming</b> - based on wallp colors"
GENERATETHEMES="Generate themes on wallpaper change?"
GENOB="Colorize Window Decorations?"
GENMENU="Colorize Menus and Panels?"
GENCONKY="Colorize Conky?"
GENPYRADIO="Colorize PyRadio?"
YES="Yes"
NO="No"
YESC="<b>Yes</b> <i>(click to disable)</i>"
NOC="<b>No</b> <i>(click to enable)</i>"
LIGHTBG="with <b>light</b> background"
DARKBG="with <b>dark</b> background"
;;
esac
@ -76,35 +129,92 @@ help="\nBased on Mabox forum member Shwaybo <a href='https://forum.maboxlinux.or
out+=("^sep($WALLPAPERS)")
if ! pgrep mbwallpaper > /dev/null; then
#out+=("$NITROGEN,nitrogen")
out+=("<big>󰇎</big> $RANDWALL,mbwallpaper -o;$me")
out+=("<big>󰉔</big> $CHOOSE,pcmanwp")
out+=("<big></big> $RANDWALL,mbwallpaper -o;$me")
#out+=("$GENERATOR,^pipe(jgwallpapergenerate)")
out+=("^sep(<i>$SLIDESHOW</i>)")
out+=("$STARTS,run_wallpaperslideshow;$me")
out+=("<big>󰧸</big> $SLIDESHOW,^checkout(sshow)")
out+=("^sep()")
out+=("<big></big> $EDIT_WPDIRS,xdg-open $CNF_FILE")
[[ "$wall2themes" = "yes" ]] && out+=("<big></big> $AUTOGEN_THEMES,^checkout(colsettings)") || out+=("<big></big> $AUTOGEN_THEMES,^checkout(colsettings)")
else
out+=("$STOPS,killall mbwallpaper;pkill -f 'yad --not';$me")
fi
out+=("^sep()")
out+=("\"\"\"$WALLDIR: <small>[ <b>$wallpaper_dir</b> ]</small>\"\"\",xdg-open $CONFIG_FILE")
out+=("$INTERVAL [ <b>$interval</b> ] <small>($SEC)</small>,^checkout(interval)")
out+=("^sep()")
out+=("<big></big> $EDITCONF ,xdg-open $CONFIG_FILE")
out+=("<big></big> $OPENDIR,pcmanfm -n $wallpaper_dir")
out+=("About Slideshow,\"\"\"notify-send.sh -u critical -i mbcc 'Wallpaper Changer - rotate desktop wallpaper every n-seconds' \"$help\" -o 'Edit configuration file:geany ~/.config/mbwallpaper/mbwallpaper.conf'\"\"\"")
out1+=("^tag(sshow)")
out1+=("^sep($SLIDESHOW)")
out1+=("$STARTS,run_wallpaperslideshow;$me")
out1+=("\"\"\"$WALLDIR: <small>[ <b>$wallpaper_dir</b> ]</small>\"\"\",xdg-open $CONFIG_FILE")
out1+=("$INTERVAL [ <b>$interval</b> ] <small>($SEC)</small>,^checkout(interval)")
out1+=("^sep()")
out1+=("<big></big> $EDITCONF ,xdg-open $CONFIG_FILE")
out1+=("<big></big> $OPENDIR,pcmanfm -n $wallpaper_dir")
out1+=("About Slideshow,\"\"\"notify-send.sh -u critical -i mbcc 'Wallpaper Changer - rotate desktop wallpaper every n-seconds' \"$help\" -o 'Edit configuration file:geany ~/.config/mbwallpaper/mbwallpaper.conf'\"\"\"")
out2+=("^tag(interval)")
for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf "<tt> %4s</tt>,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done
# COLORIZER_CONF SUBMENU
out1+=("^tag(colsettings)")
out1+=("^sep($GENERATETHEMES)")
[[ "$wall2themes" = "yes" ]] && out1+=("<big></big> $YESC,mb-setvar wall2themes=no $COLORIZER_CONF;$me") || out1+=("<big></big> $NOC,mb-setvar wall2themes=yes $COLORIZER_CONF;$me")
out1+=("^sep()")
out1+=("$OBTHEME [ <b>${wall2themes_ob}</b> ],^checkout(ob)")
out2+=("^tag(ob)")
out2+=("^sep($GENOB)")
out2+=("$NO,mb-setvar wall2themes_ob=none $COLORIZER_CONF;$me")
out2+=("^sep()")
out2+=("$LIGHTBG,mb-setvar wall2themes_ob=light $COLORIZER_CONF;$me")
out2+=("$DARKBG,mb-setvar wall2themes_ob=dark $COLORIZER_CONF;$me")
out1+=("$MENUPANELS [ <b>${wall2themes_menu}</b> ],^checkout(mp)")
out2+=("^tag(mp)")
out2+=("^sep($GENMENU)")
out2+=("$NO,mb-setvar wall2themes_menu=none $COLORIZER_CONF;$me")
out2+=("^sep()")
out2+=("$LIGHTBG,mb-setvar wall2themes_menu=light $COLORIZER_CONF;$me")
out2+=("$DARKBG,mb-setvar wall2themes_menu=dark $COLORIZER_CONF;$me")
out1+=("Conky [ <b>${wall2themes_conky}</b> ],^checkout(conky)")
out2+=("^tag(conky)")
out2+=("^sep($GENCONKY)")
out2+=("$NO,mb-setvar wall2themes_conky=none $COLORIZER_CONF;$me")
out2+=("^sep()")
out2+=("$LIGHTBG,mb-setvar wall2themes_conky=light $COLORIZER_CONF;$me")
out2+=("$DARKBG,mb-setvar wall2themes_conky=dark $COLORIZER_CONF;$me")
out1+=("PyRadio [ <b>${wall2themes_pyradio}</b> ],^checkout(pyradio)")
out2+=("^tag(pyradio)")
out2+=("^sep($GENPYRADIO)")
out2+=("$NO,mb-setvar wall2themes_pyradio=none $COLORIZER_CONF;$me")
out2+=("^sep()")
out2+=("$LIGHTBG,mb-setvar wall2themes_pyradio=light $COLORIZER_CONF;$me")
out2+=("$DARKBG,mb-setvar wall2themes_pyradio=dark $COLORIZER_CONF;$me")
### RUN
if [[ $1 == "-s" || $1 == "-c" || $1 == "-u" ]]; then
if [[ $1 == "-s" || $1 == "-c" || $1 == "-u" || $1 == "ipc" ]]; then
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
out+=("^sep()")
case "$1" in
-s) out+=(" ⮜ $LEFTPANEL,mb-jgtools places");;
-c) out+=(" ⮜ Colorizer,colorizer -s");;
-u) out+=(" ⮜ Settings menu,mb-jgtools settings");;
ipc) POSITION_MODE=${1:-fixed}
out+=("^sep(COLORIZER)")
out+=("COLORIZER_HELP,ycolorizer")
out+=("COLORIZER_ROOT,colorizer -s")
out+=("^sep()")
out+=("COLORIZER_OB,colorizer-ob -s")
out+=("COLORIZER_MENU,colorizer-menus -s")
out+=("COLORIZER_CONKY,colorizer-conky -s")
;;
esac
. $HOME/.config/mabox/mabox.conf
@ -152,6 +262,7 @@ mkconfigfile
cat <<EOF > ${MENU_ITEMS}
@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB}
$(printf '%s\n' "${out[@]}")
$(printf '%s\n' "${out1[@]}")
$(printf '%s\n' "${out2[@]}")
EOF
@ -171,4 +282,12 @@ esac
printf '%s\n' "^sep()"
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgwallpaperchanger=false;mb-jgtools places"
fi
printf '%s\n' "${out1[@]}"
printf '%s\n' "${out2[@]}"
}
case "$1" in
lclick) lclick;;
*) main "$@";;
esac