I would like to extend the commandline options for kinfocenter with one new entry. The kinfocenter GUI currently has a click-button called "Copy to Clipboard". This is quite useful as it allows us to copy that output to e. g. some website, like here in the textview/textarea HTML widget. Currently we have to start the kinfocenter widget for this, though. I propose a new commandline flag, also shown in --help, that would "dump", aka show, the very same information that is normally copied via that button onto the commandline. The name I suggest would be: --paste-clipboard or just --paste (or both). The output would be exactly the same as via the copy-to-clipboard functionality such as: Operating System: Slackware 14.2 KDE Plasma Version: 5.14.5 Qt Version: 5.12.0 KDE Frameworks Version: 5.53.0 Kernel Version: 4.4.14 OS Type: 64-bit Processors: 4 × AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G Memory: 14.6 GiB of RAM This should be an easy change because the functionality currently already exists, assumingly, since the generation of that string must be tied to the action when a user clicks the button copy-to-clipboard, which already works as is. I am not sure if the functionality is wanted by the KDE developers/maintainers but I think we can already gain that information when we start the GUI as-is; so the only change proposed here is to be able to do so from the commandline alone too, without starting the GUI.
Seems simple and sensible enough. Gregor, what do you think?
Code-wise: I have to look because during the review process I remember the logic to be changed to be more tied to the GUI elements. But nothing that could not be done :) Command line options. I suggest: --versions-to-clipboard - Copy the system information to clipboard --print-versions - Print the system information --versions-to-clipboard can be useful if someone even wants to create a custom keyboard shortcut.
KCMs are widgets, widgets usually do not get loaded until after command line parsing. What's more, this breaks abstraction a fair amount and ties kinfocenter to specific modules. So, overall not the hottest idea IMO. That being said, I want drkonqi to pick up this data as well, so we probably should split the data into a library or something, that library could be used by kinfocenter for text dumping and drkonqi for injection into reports. TBH I would much rather have a new CLI only tool `plasma-about-system` that prints the shebang instead of glueing it into kinfocenter though.
Git commit d07de79b44098f96058bee58c4e9b9aa73a82eb1 by Harald Sitter. Committed on 06/05/2023 at 14:41. Pushed by sitter into branch 'master'. about-distro: add a dump mode to print to cli used like so: kcmshell5 kcm_about-distro --args dump --platform offscreen a more handy tool to run that command may get added to kde-cli-tools M +25 -13 Modules/about-distro/src/main.cpp https://invent.kde.org/plasma/kinfocenter/commit/d07de79b44098f96058bee58c4e9b9aa73a82eb1
Git commit 3edc221749458e13acd8da66cb44367c339a0d01 by Harald Sitter. Committed on 06/05/2023 at 15:32. Pushed by sitter into branch 'master'. add kinfo fancy wrapper to dump about info out of about kcm M +1 -0 CMakeLists.txt A +4 -0 kinfo/CMakeLists.txt A +6 -0 kinfo/kinfo https://invent.kde.org/plasma/kde-cli-tools/commit/3edc221749458e13acd8da66cb44367c339a0d01
Git commit 34838dc61b4448791745a53df677f75710e3ca03 by Harald Sitter. Committed on 06/05/2023 at 15:28. Pushed by sitter into branch 'Plasma/5.27'. about-distro: add a dump mode to print to cli used like so: kcmshell5 kcm_about-distro --args dump --platform offscreen a more handy tool to run that command may get added to kde-cli-tools (cherry picked from commit d07de79b44098f96058bee58c4e9b9aa73a82eb1) M +24 -12 Modules/about-distro/src/main.cpp https://invent.kde.org/plasma/kinfocenter/commit/34838dc61b4448791745a53df677f75710e3ca03
Git commit c48699eb6088bebc8b877d9e00e92552355c2369 by Harald Sitter. Committed on 07/05/2023 at 08:57. Pushed by sitter into branch 'Plasma/5.27'. add kinfo fancy wrapper to dump about info out of about kcm (cherry picked from commit 3edc221749458e13acd8da66cb44367c339a0d01) M +1 -0 CMakeLists.txt A +4 -0 kinfo/CMakeLists.txt A +6 -0 kinfo/kinfo https://invent.kde.org/plasma/kde-cli-tools/commit/c48699eb6088bebc8b877d9e00e92552355c2369
Does not appear to work in Neon 5.27.5, build issue on Neon maybe? kinfo /usr/bin/kinfo: 6: exec: kcmshell6: not found My Info: Operating System: KDE neon 5.27 KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 Kernel Version: 5.19.0-41-generic (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor Memory: 62.7 GiB of RAM Graphics Processor: AMD Radeon RX 580 Series
That does look like a Neon build issue, yeah. It's trying to use kcmshell6, which isn't released yet.
(In reply to Nate Graham from comment #9) > That does look like a Neon build issue, yeah. It's trying to use kcmshell6, > which isn't released yet. Well that's also fixed now so yay :)