mirror of
https://github.com/Zerodya/hyprfreeze.git
synced 2024-11-10 01:18:49 +01:00
Slimmer code in main
This commit is contained in:
parent
5f3b9204c2
commit
a1a0fa255c
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue