Skip to content

Commit

Permalink
init etc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Knifa committed Mar 25, 2023
1 parent 5046476 commit 77a778b
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions ipk/control/conffiles
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/opt/etc/package-config/dji-moonlight-shim/config.json
18 changes: 18 additions & 0 deletions ipk/control/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/system/bin/sh

# Reboot glasses service to pick up menu entry.

IS_V2=$(getprop ro.product.device | grep -c "wm170_gls")
if [ $IS_V2 -eq 1 ]; then
GLASSES_SERIVCE="dji.glasses_wm150_service"
else
GLASSES_SERIVCE="dji.glasses_service"
fi

IS_GLASSES_RUNNING=$(getprop $GLASSES_SERIVCE)
if [ $IS_GLASSES_RUNNING -eq 1 ]; then
setprop $GLASSES_SERIVCE 0
sleep 3
setprop $GLASSES_SERIVCE 1
sleep 3
fi
2 changes: 2 additions & 0 deletions ipk/control/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/system/bin/sh
/opt/sbin/dinitctl -u stop dji-moonlight-shim || true
2 changes: 2 additions & 0 deletions ipk/control/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/system/bin/sh
/opt/sbin/dinitctl -u stop dji-moonlight-shim || true
11 changes: 8 additions & 3 deletions ipk/data/opt/bin/dji-moonlight-shim
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ fi

# Start the shim.

trap "setprop $GLASSES_SERIVCE 1" EXIT

function cleanup {
sleep 3
setprop $GLASSES_SERIVCE 1
exit 0
}

trap cleanup EXIT INT TERM

setprop $GLASSES_SERIVCE 0
sleep 3

cd /opt/moonlight
./dji-moonlight-shim $SHIM_ARGS

setprop $GLASSES_SERIVCE 1
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"use_usb_mode": "false"
"use_usb_mode": false
}
5 changes: 5 additions & 0 deletions ipk/data/opt/share/applications/dji-moonlight-shim.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Desktop Entry]
Exec=/opt/sbin/dinitctl start dji-moonlight-shim
Name=Moonlight
Icon=/opt/share/applications/dji-moonlight-shim.png
Icon_Active=/opt/share/applications/dji-moonlight-shim-active.png
5 changes: 0 additions & 5 deletions ipk/data/opt/share/applications/moonlight-shim.desktop

This file was deleted.

0 comments on commit 77a778b

Please sign in to comment.