[Linux] need to exec some bash commands after boot?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
khuong Offline
Junior Member
Posts: 12
Joined: Sep 2009
Reputation: 0
Post: #1
Hi, I'm trying to figure out how to run a set of bash commands, or exec a bash script after XBMC has booted, and I can't seem to figure it out, in ubuntu forums or here, so I decided to ask.

the script/commands are as follows

#!/bin/bash
echo xbmc | sudo -S aticonfig --set-dispattrib=tmds2i,positionX:0
echo xbmc | sudo -S aticonfig --set-dispattrib=tmds2i,positionY:0
echo xbmc | sudo -S aticonfig --set-dispattrib=tmds2i,sizeX:1920
echo xbmc | sudo -S aticonfig --set-dispattrib=tmds2i,sizeY:1080

obviously, i'm echoing the sudo password in case it needs it, i tried to put it in .xinitrc, i tried to put it in xsession (but figured that runXBMC overwrites it) so that failed.

my setup is..
ubuntu bare system + xbmc + xbmc live helper (to autostart it) no gnome/kde or anything, just boots straight to xbmc!

any help would be nice! thanks (if you're curious, my tv underscans the res for some reason, and those set of commands, fixes it, i hate having a black border)

i'm hoping there's a easy solution, if not, my last resort i guess would be to make a python script to run at xbmc boot to do it! but that requires me to learn some python
find quote
topfs2 Offline
Team-Kodi Developer
Posts: 4,045
Joined: Dec 2007
Reputation: 10
Post: #2
If you don't care for when it's executed /etc/rc.local is rather good (read, may be well after XBMC has launched). it's also executed as root so you won't need to do the echo stuff.

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
khuong Offline
Junior Member
Posts: 12
Joined: Sep 2009
Reputation: 0
Post: #3
heh, i tried that too, but it needs to be exec'ed after xbmc has launched..

i managed to get it to run as a python script, i hate to hijack my own thread but, is there away to make xbmc run a python script after it loads? (i.e after splash screen and goes to home window?)
find quote
crego Offline
Junior Member
Posts: 22
Joined: Jan 2008
Reputation: 0
Post: #4
What happened when you had it in your .xinitrc?
find quote
usererror Offline
Junior Member
Posts: 3
Joined: Jul 2008
Reputation: 0
Post: #5
wouldn't do anything, it would echo errors saying no display.
find quote
CrashX Offline
Posting Freak
Posts: 1,164
Joined: Jan 2009
Reputation: 2
Post: #6
i believe xbmc executes autoexec.py when it loads ...

The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
find quote