PocketSized
Posts: 13
Joined: Sat Sep 15, 2012 10:36 am
Location: Norway

Start xbmc the same way as ls or cp?

Fri Dec 28, 2012 3:54 am

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?
It's here!

efflandt
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

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

Fri Dec 28, 2012 4:27 am

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

PocketSized
Posts: 13
Joined: Sat Sep 15, 2012 10:36 am
Location: Norway

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

Fri Dec 28, 2012 5:18 am

Thank you! :)
It's here!

Return to “Beginners”