1
0
Fork 1
mirror of https://github.com/Zerodya/hyprfreeze.git synced 2024-11-10 01:18:49 +01:00

fix: check for numeric PID in toggleFreeze

This commit is contained in:
alterNERDtive 2024-02-12 12:41:05 +01:00
parent f3689a5806
commit a0174adacc
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1

View file

@ -58,6 +58,12 @@ function getPidByActive() {
debugPrint "Getting PID by active window..."
PID=$(hyprctl activewindow -j | jq '.pid')
debugPrint "PID by active window: $PID"
# Die if PID is not numeric (e.g. "null" if there is no active window)
if ! [[ $PID == ?(-)+([[:digit:]]) ]]; then
echo "Cannot freeze window with invalid PID $PID."
exit 1
fi
}
function getPidByPid() {