Help - Search - Members - Calendar
Full Version: Custom Buddy Sign-in Sounds
Skype Community > English > Development, Betas and Skype Garage > Archive > Skype for Linux 1.4 Alpha
heshamwhwaf
Hi,
First I'd like to say that you guys did a great job with the 1.4 release so far. Its still sad that there is no video or sms support thus far, but here's to hoping that a client for the n770 and n800 will come out of this effort as well smile.png
In any case, the new client is certainly very pretty and polished, but one of the main wishlist items I have other than video or sms is to be able to set custom sounds based on who I'm chatting with or who signs in or calls. It would be a nice feature to have, and as you guys expressed an interest in adding features just for us Linux users, please let me know what you guys think.

Thanks
Andypoo
Warning: Bash scripting follows in this message. If this confuses/baffles you, stop reading here. smile.png

QUOTE(heshamwhwaf @ Sat May 5 2007, 17:58) [snapback]390556[/snapback]

... to be able to set custom sounds based on who I'm chatting with or who signs in or calls. It would be a nice feature to have, and as you guys expressed an interest in adding features just for us Linux users, please let me know what you guys think.

Well, today is your lucky day, because I actually felt similarly, and implemented a feature just for you (and me tongueout.png).

If you go into the Options dialog and Notifications, choose the event (such as Sign In, Incoming Call or Incoming Chat Message) and then choose Advanced, you will see a rather undocumented feature called "Execute the following script:"

The are a number of funky things you can do with this feature, but for now, try setting a script in this box like:

~/.Skype/soundscript.sh %type %sskype

Then, create a file called ~/.Skype/soundscript.sh which contains something like the following:

-- snip --
CODE

#!/bin/sh

if [ "$1" == "ContactOnline" ]; then
  if [ "$2" == "bill" ]; then
    aplay /usr/share/skype/sounds/custom/contacts/bill.wav
  elif [ "$2" == "charlotte" ]; then
    aplay /usr/share/skype/sounds/custom/contacts/wolfwhistle.wav
  else
    aplay /usr/share/skype/sounds/ContactOnline.wav
  fi
elif [ "$1" == "ChatIncoming" ]; then
  if [ "$2" == "sandra" ]; then
    aplay /usr/share/skype/sounds/custom/chat/sandra.wav
  else
    aplay /usr/share/skype/sounds/ChatIncoming.wav
  fi
fi

-- snip --

Hopefully, that made some sense smile.png If not, then ignore it. If so, then enjoy it smile.png

It's up to you if you want to set this as a 'global' script (ie. one that gets executed on all events), or a local script to the event. At the moment, there is a possibility that global scripts aren't yet functional, as I'm not sure where we were up to with this implementation before the alpha release. But sound-specific scripts are definitely functioning smile.png

Enjoy!
Andypoo.
Abetsic
Hello,

Andypoo, can we wave the others options that can be passed from skype to the script like %type and %sskype ? And what are the others possible events (%type) names ? At first sight it seems to be the suffix of the wav filename, right ? Is there a way to get the contact's group and other stuffs ?

If the features get documented, let me know wink.png

It would be nice to be able to "talk" to skype from the script, for exemple, an incoming chat is coming from Martin, the general incomingchat.sh script executes, enter where user is martin, and there execute something to reply automatically something like "Go to hell, I don't want to speak to you right now !" (or something nicer)


Thanks in advance smile.png
heshamwhwaf
That's exactly what I was looking for. Gave this a shot, its pretty cool and works as advertised, including as a global script smile.png I guess a similar thing could be implemented using the DBus API. Looking forward to when it is available so I can play with it smile.png Abetsic, you should be able to talk to the script since you can write any program you like and pass stuff in, not just shell scripts, though I think ultimately the DBus API might make this a more manageable process, get events through a script and fire off a message on the bus that says respond to so and so with whatever... but it would be even nicer to have plugins that can run in the process the or along with it so we don't need to fire off scripts or run separate programs that can handle these API events. Documentation on these parameters would be great though so we can write some lighter-weight scripts in the interim.

Thanks again
Hesh
berkus
Here's the current list of available scripting parameters (valid for this alpha ONLY, and will be extended with new options in new releases, for comprehensive list refer to [ping me to insert proper url here])

Script Parameters
=================
The following are valid parameters for Script notifications:

Global Parameters
-----------------
%type Event Type (these you can figure out pretty simple by putting "echo %type" in the script box in Notifications setup and performing various activities)
%sskype Remote Skype Name (where applicable)
%sname Remote Display Name (where applicable)

Chat Messages
-------------
%smessage Chat Message

File Transfers
--------------
%fpath File Path
%fname File Name
%fsize File Size (in bytes)
%fprogress File Progress (in bytes)
%fspeed File Speed (in bytes per second)

-------------
Here's the small script I'm using myself (you should have festival installed):

Save the following as "~/.Skype/skype-to-speech":
CODE

echo "Incoming message. $1 says, "`echo $2 | cut -c -25` | festival -b --tts


In notifications configuration set this script for Incoming Chat Message event:
CODE

~/.Skype/skype-to-speech "%sname" "%smessage"

Abetsic
Thanks for the parameters, now I guess I'll have a look at the dbus API tomorrow, there must be some fun things to do smile.png

I tried your script, but unfortunately festival fails to open /dev/dsp, maybe due to arts or alsa, i don't really know
Andypoo
Oi, who posted my list wink.png

Just a note that not all those parameters are implemented.

With regards the event names, I'd recommend just experimenting for now smile.png But as a hint, they should be named the same as the sound files for the associated events I believe.

Andypoo.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.