Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Adding support for AMD cpu #65

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
1 change: 0 additions & 1 deletion 99-plasma-pstate

This file was deleted.

27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Intel P-state and CPUFreq Manager Widget

```diff
-Important
```
as of October 11, 2020, I'm not willing to maintain this widget anymore. I will maintain it based only to my personal needs. I thank you for your support and feedback all this time. Hope the community will take over from here and make the widget even better than it is now.

## What it is
Intel P-state and CPUFreq Manager is a KDE Plasma widget in order to control
the frequencies of Intel CPUs and their integrated GPUs for any modern Intel
Expand Down Expand Up @@ -33,6 +28,10 @@ through [libsmbios library](https://github.com/dell/libsmbios).

<a target="_blank" rel="noopener noreferrer" href="https://github.com/jsalatas/plasma-pstate/raw/master/screenshots/screenshot_4.png"><img src="https://github.com/jsalatas/plasma-pstate/raw/master/screenshots/screenshot_4.png" alt="Intel P-state and CPUFreq Manager Widget with Nvidia PowerMizer Settings" title="Intel P-state and CPUFreq Manager Widget with Nvidia PowerMizer Settings" width="500px"></a>

4. MSI Cooler Boost

- This assume that you already have seen if your laptop is supported by ISW tool, already seen https://github.com/YoyPa/isw/blob/master/README.md and set up it, and isw is in the executable path.


## What it isn't
This is just a GUI widget and it is not meant to replace
Expand Down Expand Up @@ -74,9 +73,10 @@ sudo apt install linux-tools-generic linux-tools-`uname -r`
Assuming that you have checked out the latest code, you just need to run the following commands as root:

```
sudo kpackagetool5 -g -t Plasma/Applet -u gr.ictpro.jsalatas.plasma.pstate
sudo kpackagetool5 -g -t Plasma/Applet -u org.thefreecircle.mibofra.plasma.pstate

sudo chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh
sudo chmod 755 /usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/set_prefs.sh
sudo chmod 755 /usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/get_thermal.sh
```


Expand All @@ -86,10 +86,17 @@ especially in relation to similar to Dell's Thermal Management Feature that
may be available in other hardware platforms.

## Issues
The widget uses a shell script that needs to be run as root user (sudo) and which apparently floods your log files with security related messages as described in [issue #16](https://github.com/jsalatas/plasma-pstate/issues/16).

If you want to get rid of these messages, please see a workaround at
Using PolKit, I don't see any log flood a the moment.

If it's not your case, plese read: https://github.com/jsalatas/plasma-pstate/wiki/Too-many-messages-in-system-log

For option with a slider, please, be sure to slide them and not click on an arbitrary point of the slider. This will ensure that, the plasmoid slider is working fine, getting the preference issued, avoiding it to bug plasmashell, the plasmoid, or the panel where it is docked. And surely, making polkit agent asking the password for setting the preference, as expected.

## Info

https://github.com/jsalatas/plasma-pstate/wiki/Too-many-messages-in-system-log
The original author is maintaining the plasmoid up to his needs, see the head of: https://github.com/jsalatas/plasma-pstate/blob/master/README.md ,
also because there are efforts to have hardware profiles directly in powerdevil and kcm like in gnome with https://gitlab.freedesktop.org/hadess/power-profiles-daemon .

Anyway, some tools can be still useful for some users, like me, who added the possibility to set the number of online cpus, or other tools that are out of scope of powerdevil and kcm itself. So I'm trying to keep at least it up to date, in a working state with latest KDE releases, trying to adding new functions if needed. With patience and time, also trying to redesing the ui, as the original author wanted: https://github.com/jsalatas/plasma-pstate/issues/40 (or the space on the desktop for the tools will decrease).

21 changes: 5 additions & 16 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,13 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi

SUDOERS_FILE="99-plasma-pstate"
kpackagetool5 -g -t Plasma/Applet -i org.thefreecircle.mibofra.plasma.pstate

cp -R ${SUDOERS_FILE} /etc/sudoers.d/
kpackagetool5 -g -t Plasma/Applet -i gr.ictpro.jsalatas.plasma.pstate
chmod 755 /usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/set_prefs.sh
chmod 755 /usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/get_thermal.sh

chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh

chown root:root /etc/sudoers.d/${SUDOERS_FILE}
chmod 400 /etc/sudoers.d/${SUDOERS_FILE}

# Test for wheel group instead of sudo
# this is the case of arch based distros
wheelgroup=`grep wheel /etc/group | wc -l`
sudogroup=`grep sudo /etc/group | wc -l`
if [ "$wheelgroup" -eq "1" ] && [ "$sudogroup" -eq "0" ]; then
# seems to be safe enough: there is a wheel group and not a sudo group
sed -i 's/sudo/wheel/' /etc/sudoers.d/${SUDOERS_FILE}
fi
cp org.thefreecircle.mibofra.plasma.pstate/contents/code/org.thefreecircle.mibofra.plasma.pstate.get-thermal.policy /usr/share/polkit-1/actions/
cp org.thefreecircle.mibofra.plasma.pstate/contents/code/org.thefreecircle.mibofra.plasma.pstate.set-prefs.policy /usr/share/polkit-1/actions/

echo -e "\nSetup complete."
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
smbios-thermal-ctl -g
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

<action id="org.thefreecircle.mibofra.plasma.pstate.get-thermal.pkexec.get_thermal.sh">
<message>Authentication is required to run Plasma P-state (Get thermal info)</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/get_thermal.sh</annotate>
</action>

</policyconfig>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

<action id="org.thefreecircle.mibofra.plasma.pstate.set-prefs.pkexec.set_prefs.sh">
<message>Authentication is required to run Plasma P-state</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/plasma/plasmoids/org.thefreecircle.mibofra.plasma.pstate/contents/code/set_prefs.sh</annotate>
</action>

</policyconfig>
Loading