Skip to content

Commit

Permalink
Remove loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimiblock committed Feb 14, 2025
1 parent 52ea0d4 commit a928ac5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions portable-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

function waitForStart() {
echo 1 >~/startSignal
inotifywait \
-e modify \
--quiet \
~/startSignal
#inotifywait \
# -e modify \
# --quiet \
# ~/startSignal
}

waitForStart
Expand Down
14 changes: 5 additions & 9 deletions portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ function execApp() {
else
pecho warn "bwBindPar is ${bwBindPar}"
fi
rm "${XDG_DATA_HOME}/${stateDirectory}/startSignal"
passPid &
rm "${XDG_DATA_HOME}/${stateDirectory}/startSignal" 2>/dev/null
passPid
systemd-run \
--user \
${sdOption} \
Expand Down Expand Up @@ -850,12 +850,8 @@ function launch() {
}

function passPid() {
pecho debug "Waiting for application start"
inotifywait \
-e modify \
--quiet \
"${XDG_DATA_HOME}/${stateDirectory}/startSignal"
getChildPid
#getChildPid
local childPid=$(systemctl --user show "${friendlyName}-dbus" -p MainPID | cut -c '9-')
echo "${childPid}" >"${XDG_DATA_HOME}/${stateDirectory}/mainPid"
echo "${childPid}" >"${XDG_RUNTIME_DIR}/.flatpak/${instanceId}/pid"
sed -i \
Expand All @@ -868,7 +864,7 @@ function passPid() {
sed -i \
"s|placeholderPidId|$(readlink /proc/${childPid}/ns/pid | sed 's/[^0-9]//g')|g" \
"${XDG_RUNTIME_DIR}/.flatpak/${instanceId}/bwrapinfo.json"
echo 2 >"${XDG_DATA_HOME}/${stateDirectory}/startSignal"
#echo 2 >"${XDG_DATA_HOME}/${stateDirectory}/startSignal"
}

function stopApp() {
Expand Down

0 comments on commit a928ac5

Please sign in to comment.