Score:2

How to remove the battery icon from the topbar and stop estimating battery life?

cn flag

I have moved to ubuntu(21.04) from Windows recently. So I know very little about linux. I have an old laptop and its battery is dead. I run the laptop directly from the charger. At the topbar it keeps showing the battery icon which is trying to estimate the battery life and disappears in a second. This keeps going all the time. This is very annoying to me. So I am trying to find a way to remove the battery icon from topbar and stop estimating battery life.

I have tried sudo apt-get remove indicator-power which shows

Package 'indicator-power' is not installed, so not removed

24601 avatar
in flag
will it disappear if you remove the battery from the laptop?
galexite avatar
pk flag
@24601, the reference is for GNOME Shell, not Unity.
24601 avatar
in flag
@galexite and it didn't solve the problem...
galexite avatar
pk flag
Yes, I realised after looking again, apologies for that!
galexite avatar
pk flag
This answer is a bit more complicated than it should be, and the first `gsettings` command doesn't work, but these extensions might provide a workaround? https://askubuntu.com/a/1143362/287379
galexite avatar
pk flag
The problem is, that the 'Extend Panel Menu' extension is not compatible with the GNOME Shell which comes with 21.04...
Raisi Biden avatar
cn flag
@24601 When I remove the battery problem is solved automatically. But I want it solved with the battery inserted in the laptop. Without the battery the laptop looks bad :)
Raisi Biden avatar
cn flag
@galexite That answer is very complicated and seems it won’t work.
24601 avatar
in flag
That works because Linux automatically recognises the battery presence in the same way it does on a desktop connected to a UPS. Aesthetics aside, I don't think you will find a better solution tbh
galexite avatar
pk flag
@RaisiBiden I think it would be worth filing a feature request to the GNOME Shell community to introduce a new configuration flag to be able to disable the battery icon. Alternatively as a workaround, and rather hesitantly as a GNOME user, you can choose another desktop environment, like `xubuntu-desktop` or `kubuntu-desktop`, which provide far more configuration. There, you can simply right click the panel, and remove the icon entirely.
br flag
@RaisiBiden removing the icon is possible but "stop estimating" seems tough.
Raisi Biden avatar
cn flag
@UnKNOWn Can you tell me how?
br flag
Sure, I will write the command now.
br flag
`gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval string:'Main.panel.statusArea.aggregateMenu._power.hide();'`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.