diff --git a/usr/bin/jgmenusettings-pipe b/usr/bin/jgmenusettings-pipe index 40bb3bb..a514146 100755 --- a/usr/bin/jgmenusettings-pipe +++ b/usr/bin/jgmenusettings-pipe @@ -36,6 +36,7 @@ case $LANG in SYSINFO="Informacje o systemie" SHORTCUTS="Skróty klawiszowe" MENUPANELS="Ustawienia Menu/Paneli bocznych" + WALLCHANGER="Tapeta i Blokada Ekranu" TINT2="Ustawienia panelu Tint2" CONKY="Ustawienia Conky" SSH_CONN="Połączenia SSH" @@ -60,6 +61,7 @@ case $LANG in EDIT_CURRENT="Edytuj aktywny" FOLLOW_OB="Zgodny z motywem OpenBox" CHOOSE="Wybierz..." + RANDTHEME="Losowy" REMOVE="Usuń to menu z panelu" ;; es*) @@ -95,6 +97,7 @@ case $LANG in SYSINFO="System information" SHORTCUTS="Atajos del teclado" MENUPANELS="Menu/Paneles laterales" + WALLCHANGER="Wallpaper and ScreenLocker" TINT2="Tint2 panel settings" CONKY="Conky settings" SSH_CONN="SSH Connections" @@ -119,6 +122,7 @@ case $LANG in EDIT_CURRENT="Editar el actual" FOLLOW_OB="Similiar al de Openbox" CHOOSE="Elegir..." + RANDTHEME="Random" REMOVE="Eliminar este menú del panel" ;; *) @@ -154,6 +158,7 @@ case $LANG in SYSINFO="System information" SHORTCUTS="Keyboard shortcuts" MENUPANELS="Menu/Sidepanels settings" + WALLCHANGER="Wallpaper and ScreenLocker" TINT2="Tint2 panel settings" CONKY="Conky settings" SSH_CONN="SSH Connections" @@ -178,11 +183,13 @@ case $LANG in EDIT_CURRENT="Edit current" FOLLOW_OB="Same as OpenBox theme" CHOOSE="Choose..." + RANDTHEME="Random" REMOVE="Remove this menu from panel" ;; esac -me="mb-jgtools $jgtools_last" +#me="mb-jgtools $jgtools_last" +me="jgmenusettings-pipe -s" L="mb-jgtools places" R="mb-jgtools right" @@ -216,6 +223,7 @@ out2+=("^sep($MODULES)") out2+=("^sep($PIPEMENUS)") [[ $places_menusettingspipe = false ]] && out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=true;$L") || out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=false;$L") +[[ $places_jgwallpaperchanger = false ]] out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=true;$L") || out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=false;$L") [[ $places_jgdesktops = false ]] && out2+=("$DESKTOPS,mb-setvar places_jgdesktops=true;$L") || out2+=("$DESKTOPS,mb-setvar places_jgdesktops=false;$L") [[ $places_jgdeskmngr = false ]] && out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=true;$L") || out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=false;$L") [[ $places_jgdeskgrid = false ]] && out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=true;$L") || out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=false;$L") @@ -325,6 +333,7 @@ if [ $jgmenu_theme != obtheme ]; then #INNY NIŻ OB THEME . $HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc > /dev/null 2>&1 & out+=("$CHOOSE [$jgmenu_theme],^checkout(motywy)") out+=("$EDIT_CURRENT: ($jgmenu_theme),geany $HOME/.config/mabox/jgobthemes/$jgmenu_theme.colorrc,geany") +out+=("$RANDTHEME,mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1));$me") out+=("$FOLLOW_OB,mb-setvar jgmenu_theme=obtheme;$me ^sep()") out+=("$GRADIENT [ ${menu_gradient_pos:-none} ],^checkout(gradient)") @@ -337,6 +346,7 @@ else #out+=("#${menu_gradient_pos}\n") out+=("$CHOOSE [${wm_theme// /_}],^checkout(motywy)") out+=("$EDIT_CURRENT: (${wm_theme// /_}),geany $HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc,geany") +out+=("$RANDOM,mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1));$me") out+=("$FOLLOW_OB,mb-setvar jgmenu_theme=obtheme;$me ^sep()") out+=("$GRADIENT [ ${menu_gradient_pos:-none} ],^checkout(gradient)") @@ -380,7 +390,6 @@ out2+=("Sardi-Mono,mb-setvar jgmenu_icon_theme=Sardi-Mono;mb-setvar jgmenu_use_i else out+=("^sep()") out+=("$INSTALL Sardi icons, pamac-installer sardi-icons") - fi @@ -392,9 +401,12 @@ if [[ $1 == "-s" ]]; then MENU_PADDING_TOP=0 -MENU_HALIGN="center" +MENU_HALIGN="left" MENU_VALIGN="center" jgmenu_icon_size=0 +JGWIDTH=40 +menu_margin_x=${submenu_spacing:-0} +[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius mkconfigfile cat < ${MENU_ITEMS} diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger new file mode 100755 index 0000000..f5d634c --- /dev/null +++ b/usr/bin/jgwallpaperchanger @@ -0,0 +1,149 @@ +#!/bin/bash +# jgwallpaperchanger - rotate desktop wallpaper every n-seconds, +# + +CONFIG_DIR="$HOME/.config/mbwallpaper" +CONFIG_FILE="$CONFIG_DIR/mbwallpaper.conf" +WALLPAPERS_LIST="$CONFIG_DIR/wplist" +SCRNLOCKCFG="$HOME/.config/mbscreenlocker/mbscreenlocker.conf" + +# 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} +# Directory with wallpapers +wallpaper_dir=/usr/share/backgrounds/ +# Rotate time in seconds +interval=10 +# Wallpaper setter program: nitrogen or feh +setter=nitrogen +EOF +fi + +# read config variables from file +source <(grep = $CONFIG_FILE) +case $LANG in + pl*) + TITLE="Zmieniacz tapet i Blokada ekranu" + RANDWALL="Losowa tapeta" + CHOOSE="Wybierz tapetę..." + STARTS="Uruchom Pokaz slajdów (zatrzymany)" + STOPS="Zatrzymaj Pokaz slajdów (działający)" + CONF="Konfiguracja" + WALLDIR="Katalog z tapetami" + INTERVAL="Interwał" + SEC="sekund" + EDITCONF="Edytuj plik konfiguracyjny" + OPENDIR="Otwórz katalog z tapetami" + LOCKER="Blokada ekranu (W+l)" + TYPETO="wpisz hasło aby odblokować" + CACHE="Użyj aktualnej tapety" + EFFECT="Efekt (ustaw i wypróbuj)" + DIM="przyciemnienie" + BLUR="rozmycie" + DIMBLUR="przyciemnienie i rozmycie" + PIXEL="pikseloza" + DESK="Rozmyty pulpit" + ;; + *) + TITLE="Wallpaper Changer & ScreenLocker" + RANDWALL="Random Wallpaper" + CHOOSE="Choose Wallpaper..." + STARTS="Start Slideshow (stopped)" + STOPS="Stop Slideshow (running)" + CONF="Configuration" + WALLDIR="Wallpaper dir" + INTERVAL="Slideshow Interval" + SEC="seconds" + EDITCONF="Edit config file" + OPENDIR="Open wallpaper directory" + LOCKER="ScreenLocker (W+l)" + TYPETO="type password to unlock" + CACHE="Cache current wallpaper for ScreenLock" + EFFECT="Effect (set and run)" + DIM="dim" + BLUR="blur" + DIMBLUR="dim and blur" + PIXEL="pixel" + DESK="Blurred desktop" + ;; +esac + +. $HOME/.config/mabox/mabox.conf + +me="jgwallpaperchanger -s" +#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' + +out+=("^sep($TITLE)") +if ! pgrep mbwallpaper > /dev/null; then + out+=("$RANDWALL,mbwallpaper -o;$me") + out+=("$CHOOSE,mbwallpaper -c") + out+=("$STARTS,run_wallpaperslideshow;$me") + else + out+=("$STOPS,killall mbwallpaper;$me") +fi + +out+=("^sep($CONF)") +#out+=("About Wallpaper changer,\"\"\"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'\"\"\"") + +out+=("$WALLDIR: [ $wallpaper_dir ],geany $CONFIG_FILE") +out+=("$INTERVAL [ $interval ] ($SEC),^checkout(interval)") +out+=("^sep()") +out+=("$EDITCONF ,geany $CONFIG_FILE") +out+=("$OPENDIR,pcmanfm -n $wallpaper_dir") + +out+=("^sep($LOCKER)") +out+=("^sep($TYPETO") +#out+=("^sep(Betterlockscreen)") +out+=("$CACHE,mbscreenlocker -c") +out+=("^sep($EFFECT)") +out+=("$DIM,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker") +out+=("$BLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker") +out+=("$DIMBLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker") +out+=("$PIXEL,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker") +out+=("^sep()") +out+=("$DESK,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker") + +out2+=("^tag(interval)") +for i in 10 30 60 120 300 600 1800 3600; do out2+=("$(printf " %4s,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done + +### RUN +if [[ "$1" == "-s" ]]; then +. /usr/bin/pipemenu-standalone.cfg +. $HOME/.config/mabox/mabox.conf + +MENU_PADDING_TOP=0 +MENU_HALIGN="left" +MENU_VALIGN="center" +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 < ${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[@]}" + +if [[ $1 == "-r" ]]; then +case $LANG in + pl*) REMOVE="Usuń to menu z panelu";; + es*) REMOVE="Eliminar este menú del panel";; + *) REMOVE="Remove this menu from panel";; +esac +printf '%s\n' "^sep()" +printf '%s\n' "$REMOVE,mb-setvar places_jgwallpaperchanger=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}"