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:
parent
f3689a5806
commit
a0174adacc
1 changed files with 6 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue