Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/tabs/applications-setup/dwmtitus-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@
fi
}


batteryShown() {
if ls /sys/class/power_supply/ 2>/dev/null | grep -q '^BAT'; then

Check warning on line 166 in core/tabs/applications-setup/dwmtitus-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. Raw Output: ./core/tabs/applications-setup/dwmtitus-setup.sh:166:8: warning: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. (ShellCheck.SC2010)
sed -i '35s/^\(.\{36\}\)/\1'" battery"'/' "$HOME/.local/dwm-titus/polybar/themes/minimal/config.ini"
fi
Comment on lines +166 to +168
Copy link
Collaborator

@adamperkowski adamperkowski Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ls /sys/class/power_supply/ 2>/dev/null | grep -q '^BAT'; then
sed -i '35s/^\(.\{36\}\)/\1'" battery"'/' "$HOME/.local/dwm-titus/polybar/themes/minimal/config.ini"
fi
for p in /sys/class/power_supply/BAT*; do
if [[ -e "$p" ]]; then
sed -i '35s/^\(.\{36\}\)/\1 battery/' "$HOME/.local/dwm-titus/polybar/themes/minimal/config.ini"
fi
done

idk if that was ur intention but ur implementation would only run on the first file it matches. also shellcheck and also cleaned up this regex mess

}

checkEnv
checkEscalationTool
setupDisplayManager
Expand Down
Loading