Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
Apply icons to bash scripts

I need to run " v4l2-ctl -i 2 " in Terminal, by clicking on a desktop icon. Right now, I have to manually open Terminal, type in this command, and it sets the video input of my tv card in Ubuntu. Then I can open the tv player to watch tv. For some reason, the tv card input doesn't stay set. It is a pain to have to open Terminal and run this command every time I want to watch tv. I want to just be able to click a desktop icon, and have it automatically open Terminal, and run this command, and then shut Terminal by itself. (the tv player already has an desktop icon) I've never done any kind of script before, so speak S L O W L Y....LOL -Thanks

share|improve this question

marked as duplicate by belacq, bodhi.zazen, Stephen Myall, Chris Wilson, Eliah Kagan Feb 5 '13 at 1:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

  • Create the file
    • Right Click on the desktop
    • Create New Document -> Empty Document
    • Name it: tv or something to your taste
    • Open the file with text editor

File Contents (save it please)

    #!/bin/bash
    v4l2-ctl -i 2

Right click on the file

Select Properties>Permissions

Check the box following Execute: which allows the file to be executed

Double Click And Select either Run or Run In Terminal

(you can also use properties to change how the file looks) just click on the icon and then select a suitable image also you could create a custom keyboard shortcut, or an alias if you find the desktop icon unsightly.

share|improve this answer
    
After creating the script, to really make a desktop icon, a desktop file (specifying icon) should be created to run the given script: as here: askubuntu.com/a/60670/47206 –  cipricus Feb 4 '13 at 9:57
    
i cant seem to put it in terminal it keeps opening in gedit –  samgabbay Jun 30 '13 at 22:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.