Skip to content

Instantly share code, notes, and snippets.

@pwc3
Created May 18, 2012 23:42
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pwc3/2728176 to your computer and use it in GitHub Desktop.
Save pwc3/2728176 to your computer and use it in GitHub Desktop.
Shows the number of unread Skype conversations in the menu bar
#!/usr/bin/env ruby
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
GDB = IO.popen("gdb", "w")
def gdb(cmd)
GDB.puts cmd
GDB.flush
end
updaterScript = <<END_OF_FSCRIPT
SkypeMenuUpdater : NSObject
{
statusBarItem
timer
- init
{
self := super init.
self ~~ nil ifTrue:
[
statusBarItem := NSStatusBar systemStatusBar statusItemWithLength:20.
timer := NSTimer scheduledTimerWithTimeInterval:1
target:[self updateMenu]
selector:#value
userInfo:nil
repeats:YES.
].
^ self
}
- updateMenu
{
statusBarItem setTitle:NSApplication sharedApplication dockTile badgeLabel.
}
}.
updater := (SkypeMenuUpdater alloc) init.
END_OF_FSCRIPT
updaterScript.gsub!("\n", "\\n")
gdb "attach Skype"
gdb "p (char)[[NSBundle bundleWithPath:@\"#{FSCRIPT_PATH}\"] load]"
gdb "p (void)[[FSInterpreter interpreter] execute:@\"#{updaterScript}\"]"
gdb "detach"
gdb "quit"
GDB.close
@c10b10
Copy link

c10b10 commented Feb 8, 2013

Should this work with Skype 6?

@pwc3
Copy link
Author

pwc3 commented Mar 6, 2013

I have used it with Skype 6 and it worked. It's just copying the dock icon's badge label (which is the number of unread conversations) to the menu bar. So long as Skype continues to use the badge label, this should work.

@BAndonovski
Copy link

Tried to get this working with Skype 6 on OS X 10.8.5, but with no success. Have you tried that, hopefully, with any good results?

@briangershon
Copy link

F-Script not supported on OSX 10.6 and above -- saw note on http://sabi.net/nriley/software/

@DenimTornado
Copy link

I there the way to do it without GDB? I do't want to install it on Mavericks.

@onemanstartup
Copy link

It's working just needs updated with lldb and use last version Kentzo/F-Script#12 see my fork https://gist.github.com/onemanstartup/a240051b05d4858593d7

@MacL3an
Copy link

MacL3an commented Feb 27, 2015

Please excuse my ignorance, but I feel a bit lost here. I've downloaded and installed F-script (moved the files to Applications- and appropriate Library-folder?), installed Xcode and downloaded onemanstartup's version of SkypeMenuUpdater.rb. I then ran the ruby script in a Terminal window by writing "ruby SkypeMenuUpdater.rb". Nothing appeared in the terminal and I don't get any updates on the icon. I'm running Yosemite and the latest version of Skype. Is there anything I'm doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment