-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide battery when none is detected #651
Comments
You can easily disable the battery module, it's not hard-baked into the bar. If you want to remove it from your setup (like I do on my pc), you can simply remove it from the json entry in the settings window as shown in the wiki here. |
I read the documentation and checked out your link. I imported the text sample as a config.json into hyprpanel. I don't know how I'd remove the battery module. |
Simply delete the "battery" entry in the imported text if it's there. You can do this entirely within the GUI. If it's not there in the GUI field make sure you hit enter to confirm the selection. If it still doesn't work, kill hyprpanel and run it again with If it still somehow doesn't work, you can search for
This is a bit drastic though, it should be fine to do it all in the GUI. Still good to manually edit the file if you completely ruin something like set transparency to 100% (then obviously can't see what you're selecting lol). edit: clarification |
Thanks, I'll try when I have time. 👍 |
So the option to enable modules in hyprpanel is not in the module sections themselves, but in the top section of the "bar" tab itself. The reason why you can't see it in your config is that it's currently set to default values and won't be explicitly overwritten in your configuration. If you want to remove it, scroll to the top of the gui entry where it is in your screenshot. You'll see a text field at the very top, and a .json entry in that field. Scroll right using your arrow keys to get to the "battery" entry and delete it along with the associated comma. Then everything should work. |
Just want to remark, a simple "remove from the bar" works for this case, but I would like to request the feature to be added. Use case is sharing the same bar config between my pc and my laptop, where the pc just shows "0%" in the component. It would be a nice QOL, and I know that it's a bit too niche 🙃 |
I second having this feature. I don't believe adding it will be too hard as long as we address the edge cases correctly. A basic implementation would follow: isVisible: batteryService.is_present, In the event that the bar still needs to be accessible for the brightness slider (I'm not sure if devices with a battery but without brightness exist), you could add an optional condition to check if the brightness is above 0. This could cause problems on the edge case that you launch hyprpanel with 0 brightness. A possible fix for this would require a change to Astal to allow for the max to be called as a field of the brightness service (the battery icon should perhaps also be changed in this case). I'm new to using Hyprpanel so if I got anything wrong about implementation I apologise in advance. |
This is what helped. Thanks. |
Is your feature request related to a problem? Please describe.
I use a desktop PC that has no battery. But the battery module just shows that I have 0%.
Describe the solution you'd like
It would be great if, instead of just saying 0%, it would hide the battery icon automatically.
The text was updated successfully, but these errors were encountered: