mirror of
https://github.com/Zerodya/hyprfreeze.git
synced 2024-11-09 17:08: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() {
|
function main() {
|
||||||
# Handle the chosen required flag
|
# Get pid by a required flag
|
||||||
if [ "$FLAG_ACTIVE" = true ]; then
|
if [ "$FLAG_ACTIVE" = true ]; then
|
||||||
getPidByActive
|
getPidByActive
|
||||||
toggleFreeze
|
|
||||||
elif [ -n "$FLAG_PID" ]; then
|
elif [ -n "$FLAG_PID" ]; then
|
||||||
getPidByPid "$FLAG_PID"
|
getPidByPid "$FLAG_PID"
|
||||||
toggleFreeze
|
|
||||||
elif [ -n "$NAME_FLAG" ]; then
|
elif [ -n "$NAME_FLAG" ]; then
|
||||||
getPidByName "$NAME_FLAG"
|
getPidByName "$NAME_FLAG"
|
||||||
toggleFreeze
|
|
||||||
elif [ "$FLAG_PROP" = true ]; then
|
elif [ "$FLAG_PROP" = true ]; then
|
||||||
getPidByProp
|
getPidByProp
|
||||||
toggleFreeze
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Suspend or resume process
|
||||||
|
toggleFreeze
|
||||||
|
|
||||||
# Run these functions after PID is obtained
|
# Run these functions after PID is obtained
|
||||||
if [ $INFO -eq 1 ]; then printInfo; fi
|
if [ $INFO -eq 1 ]; then printInfo; fi
|
||||||
if [ $SILENT -ne 1 ]; then sendNotification; fi
|
if [ $SILENT -ne 1 ]; then sendNotification; fi
|
||||||
|
|
Loading…
Reference in a new issue