Open vpsone opened 2 weeks ago
You need to change the qdbus executable name to match the one in your system:
Qdbus is needed to get the shortcuts and also to run them. I will add automatic detection based on the most common names and warn the user when it needs to be configured manually.
I have changed it but still not getting actions
Try switching to another tab and back (they are loaded when the tab loads), also if the executable is set correctly actions on the panel should work
I have rebooted my pc, even it is not working.
Actions on panel working correctly, only actions are missing when try to change it
What's the output of the command below?
for comp in $(qdbus org.kde.kglobalaccel | grep '/component/'); do name=$(echo $comp | sed 's|\/component\/||g') friendly_name=$(qdbus org.kde.kglobalaccel $comp org.kde.kglobalaccel.Component.friendlyName) IFS=$'\n';for shortcut in $(qdbus org.kde.kglobalaccel $comp org.kde.kglobalaccel.Component.shortcutNames); do echo $friendly_name,$name,$shortcut;done; done | sort
It's what I use to get the shortcuts from the system
Actions are shown if I replace getShortcutsCommand
with what you have provided in configActions.qml
but for kwin action it showing me like this
Okay that's progress, please replace the contents of configActions.qml with the following:
After that restart/logout and with journalctl -f --grep="qml|js"
running open the widget settings and send the command output, I think there is a problem with the parsing somewhere. The output will be large so a text file may be better
Here is the output output.txt
Even with the log I am still not sure what's wrong:
stderr: Cannot find '.e' in object /compo at org.kde.kglobalaccel
The command I shared earlier wasn't the correct one (took it from the shell history 🤦♂️), does the following run without errors?
for comp in $(qdbus org.kde.kglobalaccel | grep '/component/'); do
echo "COMPONENT" $comp
IFS=$'\n';
for shortcut in $(qdbus org.kde.kglobalaccel $comp org.kde.kglobalaccel.Component.shortcutNames); do
echo $comp,$shortcut;
done;
done
If I change do IFS=$'\\n';
to do IFS=$'\n';
in configActions.qml
, It is working fine without any error, I think using extra \
causing the error
Looks like the problem is the shell that Plasma is calling, it defaults to /bin/sh
and on my system that is aliased to bash. Probably in yours is running pure sh
(can you verify that? ls -l /bin/sh
). Which causes https://www.shellcheck.net/wiki/SC3003.
Apparently leaving the backslash unescaped (like you did) lets the shell interpret it literally so it still works. Not sure if this could cause problems with other systems where the alias is set to some other shell though.
Probably the correct thing to do would be to put the command in a script with bash shebang and make sh run that
For my system /bin/sh
aliased to dash
, I am using KDE neon based on Ubuntu 22.04.
Yeah that's the reason. Switching to separate bash script will fix this
At some point I plan to switch to a python dbus script because that will make it easier to pull shortcut names in the system language
Even I'm searching something, it's showing me blank
I am using latest version.