diff options
Diffstat (limited to 'config/hypr/scripts/KillActiveProcess.sh')
| -rwxr-xr-x | config/hypr/scripts/KillActiveProcess.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/hypr/scripts/KillActiveProcess.sh b/config/hypr/scripts/KillActiveProcess.sh index 2bc108f2..d9d26bb3 100755 --- a/config/hypr/scripts/KillActiveProcess.sh +++ b/config/hypr/scripts/KillActiveProcess.sh @@ -7,5 +7,10 @@ # Get id of an active window active_pid=$(hyprctl activewindow | grep -o 'pid: [0-9]*' | cut -d' ' -f2) +if [[ -z "$active_pid" || ! "$active_pid" =~ ^[0-9]+$ ]]; then + notify-send -u low -i "$HOME/.config/swaync/images/error.png" "Kill Active Window" "No active window PID found." + exit 1 +fi + # Close active window -kill $active_pid
\ No newline at end of file +kill "$active_pid" |
