New plugin: ThinkPad - Fan & Thermal Control#870
Conversation
- Percentage & remaining time - Popup controls in a padded pill
…override the fan mode
This comment was marked as resolved.
This comment was marked as resolved.
|
This PR also contains your other PR about the battery-and-power-management plugin. Prefer to have one PR for one plugin. |
This comment was marked as resolved.
This comment was marked as resolved.
|
Hi, thanks, I'm sorry but this are my very first PRs and I'm not very skilled with git. I'll work on it! |
No worries at all, if you need any help just ask! :) |
spiros132
left a comment
There was a problem hiding this comment.
Some feedback about the PR! :D
| readonly property string screenName: screen ? (screen.name ?? "") : "" | ||
| readonly property real capsuleHeight: (typeof Style !== "undefined" && typeof Style.getCapsuleHeightForScreen === "function") ? Style.getCapsuleHeightForScreen(root.screenName) : 26 | ||
| readonly property real barFontSize: (typeof Style !== "undefined" && typeof Style.getBarFontSizeForScreen === "function") ? Style.getBarFontSizeForScreen(root.screenName) : 10 | ||
| readonly property string fixedFont: (typeof Settings !== "undefined" && Settings.data?.ui?.fontFixed) ? Settings.data.ui.fontFixed : "monospace" |
There was a problem hiding this comment.
Settings and Style should never be undefined. If they are then something has gone wrong. You don't need to check if they are undefined or not.
| pluginApi?.manifest?.metadata?.defaultSettings?.allowPopupOpening ?? | ||
| true | ||
|
|
||
| readonly property real contentWidth: layout.implicitWidth + ((typeof Style !== "undefined") ? Style.marginS * 2 : 8) |
There was a problem hiding this comment.
Here as well, you don't need to check if Style is undefined or not.
| readonly property real contentWidth: layout.implicitWidth + ((typeof Style !== "undefined") ? Style.marginS * 2 : 8) | ||
| readonly property real contentHeight: capsuleHeight | ||
| implicitWidth: contentWidth | ||
| implicitHeight: (typeof Style !== "undefined") ? Style.barHeight : 32 |
| import QtQuick.Layouts | ||
| import QtQuick.Controls | ||
| import Quickshell | ||
| import Quickshell.Io as QSIo |
There was a problem hiding this comment.
Is there a reason why this needs to be imported as a separate name?
| } | ||
|
|
||
| // Hardware fan monitoring (passive tracking bound to thinkfan) | ||
| QSIo.FileView { |
There was a problem hiding this comment.
You can just use the regular FileView no need to specify where the component comes from.
| } | ||
|
|
||
| Timer { id: refreshTimer; interval: 300; repeat: false; onTriggered: { fanLoader.reload(); tempLoader.reload(); } } | ||
| Timer { interval: 2000; running: true; repeat: true; triggeredOnStart: true; onTriggered: { fanLoader.reload(); tempLoader.reload(); } } |
There was a problem hiding this comment.
Is this timer really needed? I believe that the FileView component gets updated immediately when any change happens on the file.
| anchors.centerIn: parent | ||
| width: root.contentWidth | ||
| height: root.contentHeight | ||
| radius: (typeof Style !== "undefined") ? Style.radiusL : 6 |
There was a problem hiding this comment.
As before, you don't need to check if Style is undefined or not.
| : (root.isCustomActive | ||
| ? ((typeof Color !== "undefined") ? Color.mPrimary : "#3355ff") | ||
| : (root.fanLevel === "0" ? "#cc241d" : ((typeof Style !== "undefined") ? Style.capsuleBorderColor : "#33ffffff"))) | ||
| border.width: (typeof Style !== "undefined") ? Style.capsuleBorderWidth : 1 |
There was a problem hiding this comment.
You don't need to check if Style or any other singleton component exists on any of these.
I won't comment on each and every one to skip spam.
| pointSize: (typeof Style !== "undefined") ? Style.fontSizeS : 10 | ||
| color: parent.isSelected | ||
| ? ((typeof Color !== "undefined") ? Color.mOnPrimary : "#ffffff") | ||
| : ((typeof Color !== "undefined") ? Color.mOnSurface : "#ffffff") |
There was a problem hiding this comment.
As before, no need to check if these singleton are undefined or not.
|
|
||
| Grant group write parameters over systemic thermal interfaces by applying the setup script: | ||
|
|
||
| cd ~/.config/noctalia/plugins/fan-speed/ |
There was a problem hiding this comment.
This isn't the correct plugin name.
Description
This PR adds the ThinkPad Fan Control (thinkpad-fan) plugin to the community registry.
It provides real-time hardware monitoring and control for Lenovo ThinkPad laptops by interfaces with /proc/acpi/ibm/fan and system thermal zones. The plugin has been fully updated to utilize Noctalia's native settings API and UX guidelines, integrating seamlessly with the system settings panel.
Features
Plugin Structure
Test
Tested on 2 ThinkPad T14 Gen 1.