CCTK always requires root permissions to run
Created by: TID41
I followed the guide listed to allow CCTK to run as root without a password prompt. If I untick the box for "needs SUDO," however, the CCTK application still refuses to run, so the plasmoid cannot read or set the battery charge config.
From the terminal, I can now use
sudo /opt/dell/dcc/cctk --PrimaryBattChargeCfg
and it runs and displays the charge config without me being prompted for the password, but the 'sudo' command is still needed. If I enter
/opt/dell/dcc/cctk --PrimaryBattChargeCfg
(which is what the plasmoid does if you untick the box), cctk refuses to run without being root. Apparently, cctk itself always checks to see if it is root when it is executed, and if not, it fails with the error. Some kind of privilege elevation (whether pkexec or sudo) is always needed.
I modified the plasmoid to use pkexec if the box is ticked and sudo if not, and changed the text to match, and also took out the bit where it sends the password when querying the status (I will post another issue about that), if you would like to use it as a reference (being that I have a Dell that can be used to test it and you don't!).