Go Back   MacRumors Forums > Mac Community > Picture Gallery > UI Customization

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old Nov 24, 2012, 12:50 PM   #1
unsanity77
macrumors member
 
Join Date: Nov 2012
Complete Customization for your Dock on Mountain Lion

UPDATE: Full-featured app for more than just black -- http://spyresoft.com


Here's something I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

So.... I've written a program that will patch the Dock's code. It performs a static decryption on the Dock binary, patches several offsets, and removes an integral part of the code signature to bypass the signing process.

This is no longer considered BETA software. It has stood the test of time, and hundreds of users have reported success, with no failures.

However, I have created an actual cocoa app in an effort to make it even easier for most people to use. This app is considered BETA for now. There is no functional difference between the command-line version and the GUI version, so if you've already modified your dock, there's no need to download the new version (unless you want to BETA test it). This app will ask for your password to install a helper app. This helper app is so that changes can be made to the Dock app (which is owned by the "root" user). If you ever want to uninstall, remove the following files:

Code:
/Library/LaunchDaemons/com.chasingsilver.dpprivilegedhelper.plist
/Library/PrivilegedHelperTools/com.chasingsilver.dpprivilegedhelper

To use the command-line dock mod,
Code:
usage:
    dockmod -c <color> -r

    -c, --color            color to make the dock ('default' or 'black')
    -r, --noreflections    disable icon reflections
Keep in mind, again, this will only work for 10.8.2 so far, and will have to be updated for future versions. Success has been reported also for 10.8.3.

use it like this:
Code:
sudo dockmod -c black -r
The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.

This is what it looks like:
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-12-05 at 1.33.11 AM.png
Views:	4654
Size:	929.4 KB
ID:	381605  
Attached Files
File Type: zip dockmod.zip (4.8 KB, 3779 views)
File Type: zip dockmod (GUI).zip (633.2 KB, 3406 views)

Last edited by unsanity77; May 22, 2013 at 03:39 PM.
unsanity77 is offline   12
Old Nov 24, 2012, 01:00 PM   #2
gumblecosby
macrumors 6502
 
Join Date: Jun 2010
Quote:
Originally Posted by unsanity77 View Post
Here's a guide I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

It can be quite complex as it involves some hacking of the OS, but as I wanted a black dock bad enough to do this, I figured there may be others. So here's how I did it.
The dock executable contains the mission control code also. Any chance you found any adjustable attributes? For example - decrease amount of empty space between the windows in Mission Control.


Great work on the Dock theming. Somebody is going to take your idea and sell it as an app if you are not careful
gumblecosby is offline   2
Old Nov 24, 2012, 01:02 PM   #3
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
I didn't look for mission control code, but if it's in there I could probably find it.

And this way is fairly complicated, unportable across minor OS versions, and easily broken but if someone wants to try to sell it, I suppose there's no way to stop them!
unsanity77 is offline   0
Old Nov 24, 2012, 01:15 PM   #4
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Thanks again for all your help in the other thread.

I have the latest Xcode 4.x Beta (iOS developer), and I didn't install the command line tools.

Once done, I should be able to call 'gdb', currently it's unrecognized in Terminal, which may have been the issue (I used a work around that didn't take).

Thanks mate!
bedifferent is offline   0
Old Nov 24, 2012, 01:17 PM   #5
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.
unsanity77 is offline   1
Old Nov 24, 2012, 01:21 PM   #6
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Quote:
Originally Posted by unsanity77 View Post
Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.
Last ?, after dumping binary, terminal claims gdb is still running and should I quit. Is it still working in the background and should I wait until it is done or just quit? Thanks!
bedifferent is offline   0
Old Nov 24, 2012, 01:22 PM   #7
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
Screenshot so I can see what you typed.
unsanity77 is offline   0
Old Nov 24, 2012, 01:23 PM   #8
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Quote:
Originally Posted by unsanity77 View Post
Screenshot so I can see what you typed.
There you go
Attached Thumbnails
Click image for larger version

Name:	CJ  gdb-i386-apple-d  11625.jpg
Views:	1703
Size:	101.4 KB
ID:	379431  
bedifferent is offline   0
Old Nov 24, 2012, 01:26 PM   #9
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
You can just quit anyway there

Remember when you paste in this dumped code in 0xED to make sure that you're pasting starting at offset 0 and that you're write mode is overwrite.

You can also just use this command to copy the dumped code from the dump file on your desktop to the Dock binary also on your desktop:
cat ~/Desktop/dump | dd of=~/Desktop/Dock bs=1 seek=0 count=`stat -f %z ~/Desktop/dump` conv=notrunc

Last edited by unsanity77; Nov 24, 2012 at 02:10 PM.
unsanity77 is offline   0
Old Nov 24, 2012, 04:49 PM   #10
Wich
macrumors newbie
 
Join Date: Nov 2012
Hi, I' ve just finished following the guide but I' ve got a "strange" result as you can see from the two screenshots attached. Basically the dock becomes kinda grey when I have any window open and takes the background color when I have none open so I guess that has to do with some opacity/reflection settings. I' ve checked all the values I' ve inserted in 0xED and they are correct(I guess)...any suggestions?
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-11-24 at 11.35.45 PM.png
Views:	1272
Size:	527.4 KB
ID:	379461   Click image for larger version

Name:	Screen Shot 2012-11-24 at 11.35.48 PM.png
Views:	1596
Size:	1.31 MB
ID:	379463  
Wich is offline   0
Old Nov 24, 2012, 05:51 PM   #11
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
You'll remember that even the original Dock reflected windows that were above it. It's because the background of the Safari window is a bright white, and that's being reflected in the glossy black dock, and so it becomes a gray color. Try a website with a darker background color or make the window smaller and move it closer and then away from the dock to see what I mean.

With that said, your dock does seem a bit different. Are you sure you left the Dock Alpha Transparency Value unchanged?

I to would like to change this reflection type too, and I'll take a look at it again probably in the coming weekends and post my result.
unsanity77 is offline   0
Old Nov 24, 2012, 07:46 PM   #12
LastMinuteMike
macrumors member
 
Join Date: Jun 2012
Quote:
Originally Posted by unsanity77 View Post
I didn't look for mission control code, but if it's in there I could probably find it.
Yeah, please find out what kind of tweaks one can perform to Mission Control, pleeeeeaaase!

----------

Quote:
Originally Posted by Wich View Post
Hi, I' ve just finished following the guide but I' ve got a "strange" result as you can see from the two screenshots attached. Basically the dock becomes kinda grey when I have any window open and takes the background color when I have none open so I guess that has to do with some opacity/reflection settings. I' ve checked all the values I' ve inserted in 0xED and they are correct(I guess)...any suggestions?
The dock reflects the whatever is above it. So if you have a mostly white window open, the dock is going to look white/grey. If you close all windows it'll only reflect your desktop. Try scrolling a window and see if you can catch the movement in the dock reflection!
LastMinuteMike is offline   1
Old Nov 25, 2012, 03:26 AM   #13
Wich
macrumors newbie
 
Join Date: Nov 2012
Quote:
Originally Posted by unsanity77 View Post
You'll remember that even the original Dock reflected windows that were above it. It's because the background of the Safari window is a bright white, and that's being reflected in the glossy black dock, and so it becomes a gray color. Try a website with a darker background color or make the window smaller and move it closer and then away from the dock to see what I mean.

With that said, your dock does seem a bit different. Are you sure you left the Dock Alpha Transparency Value unchanged?

I to would like to change this reflection type too, and I'll take a look at it again probably in the coming weekends and post my result.
Yeah, but with the original dock the effect was more subtle(as it stayed always kinda grey) while here I have a dock that goes from grey for example all the way to completely green/red if I put a completely green/red background when I have no windows open. I would really love a dock that stays always black regardless of any windows open/background. As for the Dock Alpha Transparency value I didn' t touch it and it has this value for me: 00 00 00 00 00 00 F0 3F...
edit: Btw I just noticed that the stacks on the dock are "broken"(they don' t display the correct items anymore)...

Last edited by Wich; Nov 25, 2012 at 04:18 AM.
Wich is offline   0
Old Nov 25, 2012, 01:35 PM   #14
symo
macrumors newbie
 
Join Date: Nov 2008
Location: Italy
Quote:
Originally Posted by unsanity77 View Post
If you pulled it from the ML installation disk, then it's the Dock.app from 10.8.0. You'll have to download the 10.8.2 combo update and get your dock back to where it's supposed to be
I did as you said in the other thread, but the md5 is still different from yours.
I tried the hack ad obviously it didn't work, the dock became gray with colored reflections depending on the wallpaper (or the currently open window).

I'm afraid I'll have to give up.
Thank you anyway.

Last edited by symo; Nov 25, 2012 at 01:48 PM.
symo is offline   0
Old Nov 25, 2012, 02:08 PM   #15
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
Actually, from the picture, it appears that you were successful in patching the dock. The dock always reflects the wallpaper or the windows directly above it. It's just more noticeable now that it's black. However, I'll still be looking for a way to "tone down" this reflective behavior, and it will most likely result in just a couple more offsets to patch.
unsanity77 is offline   0
Old Nov 25, 2012, 03:37 PM   #16
symo
macrumors newbie
 
Join Date: Nov 2008
Location: Italy
I thought the hack hadn't worked because in your picture the dock looked darker, but now I guess it's because of the black wallpaper.
Very well then.
Thanks!
symo is offline   0
Old Nov 25, 2012, 04:02 PM   #17
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
EDIT: As these are the only stable patches for now, I've updated the guide in post #1 to reflect these new patches/offset.

Alright, thanks to everyone for giving this a whirl. I've realized that changing constant float values in memory has led to unintended consequences, since these values are also being used elsewhere in the program. So I have localized the changes to black to the rendering function. However, by doing this, you cannot play around with the colors. Your dock is either black, or it's the original color. For those of you who would like to give this a try, I'm including the offsets you should patch here.

These offsets are used INSTEAD OF the ones listed in the document I uploaded. So essentially, you'd need to start with the original Dock binary, and do the steps again, except this time only patch what's listed here in this post. I've included pictures for you to see what it looks like now.


Patch 0xDC0AD to 0F 57 C0
Patch 0xDC0C8 to 0F 57 C0 90 90 90 90 90
Patch 0xDC0ED to 0F 57 C0 90 90 90 90 90
Patch 0xDC19F to 0F 57 C0 90 90 90 90 90
Patch 0xDC1C7 to 0F 57 C0 90 90 90 90 90
Patch 0xDC26D to 0F 57 C0
Patch 0xDC31D to 0F 57 C0 90 90 90 90 90

Patch 0xAC to 00 (so kernel doesn't attempt to decrypt what's already decrypted)

And you can still disable the icon reflections by patching 0x12EB2 to 00 as well (though I think that looks weird now).

As you can see from the pictures, it tends to look better with the lighter or colored backgrounds. Not so distinguishable when you have a darker gray/almost black background. YMMV.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-11-25 at 3.44.55 PM.png
Views:	405
Size:	967.3 KB
ID:	379629   Click image for larger version

Name:	Screen Shot 2012-11-25 at 3.45.11 PM.png
Views:	436
Size:	1.04 MB
ID:	379630   Click image for larger version

Name:	Screen Shot 2012-11-25 at 3.45.55 PM.png
Views:	460
Size:	687.8 KB
ID:	379631  

Click image for larger version

Name:	Screen Shot 2012-11-25 at 3.48.58 PM.png
Views:	374
Size:	547.2 KB
ID:	379632  

Last edited by unsanity77; Nov 26, 2012 at 01:23 PM.
unsanity77 is offline   1
Old Nov 26, 2012, 09:45 AM   #18
symo
macrumors newbie
 
Join Date: Nov 2008
Location: Italy
Thumbs up

I like it a lot.
Thumb resize.
Thank you so much!!!

Last edited by symo; Nov 26, 2012 at 01:03 PM.
symo is offline   0
Old Nov 26, 2012, 10:14 AM   #19
Mal
macrumors 603
 
Mal's Avatar
 
Join Date: Jan 2002
Location: Orlando
I started to attempt this, but not having any programming experience, I discovered I'm not up to the task. Is there any way someone could post the Dock.app and just let me do the code signing and place it in the proper location? I can handle that part.

jW
__________________
The Bearded Nerd
13" MacBook Pro; 64GB iPod touch
"It's a real burn, being right so often."
NoiseTrade.com/Walker
Mal is offline   0
Old Nov 26, 2012, 12:58 PM   #20
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Worked like a charm! Thanks so much for your hard work and help.

The developers of "Candybar" over at Panic should read this as it may benefit them in allowing OS X 10.8 Dock modification. Since the change, dock modding is no longer functional in the application, hence Candybar decided on making the application free.
bedifferent is offline   0
Old Nov 26, 2012, 01:06 PM   #21
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
Any one else reading this can refer to the original post #1 to download an automatic patcher. This should simplify things for those not comfortable with all the steps outlined in the tutorial. However, keep in mind that at this point, you will be a beta tester... muahahaha

If there's anything wrong with it, I'll update what I can.

And honestly, this is an extremely hacky method that I would doubt could be incorporated into CandyBar.
unsanity77 is offline   2
Old Nov 26, 2012, 01:11 PM   #22
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Quote:
Originally Posted by unsanity77 View Post
Any one else reading this can refer to the original post #1 to download an automatic patcher. This should simplify things for those not comfortable with all the steps outlined in the tutorial. However, keep in mind that at this point, you will be a beta tester... muahahaha

If there's anything wrong with it, I'll update what I can.

And honestly, this is an extremely hacky method that I would doubt could be incorporated into CandyBar.

After I wrote that comment I realized sandboxing and other "hacks" would be outside of the allowed parameters. Prior to 10.8, modding the Dock required replacing the frontline and s-curve png's. As the Dock is more "interactive", using Candybar's method of replacing the icons and images isn't possible and you are right, I doubt it would be in their best interest.

However, YOU could make some money! Your work is the only method I have tried since 10.8 DP2 or 3 that works. I know many who would gladly pay for an easy app.
bedifferent is offline   0
Old Nov 26, 2012, 01:15 PM   #23
unsanity77
Thread Starter
macrumors member
 
Join Date: Nov 2012
Quote:
Originally Posted by bedifferent View Post
However, YOU could make some money! Your work is the only method I have tried since 10.8 DP2 or 3 that works. I know many who would gladly pay for an easy app.
I probably could, but I'm not really interested in that. I did it because it's fun. And as many people as you know who would gladly pay for an easy app, I bet I know more who would gladly have that app for free! In any case, the "software" is now free at the top of this page. =D

But thanks, I'm sure glad you find it useful.
unsanity77 is offline   3
Old Nov 26, 2012, 01:18 PM   #24
bedifferent
macrumors Demi-God
 
bedifferent's Avatar
 
Join Date: Jan 2009
Location: NY
Quote:
Originally Posted by unsanity77 View Post
I probably could, but I'm not really interested in that. I did it because it's fun. And as many people as you know who would gladly pay for an easy app, I bet I know more who would gladly have that app for free! In any case, the "software" is now free at the top of this page. =D

But thanks, I'm sure glad you find it useful.
A scholar and a gentleman. I'm much the same, I enjoy the process and helping others. Thank you again.
bedifferent is offline   0
Old Nov 26, 2012, 02:22 PM   #25
TheAngryPenguin
macrumors member
 
Join Date: Oct 2012
Thanks for putting together the automatic patcher. I am, however, unable to get it to work properly. I had been using another 'hack' (outlined here), but I reverted to Dock.app v.10.8.2 from a backup before attempting to run the auto-patcher. Here's the output:

Code:
$ sudo ./patch_dock 
Backing up original Dock contents
Dumping memory from Dock (5263) [0x104eda000-0x105135000]
Copying Dock binary to working directory
Replacing encrypted contents with decrypted dump
Patching __TEXT segment flags
Patching offset 0xDC0AD
Patching offset 0xDC0C8
Patching offset 0xDC0ED
Patching offset 0xDC19F
Patching offset 0xDC1C7
Patching offset 0xDC26D
Patching offset 0xDC31D
Importing code signing certificates
Replacing with patched Dock
Code signing the patched Dock
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
Restarting the Dock process
The Dock process cannot successfully restart, and my wallpaper disappears. Reverting seems to work. Also, if I run the revert_to_original script, and then run the patch_dock script, I get the same results listed above. Any ideas?

Update: After realizing the the scripts already include the sudo command, I tried running them w/o it. Same result.

Last edited by TheAngryPenguin; Nov 26, 2012 at 02:28 PM.
TheAngryPenguin is offline   0


Closed Thread
MacRumors Forums > Mac Community > Picture Gallery > UI Customization

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
OS X: Sims complete collection, work with Mountain Lion? michaelshaw2121 Mac and PC Games 2 Feb 8, 2014 02:59 PM
Can I get Mountain Lion's Dock on Snow Leopard? (Candybar customization) LeandrodaFL OS X 1 Oct 11, 2013 05:57 PM
The Dock in Mountain Lion Airnova iMac 1 Dec 31, 2012 04:34 PM
Resolved: Can't Change Dock In Mountain Lion muzikman54 OS X 10.8 Mountain Lion 3 Aug 4, 2012 11:47 AM
How do I change the dock in Mountain Lion? Manic Harmonic OS X 10.8 Mountain Lion 1 Jul 28, 2012 04:12 AM

Forum Jump

All times are GMT -5. The time now is 01:04 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC