aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/AppAutoClose.sh
blob: 32a6d735e29f0b69f9e8e97a525ce1c581e63131 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Variables: put the process names you want to auto close here. Make sure to add "" and inside the ()
processes=("pavucontrol")

# Loop through each process name
while true; do
    active_window=$(hyprctl activewindow | grep class | awk '{print $2}')

    # Loop through each process name in the array
    for process in "${processes[@]}"; do
        if [ "$active_window" == "$process" ]; then
            # If the active window matches the process, mark it as active
            process_active=true
        else
            # If not, mark it as inactive and try to kill the process
            process_active=false
            pkill "$process"
        fi
    done

    sleep 5
done
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage