Skip to content

Commit

Permalink
handles new HyDE
Browse files Browse the repository at this point in the history
  • Loading branch information
kRHYME7 committed Nov 19, 2024
1 parent 7eda316 commit d72141b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 36 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"[markdown]": {
"editor.defaultFormatter": "xaver.clang-format"
}
},
"makefile.configureOnOpen": false
}
40 changes: 20 additions & 20 deletions Hyde
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

CLI_PATH="$(dirname "$(dirname "${0}")")"
PATH=$PATH:${CLI_PATH}/lib/hyde-cli/
export CLI_PATH
export CLI_PATH
export PATH

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

Expand All @@ -108,7 +108,7 @@ version() { #? Hyde-cli version
repo_info
barLine
inform_updates
}
}
}

systeminfo() { #? System information
Expand Down Expand Up @@ -516,7 +516,7 @@ USAGE
select) #? Wallpaper selector
"${scrDir}"/swwwallselect.sh
;;
variety) #? [*] Use variety package to manage wallpapers\nﯦ Add 'exec-once=Hyde wallpaper variety' in ./userprfs.conf
variety) #? [*] Use variety package to manage wallpapers\nﯦ Add 'exec-once=Hyde wallpaper variety' in ./userprfs.conf
shift
Run-Wallpaper "${@}"
: <<USAGE
Expand Down Expand Up @@ -671,7 +671,7 @@ sddm() { #? Sddm commands
;;
info) #? Check sddm theme status
sddm_info
;;
;;
*) Parameters "${FUNCNAME[0]}" ;;

esac;
Expand Down Expand Up @@ -736,7 +736,7 @@ USAGE

}

code() { #? Code editor related commands
code() { #? Code editor related commands
case $1 in
# select) #! Selector for default Theme presets

Expand Down Expand Up @@ -766,7 +766,7 @@ HELP
codet=${*:-wallbash}
[[ "$*" == "-"* ]] && { help ; exit 1; }
readarray -t codeConf < <(find "${confDir}" -mindepth 1 -maxdepth 1 -type d -name "Code*" -o -name "VSCodium*" -o -name "Cursor" | sort)
print_prompt -y "Setting '${codet}' as code theme..."
print_prompt -y "Setting '${codet}' as code theme..."
for i in "${!codeConf[@]}" ; do
[ -d "${codeConf[i]}/User" ] || continue
[ -f "${codeConf[i]}/User/settings.json" ] || echo -e "{\n \"workbench.colorTheme\":\"wallbash\" \n}" > "${codeConf[i]}/User/settings.json"
Expand All @@ -788,7 +788,7 @@ show() { #? Useful GUI util
# Keybinds_Hint #! Moved to .extra
shift
diff "${etcDir}/keybinds_hint.sh" "${scrDir}/keybinds_hint.sh" > /dev/null || \
print_prompt +b "\n[changes available] " "copy '"${etcDir}/keybinds_hint.sh"' to '${scrDir}/keybinds_hint.sh' to update your keybinds_hint.sh"
print_prompt +b "\n[changes available] " "copy '"${etcDir}/keybinds_hint.sh"' to '${scrDir}/keybinds_hint.sh' to update your keybinds_hint.sh"
"${scrDir}"/keybinds_hint.sh "${@}"
: <<USAGE
[SHOW_BINDS_USAGE]
Expand All @@ -814,9 +814,9 @@ USAGE
[END]
USAGE
;;
calc) #? [*] Calculator (libqalculate)
calc) #? [*] Calculator (libqalculate)
shift
Launch-Calculator "${@}"
Launch-Calculator "${@}"
: <<USAGE
[SHOW_CALC_USAGE]
--rasi <PATH>? set rofi configuration
Expand All @@ -825,14 +825,14 @@ USAGE
[END]
USAGE
;;
emoji) #? [*] Emoji selector\nﯦ Add 'emoji_style=2'\n 1 = list\n 2 = grid
emoji) #? [*] Emoji selector\nﯦ Add 'emoji_style=2'\n 1 = list\n 2 = grid
shift
Launch-Emoji "${@}"
: <<USAGE
[SHOW_EMOJI_USAGE]
--style ? use style [ 1 | 2 ]
--rasi <PATH>? set rofi configuration
--deps ? check and resolve dependencies
--deps ? check and resolve dependencies
[END]
USAGE
;;
Expand Down Expand Up @@ -861,7 +861,7 @@ USAGE
screencap) #? Use rofi to select screenshot options \n !! kills another rofi session
Launch-Screencap
;;
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" )
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" )

shift
Launch-Search "${@}"
Expand All @@ -884,7 +884,7 @@ USAGE
run() { #? Executable utilities
case $1 in

airplane_mode) #? Toggle airplane mode\n\tﯦ Toogles wifi
airplane_mode) #? Toggle airplane mode\n\tﯦ Toogles wifi
airplane-mode
;;
audio_idle) #? Inhibits idle when player status: 'Playing
Expand All @@ -908,7 +908,7 @@ run() { #? Executable utilities
--print-monitor ? Print focused monitor
--scan ? Use 'tesseract' to scan image then add to clipboard
--stop ? Stop every instance of Screencap
--reset ? Reinitialize
--reset ? Reinitialize
--deps ? Check and resolve dependencies
[END]
USAGE
Expand Down Expand Up @@ -999,10 +999,10 @@ USAGE
reload() { #? Just reload
if [[ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]]; then
box_me "Reloading Dots"
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && $HOME/.local/share/bin/swwwallcache.sh -t ""
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && $HOME/.local/lib/hyde/swwwallcache.sh -t ""
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && "$HOME/.local/share/bin/swwwallcache.sh" -t ""
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && "$HOME/.local/lib/hyde/swwwallcache.sh"-t ""
{ [ -n "$hydeTheme" ] && "${scrDir}/themeswitch.sh" -s "$hydeTheme"; } || "${scrDir}/swwwallcache.sh"

fi
}

Expand Down
1 change: 1 addition & 0 deletions Scripts/GLOBAL-hyde
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export ctl_override

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

export scrDir
Expand Down
33 changes: 18 additions & 15 deletions Scripts/Patch-Theme
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,23 @@ Supported Archive Format:
| Gtk_ | \$GTK_THEME | \$HOME/.themes |
| Icon_ | \$ICON_THEME | \$HOME/.icons |
| Cursor_ | \$CURSOR_THEME | \$HOME/.icons |
| Sddm_ | \$SDDM_THEME | /usr/share/sddm/themes |
| Sddm_ | \$SDDM_THEME | /usr/share/sddm/themes |
| Font_ | \$FONT | \$HOME/.local/share/fonts |
| Document-Font_ | \$DOCUMENT_FONT | \$HOME/.local/share/fonts |
| Monospace-Font_ | \$MONOSPACE_FONT | \$HOME/.local/share/fonts |
Note:
Target directories without enough permissions will be skipped.
Note:
Target directories without enough permissions will be skipped.
run 'sudo chmod -R 777 <target directory>'
example: 'sudo chmod -R 777 /usr/share/sddm/themes'
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}"
[ "${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
Expand Down Expand Up @@ -162,9 +161,9 @@ while IFS= read -r fchk; do
print_prompt -y "[!!] " "${fchk} --> do not exist in ${Theme_Dir}/Configs/"
fi
done <<<"$config"
if [ -f "${Fav_Theme_Dir}/theme.dcol" ];then
print_prompt -n "[ok] " "found theme.dcol to override wallpaper dominant colors"
restore_list+="Y|Y|\${HOME}/.config/hyde/themes/${Fav_Theme}|theme.dcol|hyprland\n"
if [ -f "${Fav_Theme_Dir}/theme.dcol" ]; then
print_prompt -n "[ok] " "found theme.dcol to override wallpaper dominant colors"
restore_list+="Y|Y|\${HOME}/.config/hyde/themes/${Fav_Theme}|theme.dcol|hyprland\n"
fi
readonly restore_list

Expand Down Expand Up @@ -262,13 +261,13 @@ for indx in "${!prefix[@]}"; do
[[ "${FORCE_THEME_UPDATE}" = true ]] || { [ -d "${tgtDir[indx]}/${tgtChk}" ] && print_prompt -y "[skip] " "\"${tgtDir[indx]}/${tgtChk}\" already exists" && continue; }
print_prompt -g "[extracting] " "${tarFile} --> ${tgtDir[indx]}"
if [ ! -w "${tgtDir[indx]}" ]; then
# Sddm themes can still be accessible
# Sddm themes can still be accessible
NOTIFY -a "[HyDE-CLI] " "Run 'sudo chmod -R 777 ${tgtDir[indx]}' to set the permissions one time" -t 10
print_prompt -c "[note] " "Run 'sudo chmod -R 777 ${tgtDir[indx]}' to set the permissions one time"
print_prompt -r "[skip] " "${tarFile} =! ${tgtDir[indx]} permission not set"
continue
elif [ ! -w "${tgtDir[indx]}/${tgtChk}" ];then
tar -xf "${tarFile}" -C "${cacheDir}/landing"
elif [ ! -w "${tgtDir[indx]}/${tgtChk}" ]; then
tar -xf "${tarFile}" -C "${cacheDir}/landing"
chmod -R 775 "${cacheDir}/landing/${tgtChk}"
mv "${cacheDir}/landing/${tgtChk}" "${tgtDir[indx]}/"
else
Expand All @@ -288,6 +287,10 @@ echo -en "${restore_list}" >"${Theme_Dir}/restore_cfg.lst"
trap 'rm "${Theme_Dir}/restore_cfg.lst"' EXIT
print_prompt -g "\n[exec] " "restore_cfg.sh \"${Theme_Dir}/restore_cfg.lst\" \"${Theme_Dir}/Configs\" \"${Fav_Theme}\"\n"
"${CloneDir}/Scripts/restore_cfg.sh" "${Theme_Dir}/restore_cfg.lst" "${Theme_Dir}/Configs" "${Fav_Theme}" &>/dev/null
[ "${3}" == "--skipcaching" ] || "$HOME/.local/share/bin/swwwallcache.sh" -t "${Fav_Theme}"

if [ "${3}" == "--skipcaching" ]; then
[ -f "$HOME/.local/share/bin/swwwallcache.sh" ] && "$HOME/.local/share/bin/swwwallcache.sh" -t "${Fav_Theme}"
[ -f "$HOME/.local/lib/hyde/swwwallcache.sh" ] && "$HOME/.local/lib/hyde/swwwallcache.sh" -t "${Fav_Theme}"
fi

exit 0

0 comments on commit d72141b

Please sign in to comment.