My use case is kinda niche. I want to write a script that activates a window when I hit a shortcut. The script should activate a program if an instance of it is running.
For example: I start a firefox instance manually. If I minimize it and hit alt+F, firefox should be unminimized and/or maximized.
The GNOME equivalent that I’ve been using is this:
// $APP_NAME in this case example is "firefox"
if xdotool search --name "$APP_NAME" > /dev/null 2>&1; then
echo "found it"
wmctrl -a "$APP_NAME"
wmctrl -r "$APP_NAME" -b add,maximized_vert,maximized_horz
wmctrl and xdotool are as far as I know not fully compatible with KDE.
I use Fedora Linux 42, KDE Plasma edition