Skip to content

Instantly share code, notes, and snippets.

@onemanstartup
Forked from pwc3/SkypeMenuUpdater.rb
Created October 27, 2014 04:03
Show Gist options
  • Save onemanstartup/a240051b05d4858593d7 to your computer and use it in GitHub Desktop.
Save onemanstartup/a240051b05d4858593d7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
Process.daemon
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
LLDB = IO.popen("lldb", "w")
def lldb(cmd)
LLDB.puts cmd
LLDB.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")
lldb "attach Skype"
lldb "p (char)[[NSBundle bundleWithPath:@\"#{FSCRIPT_PATH}\"] load]"
lldb "p (void)[[FSInterpreter interpreter] execute:@\"#{updaterScript}\"]"
lldb "detach"
lldb "quit"
LLDB.close
@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 this version of SkypeMenuUpdater.rb. I then ran the ruby script in a Terminal window, but nothing happens when I receive new messages. 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