Skip to content

Commit f332835

Browse files
committed
update: debug fix & changes
1 parent 1da1bbb commit f332835

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

scripts/apply.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22

33
# Function to apply wallpaper using pywal16
44
applyWAL() {
5-
generateGTKTHEME ; generateICONSTHEME
5+
downloadTemplates ; generateGTKTHEME ; generateICONSTHEME
66
verbose info "Running pywal to generate color scheme"
7-
#echo "wal $4 --backend $2 $3 -i $1 -n --out-dir $PYWAL_CACHE_DIR $5"
87
sh -c "wal -q $4 --backend $2 $3 -i $1 -n --out-dir $PYWAL_CACHE_DIR $5" || pywalerror
98
[[ -f $PYWAL_CACHE_DIR/colors.sh ]] && . "${PYWAL_CACHE_DIR}/colors.sh" # Load Colors & other values to be used
109
generateGTKTHEME 4 ; set_THEME "Icon" "Net/IconThemeName" && set_THEME "Gtk" "Net/ThemeName" ; applyToPrograms
1110
if $RELOAD; then reloadTHEMES; fi
1211
}
1312

13+
downloadTemplates() {
14+
if [[ ! -d $THEMING_ASSETS ]]; then
15+
if [[ ! -z $CUSTOM_THEME_ASSETS ]]; then
16+
curl -O "$CUSTOM_THEME_ASSETS" "$THEMING_ASSETS" | unzip - || \
17+
git clone "$CUSTOM_THEME_ASSETS" "$THEMING_ASSETS" || true
18+
verbose info "Downloading the custom theme template assets files"
19+
else
20+
git clone https://github.com/aKqir24/walset-pywal16-templates.git "$THEMING_ASSETS" || true
21+
verbose info "Cloning the default theme template assets repository"
22+
fi
23+
fi
24+
}
25+
1426
# Apply gtk theme / reload gtk theme
1527
generateGTKTHEME() {
1628
if $theming_gtk || $RESET; then

scripts/paths.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# DEFAULT PATHS FOR CONFIG:
4-
THEMING_ASSETS="$WORK_PATH/assets"
4+
THEMING_ASSETS="$HOME/.local/share/walset/assets"
55
DEFAULT_PYWAL16_OUT_DIR="$HOME/.cache/wal"
66
WALLPAPER_CONF_PATH="$HOME/.config/walset.toml"
77
XSETTINGSD_CONF="$HOME/.xsettingsd.conf"

scripts/theming/gtk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ for gtkCSSFile in "${GTK_CSS_FILES[@]}"; do
3030
theme_style_file="$USER_THEME_FOLDER/$base_name/$(basename "$gtkCSSFile")"
3131
[[ ! -e $temp_file_path ]] && ln -s "$base_file" "$temp_file_path"
3232
[[ ! -e $theme_style_file ]] && ln -sf "$PYWAL_CACHE_DIR/$gtk_tmp_file" "$theme_style_file"
33-
if [[ $XDG_SESSION_TYPE == "wayland" ]] && [[ $base_filename == "gtk-4.0.base" ]]; then
33+
if [[ ! -z $WAYLAND_DISPLAY ]] && [[ $base_filename == "gtk-4.0.base" ]]; then
3434
[[ ! -d "$WAYLAND_GTK4" ]] && mkdir -p "$WAYLAND_GTK4"
3535
ln -sf "$theme_style_file" "$WAYLAND_GTK4"
3636
ln -sf "$(dirname "$theme_style_file")/assets" "$WAYLAND_GTK4"

scripts/wallpaper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ set_wallpaper_with_mode() {
7171
fi
7272

7373
# Choose setter type
74-
if [[ "$wallpaper_animated" == true && "$wallpaper" == *.gif ]]; then
74+
if [[ "$wallpaper_animated" == true ]]; then
7575
WALL_SETTERS=(${WALL_SETTERS_ANIMATED[@]})
7676
else
7777
WALL_SETTERS=(${WALL_SETTERS_STATIC[@]})
@@ -90,7 +90,7 @@ set_wallpaper_with_mode() {
9090
WALL_SETTERS=(${WALL_SETTERS_STATIC[@]})
9191
choose_available_setter
9292
verbose sorry "Wallpaper doesn’t support animation, using static instead."
93-
else
93+
elif [[ "$wallpaper" == *.gif ]]; then
9494
image_path="$image_path.gif"
9595
fi
9696

walset.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#!/bin/bash
22

33
# Import all the scripts
4-
if [[ ! -e "$(pwd)/scripts" ]]; then
5-
WORK_PATH="$(dirname "$0")"
6-
else
7-
WORK_PATH="$(pwd)"
8-
fi
4+
[[ ! -e "$(pwd)/scripts" ]] && WORK_PATH="$(dirname "$0")" || WORK_PATH="$(pwd)"
95

106
LOG_FILEPATH="/tmp/walset.log"
117
SCRIPT_PATH="$WORK_PATH/scripts"
128
SCRIPT_FILES=(messages paths config startup apply)
139
for script in "${SCRIPT_FILES[@]}"; do . "$SCRIPT_PATH/$script.sh"; done
1410

1511
# Options To be used
16-
# TODO: Debug option
1712
OPTS=$(getopt -o VRDLrh --long gui,setup,reset,debug,verbose,load,reload,help -- "$@")
1813
[ $? -ne 0 ] && exit 1 && eval set -- "$OPTS"
1914
while true; do
@@ -31,7 +26,16 @@ while true; do
3126
done
3227

3328
# Debug option logic
34-
$DEBUG && cat "$LOG_FILEPATH" || LOG_FILEPATH=/dev/null
29+
debug() {
30+
if $DEBUG; then
31+
while true; do
32+
sleep 1 ; && cat "$LOG_FILEPATH"
33+
done
34+
else
35+
LOG_FILEPATH=/dev/null
36+
fi
37+
}
38+
debug &
3539

3640
# GUI dialog Configuration
3741
if $GUI && $SETUP; then

0 commit comments

Comments
 (0)