diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-10-22 15:55:57 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-10-22 15:55:57 +0900 |
| commit | c222e1bad2ba5e779c3af5b956906c82ead43271 (patch) | |
| tree | a5253e0861c200ff90354169e1f67ef42ebf0ef9 /config/hypr/scripts/AppAutoClose.sh | |
| parent | bb0be21dba7980fc1c047eaba24eda1712bd7f31 (diff) | |
Initial upload
Diffstat (limited to 'config/hypr/scripts/AppAutoClose.sh')
| -rwxr-xr-x | config/hypr/scripts/AppAutoClose.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/hypr/scripts/AppAutoClose.sh b/config/hypr/scripts/AppAutoClose.sh new file mode 100755 index 00000000..32a6d735 --- /dev/null +++ b/config/hypr/scripts/AppAutoClose.sh @@ -0,0 +1,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 |
