Skip to content

Commit d3a4085

Browse files
committed
chore: new fixes debug option and sub option
fix: xsettingsd is freezing in --reload option upd: add debug option and its description
1 parent 55b7e53 commit d3a4085

File tree

7 files changed

+37
-21
lines changed

7 files changed

+37
-21
lines changed

scripts/apply.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ set_THEME() {
5757
# Reload Gtk themes using xsettingsd
5858
reloadTHEMES() {
5959
verbose info "Reloading Gtk & Icon themes"
60-
(pgrep -x xsettingsd && pkill -HUP xsettingsd)>/dev/null 2>&1
61-
xsettingsd --config "$XSETTINGSD_CONF">/dev/null 2>&1
62-
gtk-update-icon-cache "$USER_ICONS_FOLDER/">/dev/null 2>&1 &
60+
if command -v 'xsettingsd'>$LOG_FILEPATH; then
61+
(pidof "xsettingsd" && pkill -HUP xsettingsd)>$LOG_FILEPATH 2>&1
62+
xsettingsd --config "$XSETTINGSD_CONF">$LOG_FILEPATH 2>&1 &
63+
fi
64+
gtk-update-icon-cache "$USER_ICONS_FOLDER/">$LOG_FILEPATH 2>&1 &
6365
}
6466

6567
# Still pywalfox uses 'The Default OutDir in pywal so just link them to the default'

scripts/config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Default options config values
44
GUI=false
55
LOAD=false
6+
DEBUG=false
67
RESET=false
78
SETUP=false
89
RELOAD=false

scripts/dialogs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SETUPS=( wallBACK "Backend In Use" off \
1919
# Start Configuration dialogs
2020
verbose info "Running kdialog for configuration..." &
2121
ToCONFIG=$( kdialog --checklist "Available Configs" "${SETUPS[@]}" --separate-output )
22-
assignTEMPCONF >/dev/null && [[ -z $ToCONFIG ]] && cancelCONFIG
22+
assignTEMPCONF >$LOG_FILEPATH && [[ -z $ToCONFIG ]] && cancelCONFIG
2323
theming_values() {
2424
THEME_MODE=$( kdialog --yes-label "Light" --no-label "Dark" \
2525
--yesno "Select an theme mode, it can be either:" && echo "light" || echo "dark")
@@ -31,7 +31,7 @@ theming_values() {
3131
# Configuration Dialogs
3232
for config in $ToCONFIG; do
3333
if [[ $config == 'wallGTK' ]] || [[ $config == 'wallICONS' ]]; then
34-
theming_values >/dev/null ; unset -f theming_values
34+
theming_values >$LOG_FILEPATH ; unset -f theming_values
3535
theming_values() { echo "" ; }
3636
fi
3737
case "$config" in

scripts/messages.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ are writen in the https://github.com/aKqir24/walset.
99
1010
Usage: $0 [OPTIONS]
1111
--gui: To launch a configuration GUI and apply the configurations.
12-
--reload: enables programs to reload after running pywal, eg.(gtk|icons|wm)
1312
--setup: Show dialogs that sets up the configurations in order.
14-
--reset: To remove all set features, and set them all to default.
15-
--verbose: To show log messages when each step of the script is executed.
16-
--help: to show how to use this script.
17-
--load: loads/applies the configurations.
13+
-D | --debug: shows all the messages of this script.
14+
-R | --reload: enables programs to reload after running pywal, eg.(gtk|icons|wm)
15+
-r | --reset: To remove all set features, and set them all to default.
16+
-V | --verbose: To show log messages when each step of the script is executed.
17+
-h | --help: to show how to use this script.
18+
-L | --load: loads/applies the configurations.
1819
"
1920
applied=()
2021

@@ -37,6 +38,14 @@ verbose() {
3738
[[ $1 == "error" ]] && exit 1
3839
fi
3940
}
41+
42+
# Debug option logic
43+
if ! $DEBUG; then
44+
LOG_FILEPATH=/dev/null
45+
else
46+
cat "$LOG_FILEPATH"
47+
fi
48+
4049
wallsetERROR() { verbose error "Failed to set wallpaper..."; exit 1; }
4150
pywalerror() { verbose error "Pywal16 ran into an error!\nplease run 'bash $0 --reset --load --verbose'" ; exit 1 ; }
4251
wallSETTERError() { verbose warning "No Wallpaper setter found!\nSo wallpaper is not set..."; }

scripts/startup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh
22

33
# Check for required dependencies
4-
command -v wal > /dev/null || verbose error "pywal16 is not installed, Please install it!"
4+
command -v wal > $LOG_FILEPATH || verbose error "pywal16 is not installed, Please install it!"
55
if $LOAD; then
6-
if $SETUP && ! command -v kdialog >/dev/null; then
6+
if $SETUP && ! command -v kdialog >$LOG_FILEPATH; then
77
verbose error "kdialog is not installed, Please install it!"
8-
elif $SETUP && ! command -v python3 >/dev/null; then
8+
elif $SETUP && ! command -v python3 >$LOG_FILEPATH; then
99
verbose error "python is not installed, Please install it!"
1010
fi
1111
fi

scripts/theming/programs/status/i3status_rust.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ write_toml "
1414
.theme.overrides.alternating_tint_bg = \"$color0\" |
1515
.theme.overrides.alternating_tint_fg = \"$color0\"" "$1"
1616

17-
pidof "i3status-rs" &>/dev/null && pkill i3status-rs
18-
[[ $XDG_CURRENT_DESKTOP == "i3" ]] && i3-msg reload >/dev/null
17+
pidof "i3status-rs" &>$LOG_FILEPATH && pkill i3status-rs
18+
(i3-msg reload || swaymsg reload)>$LOG_FILEPATH 2>&1

walset.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ if [[ ! -e "$(pwd)/scripts" ]]; then
66
else
77
WORK_PATH="$(pwd)"
88
fi
9+
10+
LOG_FILEPATH="/tmp/wlaset.log"
911
SCRIPT_PATH="$WORK_PATH/scripts"
1012
SCRIPT_FILES=(messages paths config startup apply)
1113
for script in "${SCRIPT_FILES[@]}"; do . "$SCRIPT_PATH/$script.sh"; done
1214

1315
# Options To be used
1416
# TODO: Debug option
15-
OPTS=$(getopt -o -v --long verbose,reset,load,reload,setup,gui,help -- "$@") ; eval set -- "$OPTS"
17+
OPTS=$(getopt -o VRDLrh --long gui,setup,reset,debug,verbose,load,reload,help -- "$@")
18+
[ $? -ne 0 ] && exit 1 && eval set -- "$OPTS"
1619
while true; do
1720
case "$1" in
1821
--gui) GUI=true; shift;;
1922
--setup) SETUP=true; shift;;
20-
--reset) RESET=true; shift ;;
21-
--verbose) VERBOSE=true; shift ;;
22-
--load) LOAD=true; shift;;
23-
--reload) RELOAD=true; shift;;
24-
--help) echo "$HELP_MESSAGE"; exit 0;;
23+
-R | --reset) RESET=true; shift ;;
24+
-D | --debug) DEBUG=true; shift ;;
25+
-V | --verbose) VERBOSE=true; shift ;;
26+
-L | --load) LOAD=true; shift;;
27+
-r | --reload) RELOAD=true; shift;;
28+
-h | --help) echo "$HELP_MESSAGE"; exit 0;;
2529
*) shift; break ;;
2630
esac
2731
done

0 commit comments

Comments
 (0)