Control itunes from the command line, over **40** commands inculding play/pause, mute/unmute, playlist and play random album. Also inculdes also scripts for getting data from itunes.
Shell Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
extra
Readme.md
itunes.sh

Readme.md

Shell Tunes {#readmeTitle}

Control itunes from the command line, over 40 commands inculding play/pause, mute/unmute, playlist and play random album. Also inculdes also scripts for getting data from itunes. {#description}

Usage

Usage: itunes.sh <option>

Prerequisites

  • Mac OS X (tested on 10.6)

Install

  • Put the scripts in your $PATH
  • See below for bash completion.

Options

Usage: itunes.sh <option>
Options: (short)
 (s) status          : Shows iTunes' status, and track info
 (y) play            : Start playing.
 (a) pause           : Pause iTunes.
 (p) playpause       : Start playing / Pauses.

 (n) next            : Go to the next track.
 (b) prev            : Go to the previous track.
 (r) rewind          : Rewinds the current track.

 (m)                 : Toggles Mute iTunes' volume.
     mute            : Mute iTunes' volume.
     unmute          : Unmute iTunes' volume.
 (v) vol up          : Increase iTunes' volume by 10%
 (v) vol down        : Increase iTunes' volume by 10%
 (v) vol #           : Set iTunes' volume to # [0-100]

 (@) search        {string} : Search for songs in each field (results playlist must exist)
 (@) search [type] {string} : Search for songs by type
                            : Types are album, artist, composer 
                            : comment, genre, grouping, name and year 
 ($)               {string} : Serching for songs using name, album and comment as fields

 (l) playlist        : List all the playlists
 (l) playlist {name} : Plays the specified playlist 
 (c) current         : List the songs of the current playlist

 (d) random          : Plays a random album
 (f) shuffle         : Toggles shuffle
 (f) shuffle on      : Turns shuffle on
 (f) shuffle off     : Turns shuffle off

 (e) repeat all      : Set repeat to all
 (e) repeat one      : Set repeat to on
 (e) repeat off      : Set repeat to off


     [0-5]          : Set the current song rating
 (6) 4.5            : Set the current song rating to 4½ stars

 (t) stop           : Stop iTunes.
 (q) quit           : Quit iTunes.

Bash Completion

  • Add this to your .bash_profile or .bashrc

    function i(){
        itunes.sh "$@"
    }
    
    function _ilist(){
        itunes.sh commands
    }
    
    function _icomp(){
        local curw
        COMPREPLY=()
        curw=${COMP_WORDS[COMP_CWORD]}
        COMPREPLY=($(compgen -W '`_ilist`' -- $curw))
        return 0
    }
    
    #  Completion for itunes.sh
    shopt -s progcomp
    complete -F _icomp i
    

Other

Issues

None Yet

Licence

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

Authors

  • Bilal Hussain