diff --git a/99-plasma-pstate b/99-plasma-pstate index 70a42ab..9e4e275 100644 --- a/99-plasma-pstate +++ b/99-plasma-pstate @@ -1 +1 @@ -%sudo ALL=NOPASSWD: /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh +#%sudo ALL=NOPASSWD: /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh diff --git a/README.md b/README.md index d188e4e..092c825 100644 --- a/README.md +++ b/README.md @@ -49,19 +49,32 @@ comfort of your graphical interface using point and click or tap interactions even in cases that a keyboard isn't available. ## How to install -First of all you need to be in sudoers' group. After that you can just clone + +Under blackPanther OS just run +``` +installing plasma-pstate + +``` + +From source You can just clone the code and install it using the following commands: ``` git clone https://github.com/jsalatas/plasma-pstate cd plasma-pstate -sudo ./install.sh +./install.sh ``` **Notice:** If your processor doesn't support EPP(ie older generations without -HWP), then you need also to install the ``x86_energy_perf_policy`` which (in -case of Ubuntu 18.04 distros) is provided by the ``linux-tools`` package and +HWP), then you need also to install the ``x86_energy_perf_policy`` which is +provided by the ``kernel-tools`` (in case of Ubuntu 18.04 distros) ``linux-tools`` package and can be installed using the following command +``` +installing kernel-tools +``` + +or on another Debian based distro + ``` sudo apt install linux-tools-generic linux-tools-`uname -r` ``` @@ -69,22 +82,13 @@ 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 +kpackagetool5 -g -t Plasma/Applet -u gr.ictpro.jsalatas.plasma.pstate -sudo chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh +chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh ``` - ## Contributions Please feel free to clone, hack, and contribute anything you may find useful, 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 - -https://github.com/jsalatas/plasma-pstate/wiki/Too-many-messages-in-system-log - - diff --git a/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh b/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh index e017ac7..a71f121 100755 --- a/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh +++ b/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh @@ -46,11 +46,24 @@ check_nvidia () { fi } +read_cpu_min_perf () { + cpu_min_perf=`cat $CPU_MIN_PERF` +} + set_cpu_min_perf () { minperf=$1 if [ -n "$minperf" ] && [ "$minperf" != "0" ]; then printf '%s\n' "$minperf" > $CPU_MIN_PERF; 2> /dev/null fi + read_cpu_min_perf + json="{" + json="${json}\"cpu_min_perf\":\"${cpu_min_perf}\"" + json="${json}}" + echo $json +} + +read_cpu_max_perf () { + cpu_max_perf=`cat $CPU_MAX_PERF` } set_cpu_max_perf () { @@ -58,6 +71,20 @@ set_cpu_max_perf () { if [ -n "$maxperf" ] && [ "$maxperf" != "0" ]; then printf '%s\n' "$maxperf" > $CPU_MAX_PERF; 2> /dev/null fi + read_cpu_max_perf + json="{" + json="${json}\"cpu_max_perf\":\"${cpu_max_perf}\"" + json="${json}}" + echo $json +} + +read_cpu_turbo () { + cpu_turbo=`cat $CPU_TURBO` + if [ "$cpu_turbo" == "1" ]; then + cpu_turbo="false" + else + cpu_turbo="true" + fi } set_cpu_turbo () { @@ -69,6 +96,15 @@ set_cpu_turbo () { printf '1\n' > $CPU_TURBO; 2> /dev/null fi fi + read_cpu_turbo + json="{" + json="${json}\"cpu_turbo\":\"${cpu_turbo}\"" + json="${json}}" + echo $json +} + +read_gpu_min_freq () { + gpu_min_freq=`cat $GPU_MIN_FREQ` } set_gpu_min_freq () { @@ -76,6 +112,15 @@ set_gpu_min_freq () { if [ -n "$gpuminfreq" ] && [ "$gpuminfreq" != "0" ]; then printf '%s\n' "$gpuminfreq" > $GPU_MIN_FREQ; 2> /dev/null fi + read_gpu_min_freq + json="{" + json="${json}\"gpu_min_freq\":\"${gpu_min_freq}\"" + json="${json}}" + echo $json +} + +read_gpu_max_freq () { + gpu_max_freq=`cat $GPU_MAX_FREQ` } set_gpu_max_freq () { @@ -83,6 +128,15 @@ set_gpu_max_freq () { if [ -n "$gpumaxfreq" ] && [ "$gpumaxfreq" != "0" ]; then printf '%s\n' "$gpumaxfreq" > $GPU_MAX_FREQ; 2> /dev/null fi + read_gpu_max_freq + json="{" + json="${json}\"gpu_max_freq\":\"${gpu_max_freq}\"" + json="${json}}" + echo $json +} + +read_gpu_boost_freq () { + gpu_boost_freq=`cat $GPU_BOOST_FREQ` } set_gpu_boost_freq () { @@ -90,6 +144,15 @@ set_gpu_boost_freq () { if [ -n "$gpuboostfreq" ] && [ "$gpuboostfreq" != "0" ]; then printf '%s\n' "$gpuboostfreq" > $GPU_BOOST_FREQ; 2> /dev/null fi + read_gpu_boost_freq + json="{" + json="${json}\"gpu_boost_freq\":\"${gpu_boost_freq}\"" + json="${json}}" + echo $json +} + +read_cpu_governor () { + cpu_governor=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` } set_cpu_governor () { @@ -99,6 +162,25 @@ set_cpu_governor () { printf '%s\n' "$gov" > $cpu; 2> /dev/null done fi + read_cpu_governor + json="{" + json="${json}\"cpu_governor\":\"${cpu_governor}\"" + json="${json}}" + echo $json +} + +read_energy_perf () { + energy_perf=`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference 2>/dev/null` + if [ -z "$energy_perf" ]; then + energy_perf=`x86_energy_perf_policy -r 2>/dev/null | grep -v 'HWP_' | \ + sed -r 's/://; + s/(0x0000000000000000|EPB 0)/performance/; + s/(0x0000000000000004|EPB 4)/balance_performance/; + s/(0x0000000000000006|EPB 6)/default/; + s/(0x0000000000000008|EPB 8)/balance_power/; + s/(0x000000000000000f|EPB 15)/power/' | \ + awk '{ printf "%s\n", $2; }' | head -n 1` + fi } set_energy_perf () { @@ -118,10 +200,11 @@ set_energy_perf () { x86_energy_perf_policy $pnum > /dev/null 2>&1 fi fi -} - -set_thermal_mode () { - smbios-thermal-ctl --set-thermal-mode=$1 2> /dev/null + read_energy_perf + json="{" + json="${json}\"energy_perf\":\"${energy_perf}\"" + json="${json}}" + echo $json } set_lg_battery_charge_limit(){ @@ -161,36 +244,33 @@ set_lg_usb_charge() { fi } +read_thermal_mode () { + thermal_mode=`smbios-thermal-ctl -g | grep -C 1 "Current Thermal Modes:" | tail -n 1 | awk '{$1=$1;print}' | sed "s/\t//g" | sed "s/ /-/g" | tr [A-Z] [a-z] ` +} + +set_thermal_mode () { + smbios-thermal-ctl --set-thermal-mode=$1 > /dev/null 2>&1 + read_thermal_mode + json="{" + json="${json}\"thermal_mode\":\"${thermal_mode}\"" + json="${json}}" + echo $json +} + read_all () { -cpu_min_perf=`cat $CPU_MIN_PERF` -cpu_max_perf=`cat $CPU_MAX_PERF` -cpu_turbo=`cat $CPU_TURBO` -if [ "$cpu_turbo" == "1" ]; then - cpu_turbo="false" -else - cpu_turbo="true" -fi -gpu_min_freq=`cat $GPU_MIN_FREQ` -gpu_max_freq=`cat $GPU_MAX_FREQ` +read_cpu_min_perf +read_cpu_max_perf + +read_cpu_turbo + gpu_min_limit=`cat $GPU_MIN_LIMIT` gpu_max_limit=`cat $GPU_MAX_LIMIT` -gpu_boost_freq=`cat $GPU_BOOST_FREQ` gpu_cur_freq=`cat $GPU_CUR_FREQ` -cpu_governor=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` -energy_perf=`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference` -if [ -z "$energy_perf" ]; then - energy_perf=`x86_energy_perf_policy -r 2>/dev/null | grep -v 'HWP_' | \ - sed -r 's/://; - s/(0x0000000000000000|EPB 0)/performance/; - s/(0x0000000000000004|EPB 4)/balance_performance/; - s/(0x0000000000000006|EPB 6)/default/; - s/(0x0000000000000008|EPB 8)/balance_power/; - s/(0x000000000000000f|EPB 15)/power/' | \ - awk '{ printf "%s\n", $2; }' | head -n 1` -fi -if check_dell_thermal; then - thermal_mode=`smbios-thermal-ctl -g | grep -C 1 "Current Thermal Modes:" | tail -n 1 | awk '{$1=$1;print}' | sed "s/\t//g" | sed "s/ /-/g" | tr "[A-Z]" "[a-z]" ` -fi +read_gpu_min_freq +read_gpu_max_freq +read_gpu_boost_freq +read_cpu_governor +read_energy_perf if check_lg_drivers; then lg_battery_charge_limit=`cat $LG_BATTERY_CHARGE_LIMIT` @@ -230,6 +310,7 @@ json="${json},\"gpu_cur_freq\":\"${gpu_cur_freq}\"" json="${json},\"cpu_governor\":\"${cpu_governor}\"" json="${json},\"energy_perf\":\"${energy_perf}\"" if check_dell_thermal; then + read_thermal_mode json="${json},\"thermal_mode\":\"${thermal_mode}\"" fi if check_lg_drivers; then @@ -245,78 +326,79 @@ echo $json } case $1 in - "-cpu-min-perf") + "cpu-min-perf") set_cpu_min_perf $2 ;; - "-cpu-max-perf") + "cpu-max-perf") set_cpu_max_perf $2 ;; - "-cpu-turbo") + "cpu-turbo") set_cpu_turbo $2 ;; - "-gpu-min-freq") + "gpu-min-freq") set_gpu_min_freq $2 ;; - "-gpu-max-freq") + "gpu-max-freq") set_gpu_max_freq $2 ;; - "-gpu-boost-freq") + "gpu-boost-freq") set_gpu_boost_freq $2 ;; - "-cpu-governor") + "cpu-governor") set_cpu_governor $2 ;; - "-energy-perf") + "energy-perf") set_energy_perf $2 ;; - "-thermal-mode") + "thermal-mode") set_thermal_mode $2 ;; - "-lg-battery-charge-limit") + "lg-battery-charge-limit") set_lg_battery_charge_limit $2 ;; - "-lg-fan-mode") + "lg-fan-mode") set_lg_fan_mode $2 ;; - "-lg-usb-charge") + "lg-usb-charge") set_lg_usb_charge $2 ;; - "-powermizer") + "powermizer") set_powermizer $2 ;; - "-read-all") + "read-all") read_all ;; *) echo "Usage:" - echo "1: set_prefs.sh [ -cpu-min-perf |" - echo " -cpu-max-perf |" - echo " -cpu-turbo |" - echo " -gpu-min-freq |" - echo " -gpu-max-freq |" - echo " -gpu-boost-freq |" - echo " -cpu-governor |" - echo " -energy-perf |" - echo " -thermal-mode |" - echo " -lg-battery-charge-limit |" - echo " -lg-fan-mode |" - echo " -lg-usb-charge |" - echo " -powermizer ] value" - echo "2: set_prefs.sh -read-all" + echo "1: set_prefs.sh [ cpu-min-perf |" + echo " cpu-max-perf |" + echo " cpu-turbo |" + echo " gpu-min-freq |" + echo " gpu-max-freq |" + echo " gpu-boost-freq |" + echo " cpu-governor |" + echo " energy-perf |" + echo " thermal-mode ] value" + echo " lg-battery-charge-limit |" + echo " lg-fan-mode |" + echo " lg-usb-charge |" + echo " powermizer ] value" + echo "2: set_prefs.sh read-all" exit 3 ;; + esac diff --git a/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefsd b/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefsd new file mode 100755 index 0000000..4133161 --- /dev/null +++ b/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefsd @@ -0,0 +1,9 @@ +#!/bin/sh + +while true; do + #logger -t set_prefd "Read all..." + /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh read-all >/var/tmp/pstate.tmp + cat /var/tmp/pstate.tmp > /var/tmp/pstate.dat + rm -f /var/tmp/pstate.tmp + sleep 3; +done diff --git a/gr.ictpro.jsalatas.plasma.pstate/contents/code/utils.js b/gr.ictpro.jsalatas.plasma.pstate/contents/code/utils.js index db2d82d..42fb0be 100644 --- a/gr.ictpro.jsalatas.plasma.pstate/contents/code/utils.js +++ b/gr.ictpro.jsalatas.plasma.pstate/contents/code/utils.js @@ -90,69 +90,69 @@ var vendors = { } var model = [ - {'type': 'header', 'text': 'Processor Settings', 'icon': 'd', + {'type': 'header', 'text': i18n("Processor Settings"), 'icon': 'd', 'sensors': ['cpu_cur_load', 'cpu_cur_freq', 'gpu_cur_freq'], 'items': [ - {'type': 'group', 'text': 'CPU Frequencies', 'items' :[ - {'type': 'slider', 'text': 'Min perf', 'min': 0, 'max': 100, 'sensor': 'cpu_min_perf'}, - {'type': 'slider', 'text': 'Max perf', 'min': 0, 'max': 100, 'sensor': 'cpu_max_perf'}, - {'type': 'switch', 'text': 'Turbo', 'sensor': 'cpu_turbo'} + {'type': 'group', 'text': i18n("CPU Frequencies"), 'items' :[ + {'type': 'slider', 'text': i18n("Min perf"), 'min': 0, 'max': 100, 'sensor': 'cpu_min_perf'}, + {'type': 'slider', 'text': i18n("Max perf"), 'min': 0, 'max': 100, 'sensor': 'cpu_max_perf'}, + {'type': 'switch', 'text': i18n("Turbo"), 'sensor': 'cpu_turbo'} ]}, - {'type': 'group', 'text': 'GPU Frequencies', 'visible': 'showIntelGPU', 'items' :[ - {'type': 'slider', 'text': 'Min freq', 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_min_freq'}, - {'type': 'slider', 'text': 'Max freq', 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_max_freq'}, - {'type': 'slider', 'text': 'Boost freq', 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_boost_freq'}, + {'type': 'group', 'text': i18n("GPU Frequencies"), 'visible': 'showIntelGPU', 'items' :[ + {'type': 'slider', 'text': i18n("Min freq"), 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_min_freq'}, + {'type': 'slider', 'text': i18n("Max freq"), 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_max_freq'}, + {'type': 'slider', 'text': i18n("Boost freq"), 'min': 'gpu_min_limit', 'max': 'gpu_max_limit', 'sensor': 'gpu_boost_freq'}, ]}, - {'type': 'radio', 'text': 'CPU Governor', 'sensor': 'cpu_governor', 'items' :[ - {'symbol': 'a', 'text': 'Performance', 'sensor_value': 'performance'}, - {'symbol': 'f', 'text': 'Powersave', 'sensor_value': 'powersave'} + {'type': 'radio', 'text': i18n("CPU Governor"), 'sensor': 'cpu_governor', 'items' :[ + {'symbol': 'a', 'text': i18n("Performance"), 'sensor_value': 'performance'}, + {'symbol': 'f', 'text': i18n("Powersave"), 'sensor_value': 'powersave'} ]} ] }, - {'type': 'header', 'text': 'Energy Performance', 'icon': 'h', + {'type': 'header', 'text': i18n("Energy Performance"), 'icon': 'h', 'sensors': ['battery_percentage', 'battery_remaining_time'], 'items': [ {'type': 'radio', 'text': '', 'sensor': 'energy_perf', 'items' :[ - {'symbol': 'i', 'text': 'Default', 'sensor_value': 'default'}, - {'symbol': 'a', 'text': 'Performance', 'sensor_value': 'performance'}, - {'symbol': 'k', 'text': 'Balance Performance', 'sensor_value': 'balance_performance'}, - {'symbol': 'l', 'text': 'Balance Power', 'sensor_value': 'balance_power'}, - {'symbol': 'f', 'text': 'Power', 'sensor_value': 'power'} + {'symbol': 'i', 'text': i18n("Default"), 'sensor_value': 'default'}, + {'symbol': 'a', 'text': i18n("Performance"), 'sensor_value': 'performance'}, + {'symbol': 'k', 'text': i18n("Balance Performance"), 'sensor_value': 'balance_performance'}, + {'symbol': 'l', 'text': i18n("Balance Power"), 'sensor_value': 'balance_power'}, + {'symbol': 'f', 'text': i18n("Power"), 'sensor_value': 'power'} ]} ] }, - {'type': 'header', 'text': 'Thermal Management', 'icon': 'b', + {'type': 'header', 'text': i18n("Thermal Management"), 'icon': 'b', 'vendors': ['dell'], 'sensors': ['package_temp', 'fan_speeds'], 'items': [ {'type': 'radio', 'text': '', 'sensor': 'thermal_mode', 'items' :[ - {'symbol': 'e', 'text': 'Performance', 'sensor_value': 'performance'}, - {'symbol': 'j', 'text': 'Balanced', 'sensor_value': 'balanced'}, - {'symbol': 'g', 'text': 'Cool Bottom', 'sensor_value': 'cool-bottom'}, - {'symbol': 'c', 'text': 'Quiet', 'sensor_value': 'quiet'} + {'symbol': 'e', 'text': i18n("Performance"), 'sensor_value': 'performance'}, + {'symbol': 'j', 'text': i18n("Balanced"), 'sensor_value': 'balanced'}, + {'symbol': 'g', 'text': i18n("Cool Bottom"), 'sensor_value': 'cool-bottom'}, + {'symbol': 'c', 'text': i18n("Quiet"), 'sensor_value': 'quiet'} ]} ] }, - {'type': 'header', 'text': 'Power Supply Management', 'icon': 'm', + {'type': 'header', 'text': i18n("Power Supply Management"), 'icon': 'm', 'vendors': ['lg-laptop'], 'items': [ - {'type': 'switch', 'text': 'Battery Limit', 'sensor': 'lg_battery_charge_limit'}, - {'type': 'switch', 'text': 'USB Charge', 'sensor': 'lg_usb_charge'} + {'type': 'switch', 'text': i18n("Battery Limit"), 'sensor': 'lg_battery_charge_limit'}, + {'type': 'switch', 'text': i18n("USB Charge"), 'sensor': 'lg_usb_charge'} ] }, - {'type': 'header', 'text': 'Fan Control', 'icon': 'n', + {'type': 'header', 'text': i18n("Fan Control"), 'icon': 'n', 'vendors': ['lg-laptop'], 'items': [ - {'type': 'switch', 'text': 'Silent Mode', 'sensor': 'lg_fan_mode'} + {'type': 'switch', 'text': i18n("Silent Mode"), 'sensor': 'lg_fan_mode'} ] }, - {'type': 'header', 'text': 'Nvidia Settings', 'icon': 'o', + {'type': 'header', 'text': i18n("Nvidia Settings"), 'icon': 'o', 'vendors': ['nvidia'], 'items': [ - {'type': 'combobox', 'text': 'PowerMizer', 'sensor': 'powermizer', 'items' :[ - {'text': 'Adaptive', 'sensor_value': '0'}, - {'text': 'Prefer Max Performance', 'sensor_value': '1'}, - {'text': 'Auto', 'sensor_value': '2'} + {'type': 'combobox', 'text': i18n("PowerMizer"), 'sensor': 'powermizer', 'items' :[ + {'text': i18n("Adaptive"), 'sensor_value': '0'}, + {'text': i18n("Prefer Max Performance"), 'sensor_value': '1'}, + {'text': i18n("Auto"), 'sensor_value': '2'} ]} ] } diff --git a/gr.ictpro.jsalatas.plasma.pstate/contents/ui/main.qml b/gr.ictpro.jsalatas.plasma.pstate/contents/ui/main.qml index 9573490..d694daf 100644 --- a/gr.ictpro.jsalatas.plasma.pstate/contents/ui/main.qml +++ b/gr.ictpro.jsalatas.plasma.pstate/contents/ui/main.qml @@ -43,7 +43,7 @@ Item { property var sensors_model: Utils.get_sensors() property alias isReady: monitorDS.isReady property bool inTray: (plasmoid.parent === null || plasmoid.parent.objectName === 'taskItemContainer') - property var readCommand: (plasmoid.configuration.useSudoForReading ? 'sudo ' : '') + '/usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh -read-all' + property var readCommand: '/usr/bin/cat /var/tmp/pstate.dat' function sensor_short_name(long_name) { var parts = long_name.split('/'); @@ -235,7 +235,7 @@ Item { id: updater engine: 'executable' - property string commandSource: 'sudo /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh -' + property string commandSource: '/usr/bin/pkexec /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh ' onNewData: { updater.connectedSources = [] diff --git a/gr.ictpro.jsalatas.plasma.pstate/metadata.desktop b/gr.ictpro.jsalatas.plasma.pstate/metadata.desktop index c62923b..47fe428 100644 --- a/gr.ictpro.jsalatas.plasma.pstate/metadata.desktop +++ b/gr.ictpro.jsalatas.plasma.pstate/metadata.desktop @@ -1,6 +1,8 @@ [Desktop Entry] +Name=Plasma Freq Manager +Name[hu]=Plazma Freki-kezelő Comment=Intel P-state and CPUFreq Manager -Name=Intel P-state and CPUFreq Manager +Comment[hu]=Intel P-state and CPUFreq Manager Icon=cpu Type=Service X-KDE-ParentApp= @@ -9,9 +11,11 @@ X-KDE-PluginInfo-Category=System Information X-KDE-PluginInfo-Email=jsalatas@ictpro.gr X-KDE-PluginInfo-License=GPL2+ X-KDE-PluginInfo-Name=gr.ictpro.jsalatas.plasma.pstate -X-KDE-PluginInfo-Version=1.0.6 +X-KDE-PluginInfo-Version=1.0.5 X-KDE-PluginInfo-Website=https://jsalatas.ictpro.gr X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-StandAloneApp=true + + diff --git a/gr.ictpro.jsalatas.plasma.pstate/translate/hu_plasma_applet_gr.ictpro.jsalatas.plasma.pstate.po b/gr.ictpro.jsalatas.plasma.pstate/translate/hu_plasma_applet_gr.ictpro.jsalatas.plasma.pstate.po new file mode 100644 index 0000000..2a0e324 --- /dev/null +++ b/gr.ictpro.jsalatas.plasma.pstate/translate/hu_plasma_applet_gr.ictpro.jsalatas.plasma.pstate.po @@ -0,0 +1,151 @@ +msgid "" +msgstr "" +"Project-Id-Version: pstate\n" +"Report-Msgid-Bugs-To: https://jsalatas.ictpro.gr\n" +"POT-Creation-Date: 2020-09-24 08:18+0200\n" +"PO-Revision-Date: 2020-09-23 15:04+0200\n" +"Last-Translator: Barcza Károly \n" +"Language-Team: \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2\n" + +#: ../contents/code/utils.js:93 +msgid "Processor Settings" +msgstr "Processzor beállítások" + +#: ../contents/code/utils.js:96 +msgid "CPU Frequencies" +msgstr "CPU frekvenciák" + +#: ../contents/code/utils.js:97 +msgid "Min perf" +msgstr "Min telj." + +#: ../contents/code/utils.js:98 +msgid "Max perf" +msgstr "Max telj." + +#: ../contents/code/utils.js:99 +msgid "Turbo" +msgstr "Turbó" + +#: ../contents/code/utils.js:101 +msgid "GPU Frequencies" +msgstr "GPU Frekvenciák" + +#: ../contents/code/utils.js:102 +msgid "Min freq" +msgstr "Min frekv. (MHz):" + +#: ../contents/code/utils.js:103 +msgid "Max freq" +msgstr "Max frekv. (MHz):" + +#: ../contents/code/utils.js:104 +msgid "Boost freq" +msgstr "Gyorsító frekv." + +#: ../contents/code/utils.js:106 +msgid "CPU Governor" +msgstr "CPU verzérlő" + +#: ../contents/code/utils.js:107 ../contents/code/utils.js:117 ../contents/code/utils.js:129 +msgid "Performance" +msgstr "Teljesítmény" + +#: ../contents/code/utils.js:108 +msgid "Powersave" +msgstr "Energiatakarékos" + +#: ../contents/code/utils.js:112 +msgid "Energy Performance" +msgstr "Energiateljesítmény" + +#: ../contents/code/utils.js:116 +msgid "Default" +msgstr "Alapértelmezés" + +#: ../contents/code/utils.js:118 +msgid "Balance Performance" +msgstr "Egyensúlyozott teljesítmény" + +#: ../contents/code/utils.js:119 +msgid "Balance Power" +msgstr "Egyensúlyozott energia" + +#: ../contents/code/utils.js:120 +msgid "Power" +msgstr "Energiatakarékos" + +#: ../contents/code/utils.js:124 +msgid "Thermal Management" +msgstr "Hőmérsékletkezelő" + +#: ../contents/code/utils.js:130 +msgid "Balanced" +msgstr "Egyensúlyozott" + +#: ../contents/code/utils.js:131 +msgid "Cool Bottom" +msgstr "Hűtés alatt" + +#: ../contents/code/utils.js:132 +msgid "Quiet" +msgstr "Halk" + +#: ../contents/code/utils.js:136 +msgid "Power Supply Management" +msgstr "Tápellátás kezelés" + +#: ../contents/code/utils.js:139 +msgid "Battery Limit" +msgstr "Akkumlátor limit" + +#: ../contents/code/utils.js:140 +msgid "USB Charge" +msgstr "USB töltés" + +#: ../contents/code/utils.js:143 +msgid "Fan Control" +msgstr "Hűtésvezérlés" + +#: ../contents/code/utils.js:146 +msgid "Silent Mode" +msgstr "Csendes mód" + +#: ../contents/code/utils.js:149 +msgid "Nvidia Settings" +msgstr "Nvidia beállítások" + +#: ../contents/code/utils.js:152 +msgid "PowerMizer" +msgstr "PowerMizer" + +#: ../contents/code/utils.js:153 +msgid "Adaptive" +msgstr "Alaklmazkodó" + +#: ../contents/code/utils.js:154 +msgid "Prefer Max Performance" +msgstr "Lehetőleg max teljesítmény" + +#: ../contents/code/utils.js:155 +msgid "Auto" +msgstr "Auto" + +#: ../contents/ui/config/ConfigGeneral.qml:21 +msgid "Custom Icon:" +msgstr "Egyéni ikon:" + +#: ../contents/ui/config/IconPicker.qml:70 +msgctxt "@item:inmenu Open icon chooser dialog" +msgid "Choose..." +msgstr "Választás…" + +#: ../contents/ui/config/IconPicker.qml:75 +msgctxt "@item:inmenu Reset icon to default" +msgid "Clear Icon" +msgstr "Ikon visszaállítása" diff --git a/gr.ictpro.jsalatas.plasma.pstate/translate/template.pot b/gr.ictpro.jsalatas.plasma.pstate/translate/template.pot new file mode 100644 index 0000000..8a0019f --- /dev/null +++ b/gr.ictpro.jsalatas.plasma.pstate/translate/template.pot @@ -0,0 +1,156 @@ +# Translation of pstate in LANGUAGE +# Copyright (C) 2020 +# This file is distributed under the same license as the pstate package. +# Charles K Barcza - blackPanther OS , 2020. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pstate \n" +"Report-Msgid-Bugs-To: https://jsalatas.ictpro.gr\n" +"POT-Creation-Date: 2020-09-24 08:08+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../contents/code/utils.js:93 +msgid "Processor Settings" +msgstr "" + +#: ../contents/code/utils.js:96 +msgid "CPU Frequencies" +msgstr "" + +#: ../contents/code/utils.js:97 +msgid "Min perf" +msgstr "" + +#: ../contents/code/utils.js:98 +msgid "Max perf" +msgstr "" + +#: ../contents/code/utils.js:99 +msgid "Turbo" +msgstr "" + +#: ../contents/code/utils.js:101 +msgid "GPU Frequencies" +msgstr "" + +#: ../contents/code/utils.js:102 +msgid "Min freq" +msgstr "" + +#: ../contents/code/utils.js:103 +msgid "Max freq" +msgstr "" + +#: ../contents/code/utils.js:104 +msgid "Boost freq" +msgstr "" + +#: ../contents/code/utils.js:106 +msgid "CPU Governor" +msgstr "" + +#: ../contents/code/utils.js:107 ../contents/code/utils.js:117 ../contents/code/utils.js:129 +msgid "Performance" +msgstr "" + +#: ../contents/code/utils.js:108 +msgid "Powersave" +msgstr "" + +#: ../contents/code/utils.js:112 +msgid "Energy Performance" +msgstr "" + +#: ../contents/code/utils.js:116 +msgid "Default" +msgstr "" + +#: ../contents/code/utils.js:118 +msgid "Balance Performance" +msgstr "" + +#: ../contents/code/utils.js:119 +msgid "Balance Power" +msgstr "" + +#: ../contents/code/utils.js:120 +msgid "Power" +msgstr "" + +#: ../contents/code/utils.js:124 +msgid "Thermal Management" +msgstr "" + +#: ../contents/code/utils.js:130 +msgid "Balanced" +msgstr "" + +#: ../contents/code/utils.js:131 +msgid "Cool Bottom" +msgstr "" + +#: ../contents/code/utils.js:132 +msgid "Quiet" +msgstr "" + +#: ../contents/code/utils.js:136 +msgid "Power Supply Management" +msgstr "" + +#: ../contents/code/utils.js:139 +msgid "Battery Limit" +msgstr "" + +#: ../contents/code/utils.js:140 +msgid "USB Charge" +msgstr "" + +#: ../contents/code/utils.js:143 +msgid "Fan Control" +msgstr "" + +#: ../contents/code/utils.js:146 +msgid "Silent Mode" +msgstr "" + +#: ../contents/code/utils.js:149 +msgid "Nvidia Settings" +msgstr "" + +#: ../contents/code/utils.js:152 +msgid "PowerMizer" +msgstr "" + +#: ../contents/code/utils.js:153 +msgid "Adaptive" +msgstr "" + +#: ../contents/code/utils.js:154 +msgid "Prefer Max Performance" +msgstr "" + +#: ../contents/code/utils.js:155 +msgid "Auto" +msgstr "" + +#: ../contents/ui/config/ConfigGeneral.qml:21 +msgid "Custom Icon:" +msgstr "" + +#: ../contents/ui/config/IconPicker.qml:70 +msgctxt "@item:inmenu Open icon chooser dialog" +msgid "Choose..." +msgstr "" + +#: ../contents/ui/config/IconPicker.qml:75 +msgctxt "@item:inmenu Reset icon to default" +msgid "Clear Icon" +msgstr "" diff --git a/install.sh b/install.sh index 7a06a82..e78a480 100755 --- a/install.sh +++ b/install.sh @@ -5,24 +5,21 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -SUDOERS_FILE="99-plasma-pstate" +POLKIT_FILE="org.pkexec.set_prefs.policy" +POLKIT_PATH="/usr/share/polkit-1/actions" +SYSTEMD_FILE='set_prefsd' +UNITDIR_PATH='/usr/lib/systemd/system' -cp -R ${SUDOERS_FILE} /etc/sudoers.d/ -kpackagetool5 -g -t Plasma/Applet -i gr.ictpro.jsalatas.plasma.pstate +cp -f ${POLKIT_FILE} ${POLKIT_PATH} +cp -f ${SYSTED_FILE} ${UNITDIR_PATH} -chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh +systemctl daemon-reaload +systemctl enable set_perfsd +systemctl start set_perfsd -chown root:root /etc/sudoers.d/${SUDOERS_FILE} -chmod 400 /etc/sudoers.d/${SUDOERS_FILE} +kpackagetool5 -g -t Plasma/Applet -i gr.ictpro.jsalatas.plasma.pstate -# 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 +chmod 755 /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh echo -e "\nSetup complete." exit 0 diff --git a/org.pkexec.set_prefs.policy b/org.pkexec.set_prefs.policy new file mode 100644 index 0000000..4dab891 --- /dev/null +++ b/org.pkexec.set_prefs.policy @@ -0,0 +1,47 @@ + + + + + cpu + Plasma PState Widget + https://github.com/blackPantherOS/plasma-pstate/ + + + Modify Plasma State as root + Spouštět Plasma PState pod uživatelem root + Spustit Plasma PState s právy správce systému (root) + Plasma PState als Root-Benutzer ausführen + Ejecutar Plasma PState como root + Lancer Plasma PState en tant que super-utilisateur + Pokreni Plasma PState kao korijenskog korisnika + Plasma PState futtatása rendszergazdaként + Jalankan Plasma PState sebagai root + Palaist Plasma PState kā root + Uruchomienie programu Plasma PState jako administrator + Rodar Plasma PState como root + Rulează Plasma PState ca root + Запустить Plasma PState с правами администратора + Spustiť Plasma PState ako správca + Kör Plasma PState som root + Chạy Plasma PState dưới tư cách siêu quản trị. + 以 root 权限运行 Plasma PState + + Authentication is required to run Plasma PState as root. + Pro spuštění Plasma PState s právy správce je třeba ověření. + Il est nécessaire de s’authentifier pour lancer Plasma PState en tant que super-utilisateur. + Autenticação é necessária para rodar Plasma PState como root. + Для запуска Plasma PState с правами администратора требуется аутентификация. + 以 root 权限运行 Plasma PState 需要身份验证. + + + yes + no + yes + + /usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefs.sh + true + + + + diff --git a/screenshots/Screenshot_blackPanther_DELL.jpg b/screenshots/Screenshot_blackPanther_DELL.jpg new file mode 100644 index 0000000..f261745 Binary files /dev/null and b/screenshots/Screenshot_blackPanther_DELL.jpg differ diff --git a/set_perfsd.service b/set_perfsd.service new file mode 100644 index 0000000..178f3a6 --- /dev/null +++ b/set_perfsd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Pstate reading daememon + +[Service] +Type=simple +ExecStart=/usr/share/plasma/plasmoids/gr.ictpro.jsalatas.plasma.pstate/contents/code/set_prefsd +TimeoutSec=0 +RemainAfterExit=yes +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target + diff --git a/uninstall.sh b/uninstall.sh index 2ca56b4..5f3ee50 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -5,9 +5,17 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -SUDOERS_FILE="/etc/sudoers.d/99-plasma-pstate" -rm -f ${SUDOERS_FILE} +POLKIT_FILE="org.pkexec.set_prefs.policy" +POLKIT_PATH="/usr/share/polkit-1/actions" +rm -f ${POLKIT_PATH}/${POLKIT_FILE} + +systemctl stop set_perfsd +systemctl disable set_perfsd + +cp -f ${UNITDIR_PATH}/${SYSTED_FILE} +systemctl daemon-reaload + kpackagetool5 -g -t Plasma/Applet -r gr.ictpro.jsalatas.plasma.pstate echo "Uninstall complete."