https://github.com/adi1090x/battery-wallpaper
Simple bash script to set wallpaper according to battery percentage with charging animations.
https://github.com/adi1090x/battery-wallpaper
adi1090x arch-linux archcraft bash bash-scripts battery-information battery-monitor battery-status battery-wallpaper battery-widget debian dynamic-wallpaper linux live-wallpaper ubuntu unixporn wallpaper-changer wallpaper-engine wallpaper-manager
Last synced: 9 days ago
JSON representation
Simple bash script to set wallpaper according to battery percentage with charging animations.
- Host: GitHub
- URL: https://github.com/adi1090x/battery-wallpaper
- Owner: adi1090x
- License: gpl-3.0
- Created: 2020-02-18T15:27:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T14:35:10.000Z (over 1 year ago)
- Last Synced: 2025-03-30T09:06:42.923Z (16 days ago)
- Topics: adi1090x, arch-linux, archcraft, bash, bash-scripts, battery-information, battery-monitor, battery-status, battery-wallpaper, battery-widget, debian, dynamic-wallpaper, linux, live-wallpaper, ubuntu, unixporn, wallpaper-changer, wallpaper-engine, wallpaper-manager
- Language: Shell
- Homepage:
- Size: 17.4 MB
- Stars: 396
- Watchers: 5
- Forks: 22
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - adi1090x/battery-wallpaper
- awesome - adi1090x/battery-wallpaper - Simple bash script to set wallpaper according to battery percentage with charging animations. (Shell)
README
![]()
![]()
![]()
![]()
![]()
![]()
A simple
bash
script to set an animated battery as desktop wallpaper. It shows charging animation and changes according to battery percentage.
### Overview
+ 21 different types of battery wallpapers/icons.
+ Shows battery charging animation.
+ Stop animation when the battery is fully charged.
+ When not charging, the wallpaper/icon changes according to battery percentage.
+ Users can add their own icons/styles/wallpapers.
+ Tested on :
- **`Window Managers`** : Works on all window managers (tested on all WMs Archcraft have)
- **`Wayland Compositors`** : `sway`, `wayfire`, `river`, `newm`, `hyprland`
- **`Desktop Environments`** : `KDE`, `Pantheon`, `Gnome`, `Deepin`, `Cinnamon`, `XFCE`, `LXDE`, `MATE`, `Zorin`, `Budgie`### Dependencies
Install Following programs on your system before using `bwall` -
- **`acpi`** : To get battery and charging data
- **`feh`** : To set wallpapers on WMs
- **`xrandr`** : Only if you're using XFCE desktopInstall `acpi`, `feh` and `xrandr` -
```bash
# On Archlinux
$ sudo pacman -Sy acpi feh xorg-xrandr# On Ubuntu or Debian
$ sudo apt-get install acpi feh x11-xserver-utils
```> For swaywm support users must install [oguri](https://github.com/vilhalmer/oguri). The `oguri` daemon must be started for the script to work. `Oguri` can be installed on Arch linux via [AUR](https://aur.archlinux.org/packages/oguri-git/).
### Installation
Follow the step below to install `bwall` on your system -
> You can run `test.sh` to test it before installing it on your system.+ Clone this repository -
```
$ git clone https://github.com/adi1090x/battery-wallpaper.git
```+ Change to cloned directory and run `install.sh` -
```
$ cd battery-wallpaper
$ chmod +x install.sh
$ ./install.sh
```### Run the program
+ Open the terminal and execute `bwall` -
```
$ bwall┏┓ ┏━┓╺┳╸╺┳╸┏━╸┏━┓╻ ╻ ╻ ╻┏━┓╻ ╻ ┏━┓┏━┓┏━┓┏━╸┏━┓
┣┻┓┣━┫ ┃ ┃ ┣╸ ┣┳┛┗┳┛ ┃╻┃┣━┫┃ ┃ ┣━┛┣━┫┣━┛┣╸ ┣┳┛
┗━┛╹ ╹ ╹ ╹ ┗━╸╹┗╸ ╹ ┗┻┛╹ ╹┗━╸┗━╸╹ ╹ ╹╹ ┗━╸╹┗╸Bwall V3.0 : Set desktop wallpaper according to battery percentage.
Developed By : Aditya Shakya (@adi1090x)Usage : bwall.sh [-h] [-d] delay [-s style]
Options:
-h Show this help message
-d num Set charging animation delay (default 0.8s)
-s style Name of the wallpaper style to apply
Available styles: bar bonsai cartoon charge city city_alt colours cup_black cup_dark egg
faded frame industrial leaves mechanical panel paper pixel_city slash space sweetExamples:
bwall.sh -s bonsai Set wallpaper from 'bonsai' style
bwall.sh -d 1 -s bar Set wallpaper from 'bar' style with 1sec delay
```+ Select the style you like and run -
```
$ bwall -s bonsai
[*] Using style : bonsai
```### 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
1. **Wallpaper not changing** : If your wallpaper is not changing, then open an issue and show me the output of `echo $DESKTOP_SESSION`.
2. **Not working on XFCE** : If this script is not working on xfce, then open the terminal and run `xfconf-query -c xfce4-desktop -m` and change the wallpaper (any) via *xfce4-settings-manager*.
In the terminal, *xfconf-query* will print lines starting with `set:`, which show which properties have been changed, check `screen` & `monitor` values and modify the script accordingly.
```bash
110 ## For XFCE
111 if [[ "$OSTYPE" == "linux"* ]]; then
112 SCREEN="0"
113 MONITOR="1"
114 fi```
3. **Autostart** : If you want to autostart the script with desktop, you can add it to your WM autostart file & if it doesn't work for you, you can create a `desktop file` in `$HOME/.config/autostart` dir.
```bash
$ cd $HOME/.config/autostart && touch bwall.desktop# Add this to bwall.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;
```### Quick FYI
+ In KDE, `bwall` changes the wallpaper in all the Activities.
+ You can add ***bwall -s style &*** to your wm autostart file to set it as wallpaper after login.
+ Have Fun!