Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Shell Script in KDE Servicemenüs?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Feb 14, 2005 3:45 pm    Post subject: Shell Script in KDE Servicemenüs? Reply with quote

Hallo Leute...

Habe hier ein kleines Problem, dass mich langsam aber sicher in den Wahnsinn treibt:
Ich möchte ein KDE servicemenü erzeugen, dass eine Konsole öffnet und meinen Befehl ausführt.
wenn ich in der .desktop-Datei unter Exec=
Exec=/bin/sh -e "<mein befehl>"
eingebe, passiert lustigerweise gar nichts.
Auch in Klammern oder Backticks setzen bringt nichts.
Irgendwie verstehe ich das nicht... Ich habe genau den Syntax von
http://developer.kde.org/documentation/tutorials/dot/servicemenus.html
benutzt. Ansonsten finde ich im Web oder hier im Forum nichts zu dem Thema...
Also, Liebe Gentoo-User, bitte helft!
Euer Marcus :)
Back to top
View user's profile Send private message
primat
Guru
Guru


Joined: 12 Jan 2004
Posts: 437
Location: Berlin

PostPosted: Mon Feb 14, 2005 3:54 pm    Post subject: Reply with quote

Warum nimmst Du nicht xterm -e oder konsole -e? Geht das damit nicht?
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Feb 14, 2005 3:56 pm    Post subject: Reply with quote

Quote:

Warum nimmst Du nicht xterm -e oder konsole -e? Geht das damit nicht?


Nee, das habe ich auch schon probiert :(
Back to top
View user's profile Send private message
c07
Veteran
Veteran


Joined: 25 Oct 2002
Posts: 1091

PostPosted: Mon Feb 14, 2005 4:45 pm    Post subject: Reply with quote

Falls du willst, dass "<mein befehl>" direkt ausgeführt wird, musst du das schon mit -c sagen.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Feb 14, 2005 5:35 pm    Post subject: Reply with quote

Tja, danke für den Tipp, aber das hatte ich auch schon :(
Das Resultat ist das Gleiche: Nichts passiert...
Ich poste einfach mal den Text des Servicemenüs, es handelt sich darum, dass ich alle WAV-Files in einem Ordner "lamen" möchte.
Code:

[Desktop Entry]
ServiceTypes=audio/x-wav
Actions=lame
#Actions=lame
X-KDE-AuthorizeAction=shell_access
TryExec=lame
#[Desktop Action lame]
[Desktop Action lame]
Name=Komprimiere zu mp3
Exec=konsole -c "for i in *.wav; do lame -p -b 320 -q 2 -k -m s --add-id3v2 --noreplaygain "$i" "${i%.wav}.mp3"; done"

Die Zeilen
Code:

X-KDE-AuthorizeAction=shell_access
TryExec=lame

habe ich aus einem Mandrake-Servicemenü kopiert (dokumentiert ist das ja nirgends...) und auch schon weggelassen, ohne Ergebnis.
Und selbst wenn ich versuche aus dem servicemenü heraus mein lame-script (in dem auch wieder die zeile
Code:

for i in *.wav; do lame -p -b 320 -q 2 -k -m s --add-id3v2 --noreplaygain "$i" "${i%.wav}.mp3"; done

steht, passiert einfach GARNIX!
Es ist echt fies: wenn ich von Hand ins betreffende Verzeichnis gehe und das script aufrufe, funktioniert alles wunderbar.
Und: in Klammern oder ähnliches zu setzen hat auch nix gebracht.
Back to top
View user's profile Send private message
primat
Guru
Guru


Joined: 12 Jan 2004
Posts: 437
Location: Berlin

PostPosted: Mon Feb 14, 2005 5:47 pm    Post subject: Reply with quote

Semikolon hinter do; :?: Muss aber eigenlich nicht sein (glaube ich).
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Feb 14, 2005 6:28 pm    Post subject: Reply with quote

Quote:

Semikolon hinter do; Muss aber eigenlich nicht sein (glaube ich).

Wie???
Das Semikolon steht doch HINTER dem done !?!
Oder meinst Du das VOR dem "do"??
guck noch mal
gruß, marcus
Back to top
View user's profile Send private message
76062563
l33t
l33t


Joined: 16 Aug 2004
Posts: 637
Location: 127.0.0.1

PostPosted: Mon Feb 14, 2005 8:32 pm    Post subject: Reply with quote

Entweder ich kapier dein Problem nicht oder es lässt sich relativ einfach lösen indem du auf dem Desktop eine neue Verknüpfung zu einem Programm erstellst und dann unter Erweiterte Optionen den Haken bei im Terminal starten reinmachst.
_________________
gentoo - compile your own world
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Feb 14, 2005 9:13 pm    Post subject: Reply with quote

HMMM, gute Idee...
Gesagt, getan. Aber nachdem ich eine Wave-Datei via dragNdrop auf das icon geschoben habe kommt als Ausgabe der Konsole nur:
Code:

/bin/sh: -c: line 1: syntax error near unexpected token `'/home/data/temp/Titel 06.wav''
/bin/sh: -c: line 1: `for i in *.wav; do lame -p -b 320 -q 2 -k -m s --add-id3v2 --noreplaygain "" ".mp3"; done '/home/data/temp/Titel 06.wav''


Ich glaube Du verwechselst die Desktop-Verknüpfungen mit den Service-Menüs... Beide haben die slebe Endung= .desktop.
Aber OK, ich wäre auch mit einem Icon zb. im kicker zufrieden, solange letztendlich dass passiert, was ich will:
Alle mp3s eines 'Ordners nach lame konvertieren...
Verdammt, so eine einfache Sache :twisted:
Kennt jemand noch eine gute Doku zu den Servicemenüs???
Oder hat vielleicht jemand ein funktionierendes Menü ala "Konvertiere nach lame" ???
thx, marcus
Back to top
View user's profile Send private message
Qubit
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2002
Posts: 136
Location: /dev/urandom

PostPosted: Tue Feb 15, 2005 11:21 am    Post subject: Reply with quote

Hi,

das könnte Dir weiterhelfen.
http://de.kde-apps.org/index.php?xcontentmode=287
z.B Convert WMA to MP3-OGG


Qubit
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Tue Feb 15, 2005 11:50 am    Post subject: Reply with quote

Danke für den Tipp... Habe das Servicemenü gleich mal installiert und mir angeschaut, was es so macht:
Daraufhin bin ich genau so vorgegangen und habe mein kleines script "lame.sh" nach /usr/bin/ kopiert und ein servicemenü das ganze aufrufen lassen, mit folgendem Resultat:
Weder mit Exec=/bin/sh -c "lame.sh"
noch mit
Exec=/bin/sh -e "lame.sh"
oder mit
Exec=konsole -c "lame.sh"
Exec=konsole -e "lame.sh"
stellt sich der gewünschte Effekt ein :(
Es ist grausam, was mache ich nur falsch???
Aber immerhin läßt sich das script jetzt sehr bequem via Befehlsvervollständigung in der Konsole aufrufen>
Fast perfekt...
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
marc
Apprentice
Apprentice


Joined: 13 Jan 2003
Posts: 290

PostPosted: Wed Feb 16, 2005 8:24 am    Post subject: Reply with quote

Les dir das mal hier durch.

http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html

Das sollte die Frage beantworten.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum