-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathremux-api
executable file
·66 lines (64 loc) · 1.43 KB
/
remux-api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
help() {
echo "Usage: remux-api <command>"
echo ""
echo " Commands:"
echo " --help | help: Show this message and exit"
echo " list-paused: List all paused apps"
echo " list-apps: List all installed apps"
echo " current-app: Output name of current app"
echo " show: Show the remux UI"
echo " hide: Hide the remux UI"
echo " suspend: Suspend the device"
echo " launch [name]: Launch an app"
echo " pause [name]: Pause an app if it's the current app"
echo " stop [name]: Stop an app"
}
case "$1" in
list-paused | list-apps | current-app | show | hide | suspend)
if [ $# -ne 1 ]; then
help
exit 1
fi
case "$1" in
list-paused)
remux --paused-apps 2>/dev/null
;;
list-apps)
remux --all-apps 2>/dev/null
;;
current-app)
remux --current-app 2>/dev/null
;;
show)
echo "show" > /run/remux.api
;;
hide)
echo "hide" > /run/remux.api
;;
suspend)
echo "suspend" > /run/remux.api
;;
esac
;;
launch | pause | stop)
if [ $# -ne 2 ]; then
help
exit 1
fi
case "$1" in
launch)
echo "launch $2" > /run/remux.api
;;
pause)
echo "pause $2" > /run/remux.api
;;
stop)
echo "stop $2" > /run/remux.api
;;
esac
;;
* | help | --help)
help
;;
esac