Version: 1.1 (KDE 3.5.10) (using KDE 4.2.2) OS: Linux Installed from: Ubuntu Packages I have a strange problem. I had until yesterday Kubuntu Intrepid 8.10 with KDE 4.2. Then I made a clean install with Kubuntu Jaunty 9.04 and upgraded to KDE 4.2.2 by the PPA packages. So, on Intrepid I used a ruby script that I used as now playing script because of Amarok 2 [SVN]. This script stopped working for no apparent reason. However I found an old bash script that could just submit info to konversation fine. I made a simple script that will run inside the ruby script and then post it. Neither approach worked, although when called each script from the cli (and entered static info for server and channel) they worked fine. I even downloaded the media script as announced on the konversation portal page. I can say that the media script and ruby script both worked at some stage, but after a restart of konversation they ceased working. I have no explanation for this, especially when they run from the shell. Below is the script: #!/usr/bin/ruby #appid = $*[0] #server = $*[1] #target = $*[2] appid = "konversation" server = "0" target = "#konversation" metadata = `qdbus org.mpris.amarok /Player GetMetadata 2> /dev/null`.chomp hash = Hash.new metadata = metadata.split("\n") metadata.each do |line| key = line.split(": ")[0] value = line.split(": ")[1] if value.nil? value = "" end hash[key] = value end title = hash["title"] artist = hash["artist"] album = hash["album"] year = hash["year"] streamName = "" #CGI.unescape(`qdbus org.mpris.amarok /Player streamName`.chomp) version = "" #`qdbus org.mpris.amarok /Player version`.chomp version = `amarok --version`.match(/^Amarok\:(.+)/i).captures output = "" if title.empty? output += `qdbus org.mpris.amarok /Player nowPlaying`.chomp else # Strip file extension extensions = ".ogg", ".mp3", ".wav", ".flac", ".fla", ".wma", ".mpc", ".oga" ext = File.extname( title ).downcase if extensions.include?( ext ) title = title[0, title.length - ext.length] end if artist.empty? output += "'#{title}'" else output += "'#{title}' by '#{artist}'" end unless album.empty? output += " on '#{album}'" output += " (anno: #{year})" unless year == "0" or year.empty? # output += "]" end unless streamName.empty? output += " (#{streamName})" end unless version.empty? output += " - [Amarok#{version}]" end end info = "appid: #{appid} - server: #{server} - target: #{target}" f = File.open("ruby.txt", 'w') f.write(info) f.close #puts output #puts "#{output}" `dcop konversation irc say #{server} "#{target}" "/me is listening to #{output}"`
Created attachment 32589 [details] Ruby Script that's the ruby script as download
In line 67-71 there should be a text file created - I used this to check what happens. The text file gets created when invoked from the cli. However there is no text file created when I try to run this script with alias / exec in konversation.
Ok, I found the culprit. Konversation does suddenly not like this line anymore: version = `amarok --version`.match(/^Amarok\:(.+)/i).captures I commented it out and now it works. However it's still unclear why Kubuntu 8.10 with KDE 4.2 and Amarok 1.1 for KDE 3.5 had no problem with it but Kubuntu 9.04 with KDE 4.2.2 and Amarok 1.1 for KDE 3.5 refuses that one. IMHO this can be closed.
This can be closed and marked as resolved :)