Bug 403077 - Command-line argument that prints the info that would be copied to the clipboard when using the copy-to-clipboard UI button
Summary: Command-line argument that prints the info that would be copied to the clipbo...
Status: RESOLVED FIXED
Alias: None
Product: kinfocenter
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 17:33 UTC by shevegen
Modified: 2023-05-18 10:59 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shevegen 2019-01-10 17:33:59 UTC
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.
Comment 1 Nate Graham 2019-01-15 16:36:45 UTC
Seems simple and sensible enough. Gregor, what do you think?
Comment 2 Gregor Mi 2019-01-16 21:37:00 UTC
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.
Comment 3 Harald Sitter 2020-01-20 12:39:07 UTC
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.
Comment 4 Harald Sitter 2023-05-06 15:23:15 UTC
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
Comment 5 Harald Sitter 2023-05-06 15:45:47 UTC
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
Comment 6 Harald Sitter 2023-05-07 19:11:51 UTC
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
Comment 7 Harald Sitter 2023-05-07 19:19:36 UTC
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
Comment 8 Félim Whiteley 2023-05-15 18:42:49 UTC
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
Comment 9 Nate Graham 2023-05-15 18:46:40 UTC
That does look like a Neon build issue, yeah. It's trying to use kcmshell6, which isn't released yet.
Comment 10 Félim Whiteley 2023-05-18 10:59:43 UTC
(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 :)