diff --git a/Hyde b/Hyde index 867bc1f..6ca67dd 100755 --- a/Hyde +++ b/Hyde @@ -444,7 +444,7 @@ theme() { #? Theme commands select) #? Theme selector "${scrDir}"/themeselect.sh ;; - patch) #! Import a theme from different repository.\nﯦ Invoking without args will launch a menu from Hyde-gallery DB + patch) #! Patch a theme from different repository.\nﯦ Invoking without args will launch a menu from Hyde-gallery DB print_prompt -r "[warn] Command will be deprecated\n Use 'Hyde theme import' instead" shift navigate_clone @@ -462,6 +462,7 @@ theme() { #? Theme commands Manage-Themes theme_patcher else #! ./themepatcher.sh "${@}" #! This is from the repo,Decided to maintain a separate patcher + export SINGLE_THEME_ONLY=true Patch-Theme "${@}" fi ;; diff --git a/Scripts/Fzf-Menu b/Scripts/Fzf-Menu index e4d89e8..b5e5cba 100644 --- a/Scripts/Fzf-Menu +++ b/Scripts/Fzf-Menu @@ -98,6 +98,20 @@ fzf_theme_menu() { } +#? Wallpaper patch Menu +fzf_select_theme_wallpaper() { + fzf \ + --cycle \ + --preview '[ {} = "[Confirm]" ] || Fzf-Preview {}' \ + -m \ + --marker ' ' \ + --pointer=' ' \ + --prompt '[TAB] Select a theme [Esc] Exit | CTRL A : mark all | CTRL D : unmark all: ' \ + --bind 'ctrl-a:select-all,ctrl-d:deselect-all' \ + --preview-window 'right:60%,border-rounded' + +} + #? sddm theme fzf_sddm_list_arcs() { diff --git a/Scripts/Manage-Themes b/Scripts/Manage-Themes index cc6ef20..b05db90 100644 --- a/Scripts/Manage-Themes +++ b/Scripts/Manage-Themes @@ -138,11 +138,18 @@ theme_menu() { theme_patcher() { generate_theme_list + themeCount="$(wc -l <<< "${patchList}")" [ ! -f "${themepatcher_lst}" ] && return - # print_prompt -g "[themepatcher]" " Patching the following themes..." + [ "${themeCount}" == 1 ] && export SINGLE_THEME_ONLY=true + print_prompt -g "[themepatcher]" " Patching ${themeCount} theme/s..." + barLine print_prompt "${patchList}" + barLine ask_confirm +if [ "${SINGLE_THEME_ONLY}" = true ]; then +eval Patch-Theme "$(cat "${themepatcher_lst}")" +else while IFS='"' read -r null1 themeName null2 themeRepo; do themeNameQ+=("${themeName//\"/}") themeRepoQ+=("${themeRepo//\"/}") @@ -167,6 +174,7 @@ theme_patcher() { print_prompt -r "[ERROR]" " $theme" fi done +fi } eval "$(declare -F | sed -e 's/-f /-fx /')" diff --git a/Scripts/Patch-Theme b/Scripts/Patch-Theme index d4fcdc8..b86a5c9 100644 --- a/Scripts/Patch-Theme +++ b/Scripts/Patch-Theme @@ -81,6 +81,14 @@ Note: HELP } + +select_theme_wallpaper() { +[ "${SINGLE_THEME_ONLY}" = true ] || return +wallpapers="$(find "${Fav_Theme_Dir}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | Fzf-Menu "${FUNCNAME[0]}" )" +print_prompt -g "[wallpapers]" +awk -F "${Fav_Theme_Dir}" '{print $2}' <<< "${wallpapers}" +} + if [[ -z $1 || -z $2 ]]; then ask_help exit 1 @@ -158,8 +166,9 @@ readonly restore_list # Get Wallpapers wallpapers=$(find "${Fav_Theme_Dir}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \)) +select_theme_wallpaper wallcount="$(echo "${wallpapers}" | wc -l)" -{ [ -z "${wallpapers}" ] && print_prompt -r "[ERROR] " "No wallpapers found" && exit_flag=true; } || { readonly wallpapers && print_prompt -g "\n[OK] " "wallpapers :: [count] ${wallcount} (.gif+.jpg+.jpeg+.png)"; } +{ [ -z "${wallpapers}" ] && print_prompt -r "[ERROR] " "No wallpapers found/selected" && exit_flag=true; } || { readonly wallpapers && print_prompt -g "\n[OK] " "wallpapers :: [count] ${wallcount} (.gif+.jpg+.jpeg+.png)"; } # overparsing 😁 check_tars() {