From d2040b58b1799c23133028c5aec064123e476415 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Fri, 28 May 2021 02:47:06 +0200 Subject: [PATCH] mb-reset update --- bin/mb-jgtools | 14 ++++++++++---- bin/mb-reset | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/bin/mb-jgtools b/bin/mb-jgtools index 7a174cf..a2782a8 100755 --- a/bin/mb-jgtools +++ b/bin/mb-jgtools @@ -509,6 +509,7 @@ case $LANG in DESKMNGR="Desktop Session Manager" DESKTOPS="Pulpity i Okna" DESKGRID="DeskGrid" + WALLCHANGER="Zmieniacz tapet" ;; es*) QUICK_NAV="Navegación rápida" @@ -525,6 +526,7 @@ case $LANG in DESKMNGR="Desktop Session Manager" DESKTOPS="Desktops and Windows" DESKGRID="Desktop Grid" + WALLCHANGER="Wallpaper Changer" ;; *) QUICK_NAV="Quick Navigation" @@ -541,6 +543,7 @@ case $LANG in DESKMNGR="Desktop Session Manager" DESKTOPS="Desktops and Windows" DESKGRID="DeskGrid" + WALLCHANGER="Wallpaper Changer" ;; esac @@ -591,16 +594,18 @@ QNAV="" fi # PIPEMENUS -[ $places_menusettingspipe == true ] && menusettingspipe=" $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)" -[ $places_tint2pipe == true ] && tint2pipe=" $TINT2SETTINGS,^pipe(jgtint2-pipe -r)" && pipesep="^sep($PIPEMENUS)" +[ $places_menusettingspipe == true ] && menusettingspipe=" $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)" +[ $places_tint2pipe == true ] && tint2pipe=" $TINT2SETTINGS,^pipe(jgtint2-pipe -r)" && pipesep="^sep($PIPEMENUS)" [ $places_sysinfopipe == true ] && sysinfopipe=" $SYSINFO,^pipe(jgsysinfo-pipe -r)" && pipesep="^sep($PIPEMENUS)" [ $places_keyspipe == true ] && keyspipe=" $SHORTCUTS,^pipe(jgkeys-pipe -r)" && pipesep="^sep($PIPEMENUS)" [ $places_sshpipe == true ] && sshpipe=" $SSH_CONN,^pipe(jgssh -r)" && pipesep="^sep($PIPEMENUS)" [ $places_softwarepipe == true ] && softwarepipe=" $POPINSTALL,^pipe(jgsoftware-pipe -r)" && pipesep="^sep($PIPEMENUS)" -[[ $places_conkypipe == true || -z ${places_conkypipe} ]] && conkypipe=" $CONKYSETTINGS,^pipe(jgconky-pipe -r)" && pipesep="^sep($PIPEMENUS)" +[[ $places_conkypipe == true || -z ${places_conkypipe} ]] && conkypipe=" $CONKYSETTINGS,^pipe(jgconky-pipe -r)" && pipesep="^sep($PIPEMENUS)" [[ $places_jgdeskmngr == true || -z ${places_jgdeskmngr} ]] && jgdeskmngr=" $DESKMNGR,^pipe(jgdeskmngr -r)" && pipesep="^sep($PIPEMENUS)" [[ $places_jgdesktops == true || -z ${places_jgdesktops} ]] && jgdesktops=" $DESKTOPS,^pipe(jgdesktops -r)" && pipesep="^sep($PIPEMENUS)" [[ $places_jgdeskgrid == true || -z ${places_jgdeskgrid} ]] && jgdeskgrid=" $DESKGRID,^pipe(jgdeskgrid -r)" && pipesep="^sep($PIPEMENUS)" +#[[ $places_jgwallpaperchanger == true || -z ${places_jgwallpaperchanger} ]] && jgwallpaperchanger=" $WALLCHANGER,^pipe(jgwallpaperchanger -r)" && pipesep="^sep($PIPEMENUS)" + # VBOXES [[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes="" @@ -619,6 +624,8 @@ cat < ${MENU_ITEMS} $(gtkbookmarks) $pipesep +$menusettingspipe +#$jgwallpaperchanger $jgdesktops $jgdeskmngr $jgdeskgrid @@ -626,7 +633,6 @@ $sysinfopipe $keyspipe $sshpipe $softwarepipe -$menusettingspipe $tint2pipe $conkypipe diff --git a/bin/mb-reset b/bin/mb-reset index 960b38c..1ffd398 100755 --- a/bin/mb-reset +++ b/bin/mb-reset @@ -1,10 +1,18 @@ #!/bin/bash # Daniel Napora 2021 -#: mb-reset - reset/update user config files to current defaults. It only affects files shipped with Mabox. Be aware that you may loose your own customizations (if any). +#: mb-reset - reset/update user config files to current defaults. +#: It only affects files shipped with Mabox. +#: Be aware that you may loose your own customizations (if any). #: #: Usage: mb-reset option #: #: Options: +#: Compare mode: +#: -c - compare files using meld GUI (if installed) +#: It lets you see changes and decide which one to pick or not. +#: Works with rc.xml,bashrc and autostart files +#: Usage: mb-reset -c obrcxml | autostart | bashrc +#: Overwrite mode: #: obrcxml - rc.xml default OpenBox configuration file #: obautostart - default autostart file #: bashrc - bash config file (~/.bashrc) @@ -30,6 +38,29 @@ __usage() { exit } +__compare() { + command -v meld >/dev/null 2>&1 || { echo "mb-reset compare mode requires meld. Install it and try again. (yay -S meld)" >&2; exit 1; } + case "$1" in + obrcxml) + meld /usr/share/mabox/common/rc.xml ~/.config/openbox/rc.xml & + ;; + autostart) + meld /usr/share/mabox/common/autostart ~/.config/openbox/autostart & + ;; + bashrc) + meld /usr/share/mabox/common/.bashrc ~/.bashrc & + ;; + conky) + meld /usr/share/mabox/lang/$LNGDIR/.config/conky/ ~/.config/conky/ & + ;; + *) + echo "Compare " + echo "Usage: mb-reset -c obrcxml|autostart|bashrc" + ;; + esac +} + + __allmenus() { rsync -a /usr/share/mabox/lang/$LNGDIR/.config/mabox/settings* $HOME/.config/mabox/ rsync -a /usr/share/mabox/lang/$LNGDIR/.config/jgmenu/*.csv $HOME/.config/jgmenu/ @@ -87,6 +118,8 @@ rsync -a /usr/share/mb-jgtools/jgobthemes/* $HOME/.config/mabox/jgobthemes/ } __conky() { +cp $HOME/.config/conky/conky-sessionfile{,.bak."$(date +%Y%m%d-%H%M%S)"} +cp $HOME/.config/conky/saved-sessions{,.bak."$(date +%Y%m%d-%H%M%S)"} rsync -a /usr/share/mabox/lang/$LNGDIR/.config/conky/* $HOME/.config/conky/ killall -SIGUSR1 conky } @@ -102,6 +135,7 @@ openbox --reconfigure } __obautostart() { +cp $HOME/.config/openbox/autostart{,.bak."$(date +%Y%m%d-%H%M%S)"} rsync -a /usr/share/mabox/common/autostart $HOME/.config/openbox/ } @@ -115,6 +149,7 @@ rsync -a /usr/share/mabox/common/terminator/* $HOME/.config/terminator/ } case "$1" in + -c|check) __compare "$2";; "allmenus") __allmenus ;; "mainmenu") __mainmenu ;; "leftpanel") __leftpanel ;;