Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
RobertAudi / BasicTerminal.scpt
Created June 30, 2010 03:06
Open a new Terminal.app window with the *Basic* color theme using applescript
tell application "Terminal" to activate
tell application "System Events"
tell process "Terminal"
tell menu item "Basic" of menu "New Window" of menu item "New Window" of menu "Shell" of menu bar item "Shell" of menu bar 1
click
end tell
end tell
end tell
@RobertAudi
RobertAudi / BasicWindowGroup.scpt
Created June 30, 2010 03:22
Open a Terminal.app window group using AppleScript
tell application "Terminal" to activate
tell application "System Events"
tell process "Terminal"
tell menu item "Basic" of menu "Open Window Group" of menu item "Open Window Group" of menu "Window" of menu bar item "Window" of menu bar 1
click
end tell
end tell
end tell
@RobertAudi
RobertAudi / osascript_shebang.sh
Created June 30, 2010 03:56
AppleScript shebang
#!/usr/bin/osascript
@RobertAudi
RobertAudi / HomebrewTab.scpt
Created June 30, 2010 04:27
Open a new Terminal.app tab with the *Homebrew* color theme using applescript
tell application "Terminal" to activate
tell application "System Events"
tell process "Terminal"
tell menu item "Homebrew" of menu "New Tab" of menu item "New Tab" of menu "Shell" of menu bar item "Shell" of menu bar 1
click
end tell
end tell
end tell
<theme>
<!-- Window Style -->
<color id="foreground" red="0.59" green="0.80" blue="0.99" alpha="1.0" />
<color id="background" red=".1" green=".1" blue=".1" alpha=".95" />
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="yes" />
<!-- Text View Style -->
<color id="tag" red=".48" green=".48" blue=".48" alpha="1.0" />
<color id="handle" extendsColorID="foreground" />
<color id="insertionPoint" red=".4" green=".4" blue=".4" alpha="1.0" />
@RobertAudi
RobertAudi / moc
Created July 5, 2010 18:40
Save that code in a file called moc and put it somewhere in your $PATH
#!/bin/bash
# /!\ WARNING /!\
# ---------------
# DO NOT PUT THE CONTENTS OF THIS SCRIPT INTO
# A FUNCTION OR ELSE MOC WILL STOP RUNNING AS
# SOON AS YOU CLOSE THE TERMINAL WINDOW IN WHICH
# IT WAS FIRST LAUNCHED!!
number=$(ps aux | grep jackd | grep -v grep | wc -l)
@RobertAudi
RobertAudi / moc-orpheus
Created July 5, 2010 18:46
The moc-orpheus theme for MOC
# Copy what's below and save it in ~/.moc/themes/moc-orpheus
# moc-orpheus is the name of the file; don't give it an extension.
# Also, create the themes folder if it doesn't exist.
# I found this theme at this address:
# http://nic-nac-project.org/~orveldv/wiki/doku.php?id=moc
# A couple ather themes are also available there.
background = black black normal
frame = blue black bold
window_title = black black bold
@RobertAudi
RobertAudi / config
Created July 5, 2010 18:48
Copy this config file in ~/.moc
# /!\ WARNING /!\
# ---------------
# YOU NEED TO INSERT AT LEAST ONE BLANK LINE
# AT THE BOTTOM OF THE FILE OTHERWIZE YOU WILL
# GET A FATAL ERROR AND WON'T BE ABLE TO LAUNCH MOC!
# Default theme.
Theme = moc-orpheus
# Turn on repeat by default.
@RobertAudi
RobertAudi / moc-geetktool.sh
Created July 5, 2010 18:50
Script used to show info about the song playing in moc using GeekTool on OS X
#!/bin/bash
# First let's check if moc is running...
if [[ $(ps aux | grep mocp | grep -v grep | wc -l) -gt 0 ]];
then
out=$(/opt/local/bin/mocp -i)
# Parse mocp output.
while IFS=: read -r field value; do
@RobertAudi
RobertAudi / moc-growl.sh
Last active September 5, 2015 08:45
Growl notifications for moc
#!/bin/bash
while out=$(/usr/local/Cellar/moc/2.5.0-beta1/bin/mocp -i); do
# Parse mocp output.
while IFS=: read -r field value; do
case $field in
Artist) artist=$value;;
Album) album=$value;;
SongTitle) title=$value;;