HOW-TO:Install Kodi for Mac OS X and Archive:Create a resume script: Difference between pages

From Official Kodi Wiki
(Difference between pages)
Jump to navigation Jump to search
>Cosmicr
mNo edit summary
 
>Outleradam
No edit summary
 
Line 1: Line 1:
{{XBMC wiki toc Inline}}
This guide assumes that you have installed [[XBMC_Live]] or have at least performed all steps outlined in one of the articles listed here [[Installing_XBMC_for_Linux]] and here [[HOW-TO_setup_Lirc_to_talk_to_XBMC]]. This guide assumes that your remote works well upon startup. If it does not, then do not proceed with this article.
__NOEDITSECTION__


Installing applications on Mac OS X is quite easy compared to many other platforms, allthough it is somewhat different from other platforms. Below we list the steps needed for basic installation an uninstallation.
You will also need a [http://en.wikipedia.org/wiki/Ssh SFTP] client and a [http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator] like [http://winscp.net/eng/index.php WinSCP] and [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty].  


__TOC__
You will need [[root]] access for the following commands.


==Download==


First download XBMC. Official builds (alpha, beta, and stable versions) can be found here [http://xbmc.org/download/ http://xbmc.org/download/], unofficial nightly builds can be found here [http://sshcs.com/xbmc/ http://sshcs.com/xbmc/]. Use the latter at your own risk, there is no guarantee that the build is stable.


==Un-package==
== Setting up the basics ==
This section discusses installation and use of curl
=== Installing curl ===
*Log into a terminal as root
*Execute the following command to get a program which will allow you to turn on and off XBMC's remote monitoring function
apt-get install curl
=== Using Curl ===
The following command will disable XBMC's ability to turn your remote's commands into usable input.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
The following command will enable XBMC's ability to turn your remote's commands into usable input.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"
The following command will stop and then restart XBMC's ability to turn your remote's commands into usable input.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.restart"


XBMC is packaged as an [http://guides.macrumors.com/Disk_image disk image]. A disk image can be thought of as the virtual equivalent of a CD. The actual data in the disk image is contained within a single file which will look something like this:


[[image:Xbmc.dmg.jpg|300px]]
== Designing your resume script ==
This section discusses creating a basic lirc resume script. You will now go through each one of the sections and design your custom restart script.  It is recommended that you create a wiki article like this one, [[Snapstream Firefly]] when you are finished. When you add to the wiki, it is documented so people who are not as good with scripting may follow behind your work.
=== Create your basic script outline ===
* Open a notepad so that you can keep notes for your resume script
* Copy the following into your notepad
#!/bin/sh


You will have to "insert," or "mount," the disk image into the machine by double-clicking the file. Having done this, the the disk image will appear as new device in the Finder, as shown in the picture below:
case "$1" in
resume)
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
/etc/init.d/lirc restart
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"  
echo "lirc_atiusb resume script completed" >>/tmp/script.log
;;
esac
This is the basic resume script outline.  The two blank lines under ''curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"'' will be for restarting your drivers.


==Install==
=== checking remote output ===
* From your terminal copy and paste the following to verify if your remote is working.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
  /etc/init.d/lirc restart
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start
irw
* Press a few buttons on your remote
* press ctrl + C to exit irw
If your remote works, then skip to the creating a resume file section.


XBMC is implemented as an [http://guides.macrumors.com/Bundle installation bundle] and can be installed by drag-and-dropping it to the applications folder.
=== Locate your drivers ===
 
* From your terminal type the following to verify your system is recognizing your remote's receiver
All you have to do is copy the program to your desired location (usually your Applications folder) and run it. Copying the program is performed simply by using drag and drop. XBMC makes it even easier by supplying a link to the Application folder, on which you can drop the XBMC bundle. An example of this is shown below:
lsusb
 
* Search for your remote's physical device
[[image:Mac.drag_n_drop.jpg|300px]]
----
 
EG.
==Tidy up==
(T: XBMCLive)root@XBMCLive:~# lsusb
 
Bus 001 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Stroage Device
After you have finished installing the program you can unmount the XBMC disk image
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
  Bus 002 Device 002: ID 0bc7:0008 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)
This can be done by using the eject icon next to to it in the Finder sidebar as if it were a CD. You can also drag the mounted disk icon to the the Trash, again as if it were a CD.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
(T: XBMCLive)root@XBMCLive:~#
All files other than the bundle in the Applications folder can be simply discarded. Either place them in the Trash or back them up somewhere in case you wish to re-install the application in the future.
''08 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)'' is the remote device.  You can verify this by unplugging the device and running lsusb again
 
----
==Add to dock==
* List all lirc devices
 
sudo modprobe -l |grep lirc
If you want XBMC to appear in the Dock, simply drag the application's icon into the left side of the Dock from wherever you have installed it. Another way to add an application to the Dock is, if the program is currently running, control-click its icon in the Dock and select "Keep In Dock" .
* Search for the driver which controls the physical device
 
==Update==
 
You can use [http://metaquark.de/appfresh/ Appfresh] to keep XBMC up to date, although it will only stay current with the latest stable version.  
 
=Uninstall=
 
The XBMC bundle contains the full application. This means that to uninstall it, you only have to drag it to the Trash.  
 
However, XBMC creates [http://guides.macrumors.com/Preference_File preference files] when it is run. They are located in the Application Support folder within your user's Library folder, that is, in "~/Library/Application Support/XBMC"This directory contains all your settings and your video & music database. If you want to remove all your XBMC settings, drag this folder to the Trash.  
 
Third party uninstallers exist which will search for these preference files for you, the most notable of which is a program called [http://www.appzapper.com/ AppZapper]. A comparable, free alternative is [http://konstochvanligasaker.se/apptrap/ AppTrap]. Alternatively you can use MacKeeper [http://mackeeper.zeobit.com/uninstaller-for-mac mac uninstaller].
 
=Autostart XBMC=
 
Go into System Preferences, select "accounts". Select "Login Items", at the bottom hit the plus button and then a drop down box allows you to select XBMC.
 
Alternatively, if you have the app open in your dock, you can right-click/click-and-hold the icon and choose "Open at Log-in"                                                                                                                                                             
 
After this, the application will start up automatically after you log in.
 
=Develop for XBMC =
 
If you have grown accustomed to using XBMC but are missing features. Why not help out with the [[XBMC for Mac|development of XBMC for Mac]]
 
 
[[category:Installation]]
[[category:Mac OS X]]

Revision as of 23:46, 8 November 2009

This guide assumes that you have installed XBMC_Live or have at least performed all steps outlined in one of the articles listed here Installing_XBMC_for_Linux and here HOW-TO_setup_Lirc_to_talk_to_XBMC. This guide assumes that your remote works well upon startup. If it does not, then do not proceed with this article.

You will also need a SFTP client and a terminal emulator like WinSCP and Putty.

You will need root access for the following commands.


Setting up the basics

This section discusses installation and use of curl

Installing curl

  • Log into a terminal as root
  • Execute the following command to get a program which will allow you to turn on and off XBMC's remote monitoring function
apt-get install curl

Using Curl

The following command will disable XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"

The following command will enable XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"

The following command will stop and then restart XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.restart"


Designing your resume script

This section discusses creating a basic lirc resume script. You will now go through each one of the sections and design your custom restart script. It is recommended that you create a wiki article like this one, Snapstream Firefly when you are finished. When you add to the wiki, it is documented so people who are not as good with scripting may follow behind your work.

Create your basic script outline

  • Open a notepad so that you can keep notes for your resume script
  • Copy the following into your notepad
#!/bin/sh
case "$1" in 
	resume)
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"


		/etc/init.d/lirc restart 
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" 
		echo "lirc_atiusb resume script completed" >>/tmp/script.log
	;;
esac

This is the basic resume script outline. The two blank lines under curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop" will be for restarting your drivers.

checking remote output

  • From your terminal copy and paste the following to verify if your remote is working.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
 /etc/init.d/lirc restart
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start
irw
  • Press a few buttons on your remote
  • press ctrl + C to exit irw

If your remote works, then skip to the creating a resume file section.

Locate your drivers

  • From your terminal type the following to verify your system is recognizing your remote's receiver
lsusb
  • Search for your remote's physical device

EG.

(T: XBMCLive)root@XBMCLive:~# lsusb
Bus 001 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Stroage Device 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bc7:0008 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
(T: XBMCLive)root@XBMCLive:~#

08 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant) is the remote device. You can verify this by unplugging the device and running lsusb again


  • List all lirc devices
sudo modprobe -l |grep lirc
  • Search for the driver which controls the physical device