diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger index 1d32dd0..142e908 100755 --- a/usr/bin/jgwallpaperchanger +++ b/usr/bin/jgwallpaperchanger @@ -1,29 +1,35 @@ #!/bin/bash # jgwallpaperchanger - dynamic menu (or submenu) to configure/set wallpapers # - +if [[ $1 == "-r" ]];then +me="${0##*/} -s" +else +me="${0##*/} ${1:--s}" +fi #SLIDESHOW CONF CONFIG_DIR="$HOME/.config/mbwallpaper" -CONFIG_FILE="$CONFIG_DIR/mbwallpaper.conf" +CONF_FILE="$CONFIG_DIR/mbwallpaper.conf" WALLPAPERS_LIST="$CONFIG_DIR/wplist" # Make config directory if not exist mkdir -p $CONFIG_DIR # If config file not exist create one with defaults -if [ ! -f $CONFIG_FILE ]; then -cat < ${CONFIG_FILE} +if [ ! -f $CONF_FILE ]; then +cat < ${CONF_FILE} # Directory with wallpapers wallpaper_dir=/usr/share/backgrounds/ # Rotate time in seconds interval=10 # Wallpaper setter program: nitrogen or feh setter=nitrogen +# Tint2 panel executor button left click action +t2_button_lclick_action=choose EOF fi # read config variables from file -source <(grep = $CONFIG_FILE) +source <(grep = $CONF_FILE) COLORIZER_CONF="$HOME/.config/colorizer/colorizer.conf" source ${COLORIZER_CONF} @@ -41,7 +47,11 @@ EOF fi lclick(){ +if [[ "$t2_button_lclick_action" == "random" ]];then +mbwallpaper -o +else pcmanwp +fi } @@ -54,7 +64,7 @@ case $LANG in RANDWALL="Losowa tapeta" EDIT_WPDIRS="Edytuj katalogi z tapetami" GENERATOR="Generuj (ImageMagick)..." - CHOOSE="Wybierz tapetę..." + CHOOSE_WP="Wybierz tapetę..." SLIDESHOW="Pokaz slajdów" STARTS="Uruchom Pokaz slajdów (zatrzymany)" STOPS="Zatrzymaj Pokaz slajdów (działający - interwał: $interval sek.)" @@ -79,6 +89,16 @@ case $LANG in NOC="Nie (kliknij aby włączyć)" LIGHTBG="light - jasne tło" DARKBG="dark - ciemne tło" + COLORIZER_HELP="Okno główne i Pomoc" + COLORIZER_ROOT="Colorizer rootmenu" + COLORIZER_OB="Moduł Openbox" + COLORIZER_MENU="Moduł Menu i Panele" + COLORIZER_CONKY="Moduł Conky" + B_LC_ACTION="Akcja przycisku (lewy klik)" + RAND="losuj" + CHOOSE="wybierz" + RANDOM_DESC="Ustaw losową tapetę" + CHOOSE_DESC="Wybierz tapetę (z menu kontekstowego)" ;; *) TITLE="Wallpaper Changer" @@ -87,7 +107,7 @@ case $LANG in RANDWALL="Random Wallpaper" EDIT_WPDIRS="Edit Wallpaper dirs" GENERATOR="Generate (ImageMagick)..." - CHOOSE="Choose Wallpaper..." + CHOOSE_WP="Choose Wallpaper..." SLIDESHOW="Slideshow" STARTS="Start Slideshow (stopped)" STOPS="Stop Slideshow (running - interval: $interval sec.)" @@ -112,16 +132,22 @@ case $LANG in NOC="No (click to enable)" LIGHTBG="with light background" DARKBG="with dark background" + COLORIZER_HELP="Main Window and Help" + COLORIZER_ROOT="Colorizer rootmenu" + COLORIZER_OB="Openbox module" + COLORIZER_MENU="Menus/Panels module" + COLORIZER_CONKY="Conky module" + B_LC_ACTION="Button left click action" + RAND="random" + CHOOSE="choose" + RANDOM_DESC="Set random wallpaper" + CHOOSE_DESC="Choose wallpaper (from context menu)" ;; esac . $HOME/.config/mabox/mabox.conf -if [[ $1 == "-r" ]];then -me="${0##*/} -s" -else -me="${0##*/} ${1:--s}" -fi + help="\nBased on Mabox forum member Shwaybo idea.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n" @@ -129,7 +155,7 @@ help="\nBased on Mabox forum member Shwaybo %4s,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done +for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf " %4s,%s" "$i" "mb-setvar interval=${i} $CONF_FILE;$me")");done # COLORIZER_CONF SUBMENU @@ -207,13 +233,20 @@ case "$1" in -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(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") + out+=("$COLORIZER_OB,colorizer-ob -s") + out+=("$COLORIZER_MENU,colorizer-menus -s") + out+=("$COLORIZER_CONKY,colorizer-conky -s") + out+=("^sep()") + [[ "$t2_button_lclick_action" == "random" ]] && out+=("$B_LC_ACTION: [ $RAND ],^checkout(laction)") || out+=("$B_LC_ACTION: [ $CHOOSE ],^checkout(laction)") + out2+=("^tag(laction)") + out2+=("^sep(Panel button left click action)") + out2+=("$CHOOSE_DESC,mb-setvar t2_button_lclick_action=choose $CONF_FILE;$me") + out2+=("$RANDOM_DESC,mb-setvar t2_button_lclick_action=random $CONF_FILE;$me") + ;; esac