blob: 9af3f813be7d4cdaa41baa715d40c8a5bc31bc36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env bash
# ==================================================
# KoolDots (2026)
# Project URL: https://github.com/LinuxBeginnings
# License: GNU GPLv3
# SPDX-License-Identifier: GPL-3.0-or-later
# ==================================================
# Copied from Discord post. Thanks to @Zorg
# 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 "${XDG_CONFIG_HOME:-$HOME/.config}/swaync/images/error.png" "Kill Active Window" "No active window PID found."
exit 1
fi
# Close active window
kill "$active_pid"
|