Created
April 13, 2011 23:54
-
-
Save trshafer/918672 to your computer and use it in GitHub Desktop.
kills teleport and runs the same command again. essentially it kicks people from you
This file contains hidden or 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
Put this in an automator service as described by | |
http://blog.fosketts.net/2010/08/09/assign-keyboard-shortcut-applescript-automator-service/ |
This file contains hidden or 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
# begin | |
teleport = `ps -e -f | grep [t]eleport.prefPane` | |
original_teleport = teleport.split("\n")[0] | |
File.open('/Users/change/teleport_command.txt', 'w') {|f| f.write("#{original_teleport}\n") } | |
return if original_teleport == nil | |
original_teleport = original_teleport.split(' ') | |
teleport_command = original_teleport[original_teleport.length-2..-1].join(' ') + ' &' | |
File.open('/Users/change/teleport_command.txt', 'a') {|f| f.write("#{teleport_command}\n") } | |
x = system("kill -9 #{original_teleport[1]}") | |
system("#{teleport_command}") | |
# rescue Exception => e | |
# File.open('/Users/change/teleport_command.txt', 'a') {|f| f.write("#{e}\n") } | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I should do this in a shell script. But I know ruby. Everything is a nail.