I created a launcher for a bash(sh) script but it won't run
1 Attachment(s)
I created a script to to pass two file names to ffmpeg in order to extract the audio from the video: The script works fine and I usually run it from a directory were I have a flv file I want to strip the audio from. It places the audio created in the same directory as the flv file. I wanted to be able to run it from the top panel in gnome 2 so I created a link and drug it to the panel. Now when I click on it it wont run. I get this error:
|
Quote:
|
Quote:
2) cp script.sh /usr/local/bin/ 3) Create a launcher that says : Exec=script.sh 3a) When the launcher / the executable works, then an entry can be added to the panel. . |
I never paid any attention to that path! Maybe Ubuntu is choking on the name of the link. When I right-clicked my expresswv.sh file and chose create link that's the name it gave me, with the capital L but the full name of it was "Link to extractwv.sh" I wonder if that's all the error msg had room for or if i maybe should have renamed the link to just one word?
Well, I renamed the link and I didn't get the error msg but it didn't open the terminal window either. Here is another one I have for temperature that I have placed under the Applications menu. It opens a terminal window and works just fine. I will list it and then mine for comparison: This the temperature converter. It is just sits in the home dir. Code:
#!/bin/bash Code:
#!/bin/sh |
Knudfl:
I logged in as root so that I could copy the file extractwv.sh to user/bin/ like you said. I created a file called audible.sh with the code you gave me and converted it to a launcher by dragging it to the panel(thats the only way I know how to do it) I get no error msgs when I click on it, but it doesn't work either :( |
2 Attachment(s)
Quote:
Please copy your scripts to /usr/local/bin/ : 1) chmod +x expresswv.sh 2) chmod +x audible.sh 3) sudo cp expresswv.sh /usr/local/bin/ 4) sudo cp audible.sh /usr/local/bin/ ... First then you can get a launcher to use the scripts. Which OS are you using ? Like Ubuntu 12.04. Which Desktop is it about ? KDE, Gnome 3, Gnome 2. Please specify. A launcher is a short text file. Named a desktop entry : Name.desktop. All Desktops have a tool to automatically create a launcher. (Gnome 3 : Don't know.) Two examples are attached. . |
Hi
Don't have my laptop with me now, but just an observation: Your scripts require the user to make input in a terminal. To make a shell script run in a terminal, doesn't one have to tell the launcher explicitly to run it in a terminal? Otherwise it just runs in the background, waiting for input, like the little android boy in "AI". I seem to remember in KDE anyway there is a check-box for "Run in Terminal" or something (in the Properties). Just a thought. j0nn0 |
# 7
That's right, the command in the desktop entry should then be e.g. : xterm -exec audible.sh |
Ok that worked, but it's not saving my output file to the current directory. Is there an option for that?
|
# 9
May be change : ffmpeg -i "$I" -vn -f wav "$O" To : ffmpeg -i "$I" -vn -f wav "$O" > <path-to-"save"-directory>/ Like : ffmpeg -i "$I" -vn -f wav "$O" > /home/owner/folder1/ . |
Quote:
|
hmmm...OK, I guess not
|
The current directory . Is one period ( . )
ffmpeg -i "$I" -vn -f wav "$O" > ./ Or just : ffmpeg -i "$I" -vn -f wav "$O" > . . |
Quote:
Code:
ffmpeg -i < ./ "$I" -vn -f wav "$O" > ./ |
Quote:
> . : The current directory. Repeat: the dot, period ( . ) is the current directory. > /home/owner/folder1/ : Another directory. |
All times are GMT -5. The time now is 05:01 PM. |