Giter Site home page Giter Site logo

moredhel / battmon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robatbender/battmon

0.0 3.0 0.0 455 KB

Battmon is simple battery monitoring program written in python, especially for tiling window managers like xmonad, dwm or awesome.

Python 99.85% Shell 0.15%

battmon's Introduction

Battmon

Battmon is simple battery monitoring program written in python for Linux systems, which has especially in mind tiling window managers like xmonad, dwm or awesome.

Features:

  • very light (for really basic functionality you need have only python installed)
  • works in background
  • very configurable
  • no tray icon
  • pop-up notifications (need libnotify)
  • don't have to be run as root user
  • ... and more options can be given through the command line

Prerequisites:

  • python: for really basic functionality (>=3.2 and >=2.7 are supported, if you have older python version, install argparse)

Optional prerequisites:

  • libnotify: pop up notifications (works fine with dunst)
  • sox / pulseaudio: sounds
  • screen lock programs like: i3lock, xtrlock, xscreensaver, physlock, xlockmore etc, to lock user session before hibernating or suspending
    (you can specify your favorite screen locker through command line or in config.py file)
  • pm-utils: for hibernate, suspend or shutdown system on critical battery level (if not installed, the scripts in 'bin' directory will be used, see below)

Usage:

  • Just run:

    python ./battmon.py
    
  • to see all available options run Battmon with -h or --help option.

Notes:

  • Currently systemd/upower isn't supported and probably will never be.

  • If you have pm-utils installed, then please remember that, following commands must been execute as a root user. To do so just edit /etc/sudoers file and add something similar like this, replacing username with your own user name:

    your_username ALL = NOPASSWD: /usr/sbin/pm-hibernate
    your_username ALL = NOPASSWD: /usr/sbin/pm-suspend
    your_username ALL = NOPASSWD: /usr/sbin/pm-suspend-hybrid
    

    or enable it for a group, remember to replace group and PATH_TO_BATTMON:

    %your_group ALL = NOPASSWD: /usr/sbin/pm-hibernate
    %your_group ALL = NOPASSWD: /usr/sbin/pm-suspend
    %your_group ALL = NOPASSWD: /usr/sbin/pm-suspend-hybrid
    
  • If you don't have pm-utils installed, scripts in bin folder must be executed as a root, to allow regular user suspend, hibernate or shutdown computer. The easiest way to to do this, is to make this scripts accessible to normal user by running sudo without root password. To do so just edit /etc/sudoers file and add something like this, replacing username with your own user name and PATH_TO_BATTMON with absolute path to your Battmon folder:

    your_username  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/suspend.sh
    your_username  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/hibernate.sh
    your_username  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/shutdown.sh
    

    or enable it for a group, remember to replace group and PATH_TO_BATTMON:

    %your_group  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/suspend.sh
    %your_group  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/hibernate.sh
    %your_group  ALL = NOPASSWD: /PATH_TO_BATTMON/bin/shutdown.sh
    
  • Sound file is search by default in the same path where battmon was started, you can change this by parsing your path to your sound file using -sp argument without quotes.

  • You can specify your favor lock screen command using -lp argument in command line, if none given, then as default will be used first one found in SCREEN_LOCK_COMMANDS list variable in config.py file. You can also change default screenlock command editing DEFAULT_SCREEN_LOCK_COMMAND variable in internal_config.py file, but this will be overwritten when screen lock command was given in command line using -lp argument.

  • For more information about configuration see README file in Battmon directory

Bugs:

  • Please tell me ;)

battmon's People

Contributors

moredhel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.