battery-wallpaper

授权协议 GPL-3.0 License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 太叔炎彬
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

A simple bash script to set an animated battery as desktop wallpaper. It shows charging animation and changes according to battery percentage.

gif

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 : Openbox, i3wm, bspwm, awesomewm, Fluxbox, Fvwm, Swaywm
    • Desktop Environments : KDE, Pantheon, Gnome, Deepin, Cinnamon, XFCE, LXDE, MATE

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 desktop

Install acpi, feh and xrandr -

# 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. The oguri daemon must be started for the script to work. Oguri can be installed on Arch linux via AUR.

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 V2.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  sweet  

Examples: 
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
gif gif

Bar

Charging Full
gif gif

Cartoon

Charging Full
gif gif

Charge

Charging Full
gif gif

Colours

Charging Full
gif gif

Cup Black

Charging Full
gif gif

Cup Dark

Charging Full
gif gif

Egg

Charging Full
gif gif

Faded

Charging Full
gif gif

Frame

Charging Full
gif gif

Industrial

Charging Full
gif gif

Leaves

Charging Full
gif gif

Mechanical

Charging Full
gif gif

Panel

Charging Full
gif gif

Paper

Charging Full
gif gif

Slash

Charging Full
gif gif

Sweet

Charging Full
gif gif

Space

Charging Full
gif gif

Pixel City

Charging Full
gif gif

City

Charging Full
gif gif

City Alt

Charging Full
gif gif

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.

110   ## For XFCE
111   if [[ "$OSTYPE" == "linux"* ]]; then
112      SCREEN="0"
113      MONITOR="1"
114   fi
  1. 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.
$ 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!
 相关资料
  • Battery 是一种基于Web浏览器的2D滚动Arcade游戏。玩家控制的飞机在自上而下的方向射击敌人飞机,直升机和坦克。

  • This plugin provides an implementation of an old version of the Battery Status Events API. It adds the following three events to the window object: batterystatus batterycritical batterylow Application

  • Battery Historian Battery Historian 是一个通过分析安卓 "bugreport" 进程文件来统计电量消费情况。它允许应用程序开发人员在时间线上可视化系统和应用程序级事件,具有平移和缩放功能,在设备上完全充电后可以轻松查看各种汇总统计信息,并能选择应用程序,检查影响应用程序特定电池的指标。 它还允许两个错误报告的A / B比较,突出显示关键电池相关指标的差异。 展示

  • 采用Java开发的坦克大战Battle City Tank游戏。在线试玩:http://java.kernel.lv/battery.jsp

  • Juice 可以让电源信息更有趣。 利用苹果 IOKit 框架提供的大量关于计算机状态的信息和触发器,获取电源信息,并在这些源的值发生变化时生成回调。并且更进一步,可以根据自己的喜好定义电源信息。

  • Vista Battery Saver 这是用来给你的Vista省电的软件 ,它将关闭一些很玄的效果,据说可以节省 70%的电(是不是夸张了哦?) 界面如下:

相关阅读

相关文章

相关问答

相关文档