Skip to content

Commit d72141b

Browse files
committed
handles new HyDE
1 parent 7eda316 commit d72141b

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"[markdown]": {
33
"editor.defaultFormatter": "xaver.clang-format"
4-
}
4+
},
5+
"makefile.configureOnOpen": false
56
}

Hyde

+20-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99
CLI_PATH="$(dirname "$(dirname "${0}")")"
1010
PATH=$PATH:${CLI_PATH}/lib/hyde-cli/
11-
export CLI_PATH
11+
export CLI_PATH
1212
export PATH
1313

1414
hyde_cli_version="$( head -1 "${CLI_PATH}/share/hyde-cli/.hyde-cli.ver")"
@@ -59,8 +59,8 @@ fi
5959
man() { #? Show Manual
6060
# shellcheck disable=SC1090
6161
. "${META_FILE}" 2>/dev/null || print_prompt -r "Looks like you did not run 'Hyde-install'! "
62-
[ -f "$HYDE_RUNTIME_DIR/Hyde-tool_man" ] && [[ $* == *"--reload"* ]] && rm "$HYDE_RUNTIME_DIR/Hyde-tool_man"
63-
if [ -f "$HYDE_RUNTIME_DIR/Hyde-tool_man" ] ; then
62+
[ -f "$HYDE_RUNTIME_DIR/Hyde-tool_man" ] && [[ $* == *"--reload"* ]] && rm "$HYDE_RUNTIME_DIR/Hyde-tool_man"
63+
if [ -f "$HYDE_RUNTIME_DIR/Hyde-tool_man" ] ; then
6464
local man_ver="$(grep "Hyde-cli Version:" "$HYDE_RUNTIME_DIR/Hyde-tool_man" | cut -d ":" -f2)"
6565
if grep -q "${man_ver}" <<< "${hyde_cli_version}"; then
6666
cat "$HYDE_RUNTIME_DIR/Hyde-tool_man"
@@ -92,7 +92,7 @@ man() { #? Show Manual
9292
barLine
9393
print_prompt "\nDescriptions with" -y " [*]" " can be expanded to show more information. Append [--help]"
9494
print_prompt "\nCheck for dependencies by appending '--deps' flag. eg ' Hyde show pastebin --deps ' "
95-
print_prompt "\nRegenerate this 'man' page by appending '--reload' flag. 'Hyde man --reload' "
95+
print_prompt "\nRegenerate this 'man' page by appending '--reload' flag. 'Hyde man --reload' "
9696
) | cat - 2>/dev/null | tee "$HYDE_RUNTIME_DIR/Hyde-tool_man"
9797
}
9898

@@ -108,7 +108,7 @@ version() { #? Hyde-cli version
108108
repo_info
109109
barLine
110110
inform_updates
111-
}
111+
}
112112
}
113113

114114
systeminfo() { #? System information
@@ -516,7 +516,7 @@ USAGE
516516
select) #? Wallpaper selector
517517
"${scrDir}"/swwwallselect.sh
518518
;;
519-
variety) #? [*] Use variety package to manage wallpapers\nﯦ Add 'exec-once=Hyde wallpaper variety' in ./userprfs.conf
519+
variety) #? [*] Use variety package to manage wallpapers\nﯦ Add 'exec-once=Hyde wallpaper variety' in ./userprfs.conf
520520
shift
521521
Run-Wallpaper "${@}"
522522
: <<USAGE
@@ -671,7 +671,7 @@ sddm() { #? Sddm commands
671671
;;
672672
info) #? Check sddm theme status
673673
sddm_info
674-
;;
674+
;;
675675
*) Parameters "${FUNCNAME[0]}" ;;
676676

677677
esac;
@@ -736,7 +736,7 @@ USAGE
736736

737737
}
738738

739-
code() { #? Code editor related commands
739+
code() { #? Code editor related commands
740740
case $1 in
741741
# select) #! Selector for default Theme presets
742742

@@ -766,7 +766,7 @@ HELP
766766
codet=${*:-wallbash}
767767
[[ "$*" == "-"* ]] && { help ; exit 1; }
768768
readarray -t codeConf < <(find "${confDir}" -mindepth 1 -maxdepth 1 -type d -name "Code*" -o -name "VSCodium*" -o -name "Cursor" | sort)
769-
print_prompt -y "Setting '${codet}' as code theme..."
769+
print_prompt -y "Setting '${codet}' as code theme..."
770770
for i in "${!codeConf[@]}" ; do
771771
[ -d "${codeConf[i]}/User" ] || continue
772772
[ -f "${codeConf[i]}/User/settings.json" ] || echo -e "{\n \"workbench.colorTheme\":\"wallbash\" \n}" > "${codeConf[i]}/User/settings.json"
@@ -788,7 +788,7 @@ show() { #? Useful GUI util
788788
# Keybinds_Hint #! Moved to .extra
789789
shift
790790
diff "${etcDir}/keybinds_hint.sh" "${scrDir}/keybinds_hint.sh" > /dev/null || \
791-
print_prompt +b "\n[changes available] " "copy '"${etcDir}/keybinds_hint.sh"' to '${scrDir}/keybinds_hint.sh' to update your keybinds_hint.sh"
791+
print_prompt +b "\n[changes available] " "copy '"${etcDir}/keybinds_hint.sh"' to '${scrDir}/keybinds_hint.sh' to update your keybinds_hint.sh"
792792
"${scrDir}"/keybinds_hint.sh "${@}"
793793
: <<USAGE
794794
[SHOW_BINDS_USAGE]
@@ -814,9 +814,9 @@ USAGE
814814
[END]
815815
USAGE
816816
;;
817-
calc) #? [*] Calculator (libqalculate)
817+
calc) #? [*] Calculator (libqalculate)
818818
shift
819-
Launch-Calculator "${@}"
819+
Launch-Calculator "${@}"
820820
: <<USAGE
821821
[SHOW_CALC_USAGE]
822822
--rasi <PATH>? set rofi configuration
@@ -825,14 +825,14 @@ USAGE
825825
[END]
826826
USAGE
827827
;;
828-
emoji) #? [*] Emoji selector\nﯦ Add 'emoji_style=2'\n 1 = list\n 2 = grid
828+
emoji) #? [*] Emoji selector\nﯦ Add 'emoji_style=2'\n 1 = list\n 2 = grid
829829
shift
830830
Launch-Emoji "${@}"
831831
: <<USAGE
832832
[SHOW_EMOJI_USAGE]
833833
--style ? use style [ 1 | 2 ]
834834
--rasi <PATH>? set rofi configuration
835-
--deps ? check and resolve dependencies
835+
--deps ? check and resolve dependencies
836836
[END]
837837
USAGE
838838
;;
@@ -861,7 +861,7 @@ USAGE
861861
screencap) #? Use rofi to select screenshot options \n !! kills another rofi session
862862
Launch-Screencap
863863
;;
864-
search) #? [*] Web Search\nﯦ supports shorthand e.g 'g: some thing' (this uses google.com to search for 'some thing')\nﯦ ':' is use as delimiter\nﯦ Custom search-engines should be in 'search.lst' and be declared inside ./hyde.conf ( e.g search_file="$HOME/.config/hyde/search.lst" )
864+
search) #? [*] Web Search\nﯦ supports shorthand e.g 'g: some thing' (this uses google.com to search for 'some thing')\nﯦ ':' is use as delimiter\nﯦ Custom search-engines should be in 'search.lst' and be declared inside ./hyde.conf ( e.g search_file="$HOME/.config/hyde/search.lst" )
865865

866866
shift
867867
Launch-Search "${@}"
@@ -884,7 +884,7 @@ USAGE
884884
run() { #? Executable utilities
885885
case $1 in
886886

887-
airplane_mode) #? Toggle airplane mode\n\tﯦ Toogles wifi
887+
airplane_mode) #? Toggle airplane mode\n\tﯦ Toogles wifi
888888
airplane-mode
889889
;;
890890
audio_idle) #? Inhibits idle when player status: 'Playing
@@ -908,7 +908,7 @@ run() { #? Executable utilities
908908
--print-monitor ? Print focused monitor
909909
--scan ? Use 'tesseract' to scan image then add to clipboard
910910
--stop ? Stop every instance of Screencap
911-
--reset ? Reinitialize
911+
--reset ? Reinitialize
912912
--deps ? Check and resolve dependencies
913913
[END]
914914
USAGE
@@ -999,10 +999,10 @@ USAGE
999999
reload() { #? Just reload
10001000
if [[ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]]; then
10011001
box_me "Reloading Dots"
1002-
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && $HOME/.local/share/bin/swwwallcache.sh -t ""
1003-
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && $HOME/.local/lib/hyde/swwwallcache.sh -t ""
1002+
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && "$HOME/.local/share/bin/swwwallcache.sh" -t ""
1003+
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && "$HOME/.local/lib/hyde/swwwallcache.sh"-t ""
10041004
{ [ -n "$hydeTheme" ] && "${scrDir}/themeswitch.sh" -s "$hydeTheme"; } || "${scrDir}/swwwallcache.sh"
1005-
1005+
10061006
fi
10071007
}
10081008

Scripts/GLOBAL-hyde

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export ctl_override
4040

4141
scrDir=""$(dirname $(which globalcontrol.sh 2>/dev/null) 2>/dev/null)""
4242
[ ! -e "${scrDir}/globalcontrol.sh" ] && export scrDir="$HOME/.local/share/bin/"
43+
[ ! -e "${scrDir}/globalcontrol.sh" ] && export scrDir="$HOME/.local/lib/hyde/"
4344
[ ! -e "${scrDir}/globalcontrol.sh" ] && [[ ${is_fresh_install} != true ]] && handle_error "Scripts for HyDE not detected at ${scrDir}"
4445

4546
export scrDir

Scripts/Patch-Theme

+18-15
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,23 @@ Supported Archive Format:
6969
| Gtk_ | \$GTK_THEME | \$HOME/.themes |
7070
| Icon_ | \$ICON_THEME | \$HOME/.icons |
7171
| Cursor_ | \$CURSOR_THEME | \$HOME/.icons |
72-
| Sddm_ | \$SDDM_THEME | /usr/share/sddm/themes |
72+
| Sddm_ | \$SDDM_THEME | /usr/share/sddm/themes |
7373
| Font_ | \$FONT | \$HOME/.local/share/fonts |
7474
| Document-Font_ | \$DOCUMENT_FONT | \$HOME/.local/share/fonts |
7575
| Monospace-Font_ | \$MONOSPACE_FONT | \$HOME/.local/share/fonts |
7676
77-
Note:
78-
Target directories without enough permissions will be skipped.
77+
Note:
78+
Target directories without enough permissions will be skipped.
7979
run 'sudo chmod -R 777 <target directory>'
8080
example: 'sudo chmod -R 777 /usr/share/sddm/themes'
8181
HELP
8282
}
8383

84-
8584
select_theme_wallpaper() {
86-
[ "${SINGLE_THEME_ONLY}" = true ] || return
87-
wallpapers="$(find "${Fav_Theme_Dir}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | Fzf-Menu "${FUNCNAME[0]}" )"
88-
print_prompt -g "[wallpapers]"
89-
awk -F "${Fav_Theme_Dir}" '{print $2}' <<< "${wallpapers}"
85+
[ "${SINGLE_THEME_ONLY}" = true ] || return
86+
wallpapers="$(find "${Fav_Theme_Dir}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | Fzf-Menu "${FUNCNAME[0]}")"
87+
print_prompt -g "[wallpapers]"
88+
awk -F "${Fav_Theme_Dir}" '{print $2}' <<<"${wallpapers}"
9089
}
9190

9291
if [[ -z $1 || -z $2 ]]; then
@@ -162,9 +161,9 @@ while IFS= read -r fchk; do
162161
print_prompt -y "[!!] " "${fchk} --> do not exist in ${Theme_Dir}/Configs/"
163162
fi
164163
done <<<"$config"
165-
if [ -f "${Fav_Theme_Dir}/theme.dcol" ];then
166-
print_prompt -n "[ok] " "found theme.dcol to override wallpaper dominant colors"
167-
restore_list+="Y|Y|\${HOME}/.config/hyde/themes/${Fav_Theme}|theme.dcol|hyprland\n"
164+
if [ -f "${Fav_Theme_Dir}/theme.dcol" ]; then
165+
print_prompt -n "[ok] " "found theme.dcol to override wallpaper dominant colors"
166+
restore_list+="Y|Y|\${HOME}/.config/hyde/themes/${Fav_Theme}|theme.dcol|hyprland\n"
168167
fi
169168
readonly restore_list
170169

@@ -262,13 +261,13 @@ for indx in "${!prefix[@]}"; do
262261
[[ "${FORCE_THEME_UPDATE}" = true ]] || { [ -d "${tgtDir[indx]}/${tgtChk}" ] && print_prompt -y "[skip] " "\"${tgtDir[indx]}/${tgtChk}\" already exists" && continue; }
263262
print_prompt -g "[extracting] " "${tarFile} --> ${tgtDir[indx]}"
264263
if [ ! -w "${tgtDir[indx]}" ]; then
265-
# Sddm themes can still be accessible
264+
# Sddm themes can still be accessible
266265
NOTIFY -a "[HyDE-CLI] " "Run 'sudo chmod -R 777 ${tgtDir[indx]}' to set the permissions one time" -t 10
267266
print_prompt -c "[note] " "Run 'sudo chmod -R 777 ${tgtDir[indx]}' to set the permissions one time"
268267
print_prompt -r "[skip] " "${tarFile} =! ${tgtDir[indx]} permission not set"
269268
continue
270-
elif [ ! -w "${tgtDir[indx]}/${tgtChk}" ];then
271-
tar -xf "${tarFile}" -C "${cacheDir}/landing"
269+
elif [ ! -w "${tgtDir[indx]}/${tgtChk}" ]; then
270+
tar -xf "${tarFile}" -C "${cacheDir}/landing"
272271
chmod -R 775 "${cacheDir}/landing/${tgtChk}"
273272
mv "${cacheDir}/landing/${tgtChk}" "${tgtDir[indx]}/"
274273
else
@@ -288,6 +287,10 @@ echo -en "${restore_list}" >"${Theme_Dir}/restore_cfg.lst"
288287
trap 'rm "${Theme_Dir}/restore_cfg.lst"' EXIT
289288
print_prompt -g "\n[exec] " "restore_cfg.sh \"${Theme_Dir}/restore_cfg.lst\" \"${Theme_Dir}/Configs\" \"${Fav_Theme}\"\n"
290289
"${CloneDir}/Scripts/restore_cfg.sh" "${Theme_Dir}/restore_cfg.lst" "${Theme_Dir}/Configs" "${Fav_Theme}" &>/dev/null
291-
[ "${3}" == "--skipcaching" ] || "$HOME/.local/share/bin/swwwallcache.sh" -t "${Fav_Theme}"
290+
291+
if [ "${3}" == "--skipcaching" ]; then
292+
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && "$HOME/.local/share/bin/swwwallcache.sh" -t "${Fav_Theme}"
293+
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && "$HOME/.local/lib/hyde/swwwallcache.sh" -t "${Fav_Theme}"
294+
fi
292295

293296
exit 0

0 commit comments

Comments
 (0)