View Single Post
Posts: 234 | Thanked: 40 times | Joined on Nov 2007 @ Cincinnati, Ohio USA
#381
Nice, even easier. If someone wants to change directories they can copy past somewhere else first to edit.

To create OTG host buttons:

1. Launch x-term
2. cat >/home/user/MyDocs/Otg.sh
2.a. paste code
Code:
#!/bin/sh
# usb otg mode script
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
# if not already root, call itself as root
sudo gainroot <<EOF
$0 $*
EOF
exit
fi
echo otg > /sys/devices/platform/musb_hdrc/mode
2.b. press Ctrl and enter a lowercase d.
3. chmod +x /home/user/MyDocs/Otg.sh

repeat for cat >/home/user/MyDocs/Host.sh with this code:
Code:
#!/bin/sh
# usb host mode script
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
sudo gainroot <<EOF
$0 $*
EOF
exit
fi
echo host > /sys/devices/platform/musb_hdrc/mode
From this point you can use Status Bar mentioned below, personal toolbar and/or continue to make an Icon.

1. Launch x-term
2. sudo gainroot
3. cat >/usr/share/applications/hildon/otg.desktop
3.a. paste the following code
Code:
[Desktop Entry]
Version=0.1
Encoding=UTF-8
Name=USB Otg
Type=Application
Comment=USB On the go mode
Exec=/home/user/MyDocs/Otg.sh
X-Osso-Type=application/x-executable
3.b. press Ctrl and enter a lowercase d.

again, repeat for cat >/usr/share/applications/hildon/host.desktop
Code:
[Desktop Entry]
Version=0.1
Encoding=UTF-8
Name=USB Host
Type=Application
Comment=USB host mode
Exec=/home/user/MyDocs/Host.sh
X-Osso-Type=application/x-executable

Last edited by TheGogmagog; 2008-05-30 at 05:01.