Created
December 3, 2010 00:04
-
-
Save octaflop/726349 to your computer and use it in GitHub Desktop.
A quick-and-dirty python script to send a message using lib-notify to multiple machines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding:utf-8 -*- | |
# notify.py | |
# a simple wrapper to notify a user | |
import subprocess, os | |
user = 'guest' | |
# I named the computers after south park characters :D | |
clients = ['cartman', 'kyle', 'stan', 'kenny'] | |
title = raw_input("title?\n") | |
text = raw_input("text?\n") | |
# Image comes with default ubuntu 10.10 installs. | |
image = "/usr/share/icons/Humanity/categories/48/applications-science.svg" | |
command = "DISPLAY=:0 notify-send '%s' '%s' -i '%s'" % (title, text, image) | |
# Send a message to each client | |
for client in clients: | |
subprocess.call(['ssh', '-X', "%s@%s.local" % (user, client), command]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment