Battery percent on login screen?

As the title suggests, is this possible?

I’ve tried looking online and in this forum but the only thing I could find was a script in the Mint forum, which being based on different distros could cause problems since I don’t have much knowledge on Mint.

If anyone’s curious the Mint script is here: Mint script for showing battery level on login screen
If not, then I will accept showing it in the TTY as an alternative, which I have found solutions for.

Appreciate any assistance!

under Settings → System → Greeter settings (it’s some longer name) → thePanel Tab
is an item called “Power”
the Battery icon (along with percentage when you hover over it) will be shown
when the system is actually disconnected from mains power and runs only on battery

3 Likes

Then why would you look for a script on the forum of a Debian based OS like Mint at all?

To have this on the login screen, the suggestion by @Nachlese is likely the best approach. The only other possibilities I’m aware of depend upon being logged in to the OS.

You might find related information via:

Good luck.

1 Like

I need to correct myself.
Manjaro Xfce4 uses the lightdm-gtk-greeter - and I just assumed that the “power” item was “it”.
Not true - and I can’t even really test it because that is a VM with, of course, no battery even present or defined.

My real machine is Linux Mint, which uses the slick greeter - and there you can actually select the battery indicator to be shown or hidden.

The option in the config file /etc/lightdm/lightdm-gtk-greeter.conf
(where the greeter section is)
should be:

[Greeter]
...
...
show-power=true

or:
show-power=false
respectively

Use an editor and add it,
if there is no graphical way to configure it - I can’t test it for my VM does not even have a battery.

You might have inadvertently missed that lightdm-slick-greeter is also compatible with XFCE (and Manjaro), when using LightDM (DE):

@TC_neva

Please see the link previously given:

  • LightDM
    (See the list of supported greeters under the Greeters heading).

You will see that lightdm-slick-greeter is listed there.

If as @Nachlese suggests, the battery indicator is also available in lightdm-slick-greeter, it should be easily configurable.

Scroll down further in the link given for configuration information.


lightdm-slick-greeter is available from the Manjaro extra repository:

pacman -Si lightdm-slick-greeter

Install the greeter with:

sudo pacman -Syu lightdm-slick-greeter

Cheers.

No, I didn’t. Perhaps a slight misunderstanding here.
But I didn’t realize at first that this was not what I was dealing with - the gtk-greeter is installed by default in my Manjaro Xfce.
Of course it can be installed - the greeters can be changed.

That is perhaps not necessary though - I simply cannot test whether the battery indicator can be switched on/off the same way in both the slick-greeter and the gtk-greeter, because there is no battery available in my VM.

Sadly, that’s a problem with most Virtual Machines; at least those I’ve used. It must be difficult to simulate a power source. :smile_cat:

If you want LinuxMint lightdm-slick-greeter to replace Manjaro greeter,
I also suggest install lightdm-settings to configure the slick-greeter

$ pamac install lightdm-settings
Preparing...
                                                                                     
Resolving dependencies...                                                                                               
 
To install (5):
  libgnomekbd            1:3.28.1-1  (Required By: lightdm-settings)  extra  
  xapp                   2.8.5-1     (Required By: lightdm-settings)  extra  219.1 kB
  lightdm-slick-greeter  2.0.6-1     (Required By: lightdm-settings)  extra  891.4 kB
  python-setproctitle    1.3.3-2     (Required By: lightdm-settings)  extra  14.9 kB
  lightdm-settings       2.0.5-1                                      extra  142.1 kB
1 Like

It was just what appeared in my searches and thought it might of been a universal solution rather than specifically for Mint, also it could of provided a hint for a solution.

Unfortunately this doesn’t appear to work.

Thanks for the input everyone :slight_smile:
I’m thinking for the time being using command-line utilities.

1 Like

I know it works with the slick greeter, so you’ll have to change to that one if you want the battery icon.

I just tried with the gtk-greeter on real hardware to test my guess
but couldn’t make it work.

with slick greeter it does work