#!/usr/bin/env -S sh
kioclient ls 'applications:/'
I receive the content I expect in the output, but with an unexpected error:
PS /home/RokeJulianLockhart> kioclient ls 'applications:/'
kf.kio.core: UDSEntry for '.' not found, creating a default one. Please fix the "kioworker" KIO worker.
Development
Education
Games
Graphics
Internet
Multimedia
Office
Settings
System
Utilities
Waydroid
Help
.
Specifically:
It’s evidently minor, but I want to ensure that I’m calling it correctly.
file $(command -v kioclient5)
/usr/bin/kioclient5: symbolic link to kioclient
kioclient6 doesn’t exist.
Workaround
It’s not infeasible to deal with:
#!/usr/bin/env python3.13
# Run the command and capture output:
kioclient_result = subprocess.run(
[
"kioclient",
"ls",
"applications:/"
],
text=True,
capture_output=True,
check=True
)
# Split output into lines:
original_lines = kioclient_result.stdout.splitlines()
# Remove the first line:
filtered_lines = original_lines[1:] if builtins.len(original_lines) > 1 else []
# Ensure we remove the last non-empty line if it's ".":
while filtered_lines and filtered_lines[-1].strip() in {"", "."}:
filtered_lines.pop()
# Print or process the filtered output:
print("\n".join(filtered_lines))
However, is this fragile? I wish the command just returned JSON, YAML, or XML.
@meven, Is it really expected that a developer calls it using the shell…? I ask because I presume it’s used a lot for important functionality like the application menu and Dolphin’s plugins, which makes me wonder whether this was a bug when utilizing it via the CLI, considering that that’s an unusual way to access it.
If I’m correct, is there a library that I can call instead (even if solely via C++, instead of PyQt)? (If not, considering that it’s all FreeDesktop-standard stuff, perhaps https://unix.stackexchange.com/a/615598/386242 would work.)
The fact that warning is outputed means that all users will generate unnecessary logs. For applications:/ that kicker, the start menu mainly.
We want to keep our logs free of unnecessary warning, this is noisy and wasted disk space in logs.