Skip to content

Instantly share code, notes, and snippets.

@theist
Created July 24, 2012 07:52
Show Gist options
  • Save theist/3168670 to your computer and use it in GitHub Desktop.
Save theist/3168670 to your computer and use it in GitHub Desktop.
Hamster activity print
#!/usr/bin/perl -w
#
use strict;
use Net::DBus;
eval {
my $bus = Net::DBus->find;
my $hamster = $bus->get_service("org.gnome.Hamster");
my $hamster_manager = $hamster->get_object("/org/gnome/Hamster","org.gnome.Hamster");
my $acct = $hamster_manager->GetCurrentActivity();
if ($acct) {
print "$acct\n";
} else {
print "No Activity\n";
}
};
print "Hamster not present\n" if ($@);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment