Handy startup script for Dual use HTPC and Web Linux computer
#1
I use my Livingroom computer for both browsing the web and as HTPC.
When I watch a movie I want grab the remote, and I don't want to mess with the keyboard/touchpad.
This is a simple GUI script that starts XBMC, but gives you time to cancel it if you don't want to run it.
It uses the GUI script program Zenity, Ubuntu has it installed by default. The method run it in startup will vary by distro. You can add a startup item in the startup preferences. I use Lubuntu, I just added an entry to /etc/xdg/lxsession/Lubuntu/autostart

#!/bin/bash
# DO Whatever YOU WANT TO PUBLIC LICENSE
# Version Whatever, June 2010
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document.
#
# DO Whatever YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO whatever YOU WANT TO.


# Second to count down
seconds=15

#While-loop to show progress of time passed.

elapsedtime=1
(
while [ $elapsedtime -lt $seconds ]
do
sleep 1s
echo "$(echo "scale=4; ($elapsedtime/$seconds)*100" | bc)"
elapsedtime=$(($elapsedtime+1))
done
) | zenity --progress --auto-kill --auto-close --title="XBMC" --text="Will start. Press cancel to abort."

xbmc

exit
Reply

Logout Mark Read Team Forum Stats Members Help
Handy startup script for Dual use HTPC and Web Linux computer0