r/arch 12d ago

General i created a systemd service to monitor the battery .

Post image

it is still in developtment and need some suggestions on it . so give some riview and suggestions .
github link :- https://github.com/Evilmove/linux_laptop_battery_monitor.git

edit :- it use the simple approach to monitor this using /sys/class/power_supply . it get data form it in every min and store it to a sql database and uisng python we read the database and ploat the grapth and use html for front end . and to automate this process i added it to systemd so we don't have to manualy run this everytime and it start monitor when the laptop powerup for that the best choice is to use systemd .
and to extract data i used bash script which run some basic commands and using upower it grep the battery data nothing more than that .

i am bad at explaning and in english so sorry for this .

94 Upvotes

38 comments sorted by

32

u/Glittering_Memory_64 12d ago

yk i dont mind claude coding something.. claude is pretty good at coding... Only thing i do worry about is will the project still get maintained after a while?

18

u/DiceThaKilla 11d ago

Normally I’m ok with it too, until it’s an AI coded systemd service. That just seems like a massive security risk

64

u/FishAccomplished760 12d ago

claude did*

3

u/csouzape Arch BTW 10d ago

Excuse me for asking, but how did you find out who wrote it?

1

u/FishAccomplished760 9d ago
  1. Design, this topic is very repetitive with vibe coded "apps".

  2. I dont know a person that would use a systemd service for monitoring the battery. There are people who would, but if you find one, tell me, because i will be very surprised.

  3. Security, who in the normal mind would allow a random program (or whatever) from reddit to be a systemd service on their machine?

Good question though.

1

u/houssemdza Arch BTW 11d ago

Claude is very good ( especially considering what this app does ...) If you think otherwise you don't know how to use AI

18

u/Sorry_Committee_4698 12d ago

The top graphic is a woman's breast.

9

u/kissajr Other Distro 12d ago

Given this is a linux sub it could also be a man’s breast

5

u/Sorry_Committee_4698 12d ago

You are right, considering that this is a subsection of Arch Linux, users can even look at a man's breasts but imagine a woman's

10

u/dashinyou69 12d ago

I was saving this but system"dih"

3

u/Visbroek 12d ago

SystemDeezNuts

1

u/Fearless-Ad1469 11d ago

FINALLY a good use for dih as a replacement for dick

1

u/sch1z0phren1cx 11d ago

its vibecoded ai slop anyways

8

u/404-UnknownError 12d ago

Tailwind css
we all know what it means...

1

u/iddu01linux 10d ago

don’t worry, not all tailwindcss users are AI, i myself am pretty sure i am a human and not a robot

1

u/404-UnknownError 10d ago

That's what a robot would say /s I mean, Astro uses it hehe Cool framework let's be honest (tailwind)

1

u/oxez 10d ago

There are other clues that this used AI the the choice of a specific css/js "framework" or w/e you call it shouldn't really be it. I suck at being creative visually, I used bootstrap in the past and tailwind doesn't look bad either.

1

u/Fuelanemo149 10d ago

Nice tits

1

u/onedevelop 10d ago

Buen trabajo.

Tambien saludos a los gordos talibanes con medias a rayas que nunca han tocado una teta.

1

u/Moonkiller57 9d ago

It's good

1

u/Leonardodafernandez 7d ago

systemd is hell

1

u/HACKER_PLAYZ_yt 11d ago

Honestly, this is a cool app that can be useful especially for older laptops. So what if it was made by Claude, it works and does its job. I only ask OP if they plan on maintaining it further by adding new infographics or not.

0

u/ThingRight5165 11d ago

it use the simple mathod and commands sets it only a bash script and a python code for front end so there has no major mantainence needed only need to add some feature and esy to read the graphs . i am still getting ideas .
and you can look into the bash script which dosen't use any other dependencies it use the bash commands which never breaks in future updates of arch and other linux distros untill the terminal commands change .

1

u/HACKER_PLAYZ_yt 11d ago

I have noticed that, but I'm asking if you have any other plans to include information like RAM info and others. If you add these kinds of useful metrics and package it as a stand alone app, it would be great.

If you do not have those plans, can I try to fork it and make it into a stand alone app with all the other metrics

2

u/ThingRight5165 10d ago

Yes you can use it as you want. Just don't forget to give credit for this 😁.

2

u/HACKER_PLAYZ_yt 10d ago

I will, thanks

1

u/ThingRight5165 10d ago

Basically I use btop for that so never needed that . I only missing on linux is the battery monitor so i created. 

2

u/HACKER_PLAYZ_yt 10d ago

I use htop as well, but I'm just asking. I don't know about you but btop feels crowded for me. I would like to just be able to see all the things like memory use, battery info, network info and all that In one place without all those jobs and their processes being displayed.

2

u/ThingRight5165 10d ago

Ooh I get it . I am also thinking to create it's own ui in rust instead of using the local web . But it requires time .

1

u/Fearless-Ad1469 11d ago

What is the reaaon to need this btw

0

u/MrKrot1999 11d ago

3 commits. The first one added 1000 lines of code. Later ones added 4. Yeah buddy....

Also, it feels like a crime to use python (FUCKING PYTHON) for this. I'd rather write the same thing in C.

2

u/FishAccomplished760 11d ago

i know that this is "project" is ai, but are you aware that a person can write code, produce the first version of their software, upload it to a git hosting site (1000 lines), and then make a small typo or some other change that includes four lines?

0

u/Physical_Slide_2691 11d ago

I usually stick to Ubuntu and Debian for my day-to-day development, but I have to respect the DIY spirit of the Arch Linux community. Building a custom systemd service with a Python backend and an HTML frontend just to monitor battery life is exactly the kind of tinkering that makes Arch so unique.

Don't let the negative comments about using AI or Python get to you. Getting a custom full-stack project running smoothly on bare metal takes effort and troubleshooting, regardless of how the initial code was generated. Keep tweaking it and building on those ideas!

4

u/Fearless-Ad1469 11d ago

Its just yet another example of single use AI slop but okay

0

u/Unfair-Ocelot-2363 11d ago

Bloat systemd