/usr/share/ksysguard/scripts/README is in libkf5sysguard-data 4:5.5.5-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | To create a script:
* Make a folder here with any name
* Inside create a file with any name, ending .desktop, looking like:
[Desktop Entry]
Name=What's this process...
Comment=General information about this program
X-KDE-ServiceTypes=KSysGuard/Script
Type=Service
You will now get the Name in a context menu when right clicking on a process. This can be translated by doing Name[gr]= etc.
* Create a main.js file containing javascript code. This code will be run when the user choses the context menu entry.
* There are the following functions:
filecontent = readFile("/proc/blah")
exists = fileExists("/proc/blah")
setHtml("<html><b>Hi!</b>");
* For a quick and simple GUI, you can just call "setHtml" which will create a dialog box with a webkit browser. Subsequent calls to setHtml will replace the html in the same browser widget.
* If you create a GUI using designer, save the file in the same folder. Any file ending .ui will be made accessible to the script, with the variable name
being the filename, with "." replaced with "_".
e.g. A file called "dialog.ui" with a textbox called 'textBox' can be used like:
dialog_ui.textBox.text = "Hello";
dialog_ui.show();
* The following variables are also available to use, with their values set to the process selected:
process.pid
process.ppid
process.name
process.fullname
process.command
|