Slimbook-Team / slimbookbattery

Slimbook Battery 4
https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop
GNU General Public License v3.0
252 stars 18 forks source link

Fix pgrep length limit #99

Closed rastersoft closed 1 year ago

rastersoft commented 1 year ago

This patch makes the program run in Debian and other systems. In them, pgrep has a limit of 15 characters, so the "slimbookbatterypreferences" string is too long for it. This patch uses the -f parameter to fix this.

It also adds some extra fixes, like using /usr/bin/env in the shebang, and launching the childs with "subprocess.run", which removes the shell (this is also needed to make pgrep work, because with the -f parameter, it searches in all the command line, and since os.system() launches the process inside a shell, there would be at least two processes with that).

Fix https://github.com/Slimbook-Team/slimbookbattery/issues/96

siddhpant commented 1 year ago

This seems like a general bug, not Debian specific. Even arch manpage says 15 char length.

Maybe change commit message?

rastersoft commented 1 year ago

all changes done.