ls | perl -nl -e '/(.*)(S[0-9]+E[0-9]+).*(\.mp4)/ && print "mv \"" . $_ . "\" \"". $1 . $2 . $3 . "\""'
How does this work? First ls
outputs the list of files, one per line, like so:
The.Big.Bang.Theory.S01E01.xxxxxxxx.mp4
The.Big.Bang.Theory.S01E02.somecrap.mp4
The.Big.Bang.Theory.S04E12.otherjunk.mp4
Then perl -nl
splits this into lines, feeding each to the regex, much like awk*. The regex captures 3 groups (denoted by parentheses), first the bit before SxxEyy, then that, then the file suffix. It then simply assembles a mv
command suitable for renaming the files, like so:
mv "The.Big.Bang.Theory.S01E01.xxxxxxxx.mp4" "The.Big.Bang.Theory.S01E01.mp4"
mv "The.Big.Bang.Theory.S01E02.somecrap.mp4" "The.Big.Bang.Theory.S01E02.mp4"
mv "The.Big.Bang.Theory.S04E12.otherjunk.mp4" "The.Big.Bang.Theory.S04E12.mp4"
This can then be inspected and once you're satisfied it does what you want, piped into a shell by appending: | sh
.
*awk would normally be a good tool to use for this, but sadly only GNU awk supports regex capture groups and Mac OS X doesn't include gawk by default.
System preferences > General > Appearance > [Blue|Graphite]
Graphite will turn menu selection co
lor to dark grey. Of course it's system wide so it also will change the color for other UI elements.
Modding
You will need :
Download SArtFileTool into ~/Downloads/SArtFile then copy and decompress the system art resource file :
cd ~/Downloads/SArtFile
cp /System/Library/PrivateFrameworks/CoreUI.framework/Resources/SArtFile.bin ./
./sartfiletool -d SArtFile.bin artfiles
Go into the artfiles directory and find 52.png 68.png 71.png files and modify them.
- 52.png = "Blue" top menu text selection color
- 68.png = "Blue" menu item text selection color
- 71.png = "Blue" help menu item "Search" background color
Then recreate SArtFile.bin and put into place :
./sartfiletool -e artfiles SArtFile.bin SArtFile.new.bin
sudo cp SArtFile.new.bin /System/Library/PrivateFrameworks/CoreUI.framework/Resources/SArtFile.bin
Logout & log in again, menu should look something like this (I cheated and used the turquoise-ish files from "Lion Pulse" mod.)
Additional remarks:
The SArtFile is poorly documented for Lion, here's the explanation of the contents for Snow Leopard but Lion's is different.
The selection in Finder is still the harsher blue, haven't looked into that yet.
Best Answer
Pipe your grep through
awk
, then haveawk
color the fields.Example: