Skip to content

Conversation

@Real-MullaC
Copy link
Contributor

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

Add's Battery for Laptop Users
image

Testing

None done as no VM (@ChrisTitusTech Test on your laptop)

Impact

HIgh for Laptop Users as it allows them to see there battery percentage

Issues / other PRs related

  • Resolves #

Additional Information

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

Copy link
Collaborator

@adamperkowski adamperkowski left a comment

Choose a reason for hiding this comment

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

hey guys remember me

Comment on lines +166 to +168
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
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

@Real-MullaC
Copy link
Contributor Author

hey guys remember me

I thought you died 🤣

@adamperkowski
Copy link
Collaborator

hey guys remember me

I thought you died 🤣

come on man
cant even take a break in this cruel world 😑

@adamperkowski
Copy link
Collaborator

Testing

None done as no VM (@ChrisTitusTech Test on your laptop)

based btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants