Bläddra i källkod

New Blog entry

Thomas Buck 9 år sedan
förälder
incheckning
6361a7ef06
1 ändrade filer med 59 tillägg och 0 borttagningar
  1. 59
    0
      input/blog/2015/2015_07_01_bootcamp_icon_fix.md

+ 59
- 0
input/blog/2015/2015_07_01_bootcamp_icon_fix.md Visa fil

@@ -0,0 +1,59 @@
1
+title: Blog
2
+post: Bootcamp Icon fix
3
+date: 2015-07-01
4
+comments: true
5
+flattr: true
6
+twitter: xythobuz
7
+---
8
+
9
+## {{ page["post"] }}
10
+<!--%
11
+from datetime import datetime
12
+date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
13
+print "*Posted at %s.*" % date
14
+%-->
15
+
16
+If you like to give each disk appearing on your Macs desktop it’s own icon, and are a Bootcamp user, you’re probably aware that the Bootcamp drive icon is reset after each reboot. Fortunately, this can be fixed in an easy automated fashion.
17
+
18
+The only requirement is NTFS write support. To get this, install osxfuse and ntfs-3g, or enable the built-in NTFS write support ([find details here](http://apple.stackexchange.com/questions/152661/write-to-ntfs-formated-drives-on-yosemite)).
19
+
20
+First, set the icon you wish to use like you always would (right-click, Get Info, click on icon, cmd+v to paste new icon). This creates the hidden file `.VolumeIcon.icns` in the root of your disk. Copy it somewhere safe:
21
+
22
+    cp /Volumes/TX-55/.VolumeIcon.icns /Users/thomas/Pictures/Icons/VolumeIcon.icns
23
+
24
+Next, we need to create a little shell script that copies this file again after it is lost on reboot:
25
+
26
+    vim /Users/thomas/bin/fixBootcamp.sh
27
+    #!/bin/sh
28
+    cp /Users/thomas/Pictures/Icons/VolumeIcon.icns /Volumes/TX-55/.VolumeIcon.icns
29
+    :wq
30
+
31
+Finally create a LaunchAgent property list:
32
+
33
+    vim ~/Library/LaunchAgents/de.xythobuz.fixBootcamp.plist
34
+    
35
+    <?xml version="1.0" encoding="UTF-8"?>
36
+    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
37
+    <plist version="1.0">
38
+    <dict>
39
+        <key>Label</key>
40
+        <string>de.xythobuz.fixBootcamp</string>
41
+        <key>Program</key>
42
+        <string>/Users/thomas/bin/fixBootcamp.sh</string>
43
+        <key>RunAtLoad</key>
44
+        <true/>
45
+    </dict>
46
+    </plist>
47
+    
48
+    :wq
49
+
50
+You can now set this LaunchAgent to be executed on each Login:
51
+
52
+    launchctl load ~/Library/LaunchAgents/de.xythobuz.fixBootcamp.plist
53
+
54
+To test it without logging out and back in:
55
+
56
+    launchctl start de.xythobuz.fixBootcamp
57
+
58
+That was easy, right? :)
59
+

Laddar…
Avbryt
Spara