this post was submitted on 20 Jul 2025
10 points (100.0% liked)

Linux Questions

2260 readers
27 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS
 

Ok, first off KDE Connect is a killer app. It's so slick and convenient. Love it.

My desktop is running Fedora 42 Workstation with Gnome. Since I've got GNOME instead of KDE, I'm using an extension called GSConnect to communicate with KDE connect on my phone. It's working perfectly.

I've also got this extension called "Display Configuration Switcher" that lets me use a keyboard shortcut ( ctrl + ; ) to switch between two display configs:

  1. Standard desktop layout
  2. TV only.

(Fedora 42 is using Wayland, when I was on X11 I could use ARandR to create custom commands but Wayland is... more complicated.)

I want to add a command to KDE Connect/GSConnect to switch my display configuration from "desktop" output to "TV" output. The problem is I don't know what command to invoke to trigger "Display Configuration Switcher" to swap configurations.

There are multiple ways to approach this. The best solution is just to figure out what command is invoked when I press the keyboard shortcut "ctrl + ;", which is the shortcut to switch display configs. I'm not sure how to see what command is run when I press a button or shortcut.

Alternatively, I could find a way to send the ctrl + ; shortcut from the KDE connect app. Sending keyboard shortcuts would be handy regardless, but this is a workaround.

Any help would be appreciated. Thank you in advance!

top 10 comments
sorted by: hot top controversial new old
[–] dontmindmehere@programming.dev 2 points 19 hours ago (1 children)

as far as i can tell, those keybindings are handled internally, they don't invoke shell commands

you can use something like wtype or ydotool to send keybindings from kdeconnect

[–] riquisimo@lemmy.dbzer0.com 1 points 17 hours ago

I'll look into these, thank you!

[–] lounges@lemmy.world 2 points 19 hours ago (1 children)

You are looking for gdctl. https://manpages.ubuntu.com/manpages/plucky/man1/gdctl.1.html

You may also want pactl for audio switching.

[–] riquisimo@lemmy.dbzer0.com 1 points 17 hours ago

This looks promising, thank you!

[–] just_another_person@lemmy.world 1 points 21 hours ago (1 children)
[–] riquisimo@lemmy.dbzer0.com 1 points 20 hours ago (1 children)

Yup! I'm here. I know how to add commands, I just don't know the command to run.

I don’t know what command to invoke to trigger “Display Configuration Switcher” to swap configurations.

I appreciate the comment though!

[–] just_another_person@lemmy.world 1 points 18 hours ago (1 children)

Just send "CTRL +" if that's what works locally. Am I missing something here?

[–] riquisimo@lemmy.dbzer0.com 1 points 17 hours ago (1 children)

How do you send the ctrl key? My mobile keyboard doesn't have ctrl, alt, shift, or super modifiers.

[–] just_another_person@lemmy.world 1 points 16 hours ago* (last edited 16 hours ago) (1 children)

Literally the link I sent you that you said you read. See the link to Userbase within for examples.

Edit: also https://www.reddit.com/r/kde/comments/v3svo7/alt_ctrl_and_super_key_input_with_kde_connect/

[–] riquisimo@lemmy.dbzer0.com 1 points 1 hour ago

Thanks.

So the link you originally sent doesn't say anything about sending ctrl/shift/alt modifier keystrokes. And I didn't click the Userbase link at the end of that page because it said it was linking to scripts.

That Userbase link does mention sending keystrokes! However it uses "nircmd," which is a windows-specific command (Example: nircmd sendkeypress shift+plus)

BUT! The reddit link mentions Unexpected Keyboard, which does work! Once installed and enabled I can go into KDE Connect > remote input > keyboard and hit the language icon/globe thing and my keyboard swaps between my preferred keyboard and Unexpected keyboard. On UK I can press Ctrl and swipe down&right on the "n" key to access semicolon and my display config switches. Success!

However it's still not as clean as I would like it. It's still 5 clicks/taps instead of 2. I decided to post on the app's GitLab page to see if the developer could make a command or something that would trigger the switch. But in the mean time, I have one working solution. So thanks!