Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Remotes_Menu(){
- while true
- do
- remotechoice=""
- dialog --clear --cancel-label "Go Back" --backtitle "XBMC LIVE SETUP FOR $CUR_KER Ver: $VERSION" \
- --colors --title "\Z4[ REMOTE CONTROLLER SETUP ]\Zn" \
- --menu "\n You can use the \Z1UP\Zn/\Z1DOWN\Zn arrow keys,\n the No. of the choice as a hot key,\n to choose an option.\n\n Please choose an item:" 16 50 5 \
- 1 "ASRock 330HT/BD Remote" \
- 2 "Windows Media Center Remote" \
- 3 "Sony BT Remote" \
- 4 "XBOX Remote" 2>/tmp/xci/remotesmenu
- case $? in
- 0)
- remotesmenuitem=$(</tmp/xci/remotesmenu)
- case $remotesmenuitem in
- 1) remotechoice=asrockremote;;
- 2) remotechoice=MSMCremote;;
- 3) remotechoice=sonyremote;;
- 4) remotechoice=xboxremote;;
- esac;;
- 1)
- Hardware_Menu; break;;
- 255)
- Hardware_Menu; break;;
- esac
- # Fix remote compatibility with kernels greater than 2.6.31-20
- if [ "$remotechoice" = "asrockremote" -a "$(dmidecode -t 2 | grep -i "Product Name:" | awk '{print $3}')" != "FMCP7A-ION" ]; then
- if [ "$CUR_OS" = "karmic" ]; then
- cd ~/setup
- dialog --colors --title "\Z1[ INFORMATION ]\Zn" --msgbox "\nYour system is running Kernel\Z1 "$(uname -r)"\Zn. \n\Z1DKMS\Zn will build \Z4Asrock 330 HT remote & receiver\Zn\nautomatically after any kernel upgrade.\n\nPress \Z1OK\Zn to continue...\n " 11 54
- echo "0" | dialog --colors --title "\Z1[ FIXING DRIVER COMPATIBILITY ]\Zn" --gauge " Please Wait..." 6 70
- service xbmc-live stop >> ~/setup/logs/xci-remote.log
- aptitude purge ~nlirc -y >> ~/setup/logs/xci-remote.log
- debconf-set-selections lirc_none.seed >> ~/setup/logs/xci-remote.log
- echo "5" | dialog --colors --title "\Z1[ FIXING DRIVER COMPATIBILITY ]\Zn" --gauge " Please Wait..." 6 70
- aptitude install lirc-modules-source -y -q >> ~/setup/logs/xci-remote.log
- cd $HOME/setup/ >> ~/setup/logs/xci-remote.log
- aptitude install linux-source -y -q >> ~/setup/logs/xci-remote.log
- echo "10" | dialog --colors --title "\Z1[ FIXING DRIVER COMPATIBILITY ]\Zn" --gauge " Please Wait..." 6 70
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/lirc_none.seed >> ~/setup/logs/xci-remote.log
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/lirc_asrock.seed >> ~/setup/logs/xci-remote.log
- echo "15" | dialog --colors --title "\Z1[ FIXING DRIVER COMPATIBILITY ]\Zn" --gauge " Please Wait..." 6 70
- echo "20" | dialog --colors --title "\Z1[ FIXING DRIVER COMPATIBILITY ]\Zn" --gauge " Please Wait..." 6 70
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/IR_9.10_V1.0.4.zip >> ~/setup/logs/xci-remote.log
- unzip -o "IR_9.10_V1.0.4.zip" >> ~/setup/logs/xci-remote.log
- echo "40" | dialog --colors --title "\Z1[ DKMS DRIVER PREPARATION ]\Zn" --gauge " Please Wait..." 6 70
- dpkg -i lirc-nct677x-src-1.0.4-ubuntu9.10.deb >> ~/setup/logs/xci-remote.log
- echo "60" | dialog --colors --title "\Z1[ DKMS DRIVER PREPARATION ]\Zn" --gauge " Please Wait..." 6 70
- dkms add -m lirc-nct677x-src -v 1.0.4-ubuntu9.10 >> ~/setup/logs/xci-remote.log
- echo "70" | dialog --colors --title "\Z1[ DKMS DRIVER PREPARATION ]\Zn" --gauge " Please Wait..." 6 70
- dkms build -m lirc-nct677x-src -v 1.0.4-ubuntu9.10 >> ~/setup/logs/xci-remote.log
- echo "80" | dialog --colors --title "\Z1[ DKMS DRIVER PREPARATION ]\Zn" --gauge " Please Wait..." 6 70
- dkms install -m lirc-nct677x-src -v 1.0.4-ubuntu9.10 >> ~/setup/logs/xci-remote.log
- echo "95" | dialog --colors --title "\Z1[ BUILDING DRIVER ]\Zn" --gauge " Please Wait..." 6 70
- debconf-set-selections lirc_none.seed >> ~/setup/logs/xci-remote.log
- debconf-set-selections lirc_asrock.seed >> ~/setup/logs/xci-remote.log
- aptitude install lirc -y -q2 >> ~/setup/logs/xci-remote.log
- echo "99" | dialog --colors --title "\Z1[ BUILDING DRIVER ]\Zn" --gauge " Please Wait..." 6 70
- # debconf-set-selections lirc_none.seed >> ~/setup/logs/xci-remote.log
- # debconf-set-selections lirc_asrock.seed >> ~/setup/logs/xci-remote.log
- if [ "$OSBIT" = "i686" ]; then
- DEBIAN_FRONTEND=noninteractive dpkg -i lirc-nct677x-1.0.4-ubuntu9.10.deb >> ~/setup/logs/xci-remote.log
- elif [ "$OSBIT" = "x86_64" ]; then
- DEBIAN_FRONTEND=noninteractive dpkg -i lirc-nct677x-x64-1.0.4-ubuntu9.10.deb >> ~/setup/logs/xci-remote.log
- fi
- echo "100" | dialog --sleep 3 --colors --title "\Z1[ CLEANING UP ]\Zn" --gauge " Finished..." 6 70
- dialog --colors --title "\Z1[ INFORMATION ]\Zn" --msgbox "\nCompatibility has been restored, your HTPC will now reboot, once it has fully restarted, if remote doesnt work, please reinstall the remote drivers again." 10 50
- chmod 744 /usr/share/lirc/remotes/lirc_wb677
- rm -f ~/setup/lirc_none.seed* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/lirc_asrock.seed* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/IR_9.10_V1.0.4.zip* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/lirc-nct677x* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/readme.pdf >> ~/setup/logs/xci-remote.log
- reboot >> ~/setup/logs/xci-remote.log
- exit 1 >> ~/setup/logs/xci-remote.log
- fi
- dialog --colors --title "\Z4[ CUSTOM KEYMAP SETUP ]" --yesno "\n Would you like to install custom remote keymaps?" 7 55
- case $? in
- 0)
- dialog --colors --title "\Z1[ INSTALLING CUSTOM REMOTE KEYMAPS ]\Zn" --infobox " Please Wait..." 3 45
- rm -f /home/xbmc/.xbmc/userdata/Lircmap.xml; rm -f /home/xbmc/.xbmc/userdata/keymaps/remote.xml
- cd /home/xbmc/.xbmc/userdata ; wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/Lircmap.xml >> ~/setup/logs/xci-remote.log
- cd /home/xbmc/.xbmc/userdata/keymaps ; wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/remote.xml >> ~/setup/logs/xci-remote.log
- chown -R xbmc:xbmc /home/xbmc >> ~/setup/logs/xci-remote.log ;;
- 1)
- ;;
- 255)
- ;;
- esac
- # MCE system remote configuration
- elif [ "$remotechoice" = "MSMCremote" ]; then
- dialog --colors --title "\Z1[ IMPORTANT INFORMATION ]\Zn" --msgbox "\nIf your using the \Z1ASUS AT3N7A-I\Zn motherboard, Please plug your \Z1USB IR Dongle\Zn in \Z4TOP USB port\Zn on the back of your Motherboard, or the Remote will not be able to wake up your system! " 11 50
- echo "0" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- cd ~/setup
- service xbmc-live stop >> ~/setup/logs/xci-remote.log
- echo "5" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/lirc_none.seed >> ~/setup/logs/xci-remote.log
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/lirc_mce.seed >> ~/setup/logs/xci-remote.log
- echo "7" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- debconf-set-selections lirc_none.seed
- aptitude purge ~nlirc -y -q >> ~/setup/logs/xci-remote.log
- echo "15" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- debconf-set-selections lirc_mce.seed
- echo "30" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- aptitude install lirc -y -q >> ~/setup/logs/xci-remote.log
- echo "95" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- # cp ~/setup/10-lirc.sh /etc/pm/sleep.d/10-lirc.sh
- # cp ~/setup/01lirc_module /etc/pm/config.d/01lirc_module
- # chmod 755 /etc/pm/sleep.d/10-lirc.sh
- # chmod 755 /etc/pm/config.d/01lirc_module
- # cp custom-actions.pkla /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
- # Enable remote wakeup
- # sed -i 's/xbmc=autostart,nodiskmount,setvolume loglevel=0/xbmc=autostart,nodiskmount,setvolume loglevel=0,usbcore.autosuspend=-1/g' /boot/grub/menu.lst
- echo USB0> /proc/acpi/wakeup
- # echo USB2> /proc/acpi/wakeup
- sed -i '14i\echo USB0> /proc/acpi/wakeup' /etc/rc.local
- # sed -i '15i\echo USB2> /proc/acpi/wakeup' /etc/rc.local
- sed -i '16i\echo "rc.local has completed sucessfully." >> /tmp/resume.log' /etc/rc.local
- rm -f ~/setup/lirc_mce.seed* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/lirc_none.seed* >> ~/setup/logs/xci-remote.log
- # PS3 system remote configuration
- elif [ "$remotechoice" = "sonyremote" ]; then
- cd ~/setup
- echo "0" | dialog --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- add-apt-repository ppa:kitlaan/ppa >> ~/setup/logs/xci-remote.log
- echo "20" | dialog --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- aptitude install bluez -y >> ~/setup/logs/xci-remote.log
- echo "25" | dialog --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- aptitude install python-dbus -y >> ~/setup/logs/xci-remote.log
- echo "30" | dialog --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- aptitude install python-gobject -y >> ~/setup/logs/xci-remote.log
- modprobe uinput
- echo uinput >> /etc/modules
- echo "75" | dialog --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/ps3_pair.tar.gz >> ~/setup/logs/xci-remote.log
- tar -xzvf ps3_pair.tar.gz >> ~/setup/logs/xci-remote.log
- echo "80" | dialog --sleep 1 --colors --title "\Z1[ INSTALLING PS3 REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- dialog --colors --title "\Z1[ INFORMATION ]\Zn" --infobox "\n \Z1Hold\Zn the \Z1ENTER\Zn and \Z4START\Zn key on remote while scan is in progress." 6 50
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/ps3-input >> ~/setup/logs/xci-remote.log
- python ps3_pair.py <ps3-input >> ~/setup/logs/xci-remote.log
- if [ "$(python ps3_pair.py --list | grep "mote" | awk {'print $1'})" = "" ]; then
- while [ "$(python ps3_pair.py --list | grep 'mote' | awk {'print $1'})" = "" ]; do
- dialog --colors --title "\Z1[ INFORMATION ]\Zn" --infobox "\nNo Sony BD Remote Found, trying again \Z1Hold\Zn the \Z1ENTER\Zn and \Z4START\Zn key on remote while scan is in progress." 6 50
- python ps3_pair.py <ps3-input >> ~/setup/logs/xci-remote.log
- done
- fi
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/ps3remote.config >> ~/setup/logs/xci-remote.log
- echo "[$(python ps3_pair.py --list | grep "mote" | awk {'print $1'})]" >> /etc/bluetooth/input.conf
- cat ps3remote.config >> /etc/bluetooth/input.conf
- rm -f ~/setup/ps3-input* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/ps3_pair.tar.gz* >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/ps3remote.config* >> ~/setup/logs/xci-remote.log
- dialog --sleep 2 --colors --title "\Z1[ PS3 REMOTE INSTALLED ]\Zn" --infobox "\nSony BD Remote Found!" 5 30
- # xbox system remote configuration
- elif [ "$remotechoice" = "xboxremote" ]; then
- cd ~/setup
- echo "0" | dialog --colors --title "\Z1[ INSTALLING XBOX REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- service xbmc-live stop >> ~/setup/logs/xci-remote.log
- echo "20" | dialog --colors --title "\Z1[ INSTALLING XBOX REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/lirc_none.seed >> ~/setup/logs/xci-remote.log
- echo "40" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- debconf-set-selections lirc_none.seed >> ~/setup/logs/xci-remote.log
- aptitude purge ~nlirc -y -q >> ~/setup/logs/xci-remote.log
- echo "60" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- debconf-set-selections lirc_none.seed >> ~/setup/logs/xci-remote.log
- aptitude install lirc -y -q2 >> ~/setup/logs/xci-remote.log
- rm -f ~/setup/lirc_none.seed >> ~/setup/logs/xci-remote.log
- echo "80" | dialog --colors --title "\Z1[ INSTALLING SYSTEM REMOTE ]\Zn" --gauge " Please Wait..." 6 70
- echo "# LIRCD configuration file for Xbox DVD Kit" >> /etc/lirc/lircd.conf
- echo "# brand: Microsoft" >> /etc/lirc/lircd.conf
- echo "# model: Xbox DVD Remote" >> /etc/lirc/lircd.conf
- echo "# supported devices: Xbox DVD Remote via xpad-ir driver" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "begin remote" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "name XboxDVDDongle" >> /etc/lirc/lircd.conf
- echo "bits 8" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "begin codes" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "SELECT 0x0b" >> /etc/lirc/lircd.conf
- echo "UP 0xa6" >> /etc/lirc/lircd.conf
- echo "DOWN 0xa7" >> /etc/lirc/lircd.conf
- echo "RIGHT 0xa8" >> /etc/lirc/lircd.conf
- echo "LEFT 0xa9" >> /etc/lirc/lircd.conf
- echo "INFO 0xc3" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "9 0xc6" >> /etc/lirc/lircd.conf
- echo "8 0xc7" >> /etc/lirc/lircd.conf
- echo "7 0xc8" >> /etc/lirc/lircd.conf
- echo "6 0xc9" >> /etc/lirc/lircd.conf
- echo "5 0xca" >> /etc/lirc/lircd.conf
- echo "4 0xcb" >> /etc/lirc/lircd.conf
- echo "3 0xcc" >> /etc/lirc/lircd.conf
- echo "2 0xcd" >> /etc/lirc/lircd.conf
- echo "1 0xce" >> /etc/lirc/lircd.conf
- echo "0 0xcf" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "DISPLAY 0xd5" >> /etc/lirc/lircd.conf
- echo "BACK 0xd8" >> /etc/lirc/lircd.conf
- echo "SKIP- 0xdd" >> /etc/lirc/lircd.conf
- echo "SKIP+ 0xdf" >> /etc/lirc/lircd.conf
- echo "STOP 0xe0" >> /etc/lirc/lircd.conf
- echo "REVERSE 0xe2" >> /etc/lirc/lircd.conf
- echo "FORWARD 0xe3" >> /etc/lirc/lircd.conf
- echo "TITLE 0xe5" >> /etc/lirc/lircd.conf
- echo "PAUSE 0xe6" >> /etc/lirc/lircd.conf
- echo "PLAY 0xea" >> /etc/lirc/lircd.conf
- echo "MENU 0xf7" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "end codes" >> /etc/lirc/lircd.conf
- echo >> /etc/lirc/lircd.conf
- echo "end remote" >> /etc/lirc/lircd.conf
- fi
- echo "100" | dialog --sleep 3 --colors --title "\Z1[ INSTALLATION FINISHED ]\Zn" --gauge " XBMC will now restart..." 6 70
- service xbmc-live start >> ~/setup/logs/xci-remote.log
- done
- }
- [/code]
- Even the PS3 remote and old XBOX + the goodies fro the internal CIR you hate and Im too cheap to hate ;P have a gander...
- This part is bluethoot setup and more
- [code]unction Bluetooth_Setup(){
- while true
- do
- bluetoothinstallchoice=""
- dialog --clear --cancel-label "Go Back" --backtitle "XBMC LIVE SETUP FOR $CUR_KER Ver: $VERSION" \
- --colors --title "\Z4[ CHOOSE BLUETHOOTH MODULE ]\Zn" \
- --menu "\n You can use the \Z1UP\Zn/\Z1DOWN\Zn arrow keys,\n the No. of the choice as a hot key,\n to choose an option.\n\n Please choose an item:" 15 50 1 \
- 1 "AT3N7A-I Onboard Dongle" 2>/tmp/xci/bluetoothmenu
- # 2 "add function" \
- # 3 "add function" 2>/tmp/xci/bluetoothmenu
- case $? in
- 0)
- bluetoothinstallmenuitem=$(</tmp/xci/bluetoothmenu)
- case $bluetoothinstallmenuitem in
- 1) bluetoothinstallchoice="AT3N7A-I";;
- # 2) bluetoothinstallchoice="dongle b";;
- # 3) bluetoothinstallchoice="dongle c";;
- esac;;
- 1)
- Hardware_Menu; break;;
- 255)
- Hardware_Menu; break;;
- esac
- if [ "$bluetoothinstallchoice" = "AT3N7A-I" ]; then
- echo "0" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " INSTALLING REQUIRED TOOLS! Please wait..." 6 70 0
- cd ~/setup
- aptitude install linux-source -y >> ~/setup/logs/xci-bluetooth.log
- echo "30" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " INSTALLING REQUIRED TOOLS! Please wait..." 6 70 0
- aptitude install build-essential -y >> ~/setup/logs/xci-bluetooth.log
- echo "40" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " DOWNLOADING REQUIRED FILES! Please wait..." 6 70 0
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/ath3k.tar.bz2 >> ~/setup/logs/xci-bluetooth.log
- echo "50" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " DOWNLOADING REQUIRED FILES! Please wait..." 6 70 0
- tar -xjvf ath3k.tar.bz2 >> ~/setup/logs/xci-bluetooth.log
- echo "60" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " DOWNLOADING REQUIRED FILES! Please wait..." 6 70 0
- wget -nc -q http://dl.dropbox.com/u/4325533/XCI/Remote/ath3k-1.fw >> ~/setup/logs/xci-bluetooth.log
- echo "70" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " DOWNLOADING REQUIRED FILES! Please wait..." 6 70 0
- mv -f ath3k-1.fw /lib/firmware/ath3k-1.fw >> ~/setup/logs/xci-bluetooth.log
- echo "80" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " COMPILING SYSTEM MODULE! Please wait..." 6 70 0
- cd ath3k
- make >> ~/setup/logs/xci-bluetooth.log
- echo "90" | dialog --colors --title "\Z1[ INSTALLING BLUETOOTH MODULE ]\Zn" --gauge " COMPILING SYSTEM MODULE! Please wait..." 6 70 0
- make install >> ~/setup/logs/xci-bluetooth.log
- if [ ! -e /lib/modules/`uname -r`/kernel/drivers/bluetooth/ath3k.ko ]; then
- mv ath3k.ko /lib/modules/`uname -r`/kernel/drivers/bluetooth/ath3k.ko >> ~/setup/logs/xci-bluetooth.log
- fi
- depmod -a >> ~/setup/logs/xci-bluetooth.log
- chmod 666 /etc/modules
- echo ath3k >> /etc/modules
- chmod 644 /etc/modules
- modprobe ath3k >> ~/setup/logs/xci-bluetooth.log
- cd ~/setup
- rm -rf ath3k*
- echo "100" | dialog --sleep 1 --colors --title "\Z1[ BLUETOOTH MODULE INSTALLED ]\Zn" --gauge " System will reboot in now" 6 70 0
- reboot; exit 1
- fi
- done
- }
- [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement