Page 1 of 1

Start xbmc the same way as ls or cp?

Posted: Fri Dec 28, 2012 3:54 am
by PocketSized
Hei,

I have installed xbmc on raspbian. The path to the .bin is very long and annoying so i wonder, is there anyway I can start xbmc the same way as when I run ls, cd or any of the other "standard programs"? i.e, just type xbmc and no matter where you are in the hierarchy xbmc will start?

Re: Start xbmc the same way as ls or cp?

Posted: Fri Dec 28, 2012 4:27 am
by efflandt

Code: Select all

mkdir ~/bin
The next time you log in, that will be in your $PATH (except in lxde for some reason).

Then create a simple shell script in your ~/bin using nano ~/bin/xbmc. The 1st line should be a shebang line to tell the shell what to use for an interpreter:

Code: Select all

#! /bin/sh
Then either enter commands to cd to whatever directory and then a line for whatever you want to run, or in some cases you can simply put a full path to the binary.

After you create that file do chmod +x ~/bin/xbmc to make your xbmc script executable.

Assuming that you relogged in since you created your ~/bin, you can simple type xbmc to run it.

Note that if a command or binary needs sudo prefix and you are a user other than pi, use sudo visudo to add another line if you want to avoid typing a password for sudo:

Code: Select all

#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL
efflandt ALL=(ALL) NOPASSWD: ALL

Re: Start xbmc the same way as ls or cp?

Posted: Fri Dec 28, 2012 5:18 am
by PocketSized
Thank you! :)