Skip to content

Instantly share code, notes, and snippets.

@c10b10
Forked from pwc3/SkypeMenuUpdater.rb
Created February 8, 2013 17:22
Show Gist options
  • Save c10b10/4740508 to your computer and use it in GitHub Desktop.
Save c10b10/4740508 to your computer and use it in GitHub Desktop.
Should Add Skype Notifications in Menu
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment