Closed 0xdeafbeef closed 4 years ago
The widget is run as your user level permissions. That's why that command needs to be run as sudo
to elevate your permissions to the root
user. First things first, you should NEVER try to run an entire GUI application as root
(eg: dolphin). So don't attempt that method, as you'll likely fuckup your KDE install.
In order to do this, you need to "whitelist" that command so that you can run it as a normal user. I came across this a long time ago, but I've never tried it.
Be extremely careful that you don't accidentally allow your user to run any command as root. Good luck.
It looks like you're trying to show your nvme's temperature sensor. Can you currently graph that sensor in KSysGuard? As it might be easier for you to create a widget that displays a sensor value.
PlasmaComponents.Label {
text: i18n("SSD %1", dataSource.getData(dataSource.nvmeSensorPath))
}
PlasmaCore.DataSource {
id: datasource
engine: "systemmonitor"
property string nvmeSensorPath: '/asdf/asdf/asdf/????'
connectedSources: [ nvmeSensorPath ]
function getData(key) {
if (typeof dataSource.data[key] === 'undefined') return 0
if (typeof dataSource.data[key].value === 'undefined') return 0
return dataSource.data[key].value
}
}
I made i crutch:
Created tmpfs, and added script, which writes current temp of ssd to file on tmpfs.
Scripts starts with os.
Thank you for your help!
For example, i have such command:
which shows temperature of ssd. How can i make your widget to render output of this command?