kded: Add marker levels checking/notify
When a print job is created and completed, check the markers level (ink cartridge levels) and notify if low.
requires frameworks/breeze-icons!468 (merged)
Notes
CUPS stores the attributes in printers.conf, however, marker levels (types,colors) won't be stored until the first print job is created/sent. This might explain why getting colors and levels is seemingly so inconsistent. So, you might see something like this in printers.conf:
Attribute marker-levels 0,70
Attribute marker-low-levels 0,1
Attribute marker-high-levels 100,100
Attribute marker-names tri-color ink,black ink
Attribute marker-types ink-cartridge,ink-cartridge
Attribute marker-change-time 1746382870
In addition, CUPS also stores a Reason marker-supply-low-warning in printers.conf, again after a state change (pause/resume) or job create/complete. So, when printer changes, we also check marker levels to notify if appropriate.
CUPS 2.4.12 has a this bug: https://github.com/OpenPrinting/cups/issues/1267, which is not directly related to this MR, in case there is a question as to why marker-colors are not appearing on the KCM properly.
ToDo
-
Refine algorithm for determining low level -
Determine triggers for checking levels (job-created, job-finished, etc.)? -
Handle the CUPS scheduler stop/restart
Testing
If your printer does not have entries in printers.conf, you can add something like the above settings and fiddle with the values.
Also notifies when printer state changed (paused/resumed), to be removed before merge.

