-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix incorrect low battery report * Add app version to system tray * Added a simple cli - added --clean tag for using default settings - added --version flag * Add project dependencies to pyproject (just in case) * Update AUR files * Fix battery report error and added logs * Bump to 1.2.0
- Loading branch information
Showing
12 changed files
with
116 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ __pycache__ | |
dist | ||
src/ | ||
*.gz | ||
pkg | ||
pkg | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Maintainer: Jorge Hernández <[email protected]> | ||
pkgname="battery-advisor" | ||
pkgver=1.0.0 | ||
pkgver=1.2.0 | ||
pkgrel=1 | ||
pkgdesc="A simple tool to monitor and notify about battery status. Built with Python." | ||
arch=('any') | ||
url="https://github.com/fer-hnndz/battery-advisor" | ||
license=('MIT') | ||
depends=("python" "python-psutil" "python-toml" "python-gobject" "libnotify" "python-pystray") | ||
depends=("python" "python-psutil" "python-toml" "python-gobject" "libnotify" "python-pystray" "python-systemd") | ||
backup=("etc/battery-advisor/defaultSettings.toml") | ||
makedepends=(python-build python-installer python-wheel) | ||
_name=${pkgname#python-} | ||
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name//-/_}/${_name//-/_}-$pkgver.tar.gz") | ||
sha256sums=(d4a6f15ded5961d37566e232fccdc4b52d25ea545d67697f55da6778aa5a8205) | ||
sha256sums=(e2128de236038d4beae221cd92e8c82a50a033d97bd7bdd6afab725e02bc8fc3) | ||
validpgpkeys=() | ||
|
||
prepare() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ $ yay -S battery-advisor | |
- python-pystray | ||
- python-toml | ||
- python-psutil | ||
- python-systemd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .entry import main | ||
from .entry import cli | ||
from .settings_loader import load_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
from .battery_advisor import BatteryAdvisor | ||
from .battery_advisor import BatteryAdvisor, VERSION | ||
import argparse | ||
import logging | ||
import os | ||
from .utils import _get_project_root | ||
|
||
|
||
def main(): | ||
BatteryAdvisor().start() | ||
def cli(): | ||
log_path = os.path.join(_get_project_root(), "advisor.log") | ||
|
||
logging.basicConfig( | ||
level=logging.DEBUG, | ||
format="[%(asctime)s ] (%(module)s.%(funcName)s | %(levelname)s) %(message)s", | ||
datefmt="%d/%m/%Y @ %H:%M:%S %Z", | ||
filename=log_path, | ||
) | ||
|
||
parser = argparse.ArgumentParser( | ||
prog="Battery Advisor", | ||
description="A simple tool to monitor and notify about battery status. Built with Python.", | ||
epilog="Made with ❤️ by Jorge Hernández.", | ||
) | ||
parser.add_argument("--version", action="version", version=f"%(prog)s {VERSION}") | ||
parser.add_argument("--clean", action="store_true", help="Use default settings.") | ||
|
||
args = parser.parse_args() | ||
BatteryAdvisor(clean=args.clean).start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION = "1.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from battery_advisor import main | ||
from battery_advisor import cli | ||
|
||
if __name__ == "__main__": | ||
main() | ||
cli() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
[tool.poetry] | ||
name = "battery-advisor" | ||
version = "1.0.0" | ||
version = "1.2.0" | ||
description = "A simple tool to monitor and notify about battery status. Built with Python." | ||
authors = ["fer-hnndz <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/fer-hnndz/battery-advisor" | ||
keywords = ["battery", "monitor", "notify"] | ||
include = ["defaultSettings.toml", "icon.png", "LICENSE"] | ||
|
||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Operating System :: POSIX :: Linux", | ||
"Topic :: Desktop Environment", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
pystray = "^0.19.5" | ||
toml = "^0.10.2" | ||
psutil = "^6.0.0" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "^24.8.0" | ||
|
@@ -22,4 +29,4 @@ requires = ["poetry-core"] | |
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.scripts] | ||
battery-advisor = "battery_advisor:entry.main" | ||
battery-advisor = "battery_advisor:entry.cli" |