this post was submitted on 09 Jan 2026
14 points (100.0% liked)

KDE

7794 readers
103 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org/, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 2 years ago
MODERATORS
 

Is there a window rule for 'close' to be applied when an application starts, instead of 'Minimized'?

Why would anyone want to close an application at launch? Well, the appimage for Viber doesn't let you set Minimize to Tray at start-up. So, for now I use a window rule to minimize the window at least. 'Close' would send it to the tray, but I can't find such a rule.

top 4 comments
sorted by: hot top controversial new old
[–] JTskulk@lemmy.world 7 points 2 months ago (2 children)

There used to be a thing in KDE where you could execute actions and macros based on window titles, but it's since been removed. I've had to recreate this behavior with a shell script, here's a modified version you can use if you use Xorg:

#!/bin/bash

xprop -spy -root _NET_ACTIVE_WINDOW | grep --line-buffered -o '0[xX][a-zA-Z0-9]\{7\}' |
while read -r id; do
    class="`xprop -id $id WM_CLASS 2> /dev/null | grep Viber`"
    if [ -n "$class" ]; then
        if xprop -id "$id" | grep -q 'WM_NAME(STRING) = "Viber Window Name"'; then
            echo "key alt+f4" | xdotool -
            # wait for the window to be closed
            xprop -spy -id $id > /dev/null 2>&1
            fi
    fi
done

The first Viber is is looking for the Viber in the application name, replace "Viber Window Name" with the actual window title you want to be closed. If you don't use Xorg, you'll have to find a replacement for both xprop and xdotool.

[–] R1Rail@pouet.chapril.org 3 points 2 months ago (1 children)

@JTskulk @Stopwatch1986

You may use kdotool (and it works on X and Wayland)

[–] Stopwatch1986@lemmy.ml 1 points 2 months ago

Thanks for the tip. Without kwindowprop I will have to wait though.

[–] Stopwatch1986@lemmy.ml 1 points 2 months ago* (last edited 2 months ago)

I am on Debian 13 KDE Plasma with Wayland. I tried kdotool as @Erwan suggests but as expected xprop doesn't return anything. Apparently, I will also have to use kwindowprop which will take a while to appear on Debian Stable.

There used to be a thing in KDE where you could execute actions and macros based on window titles

Now, that would be nice but unless there is another way it looks like I will have to wait.

Thanks for the help.