-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
executable file
·121 lines (101 loc) · 4.45 KB
/
default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
from os import path
import macbok as m
def main():
"""Configures Roger's MacBook Pro."""
# Open new finder windows in home directory.
yield m.Plist('NewWindowTarget', 'PfHm', domain='com.apple.finder')
# Maximum scrolling speed.
yield m.Plist('com.apple.scrollwheel.scaling', 1.0)
# Mouse tracking speed.
yield m.Plist('com.apple.mouse.scaling', 2.5)
# Dock preferences
yield m.Plist('minimize-to-application', 1, domain='com.apple.dock')
yield m.Plist('orientation', 'left', domain='com.apple.dock')
yield m.Plist('show-recents', 0, domain='com.apple.dock')
# Move windows with ctrl+cmd drag.
yield m.Plist('NSWindowShouldDragOnGesture', True)
# On AC Power, keep the display and system on for 3 hours of inactivity.
yield m.Pmset('displaysleep', '180', 'c')
yield m.Pmset('sleep', '180', 'c')
# Use stable IPv6 addresses. Otherwise, long-lived IPv6 connections are
# dropped constantly.
yield m.Sysctl('net.inet6.ip6.use_tempaddr', '0')
yield m.Text(
'/private/etc/sudoers.d/alf',
'roger ALL = NOPASSWD: /usr/libexec/ApplicationFirewall/socketfilterfw',
sudo=True)
# Avoid creating a dead links
if path.exists(path.expanduser('~/K')):
if not path.exists(path.expanduser('~/.atom')):
os.mkdir(path.expanduser('~/.atom'))
for atom_path in ['config.cson', 'init.js', 'keymap.cson', 'snippets.cson',
'styles.less']:
yield m.Link('../K/.atom/' + atom_path,
path.expanduser('~/.atom/' + atom_path))
yield m.Link('K/.bcrc', path.expanduser('~/.bcrc'))
yield m.Link('K/.colordiffrc', path.expanduser('~/.colordiffrc'))
yield m.Link('K/.editrc', path.expanduser('~/.editrc'))
yield m.Link('K/.gitconfig', path.expanduser('~/.gitconfig'))
yield m.Link('K/.gitignore', path.expanduser('~/.gitignore'))
if not path.exists(path.expanduser('~/.gnupg')):
os.mkdir(path.expanduser('~/.gnupg'))
yield m.Link(
'../K/.gnupg/gpg-agent.conf',
path.expanduser('~/.gnupg/gpg-agent.conf'))
yield m.Link('K/.tmux.conf', path.expanduser('~/.tmux.conf'))
yield m.Link('K/bash_aliases-mac', path.expanduser('~/.bash_aliases'))
yield m.Link('K/.ssh', path.expanduser('~/.ssh'))
yield m.Touch(path.expanduser('~/.bash_sessions_disable'))
yield m.Touch(path.expanduser('~/.hushlogin'))
# Basic packages
yield m.Homebrew(tap='homebrew/core')
yield m.Homebrew(tap='homebrew/cask')
yield m.Homebrew('mcrypt', force_bottle=True)
yield m.Homebrew('iperf')
yield m.Homebrew('mtr', force_bottle=True)
yield m.Homebrew('unrar', force_bottle=True)
yield m.Homebrew('wakeonlan')
yield m.Homebrew('openssl', force_bottle=True)
yield m.Homebrew('python', force_bottle=True)
yield m.Homebrew('libav', force_bottle=True)
yield m.Homebrew('git', force_bottle=True)
yield m.Homebrew('nmap', force_bottle=True)
yield m.Homebrew('source-highlight', force_bottle=True)
yield m.Homebrew('lftp', force_bottle=True)
yield m.Homebrew('arping', force_bottle=True)
yield m.Homebrew('socat', force_bottle=True)
yield m.Homebrew('colordiff', force_bottle=True)
yield m.Homebrew('mpv', force_bottle=True)
yield m.Homebrew('gnupg', force_bottle=True)
yield m.Homebrew('pinentry-mac', force_bottle=True)
yield m.Homebrew('whois', force_bottle=True)
yield m.Homebrew('gnu-tar', force_bottle=True)
yield m.Homebrew('the_silver_searcher', force_bottle=True)
yield m.Homebrew('ctags', force_bottle=True)
yield m.Homebrew('tmux', force_bottle=True)
yield m.Homebrew('fping', force_bottle=True)
yield m.Homebrew('imagemagick', force_bottle=True)
yield m.Homebrew('exiftool', force_bottle=True)
yield m.Homebrew('iperf3', force_bottle=True)
yield m.Homebrew('webp', force_bottle=True)
# Cask packages
yield m.Homebrew(cask_package='google-chrome')
yield m.Homebrew(cask_package='gnucash')
yield m.Homebrew(cask_package='atom')
yield m.Gitclone(
'https://github.com/t9md/atom-vim-mode-plus.git',
path.expanduser('~/Downloads/atom-vim-mode-plus'))
yield m.Gitclone(
'https://github.com/rogerhub/auto-detect-indentation.git',
path.expanduser('~/Downloads/auto-detect-indentation'))
yield m.Gitclone(
'https://github.com/rogerhub/python-indent.git',
path.expanduser('~/Downloads/python-indent'))
if __name__ == '__main__':
sys.path.append(path.dirname(__file__))
m.Execute(main)