You are not logged in.
Now that we are kind of forced to use Wayland since Plasma 6.4, I have a ton of global shortcuts mapped to scripts like this:
* Meta-F:
wmctrl -xa firefox || exec firefox* Meta-K:
wmctrl -xa konsole || exec konsoleSince the forced Wayland upgrade, this always starts a new process and does not focus the existing window.
Is there an equivalent way of focusing an application in wayland like we could in Xorg with wmctrl?
Thank you.
Last edited by tvidal (2025-07-09 11:23:50)
Offline
You are not forced to anything. Nobody is stopping you from keeping using X11.
Offline
Well, I said "kind of", because for the moment I fixed by installing plasma-x11-session as suggested in another topic, but I know that is temporary a temporary solution with Xorg reaching end of support.
Ultimately, I will need to find a better solution to keep these Global Shortcuts working.
Last edited by tvidal (2025-06-22 16:10:12)
Offline
found kdotool
here's the full script for future reference:
#!/usr/bin/env zsh
set -eo pipefail
#
## open-app
#
# Usage:
# open-app [action] <class> [args]
# action:
# -R: move window to current desktop and focus
#
# name: window class / executable name
# args: executable program arguments
zparseopts -D -K -a ARGS -- R || exit 1
# focus app if already running
WINDOW=$(kdotool search --class $1)
if [ -n "$WINDOW" ]
then
if [ -n "${ARGS[(r)-R]}" ]
then
kdotool set_desktop_for_window $WINDOW $(kdotool get_desktop)
fi
kdotool windowactivate $WINDOW
exit 0
fi
cd ${HOME}
if exe=$(whence -p $1) && [ -x $exe ]
then
exec $*
else
gtk-launch $*
fiOffline
I am looking for a gnome solution for this.
Offline