Custom commands do not work

Hi,
I have kde installed on a Win11 laptop and an Android 13 mobile. I use it to control my laptop with my mobile. Everything works fine (connection, remote control) except custom commands.
I was able to define several commands, but if I try to execute them nothing happens.
Any help appreciated!

Hmmm I use KDE connect on Manjaro and it does work… but you have to formulate the commands with care.

I have these - exported to JSON - which work with my KDE desktop, I can request a screenshot to my phone, adjust volume, launch Strawberry music player etc.

[
    {
        "command": "loginctl lock-session",
        "name": "Lock Screen"
    },
    {
        "command": "file=/tmp/$(hostname)_$(date \"+%Y%m%d_%H%M%S\").png; spectacle -bno \"${file}\" && kdeconnect-cli -d $(kdeconnect-cli -a --id-only) --share ${file}",
        "name": "PrSc>phone"
    },
    {
        "command": "systemctl reboot",
        "name": "Reboot"
    },
    {
        "command": "strawberry.sh",
        "name": "Strawberry"
    },
    {
        "command": "strawberry -t",
        "name": "Strawberry - Pause"
    },
    {
        "command": "strawberry -s",
        "name": "Strawberry - stop"
    },
    {
        "command": "systemctl suspend",
        "name": "Suspend"
    },
    {
        "command": "loginctl unlock-session",
        "name": "Unlock Screen"
    },
   {
        "command": "amixer -q sset Master 10%+",
        "name": "Vol+"
    },
    {
        "command": "amixer -q sset Master 10%-",
        "name": "Vol-"
    },
    {
        "command": "conky -d -c ~/Dropbox/Admin/conky/c0-time.conky && conky -d -c ~/Dropbox/Admin/conky/c0-date.conky && conky -d -c ~/Dropbox/Admin/conky/c2-network.conky && conky -d -c ~/Dropbox/Admin/conky/c1-information.conky\nfi",
        "name": "conky"
    },
    {
        "command": "",
        "name": ""
    }
]

My commands should also be correct. I use one template and 2 other very simple commands (e.g. cmd.exe)

You’ll know they are actually correct when they actually work.

That’s the most arch linux user answer I’ve ever seen.

@hacmac I have the same issue I one line cli command works perfectly on my mac, I checked all the shells bash and zsh without sudo, but not on kde-connect.

many other commands do work but some it really hates.

1 Like

im having exact same issue but the diffrence is , In the older versions of kde connect the custom cmds wroks perfectly fine like ( shutdown -s -t 10 ) i.e simple cmd commands , But in newver version nothing works any idea ???

1 Like

Are you using a distribution without systemd?

I have these, and they all work (and have done for over a year now):

KDE Connect Commands
systemctl reboot
loginctl lock-screen
systemctl suspend
systemctl shutdown
amixer -q sset Master 10%+
amixer -q sset Master 10%-
  • I would suggest just using systemctl shutdown.

It seems you created a new account to report this issue, but you did not enter any details at all - and as you also don’t give any information about what distribution, system you are running, or what you regard to be ‘old’ or ‘new’ versions.

Interesting also - at the bottom of KDE Connect Settings is a long button with:
+ Sample Commands

In the interests of basic discoverability, you can press this and add the command for Shutdown from there, it goes with systemctl poweroff.

That works.

https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands

This is a good start…

Hi! Just to check, you mentioned this is the same issue as the one that started this Help topic - are you running the Microsoft Windows version of KDE Connect, as the original poster was?

If not, it might be most helpful to have a separate topic for your own situation, where you could provide information about the systems you’re trying to get to work together using KDE Connect, and folks could best narrow down what might be helpful for your specific situation :slight_smile:

1 Like