Package: bsnotifier
Battery Status Notifier (bsnotifier)Command line application that shows a popup window when the battery is low. This Python script can be used to notify
battery status ini3wmenvironments.Table of contentsGet startedInstallationUsageHow to use it with i3OptionsDevelopersTesting release with ToxRequirementsSet Python versionsRunStatic code analysis toolsSet up the Git hooks custom directoryPython Static CheckersShell Static CheckersRun using Tox - recommendedRun manuallyLicenseChangelogGet startedInstallationThis application can be simply installed by running:pipinstallbsnotifierif you want to install from a source distribution:gitclonehttps://github.com/eccanto/battery-status-notifiercdbattery-status-notifier/
pythonsetup.pyinstallUsageTo start the notifier you must run the command line application:bsnotifierBy default the application will check the battery status every1:30 minutes, if the battery percentage is less than10%a popup window will be shown.How to use it with i3Auto start the notifier application in i3:Linking the application executable to make it accessible to other users.BSNOTIFIER_PATH="$(whichbsnotifier)"sudoln-s"${BSNOTIFIER_PATH}"/usr/bin/bsnotifierEdit i3 config file.# ~/.config/i3/config...exec--no-startup-idbsnotifier-o"$(mktemp)"...Options$bsnotifier--help

Usage:bsnotifier[OPTIONS]Commandlineapplicationthatshowsapopupwindowwhenthebatteryislow.

Options:-i,--intervalINTEGERThetimeintervalinsecondsthatthescriptwaitsbeforecheckingthebatteryagain(default:150.0seconds).-l,--levelINTEGERThebatterypercentageatwhichthepopupwindowisdisplayed(default:10).-s,--silentDonotplaythesoundwhenpopupwindowisdisplayed.-o,--outputPATHLogfilepath(default:.bsnotifier.log).--helpShowthismessageandexit.DevelopersTesting release with ToxRequirementsPython requirements:pip3install-rrequirements_testing.txtSet Python versionsInstallpyenvInstall python versions:forpython_versionin"3.7""3.8""3.9""3.10""3.11";dopyenvinstall${python_version};doneEnable python versions:pyenvlocal"3.7""3.8""3.9""3.10""3.11"RunWe usetoxandpytestto run the
test suite:toxto run the test suite for a particular Python version, you can do:tox-epy37Static code analysis toolsThese are the linters that will help us to follow good practices and style guides of our source code. We will be using the following static analysis tools, which will be executed when generating a new push in the repository (git hooks).Set up the Git hooks custom directoryAfter cloning the repository run the following command in the repository root:gitconfigcore.hooksPath.githooksPython Static CheckersTools used:brunette: A best practice Python code formatter.isort: Python utility / library to sort imports alphabetically, and automatically separated into sections and by type.prospector: Prospector is a tool to analyse Python code and output information about errors, potential problems, convention violations and complexity.Tools executed by Prospector:pylint: Pylint is a Python static code analysis tool which looks for programming errors,   helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.bandit: Bandit is a tool designed to find common security issues.dodgy: It is a series of simple regular expressions designed to detect things such as accidental SCM diff checkins, or passwords or secret keys hard coded into files.mccabe: Complexity checker.mypy: Mypy is an optional static type checker for Python.pydocstyle: pydocstyle is a static analysis tool for checking compliance with PythonPEP 257.pycodestyle: pycodestyle is a tool to check your Python code against some of the style conventions inPEP 8.pyflakes: Pyflakes analyzes programs and detects various errors.pyroma: Pyroma is a product aimed at giving a rating of how well a Python project complies with the best practices of the Python packaging ecosystem, primarily PyPI, pip, Distribute etc, as well as a list of issues that could be improved.Shell Static CheckersTools used:shellcheck: Finds bugs in your shell scripts (bash).Installation:aptinstallshellcheckRun using Tox - recommendedtox-ecode_checkersRun manuallybashscripts/code_checkers.shLicenseMITChangelog1.0.0 - Initial version.1.0.1 - I3 support.1.0.2 - Close the popup window when connecting the battery, and update the information in real time.