1
0
Fork 1
mirror of https://github.com/Zerodya/hyprfreeze.git synced 2024-09-19 23:43:18 +02:00

Slimmer code in main

This commit is contained in:
Nicola 2023-10-20 18:47:06 +02:00 committed by GitHub
parent 5f3b9204c2
commit a1a0fa255c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,21 +158,20 @@ function args() {
}
function main() {
# Handle the chosen required flag
# Get pid by a required flag
if [ "$FLAG_ACTIVE" = true ]; then
getPidByActive
toggleFreeze
elif [ -n "$FLAG_PID" ]; then
getPidByPid "$FLAG_PID"
toggleFreeze
elif [ -n "$NAME_FLAG" ]; then
getPidByName "$NAME_FLAG"
toggleFreeze
elif [ "$FLAG_PROP" = true ]; then
getPidByProp
toggleFreeze
fi
# Suspend or resume process
toggleFreeze
# Run these functions after PID is obtained
if [ $INFO -eq 1 ]; then printInfo; fi
if [ $SILENT -ne 1 ]; then sendNotification; fi