battery-wallpaper
Simple bash script to set an animated battery as desktop wallpaper. It's shows charging animation and changes according to battery percentage.
How to install
Follow the steps below (You can run test.sh to test it before installing it on your system) -
- Install acpi, xrandr(for xfce), feh or wallpaper
# On Archlinux
sudo pacman -Sy acpi xorg-xrandr feh
# On Ubuntu or Debian
sudo apt-get install acpi x11-xserver-utils feh
# On MacOS
brew install wallpaper
-
For swaywm support users must install oguri. The
oguridaemon must be started for the script to work.Ogurican be installed on Arch linux via AUR. -
Clone this repository and...
cd $HOME
git clone https://github.com/adi1090x/battery-wallpaper.git
cd battery-wallpaper
chmod +x install.sh
./install.sh
- Run the program and choose an option
$ bwall
Battery Wallpaper V2.0
Set desktop background according to battery percentage, with charging animation.
Developed By - Aditya Shakya (@adi1090x)
usage: bwall [-s] style [-d] delay [-h]
-s style name of icon/bg style.
-d delay set charging animation delay (default 0.8s).
-h help show this usage/help message.
Styles Dir: /usr/share/battery-wallpaper/images
Available styles: bonsai cartoon city city_alt colours cup_black cup_dark egg
faded industrial mechanical paper pixel_city slash space
Features
- 21 different types of battery wallpapers/icons.
- Shows battery charging animation.
- Stop animation when battery is fully charged.
- When not charging, icon changes according to battery percentage.
- Support dual or more batteries.
- User can add their own icons/styles/wallpapers.
- Tested on - WM: Openbox, i3wm, bspwm, awesomewm, Fluxbox, Fvwm, Swaywm & DE: KDE(neon), Pantheon, Gnome(ubuntu, pop_os), Deepin, Cinnamon, XFCE, LXDE, MATE.
Previews
Click To View
Bonsai
| Charging | Full |
|---|---|
![]() |
![]() |
Bar
| Charging | Full |
|---|---|
![]() |
![]() |
Cartoon
| Charging | Full |
|---|---|
![]() |
![]() |
Charge
| Charging | Full |
|---|---|
![]() |
![]() |
Colours
| Charging | Full |
|---|---|
![]() |
![]() |
Cup Black
| Charging | Full |
|---|---|
![]() |
![]() |
Cup Dark
| Charging | Full |
|---|---|
![]() |
![]() |
Egg
| Charging | Full |
|---|---|
![]() |
![]() |
Faded
| Charging | Full |
|---|---|
![]() |
![]() |
Frame
| Charging | Full |
|---|---|
![]() |
![]() |
Industrial
| Charging | Full |
|---|---|
![]() |
![]() |
Leaves
| Charging | Full |
|---|---|
![]() |
![]() |
Mechanical
| Charging | Full |
|---|---|
![]() |
![]() |
Panel
| Charging | Full |
|---|---|
![]() |
![]() |
Paper
| Charging | Full |
|---|---|
![]() |
![]() |
Slash
| Charging | Full |
|---|---|
![]() |
![]() |
Sweet
| Charging | Full |
|---|---|
![]() |
![]() |
Space
| Charging | Full |
|---|---|
![]() |
![]() |
Pixel City
| Charging | Full |
|---|---|
City
| Charging | Full |
|---|---|
![]() |
![]() |
City Alt
| Charging | Full |
|---|---|
![]() |
![]() |
Common Issues
-
Wallpaper not changing : If your wallpaper is not changing, then open an issue and show me the output of
echo $DESKTOP_SESSION. -
Not working on XFCE : If this script is not working on xfce, then open the terminal and run
xfconf-query -c xfce4-desktop -mand change the wallpaper (any) via xfce4-settings-manager.
In terminal, xfconf-query will print lines starting withset:, which show which properties have been changed, checkscreen&monitorvalues and modify the script accordingly.
73 ## For XFCE
74 if [[ "$OSTYPE" == "linux"* ]]; then
75 SCREEN="0"
76 MONITOR="1"
77 fi
- Autostart : If you want to autostart the script with desktop, you can add it to your WM autostart file & if doesn't work for you, you can create a
desktop filein$HOME/.config/autostartdir.
$ cd $HOME/.config/autostart && touch bwall.desktop
# Add this to dwall.desktop file
[Desktop Entry]
Name=Battery Wallpaper
Comment=Set desktop background according to battery percentage, with charging animation.
Exec=/usr/bin/bwall -s leaves &
Type=Application
Icon=wallpaper
Categories=Accessories;Support This Project
FYI
- If you can improve it, you're welcome.
- You can add bwall -s style & to your wm autostart file to set it as wallpaper after login.
- Have Fun!









































