├── HOSTS ├── LICENSE.txt ├── README.md ├── ansible_modules ├── dconf ├── gconftool2 └── gsettings ├── config.json ├── gconf.txt ├── requirements.txt ├── roles └── common │ ├── files │ ├── .bash_customizations │ ├── .spacemacs │ ├── .tmux.conf │ ├── .vimrc │ ├── .vimrc.bundles │ ├── base16-monokai.vim │ ├── color_prompt.sh │ ├── keyboard-color.sh │ ├── plank.desktop │ ├── setup │ ├── variety.conf │ └── variety.desktop │ ├── tasks │ ├── base16.yml │ ├── bash_customizations.yml │ ├── bumblebee.yml │ ├── chrome.yml │ ├── dropbox.yml │ ├── font.yml │ ├── keepass2.yml │ ├── laptop.yml │ ├── main.yml │ ├── numix.yml │ ├── other_requirements.yml │ ├── plank.yml │ ├── pre.yml │ ├── ruby_scm_breeze.yml │ ├── spacemacs.yml │ ├── sublime.yml │ ├── variety.yml │ ├── vim.yml │ └── work.yml │ └── vars │ └── main.yml ├── run.sh └── setup.yml /HOSTS: -------------------------------------------------------------------------------- 1 | [local] 2 | 127.0.0.1 -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Joseph Ben-zion Kahn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Stories in Ready](https://badge.waffle.io/JBKahn/provisioning-local.png?label=ready&title=Ready)](https://waffle.io/JBKahn/provisioning-local) 2 | Provisioning My PC 3 | ============ 4 | 5 | A simple ansible script to set up my machine just the way I like it (currently base on Ubuntu 14.04). 6 | 7 | How To Install With One Command 8 | ------------------------------- 9 | 10 | ```bash 11 | wget -qO- https://github.com/JBKahn/provisioning-local/raw/master/run.sh | bash 12 | ``` 13 | 14 | 15 | How To Install The Old Fashioned Way 16 | ------------------------------------ 17 | 18 | 1. Install pip 19 | ```bash 20 | sudo apt-get install python-setuptools 21 | sudo easy_install pip 22 | ``` 23 | 24 | 2. Install Ubuntu packages 25 | ```bash 26 | sudo apt-get install aptitude 27 | sudo apt-get install git 28 | sudo apt-get install python-dev libxml2-dev libxslt-dev 29 | ``` 30 | 3. Setup Git 31 | * [setup git](https://help.github.com/articles/set-up-git) 32 | * [setup ssh keys](https://help.github.com/articles/generating-ssh-keys) 33 | 4. Checkout this repo and cd into the directory 34 | ```bash 35 | git clone https://github.com/JBKahn/provisioning-local.git 36 | cd 37 | ``` 38 | 39 | 5. Pip install the requirements 40 | ```bash 41 | sudo pip install -r requirements.txt 42 | ``` 43 | 44 | 6. Fill in the variables in the [variables file ](./config.json) 45 | 46 | | variable | Description | 47 | | :------------ |:---------------| 48 | | sager_laptop | boolean to fix keyboard colors and backlight on ubuntu for sager laptops | 49 | | vagrant_url | URL to vagrant .deb file you wish to install | 50 | | virtualbox_url |URL to virtual_box .deb file you wish to install | 51 | | github_username | github username | 52 | 7. Provision your local machine 53 | 54 | ```bash 55 | ansible-playbook setup.yml -i HOSTS --ask-sudo-pass --module-path ./ansible_modules --extra-vars "@config.json" 56 | ``` 57 | 58 | Possible Issues 59 | --------------- 60 | 61 | 1. /usr/bin/ohai does not exist (Haven't hit since early development) 62 | 63 | The fix was to remove old version of ruby, use rvm and then gem install ohai 64 | 65 | http://stackoverflow.com/questions/4464985/rails-3-ruby-1-9-2-does-it-need-usr-bin-ruby1-8 66 | https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm 67 | https://wiki.opscode.com/display/chef/Ohai+Installation+and+Use 68 | -------------------------------------------------------------------------------- /ansible_modules/dconf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # (c) 2014, Joseph Kahn 5 | # 6 | # This file is part of Ansible 7 | # 8 | # Ansible is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # Ansible is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with Ansible. If not, see . 20 | 21 | from ansible.constants import mk_boolean 22 | from ansible.module_utils.basic import * 23 | 24 | DOCUMENTATION = ''' 25 | --- 26 | module: dconf 27 | version_added: "post 1.7.1" 28 | author: Joseph Kahn 29 | short_description: alter dconf controlled settings. 30 | description: 31 | - Set the value of a dconf controlled setting using a key and a string, an integer, or a boolean. 32 | options: 33 | key: 34 | description: 35 | - The key of the dconf setting to change. 36 | required: true 37 | bool: 38 | description: 39 | - The boolean value to set the key to. 40 | required: false 41 | int: 42 | description: 43 | - The integer value to set the key to. 44 | required: false 45 | string: 46 | description: 47 | - The string value to set the key to. Wrap it in single quotes for safety. 48 | required: false 49 | float: 50 | description: 51 | - The float value to set the key to. 52 | required: false 53 | ''' 54 | 55 | EXAMPLES = ''' 56 | # Set string value 57 | - dconf: key=/apps/gnome-terminal/global/default_profile string=base-16-monokai-dark 58 | 59 | # Set bool value 60 | - dconf: key=/apps/gnome-terminal/profiles/base-16-monokai-dark/use_system_font bool=false 61 | ''' 62 | 63 | # =========================================== 64 | # Module code. 65 | # 66 | 67 | 68 | def _set_value(module, key, value): 69 | """Set value of setting, under `key`, using dconf to `value`.""" 70 | return module.run_command(" ".join(['dconf write {} {}'.format(key, value)])) 71 | 72 | 73 | def _get_value(module, key): 74 | """Return value of setting, under `key`, from dconf.""" 75 | return module.run_command('dconf read {}'.format(key))[1].strip() 76 | 77 | 78 | def main(): 79 | 80 | module = AnsibleModule( 81 | argument_spec={ 82 | 'key': {'required': True}, 83 | 'bool': {'type': 'bool'}, 84 | 'int': {'type': 'int'}, 85 | 'string': {'type': 'str'}, 86 | 'float': {'type': 'float'}, 87 | }, 88 | mutually_exclusive=[ 89 | ['bool', 'string', 'int', 'float'], 90 | ], 91 | required_one_of=[['bool', 'string', 'int', 'float']], 92 | supports_check_mode=True 93 | ) 94 | 95 | key = module.params['key'] 96 | boolean_value = module.params['bool'] 97 | string_value = module.params['string'] 98 | integer_value = module.params['int'] 99 | float_value = module.params['float'] 100 | 101 | old_value = _get_value(module, key) 102 | 103 | if boolean_value is not None: 104 | value = str(mk_boolean(boolean_value)).lower() 105 | old_value = str(mk_boolean(old_value)).lower() 106 | elif integer_value is not None: 107 | value = int(integer_value) 108 | elif string_value is not None: 109 | value = string_value 110 | elif float_value is not None: 111 | value = float_value 112 | 113 | changed = old_value != str(value) 114 | 115 | if changed and not module.check_mode: 116 | _set_value(module, key, value) 117 | 118 | module.exit_json( 119 | changed=changed, 120 | key=key, 121 | value=value, 122 | old_value=old_value 123 | ) 124 | 125 | main() 126 | -------------------------------------------------------------------------------- /ansible_modules/gconftool2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # (c) 2014, Joseph Kahn 5 | # 6 | # This file is part of Ansible 7 | # 8 | # Ansible is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # Ansible is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with Ansible. If not, see . 20 | 21 | from ansible.constants import mk_boolean 22 | from ansible.module_utils.basic import * 23 | 24 | DOCUMENTATION = ''' 25 | --- 26 | module: gconftool2 27 | version_added: "post 1.7.1" 28 | author: Joseph Kahn 29 | short_description: alter gconftool-2 controlled settings. 30 | description: 31 | - Set the value of a gconftool-2 controlled setting using a key and a string, an integer, a boolean, a pair or a list. 32 | options: 33 | key: 34 | description: 35 | - The key of the gconftool-2 setting to change. 36 | required: true 37 | bool: 38 | description: 39 | - The boolean value to set the key to. 40 | required: false 41 | int: 42 | description: 43 | - The integer value to set the key to. 44 | required: false 45 | string: 46 | description: 47 | - The string value to set the key to. Wrap it in single quotes for safety. 48 | required: false 49 | float: 50 | description: 51 | - The float value to set the key to. 52 | required: false 53 | list: 54 | description: 55 | - The list of values to set the key to. 56 | required: false 57 | list-type: 58 | description: 59 | - The type of the list of values. 60 | required: false 61 | pair: 62 | description: 63 | - The pair of values to set the key to. 64 | required: false 65 | paid-car-type: 66 | description: 67 | - The type of the first value in the pair. 68 | required: false 69 | pair-cdr-type: 70 | description: 71 | - The type of the second value in the pair. 72 | required: true 73 | ''' 74 | 75 | EXAMPLES = ''' 76 | # Set string value 77 | - gconftool2: key=/apps/gnome-terminal/global/default_profile string=base-16-monokai-dark 78 | 79 | # Set bool value 80 | - gconftool2: key=/apps/gnome-terminal/profiles/base-16-monokai-dark/use_system_font bool=false 81 | 82 | # Set pair value 83 | - gconftool2: key=/path/to/something pair-car-type=int pair-cdr-type=string pair=1,'Joseph Kahn' 84 | ''' 85 | 86 | # =========================================== 87 | # Module code. 88 | # 89 | 90 | 91 | def _set_value(module, key, value, argument_type, additional_args): 92 | """Set value of setting, under `key`, using gconftool2 to `value` of type `argument_type`.""" 93 | return module.run_command(" ".join(['/usr/bin/gconftool-2 --set --type {} {} "{}" {}'.format(argument_type, key, value, additional_args)])) 94 | 95 | 96 | def _get_value(module, key): 97 | """Return value of setting, under `key`, from gconftool2.""" 98 | return module.run_command('gconftool-2 --get {}'.format(key))[1].strip() 99 | 100 | 101 | def main(): 102 | 103 | module = AnsibleModule( 104 | argument_spec={ 105 | 'key': {'required': True}, 106 | 'bool': {'type': 'bool'}, 107 | 'int': {'type': 'int'}, 108 | 'string': {'type': 'str'}, 109 | 'float': {'type': 'float'}, 110 | 'list': {'type': 'list'}, 111 | 'pair': {'type': 'list'}, 112 | 'pair-cdr-type': {'choices': ['int', 'bool', 'float', 'string']}, 113 | 'pair-car-type': {'choices': ['int', 'bool', 'float', 'string']}, 114 | 'list-type': {'choices': ['int', 'bool', 'float', 'string']} 115 | }, 116 | mutually_exclusive=[ 117 | ['bool', 'string', 'int', 'float', 'list', 'pair'], 118 | ['bool', 'string', 'int', 'float', 'list-type', 'pair'], 119 | ['bool', 'string', 'int', 'float', 'list', 'pair-car-type'], 120 | ['bool', 'string', 'int', 'float', 'list', 'pair-cdr-type'] 121 | ], 122 | required_one_of=[['bool', 'string', 'int', 'float', 'list', 'pair']], 123 | required_together=[ 124 | ['pair', 'pair-car-type', 'pair-cdr-type'], 125 | ['list', 'list-type'] 126 | ], 127 | supports_check_mode=True 128 | ) 129 | 130 | key = module.params['key'] 131 | boolean_value = module.params['bool'] 132 | string_value = module.params['string'] 133 | integer_value = module.params['int'] 134 | float_value = module.params['float'] 135 | list_value = module.params['list'] 136 | pair_value = module.params['pair'] 137 | 138 | old_value = _get_value(module, key) 139 | 140 | additional_args = '' 141 | instance_type_mapping = {'int': int, 'string': str, 'float': float, 'bool': mk_boolean} 142 | if boolean_value is not None: 143 | argument_type = 'bool' 144 | value = str(mk_boolean(boolean_value)).lower() 145 | old_value = str(mk_boolean(old_value)).lower() 146 | elif integer_value is not None: 147 | argument_type = 'integer' 148 | value = int(integer_value) 149 | elif string_value is not None: 150 | argument_type = 'string' 151 | value = string_value 152 | elif float_value is not None: 153 | argument_type = 'float' 154 | value = float_value 155 | elif list_value is not None: 156 | argument_type = 'list' 157 | try: 158 | for item in list_value: 159 | if module.params['list-type'] == 'bool': 160 | module.boolean(item) 161 | elif not str(instance_type_mapping.get(module.params['list-type'])(item)) == item: 162 | raise ValueError 163 | except ValueError: 164 | module.fail_json(msg='list type `{}` does not match the type of the contents.'.format(module.params['list-type'])) 165 | additional_args = '--list-type={}'.format(module.params['list-type']) 166 | if module.params['list-type'] == 'bool': 167 | list_value = [str(mk_boolean(item)).lower() for item in list_value] 168 | value = '[{}]'.format(','.join(list_value)) 169 | elif pair_value is not None: 170 | if len(pair_value) != 2: 171 | module.fail_json(msg='A pair must be a list of length 2, {} items found.'.format(len(pair_value))) 172 | argument_type = 'pair' 173 | try: 174 | car_value = pair_value[0] 175 | car_type = module.params['pair-car-type'] 176 | if car_type == 'bool': 177 | module.boolean(car_value) 178 | car_value = mk_boolean(car_value) 179 | elif not str(instance_type_mapping.get(car_type)(car_value)) == car_value: 180 | raise ValueError 181 | 182 | cdr_value = pair_value[1] 183 | cdr_type = module.params['pair-cdr-type'] 184 | if cdr_type == 'bool': 185 | module.boolean(cdr_value) 186 | cdr_value = mk_boolean(cdr_value) 187 | elif not str(instance_type_mapping.get(cdr_type)(cdr_value)) == cdr_value: 188 | raise ValueError 189 | except ValueError: 190 | module.fail_json(msg='pair type `{}` or `{}` does not match the type of the contents.'.format(module.params['pair-car-type'], module.params['pair-cdr-type'])) 191 | additional_args = '--car-type={} --cdr-type={}'.format(car_type, cdr_type) 192 | value = '({},{})'.format(car_value, cdr_value) 193 | 194 | changed = old_value != str(value) 195 | 196 | if changed and not module.check_mode: 197 | _set_value(module, key, value, argument_type, additional_args) 198 | 199 | module.exit_json( 200 | changed=changed, 201 | key=key, 202 | type=argument_type, 203 | value=value, 204 | old_value=old_value 205 | ) 206 | 207 | main() 208 | -------------------------------------------------------------------------------- /ansible_modules/gsettings: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # (c) 2014, Joseph Kahn 5 | # 6 | # This file is part of Ansible 7 | # 8 | # Ansible is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # Ansible is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with Ansible. If not, see . 20 | 21 | from ansible.constants import mk_boolean 22 | from ansible.module_utils.basic import * 23 | 24 | DOCUMENTATION = ''' 25 | --- 26 | module: gsettings 27 | version_added: "post 1.7.1" 28 | author: Joseph Kahn 29 | short_description: alter gsettings controlled settings. 30 | description: 31 | - Set the value of a gsettings controlled setting using a key and a string, an integer, or a boolean. 32 | options: 33 | schema: 34 | description: 35 | - The scheme where the key of the settings can be found. 36 | required: true 37 | key: 38 | description: 39 | - The key of the dconf setting to change. 40 | required: true 41 | bool: 42 | description: 43 | - The boolean value to set the key to. 44 | required: false 45 | int: 46 | description: 47 | - The integer value to set the key to. 48 | required: false 49 | string: 50 | description: 51 | - The string value to set the key to. Wrap it in single quotes for safety. 52 | required: false 53 | float: 54 | description: 55 | - The float value to set the key to. 56 | required: false 57 | ''' 58 | 59 | EXAMPLES = ''' 60 | # Set string value 61 | - gsettings: schema=org.gnome.desktop.interface key=icon-theme string=Numix-Circle 62 | 63 | # Set bool value 64 | - gsettings: schema=org.mate.panel.object key=use-custom-icon bool=false 65 | ''' 66 | 67 | # =========================================== 68 | # Module code. 69 | # 70 | 71 | 72 | def _set_value(module, schema, key, value): 73 | """Set value of setting, under `key` in `schema`, using gsettings to `value`.""" 74 | return module.run_command(" ".join(['gsettings set {} {} {}'.format(schema, key, value)])) 75 | 76 | 77 | def _get_value(module, schema, key): 78 | """Return value of setting, under `key`, from gsettings.""" 79 | return module.run_command('gsettings get {} {}'.format(schema, key))[1].strip() 80 | 81 | 82 | def main(): 83 | 84 | module = AnsibleModule( 85 | argument_spec={ 86 | 'key': {'required': True, 'type': 'str'}, 87 | 'schema': {'required': True, 'type': 'str'}, 88 | 'bool': {'type': 'bool'}, 89 | 'int': {'type': 'int'}, 90 | 'string': {'type': 'str'}, 91 | 'float': {'type': 'float'}, 92 | }, 93 | mutually_exclusive=[ 94 | ['bool', 'string', 'int', 'float'], 95 | ], 96 | required_one_of=[['bool', 'string', 'int', 'float']], 97 | supports_check_mode=True 98 | ) 99 | 100 | key = module.params['key'] 101 | schema = module.params['schema'] 102 | boolean_value = module.params['bool'] 103 | string_value = module.params['string'] 104 | integer_value = module.params['int'] 105 | float_value = module.params['float'] 106 | 107 | old_value = _get_value(module, schema, key) 108 | 109 | if boolean_value is not None: 110 | value = str(mk_boolean(boolean_value)).lower() 111 | old_value = str(mk_boolean(old_value)).lower() 112 | elif integer_value is not None: 113 | value = int(integer_value) 114 | elif string_value is not None: 115 | value = '\'{}\''.format(string_value) 116 | elif float_value is not None: 117 | value = float_value 118 | 119 | changed = old_value != str(value) 120 | 121 | if changed and not module.check_mode: 122 | _set_value(module, schema, key, value) 123 | 124 | module.exit_json( 125 | changed=changed, 126 | key=key, 127 | value=value, 128 | old_value=old_value 129 | ) 130 | 131 | main() 132 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "github_username": "JBKahn", 3 | "sager_laptop": true, 4 | "vagrant_url": "https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.deb", 5 | "virtualbox_url": "http://download.virtualbox.org/virtualbox/5.0.12/virtualbox-5.0_5.0.12-104815~Ubuntu~trusty_amd64.deb", 6 | "steam_ulr": "https://steamcdn-a.akamaihd.net/client/installer/steam.deb", 7 | "emacs_url": "http://mirror.team-cymru.org/gnu/emacs/emacs-24.4.tar.gz", 8 | "bumblebee": false 9 | } 10 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ansible==2.1.0.0 2 | -------------------------------------------------------------------------------- /roles/common/files/.bash_customizations: -------------------------------------------------------------------------------- 1 | # parse_git_branch() { 2 | # git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' 3 | # } 4 | # PS1="\[\033[31m\]${debian_chroot:+($debian_chroot)}\u@\h:\[\033[34m\]\w\[\033[0m\]\$(parse_git_branch) $ " 5 | 6 | function fuck() { 7 | if killall -9 "$2"; then 8 | echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo 9 | fi 10 | } 11 | 12 | alias gdm='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d' 13 | alias pch='.git/hooks/pre-commit' 14 | alias proot='cd "$(git rev-parse --show-toplevel)"' 15 | alias kbbl='~/keyboard-color.sh' 16 | alias waveup='cd ~/waveapps; vagrant up; tmuxp load wavevagrant.json' 17 | alias wavesuspend='vagrant global-status | grep running | sed -r "s/([a-zA-Z0-9]*) .*/\1/" | xargs -L1 vagrant suspend' 18 | alias wavedown='vagrant global-status | grep running | sed -r "s/([a-zA-Z0-9]*) .*/\1/" | xargs -L1 vagrant halt' 19 | alias djpy='pylint --load-plugins pylint_django' 20 | 21 | source $HOME/.django_bash_completion.sh 22 | 23 | export WORKON_HOME=$HOME/.virtualenvs 24 | export PROJECT_HOME=$HOME/virtualenvProject 25 | source /usr/local/bin/virtualenvwrapper.sh 26 | 27 | # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 28 | # PS1='\[\033[0;32m\]┌ \[\033[0m\033[0;32m\]\u\[\033[0m\] @ \[\033[0;36m\]\h\[\033[0m\033[0;32m\] ─ \[\033[0m\]\t \d\[\033[0;32m\] ─ \[\033[0;31m\]\w\[\033[0;32m\] \[$(__git_ps1)\]\n\[\033[0;32m\]└▶ \[\033[0m\033[0;32m\]\$\[\033[0m\] ' 29 | # PS1='\[\033[0;32m\]┌┼─┼─ \[\033[0m\033[0;32m\]\u\[\033[0m\] @ \[\033[0;36m\]\h\[\033[0m\033[0;32m\] ─┤├─ \[\033[0m\]\t \d\[\033[0;32m\] ─┤├─ \[\033[0;31m\]\w\[\033[0;32m\] ─┤\[$(__git_ps1)\]\n\[\033[0;32m\]└┼─\[\033[0m\033[0;32m\]\$─┤▶\[\033[0m\] ' 30 | PS1='\[\033[0;34m\]┌ \[\033[0;36m\]\u\[\033[0;31m\] @ \[\033[0;34m\]\h\[\033[0;34m\] ─ \[\033[0;35m\]\t \d\[\033[0;34m\] ─ \[\033[0;31m\]\w\[\033[0;32m\] \[$(__git_ps1)\]\n\[\033[0;34m\]└▶ \[\033[0;37m\]$ \[\033[0m\]' 31 | 32 | alias tmux='tmux -2' 33 | 34 | get_crtime() { 35 | 36 | for target in "${@}"; do 37 | inode=$(ls -di "${target}" | cut -d ' ' -f 1) 38 | fs=$(df --output=source "${target}" | tail -1) 39 | crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null | 40 | grep -oP 'crtime.*--\s*\K.*') 41 | printf "%s\t%s\n" "${target}" "${crtime}" 42 | done 43 | } 44 | 45 | # Base16 Shell 46 | BASE16_SCHEME="monokai" 47 | BASE16_SHELL="$HOME/.config/base16-shell/base16-$BASE16_SCHEME.dark.sh" 48 | [[ -s $BASE16_SHELL ]] && . $BASE16_SHELL 49 | 50 | if [ "$COLORTERM" == "gnome-terminal" ] || [ "$COLORTERM" == "xfce4-terminal" ] 51 | then 52 | TERM=xterm-256color 53 | elif [ "$COLORTERM" == "rxvt-xpm" ] 54 | then 55 | TERM=rxvt-256color 56 | fi 57 | 58 | function pr_for_sha { 59 | pr=$(git log --merges --ancestry-path --oneline $1..master | grep 'pull request' | tail -n1 | awk '{print $5}' | cut -c2-) 60 | base_url=$(git config --get remote.origin.url | sed 's/.*\@//' | sed 's/\:/\//' | sed 's/\.git.*//') 61 | xdg-open "https://${base_url}/pull/${pr##*/}/" 62 | } 63 | 64 | if [ -f ~/setup/.nvm/nvm.sh ]; then 65 | . ~/setup/.nvm/nvm.sh 66 | fi 67 | 68 | export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting 69 | 70 | [ -s "/home/joseph/.scm_breeze/scm_breeze.sh" ] && source "/home/joseph/.scm_breeze/scm_breeze.sh" 71 | -------------------------------------------------------------------------------- /roles/common/files/.spacemacs: -------------------------------------------------------------------------------- 1 | ;; -*- mode: emacs-lisp -*- 2 | ;; This file is loaded by Spacemacs at startup. 3 | ;; It must be stored in your home directory. 4 | 5 | (defun dotspacemacs/layers () 6 | "Configuration Layers declaration." 7 | (setq-default 8 | ;; List of additional paths where to look for configuration layers. 9 | ;; Paths must have a trailing slash (i.e. `~/.mycontribs/') 10 | dotspacemacs-configuration-layer-path '() 11 | ;; List of configuration layers to load. If it is the symbol `all' instead 12 | ;; of a list then all discovered layers will be installed. 13 | dotspacemacs-configuration-layers 14 | '( 15 | ;; ---------------------------------------------------------------- 16 | ;; Example of useful layers you may want to use right away. 17 | ;; Uncomment some layer names and press (Vim style) or 18 | ;; (Emacs style) to install them. 19 | ;; ---------------------------------------------------------------- 20 | auto-completion 21 | ;; better-defaults 22 | emacs-lisp 23 | ;; git 24 | ;; markdown 25 | ;; org 26 | ;; (shell :variables 27 | ;; shell-default-height 30 28 | ;; shell-default-position 'bottom) 29 | syntax-checking 30 | version-control 31 | themes-megapack 32 | python 33 | react 34 | javascript 35 | joseph 36 | html 37 | sql 38 | ansible 39 | colors 40 | extra-langs 41 | ) 42 | ;; List of additional packages that will be installed without being 43 | ;; wrapped in a layer. If you need some configuration for these 44 | ;; packages then consider to create a layer, you can also put the 45 | ;; configuration in `dotspacemacs/config'. 46 | dotspacemacs-additional-packages '( 47 | ;; base16-theme 48 | ) 49 | ;; A list of packages and/or extensions that will not be install and loaded. 50 | dotspacemacs-excluded-packages '() 51 | ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that 52 | ;; are declared in a layer which is not a member of 53 | ;; the list `dotspacemacs-configuration-layers' 54 | dotspacemacs-delete-orphan-packages t)) 55 | 56 | (defun dotspacemacs/init () 57 | "Initialization function. 58 | This function is called at the very startup of Spacemacs initialization 59 | before layers configuration." 60 | ;; This setq-default sexp is an exhaustive list of all the supported 61 | ;; spacemacs settings. 62 | (setq-default 63 | ;; my settings 64 | dotspacemacs-whitespace-cleanup 'all 65 | dotspacemacs-line-numbers 'relative 66 | ;; 67 | ;; Either `vim' or `emacs'. Evil is always enabled but if the variable 68 | ;; is `emacs' then the `holy-mode' is enabled at startup. 69 | dotspacemacs-editing-style 'vim 70 | ;; If non nil output loading progress in `*Messages*' buffer. 71 | dotspacemacs-verbose-loading nil 72 | ;; Specify the startup banner. Default value is `official', it displays 73 | ;; the official spacemacs logo. An integer value is the index of text 74 | ;; banner, `random' chooses a random text banner in `core/banners' 75 | ;; directory. A string value must be a path to an image format supported 76 | ;; by your Emacs build. 77 | ;; If the value is nil then no banner is displayed. 78 | dotspacemacs-startup-banner 'official 79 | ;; List of items to show in the startup buffer. If nil it is disabled. 80 | ;; Possible values are: `recents' `bookmarks' `projects'." 81 | dotspacemacs-startup-lists '(recents projects) 82 | ;; List of themes, the first of the list is loaded when spacemacs starts. 83 | ;; Press T n to cycle to the next theme in the list (works great 84 | ;; with 2 themes variants, one dark and one light) 85 | dotspacemacs-themes '(monokai 86 | solarized-light 87 | solarized-dark 88 | spacemacs-light 89 | spacemacs-dark 90 | leuven 91 | zenburn) 92 | ;; If non nil the cursor color matches the state color. 93 | dotspacemacs-colorize-cursor-according-to-state t 94 | ;; Default font. `powerline-scale' allows to quickly tweak the mode-line 95 | ;; size to make separators look not too crappy. 96 | dotspacemacs-default-font '("Source Code Pro" 97 | :size 13 98 | :weight normal 99 | :width normal 100 | :powerline-scale 1.1) 101 | ;; The leader key 102 | dotspacemacs-leader-key "SPC" 103 | ;; The leader key accessible in `emacs state' and `insert state' 104 | dotspacemacs-emacs-leader-key "M-m" 105 | ;; Major mode leader key is a shortcut key which is the equivalent of 106 | ;; pressing ` m`. Set it to `nil` to disable it. 107 | dotspacemacs-major-mode-leader-key "," 108 | ;; Major mode leader key accessible in `emacs state' and `insert state' 109 | dotspacemacs-major-mode-emacs-leader-key "C-M-m" 110 | ;; The command key used for Evil commands (ex-commands) and 111 | ;; Emacs commands (M-x). 112 | ;; By default the command key is `:' so ex-commands are executed like in Vim 113 | ;; with `:' and Emacs commands are executed with ` :'. 114 | dotspacemacs-command-key ":" 115 | ;; Location where to auto-save files. Possible values are `original' to 116 | ;; auto-save the file in-place, `cache' to auto-save the file to another 117 | ;; file stored in the cache directory and `nil' to disable auto-saving. 118 | ;; Default value is `cache'. 119 | dotspacemacs-auto-save-file-location 'cache 120 | ;; If non nil then `ido' replaces `helm' for some commands. For now only 121 | ;; `find-files' (SPC f f) is replaced. 122 | dotspacemacs-use-ido nil 123 | ;; If non nil the paste micro-state is enabled. When enabled pressing `p` 124 | ;; several times cycle between the kill ring content. 125 | dotspacemacs-enable-paste-micro-state nil 126 | ;; Guide-key delay in seconds. The Guide-key is the popup buffer listing 127 | ;; the commands bound to the current keystrokes. 128 | dotspacemacs-guide-key-delay 0.4 129 | ;; If non nil a progress bar is displayed when spacemacs is loading. This 130 | ;; may increase the boot time on some systems and emacs builds, set it to 131 | ;; nil ;; to boost the loading time. 132 | dotspacemacs-loading-progress-bar t 133 | ;; If non nil the frame is fullscreen when Emacs starts up. 134 | ;; (Emacs 24.4+ only) 135 | dotspacemacs-fullscreen-at-startup nil 136 | ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen. 137 | ;; Use to disable fullscreen animations in OSX." 138 | dotspacemacs-fullscreen-use-non-native nil 139 | ;; If non nil the frame is maximized when Emacs starts up. 140 | ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil. 141 | ;; (Emacs 24.4+ only) 142 | dotspacemacs-maximized-at-startup nil 143 | ;; A value from the range (0..100), in increasing opacity, which describes 144 | ;; the transparency level of a frame when it's active or selected. 145 | ;; Transparency can be toggled through `toggle-transparency'. 146 | dotspacemacs-active-transparency 90 147 | ;; A value from the range (0..100), in increasing opacity, which describes 148 | ;; the transparency level of a frame when it's inactive or deselected. 149 | ;; Transparency can be toggled through `toggle-transparency'. 150 | dotspacemacs-inactive-transparency 90 151 | ;; If non nil unicode symbols are displayed in the mode line. 152 | dotspacemacs-mode-line-unicode-symbols t 153 | ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth 154 | ;; scrolling overrides the default behavior of Emacs which recenters the 155 | ;; point when it reaches the top or bottom of the screen. 156 | dotspacemacs-smooth-scrolling t 157 | ;; If non-nil smartparens-strict-mode will be enabled in programming modes. 158 | dotspacemacs-smartparens-strict-mode nil 159 | ;; Select a scope to highlight delimiters. Possible value is `all', 160 | ;; `current' or `nil'. Default is `all' 161 | dotspacemacs-highlight-delimiters 'all 162 | ;; If non nil advises quit functions to keep server open when quitting. 163 | dotspacemacs-persistent-server nil 164 | ;; List of search tool executable names. Spacemacs uses the first installed 165 | ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'. 166 | dotspacemacs-search-tools '("ag" "pt" "ack" "grep") 167 | ;; The default package repository used if no explicit repository has been 168 | ;; specified with an installed package. 169 | ;; Not used for now. 170 | dotspacemacs-default-package-repository nil 171 | ) 172 | ;; User initialization goes here 173 | ) 174 | 175 | 176 | 177 | (defun dotspacemacs/config () 178 | "Configuration function. This function is called at the very end of Spacemacs initialization after layers configuration." 179 | (setq powerline-default-separator 'arrow) 180 | (add-hook 'python-mode-hook 'anaconda-mode) 181 | (add-hook 'after-init-hook #'global-flycheck-mode) 182 | (setq x-select-enable-clipboard t) 183 | (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) 184 | ;; (set-face-background 'hl-line "firebrick4") 185 | (spacemacs/toggle-transparent-frame) 186 | ) 187 | 188 | ;; Do not write anything past this comment. This is where Emacs will 189 | ;; auto-generate custom variable definitions. 190 | -------------------------------------------------------------------------------- /roles/common/files/.tmux.conf: -------------------------------------------------------------------------------- 1 | # status bar 2 | set-option -g status-utf8 on 3 | 4 | 5 | # https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf 6 | set-option -g status-bg colour235 #base02 7 | set-option -g status-fg colour136 #yellow 8 | set-option -g status-attr default 9 | 10 | # default window title colors 11 | set-window-option -g window-status-fg colour244 #base0 12 | set-window-option -g window-status-bg default 13 | #set-window-option -g window-status-attr dim 14 | 15 | # active window title colors 16 | set-window-option -g window-status-current-fg colour166 #orange 17 | set-window-option -g window-status-current-bg default 18 | #set-window-option -g window-status-current-attr bright 19 | 20 | # pane border 21 | set-option -g pane-border-fg colour235 #base02 22 | set-option -g pane-active-border-fg colour240 #base01 23 | 24 | # message text 25 | set-option -g message-bg colour235 #base02 26 | set-option -g message-fg colour166 #orange 27 | 28 | # pane number display 29 | set-option -g display-panes-active-colour colour33 #blue 30 | set-option -g display-panes-colour colour166 #orange 31 | # clock 32 | set-window-option -g clock-mode-colour green #green 33 | 34 | 35 | set -g status-interval 1 36 | set -g status-justify centre # center align window list 37 | set -g status-left-length 20 38 | set -g status-right-length 140 39 | set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]' 40 | set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load 1) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d' 41 | 42 | # C-b is not acceptable -- Vim uses it 43 | set-option -g prefix C-a 44 | bind-key C-a last-window 45 | 46 | # Start numbering at 1 47 | set -g base-index 1 48 | 49 | # Allows for faster key repetition 50 | set -s escape-time 0 51 | 52 | # Rather than constraining window size to the maximum size of any client 53 | # connected to the *session*, constrain window size to the maximum size of any 54 | # client connected to *that window*. Much more reasonable. 55 | setw -g aggressive-resize on 56 | 57 | # Allows us to use C-a a to send commands to a TMUX session inside 58 | # another TMUX session 59 | bind-key a send-prefix 60 | 61 | # Activity monitoring 62 | setw -g monitor-activity on 63 | set -g visual-activity on 64 | 65 | # Highlight active window 66 | #set-window-option -g window-status-current-bg red 67 | 68 | # Vi copypaste mode 69 | set-window-option -g mode-keys vi 70 | bind-key -t vi-copy 'v' begin-selection 71 | bind-key -t vi-copy 'y' copy-selection 72 | 73 | # hjkl pane traversal 74 | bind h select-pane -L 75 | bind j select-pane -D 76 | bind k select-pane -U 77 | bind l select-pane -R 78 | 79 | # reload config 80 | bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." 81 | 82 | # auto window rename 83 | set-window-option -g automatic-rename on 84 | set-option -g set-titles on 85 | 86 | # rm mouse mode fail 87 | set -g mode-mouse off 88 | 89 | # color 90 | set -g default-terminal "screen-256color" 91 | 92 | set -g prefix C-a 93 | set -s escape-time 1 94 | set -g base-index 1 95 | setw -g pane-base-index 1 96 | bind r source-file ~/.tmux.conf \; display "Reloaded!" 97 | bind C-a send-prefix 98 | bind | split-window -h 99 | bind - split-window -v 100 | bind -r H resize-pane -L 5 101 | bind -r J resize-pane -D 5 102 | bind -r K resize-pane -U 5 103 | bind -r L resize-pane -R 5 104 | setw -g mode-mouse on 105 | set -g mouse-select-pane on 106 | set -g mouse-resize-pane on 107 | set -g mouse-select-window on 108 | set -g default-terminal "screen-256color" 109 | set -g status-bg black 110 | set -g status-fg white 111 | setw -g window-status-fg cyan 112 | setw -g window-status-bg default 113 | setw -g window-status-attr dim 114 | setw -g window-status-current-fg white 115 | setw -g window-status-current-bg red 116 | setw -g window-status-current-attr bright 117 | set -g pane-border-fg green 118 | set -g pane-border-bg black 119 | set -g pane-active-border-fg yellow 120 | set -g pane-active-border-bg white 121 | set -g message-fg white 122 | set -g message-bg black 123 | set -g message-attr bright 124 | set -g status-justify centre 125 | setw -g mode-keys vi 126 | set -g status-keys vi 127 | 128 | # Copy/Paste 129 | unbind [ 130 | bind-key Escape copy-mode 131 | bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode. 132 | bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode. 133 | bind-key -t vi-copy enter copy-pipe "xclip -selection clipboard -i" # Yank selection in copy mode to control v. 134 | bind-key -t vi-copy y copy-pipe "xclip -i" # Yank selection in copy mode to middle mouse. 135 | 136 | # pass keys on (used to add back text navigation using ctrl + shift) 137 | set-window-option -g xterm-keys on 138 | -------------------------------------------------------------------------------- /roles/common/files/.vimrc: -------------------------------------------------------------------------------- 1 | " __ __ _ 2 | " / / / /___ _____________ _ __(_)___ ___ 3 | " / /_/ / __ \/ ___/ ___/ _ \| | / / / __ `__ \ 4 | " / __ / /_/ / / (__ ) __/| |/ / / / / / / / 5 | "/_/ /_/\____/_/ /____/\___(_)___/_/_/ /_/ /_/ 6 | " 7 | " 8 | 9 | " Vundle Setup 10 | 11 | filetype on 12 | filetype off 13 | set rtp+=~/.vim/bundle/vundle 14 | call vundle#rc() 15 | 16 | " Bundles { 17 | " Use local bundles if available { 18 | if filereadable(expand("~/.vimrc.bundles.local")) 19 | source ~/.vimrc.bundles.local 20 | endif 21 | " } 22 | 23 | " Use bundles config { 24 | if filereadable(expand("~/.vimrc.bundles")) 25 | source ~/.vimrc.bundles 26 | endif 27 | " } 28 | " } 29 | 30 | " Formatting { 31 | 32 | set nowrap " Wrap long lines 33 | set autoindent " Indent at the same level of the previous line 34 | set shiftwidth=4 " Use indents of 4 spaces 35 | set expandtab " Tabs are spaces, not tabs 36 | set tabstop=4 " An indentation every four columns 37 | set softtabstop=4 " Let backspace delete indent 38 | set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) 39 | set splitright " Puts new vsplit windows to the right of the current 40 | set splitbelow " Puts new split windows to the bottom of the current 41 | "set matchpairs+=<:> " Match, to be used with % 42 | set pastetoggle= " pastetoggle (sane indentation on pastes) 43 | "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks 44 | " Remove trailing whitespaces and ^M chars 45 | autocmd FileType c,cpp,java,go,php,javascript,python,twig,xml,yml autocmd BufWritePre call StripTrailingWhitespace() 46 | autocmd FileType go autocmd BufWritePre Fmt 47 | autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig 48 | autocmd FileType haskell setlocal expandtab shiftwidth=2 softtabstop=2 49 | " preceding line best in a plugin but here for now. 50 | 51 | autocmd BufNewFile,BufRead *.coffee set filetype=coffee 52 | 53 | " Workaround vim-commentary for Haskell 54 | autocmd FileType haskell setlocal commentstring=--\ %s 55 | " Workaround broken colour highlighting in Haskell 56 | autocmd FileType haskell setlocal nospell 57 | 58 | " } 59 | 60 | " Vim UI { 61 | set backspace=indent,eol,start " Backspace for dummies 62 | set linespace=0 " No extra spaces between rows 63 | set nu " Line numbers on 64 | set showmatch " Show matching brackets/parenthesis 65 | set incsearch " Find as you type search 66 | set hlsearch " Highlight search terms 67 | set winminheight=0 " Windows can be 0 line high 68 | set ignorecase " Case insensitive search 69 | set smartcase " Case sensitive when uc present 70 | set wildmenu " Show list instead of just completing 71 | set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all. 72 | set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too 73 | set scrolljump=5 " Lines to scroll when cursor leaves screen 74 | set scrolloff=3 " Minimum lines to keep above and below cursor 75 | set foldenable " Auto fold code 76 | set list 77 | set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace 78 | " } 79 | 80 | " Statusline { 81 | set laststatus=2 82 | let g:airline_theme='powerlineish' 83 | " } 84 | 85 | " Key (re)Mappings { 86 | 87 | " The default leader is '\', but many people prefer ',' as it's in a standard 88 | " location. To override this behavior and set it back to '\' (or any other 89 | " character) add the following to your .vimrc.before.local file: 90 | " let g:spf13_leader='\' 91 | if !exists('g:spf13_leader') 92 | let mapleader = ',' 93 | else 94 | let mapleader=g:spf13_leader 95 | endif 96 | 97 | " Easier moving in tabs and windows 98 | " The lines conflict with the default digraph mapping of 99 | " If you prefer that functionality, add let g:spf13_no_easyWindows = 1 100 | " in your .vimrc.before.local file 101 | 102 | if !exists('g:spf13_no_easyWindows') 103 | map j_ 104 | map k_ 105 | map l_ 106 | map h_ 107 | endif 108 | 109 | " Wrapped lines goes down/up to next row, rather than next line in file. 110 | noremap j gj 111 | noremap k gk 112 | 113 | " The following two lines conflict with moving to top and 114 | " bottom of the screen 115 | " If you prefer that functionality, add the following to your 116 | " .vimrc.before.local file: 117 | " let g:spf13_no_fastTabs = 1 118 | if !exists('g:spf13_no_fastTabs') 119 | map gT 120 | map gt 121 | endif 122 | 123 | " Stupid shift key fixes 124 | if !exists('g:spf13_no_keyfixes') 125 | if has("user_commands") 126 | command! -bang -nargs=* -complete=file E e 127 | command! -bang -nargs=* -complete=file W w 128 | command! -bang -nargs=* -complete=file Wq wq 129 | command! -bang -nargs=* -complete=file WQ wq 130 | command! -bang Wa wa 131 | command! -bang WA wa 132 | command! -bang Q q 133 | command! -bang QA qa 134 | command! -bang Qa qa 135 | endif 136 | 137 | cmap Tabe tabe 138 | endif 139 | 140 | " Yank from the cursor to the end of the line, to be consistent with C and D. 141 | nnoremap Y y$ 142 | 143 | " Code folding options 144 | nmap f0 :set foldlevel=0 145 | nmap f1 :set foldlevel=1 146 | nmap f2 :set foldlevel=2 147 | nmap f3 :set foldlevel=3 148 | nmap f4 :set foldlevel=4 149 | nmap f5 :set foldlevel=5 150 | nmap f6 :set foldlevel=6 151 | nmap f7 :set foldlevel=7 152 | nmap f8 :set foldlevel=8 153 | nmap f9 :set foldlevel=9 154 | 155 | " Toggle search highlighting 156 | nmap / :set invhlsearch 157 | 158 | " Find merge conflict markers 159 | map fc /\v^[<\|=>]{7}( .*\|$) 160 | 161 | " Shortcuts 162 | " Change Working Directory to that of the current file 163 | cmap cwd lcd %:p:h 164 | cmap cd. lcd %:p:h 165 | 166 | " Visual shifting (does not exit Visual mode) 167 | vnoremap < >gv 169 | 170 | " Allow using the repeat operator with a visual selection (!) 171 | " http://stackoverflow.com/a/8064607/127816 172 | vnoremap . :normal . 173 | 174 | " Fix home and end keybindings for screen, particularly on mac 175 | " - for some reason this fixes the arrow keys too. huh. 176 | map [F $ 177 | imap [F $ 178 | map [H g0 179 | imap [H g0 180 | 181 | " For when you forget to sudo.. Really Write the file. 182 | cmap w!! w !sudo tee % >/dev/null 183 | 184 | " Some helpers to edit mode 185 | " http://vimcasts.org/e/14 186 | cnoremap %% =expand('%:h').'/' 187 | map ew :e %% 188 | map es :sp %% 189 | map ev :vsp %% 190 | map et :tabe %% 191 | 192 | " Adjust viewports to the same size 193 | map = = 194 | 195 | " Map ff to display all lines with keyword under cursor 196 | " and ask which one to jump to 197 | nmap ff [I:let nr = input("Which one: ")exe "normal " . nr ."[\t" 198 | 199 | " Easier horizontal scrolling 200 | map zl zL 201 | map zh zH 202 | 203 | " } 204 | 205 | " { Plugin Config 206 | 207 | " Misc { 208 | let g:NERDShutUp=1 209 | let b:match_ignorecase = 1 210 | " } 211 | 212 | " NerdTree { 213 | map :NERDTreeToggle:NERDTreeMirror 214 | map e :NERDTreeFind 215 | nmap nt :NERDTreeFind 216 | 217 | let NERDTreeShowBookmarks=1 218 | let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr'] 219 | let NERDTreeChDirMode=0 220 | let NERDTreeQuitOnOpen=1 221 | let NERDTreeMouseMode=2 222 | let NERDTreeShowHidden=1 223 | let NERDTreeKeepTreeInNewTab=1 224 | let g:nerdtree_tabs_open_on_gui_startup=0 225 | " } 226 | 227 | " ctrlp { 228 | let g:ctrlp_working_path_mode = 'ra' 229 | nnoremap :CtrlP 230 | nnoremap :CtrlPMRU 231 | let g:ctrlp_custom_ignore = { 232 | \ 'dir': '\.git$\|\.hg$\|\.svn$', 233 | \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' } 234 | 235 | " On Windows use "dir" as fallback command. 236 | if has('win32') || has('win64') 237 | let g:ctrlp_user_command = { 238 | \ 'types': { 239 | \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'], 240 | \ 2: ['.hg', 'hg --cwd %s locate -I .'], 241 | \ }, 242 | \ 'fallback': 'dir %s /-n /b /s /a-d' 243 | \ } 244 | else 245 | let g:ctrlp_user_command = { 246 | \ 'types': { 247 | \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'], 248 | \ 2: ['.hg', 'hg --cwd %s locate -I .'], 249 | \ }, 250 | \ 'fallback': 'find %s -type f' 251 | \ } 252 | endif 253 | "} 254 | 255 | " Fugitive { 256 | nnoremap gs :Gstatus 257 | nnoremap gd :Gdiff 258 | nnoremap gc :Gcommit 259 | nnoremap gb :Gblame 260 | nnoremap gl :Glog 261 | nnoremap gp :Git push 262 | nnoremap gr :Gread:GitGutter 263 | nnoremap gw :Gwrite:GitGutter 264 | nnoremap ge :Gedit 265 | nnoremap gg :GitGutterToggle 266 | "} 267 | 268 | " indent_guides { 269 | if !exists('g:spf13_no_indent_guides_autocolor') 270 | let g:indent_guides_auto_colors = 1 271 | else 272 | " For some colorschemes, autocolor will not work (eg: 'desert', 'ir_black') 273 | autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#212121 ctermbg=3 274 | autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#404040 ctermbg=4 275 | endif 276 | let g:indent_guides_start_level = 2 277 | let g:indent_guides_guide_size = 1 278 | let g:indent_guides_enable_on_vim_startup = 1 279 | " } 280 | " } 281 | 282 | " { Function 283 | 284 | " UnBundle { 285 | function! UnBundle(arg, ...) 286 | let bundle = vundle#config#init_bundle(a:arg, a:000) 287 | call filter(g:bundles, 'v:val["name_spec"] != "' . a:arg . '"') 288 | endfunction 289 | 290 | com! -nargs=+ UnBundle 291 | \ call UnBundle() 292 | " } 293 | 294 | " Initialize directories { 295 | function! InitializeDirectories() 296 | let parent = $HOME 297 | let prefix = 'vim' 298 | let dir_list = { 299 | \ 'backup': 'backupdir', 300 | \ 'views': 'viewdir', 301 | \ 'swap': 'directory' } 302 | 303 | if has('persistent_undo') 304 | let dir_list['undo'] = 'undodir' 305 | endif 306 | 307 | " To specify a different directory in which to place the vimbackup, 308 | " vimviews, vimundo, and vimswap files/directories, add the following to 309 | " your .vimrc.local file: 310 | " let g:spf13_consolidated_directory = 311 | " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/' 312 | if exists('g:spf13_consolidated_directory') 313 | let common_dir = g:spf13_consolidated_directory . prefix 314 | else 315 | let common_dir = parent . '/.' . prefix 316 | endif 317 | 318 | for [dirname, settingname] in items(dir_list) 319 | let directory = common_dir . dirname . '/' 320 | if exists("*mkdir") 321 | if !isdirectory(directory) 322 | call mkdir(directory) 323 | endif 324 | endif 325 | if !isdirectory(directory) 326 | echo "Warning: Unable to create backup directory: " . directory 327 | echo "Try: mkdir -p " . directory 328 | else 329 | let directory = substitute(directory, " ", "\\\\ ", "g") 330 | exec "set " . settingname . "=" . directory 331 | endif 332 | endfor 333 | endfunction 334 | " } 335 | 336 | " Initialize NERDTree as needed { 337 | function! NERDTreeInitAsNeeded() 338 | redir => bufoutput 339 | buffers! 340 | redir END 341 | let idx = stridx(bufoutput, "NERD_tree") 342 | if idx > -1 343 | NERDTreeMirror 344 | NERDTreeFind 345 | wincmd l 346 | endif 347 | endfunction 348 | " } 349 | 350 | " Strip whitespace { 351 | function! StripTrailingWhitespace() 352 | " To disable the stripping of whitespace, add the following to your 353 | " .vimrc.local file: 354 | " let g:spf13_keep_trailing_whitespace = 1 355 | if !exists('g:spf13_keep_trailing_whitespace') 356 | " Preparation: save last search, and cursor position. 357 | let _s=@/ 358 | let l = line(".") 359 | let c = col(".") 360 | " do the business: 361 | %s/\s\+$//e 362 | " clean up: restore previous search history, and cursor position 363 | let @/=_s 364 | call cursor(l, c) 365 | endif 366 | endfunction 367 | " } 368 | 369 | " Shell command { 370 | function! s:RunShellCommand(cmdline) 371 | botright new 372 | 373 | setlocal buftype=nofile 374 | setlocal bufhidden=delete 375 | setlocal nobuflisted 376 | setlocal noswapfile 377 | setlocal nowrap 378 | setlocal filetype=shell 379 | setlocal syntax=shell 380 | 381 | call setline(1, a:cmdline) 382 | call setline(2, substitute(a:cmdline, '.', '=', 'g')) 383 | execute 'silent $read !' . escape(a:cmdline, '%#') 384 | setlocal nomodifiable 385 | 1 386 | endfunction 387 | 388 | command! -complete=file -nargs=+ Shell call s:RunShellCommand() 389 | " e.g. Grep current file for : Shell grep -Hn % 390 | " } 391 | 392 | " } 393 | 394 | " Default Color Scheme 395 | syntax enable 396 | set background=dark 397 | 398 | let base16colorspace=256 " Access colors present in 256 colorspace 399 | colorscheme base16-default 400 | 401 | " Use local vimrc if available { 402 | if filereadable(expand("~/.vimrc.local")) 403 | source ~/.vimrc.local 404 | endif 405 | " } 406 | -------------------------------------------------------------------------------- /roles/common/files/.vimrc.bundles: -------------------------------------------------------------------------------- 1 | " Environment { 2 | 3 | " Basics { 4 | set nocompatible " Must be first line 5 | set background=dark " Assume a dark background 6 | " } 7 | 8 | " Setup Bundle Support { 9 | " The next three lines ensure that the ~/.vim/bundle/ system works 10 | filetype off 11 | set rtp+=~/.vim/bundle/vundle 12 | call vundle#rc() 13 | " } 14 | 15 | " } 16 | 17 | " Bundles { 18 | " Deps 19 | Bundle 'gmarik/vundle' 20 | Bundle 'MarcWeber/vim-addon-mw-utils' 21 | Bundle 'tomtom/tlib_vim' 22 | 23 | " General 24 | Bundle 'scrooloose/nerdtree' 25 | Bundle 'chriskempson/base16-vim' 26 | Bundle 'tpope/vim-surround' 27 | Bundle 'spf13/vim-autoclose' 28 | Bundle 'kien/ctrlp.vim' 29 | Bundle 'bling/vim-airline' 30 | Bundle 'mbbill/undotree' 31 | Bundle 'myusuf3/numbers.vim' 32 | Bundle 'nathanaelkane/vim-indent-guides' 33 | Bundle 'airblade/vim-gitgutter' 34 | Bundle 'rking/ag.vim' 35 | 36 | " Programming 37 | Bundle 'tpope/vim-fugitive' 38 | Bundle 'scrooloose/nerdcommenter' 39 | Bundle 'scrooloose/syntastic.git' 40 | " } 41 | 42 | " General { 43 | " set autowrite " automatically write a file when leaving a modified buffer 44 | set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') 45 | " } 46 | -------------------------------------------------------------------------------- /roles/common/files/base16-monokai.vim: -------------------------------------------------------------------------------- 1 | " Base16 Monokai (https://github.com/chriskempson/base16) 2 | " Scheme: Wimer Hazenberg (http://www.monokai.nl) 3 | 4 | " GUI color definitions 5 | let s:gui00 = "272822" 6 | let s:gui01 = "383830" 7 | let s:gui02 = "49483e" 8 | let s:gui03 = "75715e" 9 | let s:gui04 = "a59f85" 10 | let s:gui05 = "f8f8f2" 11 | let s:gui06 = "f5f4f1" 12 | let s:gui07 = "f9f8f5" 13 | let s:gui08 = "f92672" 14 | let s:gui09 = "fd971f" 15 | let s:gui0A = "f4bf75" 16 | let s:gui0B = "a6e22e" 17 | let s:gui0C = "a1efe4" 18 | let s:gui0D = "66d9ef" 19 | let s:gui0E = "ae81ff" 20 | let s:gui0F = "cc6633" 21 | 22 | " Terminal color definitions 23 | let s:cterm00 = "00" 24 | let s:cterm03 = "08" 25 | let s:cterm05 = "07" 26 | let s:cterm07 = "15" 27 | let s:cterm08 = "01" 28 | let s:cterm0A = "03" 29 | let s:cterm0B = "02" 30 | let s:cterm0C = "06" 31 | let s:cterm0D = "04" 32 | let s:cterm0E = "05" 33 | if exists('base16colorspace') && base16colorspace == "256" 34 | let s:cterm01 = "18" 35 | let s:cterm02 = "19" 36 | let s:cterm04 = "20" 37 | let s:cterm06 = "21" 38 | let s:cterm09 = "16" 39 | let s:cterm0F = "17" 40 | else 41 | let s:cterm01 = "10" 42 | let s:cterm02 = "11" 43 | let s:cterm04 = "12" 44 | let s:cterm06 = "13" 45 | let s:cterm09 = "09" 46 | let s:cterm0F = "14" 47 | endif 48 | 49 | " Theme setup 50 | hi clear 51 | syntax reset 52 | let g:colors_name = "base16-monokai" 53 | 54 | " Highlighting function 55 | fun hi(group, guifg, guibg, ctermfg, ctermbg, attr) 56 | if a:guifg != "" 57 | exec "hi " . a:group . " guifg=#" . s:gui(a:guifg) 58 | endif 59 | if a:guibg != "" 60 | exec "hi " . a:group . " guibg=#" . s:gui(a:guibg) 61 | endif 62 | if a:ctermfg != "" 63 | exec "hi " . a:group . " ctermfg=" . s:cterm(a:ctermfg) 64 | endif 65 | if a:ctermbg != "" 66 | exec "hi " . a:group . " ctermbg=" . s:cterm(a:ctermbg) 67 | endif 68 | if a:attr != "" 69 | exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr 70 | endif 71 | endfun 72 | 73 | " Return GUI color for light/dark variants 74 | fun s:gui(color) 75 | if &background == "dark" 76 | return a:color 77 | endif 78 | 79 | if a:color == s:gui00 80 | return s:gui07 81 | elseif a:color == s:gui01 82 | return s:gui06 83 | elseif a:color == s:gui02 84 | return s:gui05 85 | elseif a:color == s:gui03 86 | return s:gui04 87 | elseif a:color == s:gui04 88 | return s:gui03 89 | elseif a:color == s:gui05 90 | return s:gui02 91 | elseif a:color == s:gui06 92 | return s:gui01 93 | elseif a:color == s:gui07 94 | return s:gui00 95 | endif 96 | 97 | return a:color 98 | endfun 99 | 100 | " Return terminal color for light/dark variants 101 | fun s:cterm(color) 102 | if &background == "dark" 103 | return a:color 104 | endif 105 | 106 | if a:color == s:cterm00 107 | return s:cterm07 108 | elseif a:color == s:cterm01 109 | return s:cterm06 110 | elseif a:color == s:cterm02 111 | return s:cterm05 112 | elseif a:color == s:cterm03 113 | return s:cterm04 114 | elseif a:color == s:cterm04 115 | return s:cterm03 116 | elseif a:color == s:cterm05 117 | return s:cterm02 118 | elseif a:color == s:cterm06 119 | return s:cterm01 120 | elseif a:color == s:cterm07 121 | return s:cterm00 122 | endif 123 | 124 | return a:color 125 | endfun 126 | 127 | " Vim editor colors 128 | call hi("Bold", "", "", "", "", "bold") 129 | call hi("Debug", s:gui08, "", s:cterm08, "", "") 130 | call hi("Directory", s:gui0D, "", s:cterm0D, "", "") 131 | call hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 132 | call hi("Exception", s:gui08, "", s:cterm08, "", "") 133 | call hi("FoldColumn", "", s:gui01, "", s:cterm01, "") 134 | call hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 135 | call hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none") 136 | call hi("Italic", "", "", "", "", "none") 137 | call hi("Macro", s:gui08, "", s:cterm08, "", "") 138 | call hi("MatchParen", s:gui00, s:gui03, s:cterm00, s:cterm03, "") 139 | call hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "") 140 | call hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "") 141 | call hi("Question", s:gui09, "", s:cterm09, "", "") 142 | call hi("Search", s:gui03, s:gui0A, s:cterm03, s:cterm0A, "") 143 | call hi("SpecialKey", s:gui03, "", s:cterm03, "", "") 144 | call hi("TooLong", s:gui08, "", s:cterm08, "", "") 145 | call hi("Underlined", s:gui08, "", s:cterm08, "", "") 146 | call hi("Visual", "", s:gui02, "", s:cterm02, "") 147 | call hi("VisualNOS", s:gui08, "", s:cterm08, "", "") 148 | call hi("WarningMsg", s:gui08, "", s:cterm08, "", "") 149 | call hi("WildMenu", s:gui08, "", s:cterm08, "", "") 150 | call hi("Title", s:gui0D, "", s:cterm0D, "", "none") 151 | call hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 152 | call hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "") 153 | call hi("NonText", s:gui03, "", s:cterm03, "", "") 154 | call hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "") 155 | call hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 156 | call hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 157 | call hi("SpecialKey", s:gui03, "", s:cterm03, "", "") 158 | call hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none") 159 | call hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 160 | call hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none") 161 | call hi("ColorColumn", "", s:gui01, "", s:cterm01, "none") 162 | call hi("CursorColumn", "", s:gui01, "", s:cterm01, "none") 163 | call hi("CursorLine", "", s:gui01, "", s:cterm01, "none") 164 | call hi("CursorLineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "") 165 | call hi("PMenu", s:gui04, s:gui01, s:cterm04, s:cterm01, "none") 166 | call hi("PMenuSel", s:gui01, s:gui04, s:cterm01, s:cterm04, "") 167 | call hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 168 | call hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none") 169 | call hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none") 170 | 171 | " Standard syntax highlighting 172 | call hi("Boolean", s:gui09, "", s:cterm09, "", "") 173 | call hi("Character", s:gui08, "", s:cterm08, "", "") 174 | call hi("Comment", s:gui03, "", s:cterm03, "", "") 175 | call hi("Conditional", s:gui0E, "", s:cterm0E, "", "") 176 | call hi("Constant", s:gui09, "", s:cterm09, "", "") 177 | call hi("Define", s:gui0E, "", s:cterm0E, "", "none") 178 | call hi("Delimiter", s:gui0F, "", s:cterm0F, "", "") 179 | call hi("Float", s:gui09, "", s:cterm09, "", "") 180 | call hi("Function", s:gui0D, "", s:cterm0D, "", "") 181 | call hi("Identifier", s:gui08, "", s:cterm08, "", "none") 182 | call hi("Include", s:gui0D, "", s:cterm0D, "", "") 183 | call hi("Keyword", s:gui0E, "", s:cterm0E, "", "") 184 | call hi("Label", s:gui0A, "", s:cterm0A, "", "") 185 | call hi("Number", s:gui09, "", s:cterm09, "", "") 186 | call hi("Operator", s:gui05, "", s:cterm05, "", "none") 187 | call hi("PreProc", s:gui0A, "", s:cterm0A, "", "") 188 | call hi("Repeat", s:gui0A, "", s:cterm0A, "", "") 189 | call hi("Special", s:gui0C, "", s:cterm0C, "", "") 190 | call hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "") 191 | call hi("Statement", s:gui08, "", s:cterm08, "", "") 192 | call hi("StorageClass", s:gui0A, "", s:cterm0A, "", "") 193 | call hi("String", s:gui0B, "", s:cterm0B, "", "") 194 | call hi("Structure", s:gui0E, "", s:cterm0E, "", "") 195 | call hi("Tag", s:gui0A, "", s:cterm0A, "", "") 196 | call hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "") 197 | call hi("Type", s:gui09, "", s:cterm09, "", "none") 198 | call hi("Typedef", s:gui0A, "", s:cterm0A, "", "") 199 | 200 | " Spelling highlighting 201 | call hi("SpellBad", "", s:gui00, "", s:cterm00, "undercurl") 202 | call hi("SpellLocal", "", s:gui00, "", s:cterm00, "undercurl") 203 | call hi("SpellCap", "", s:gui00, "", s:cterm00, "undercurl") 204 | call hi("SpellRare", "", s:gui00, "", s:cterm00, "undercurl") 205 | 206 | " Additional diff highlighting 207 | call hi("DiffAdd", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 208 | call hi("DiffChange", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 209 | call hi("DiffDelete", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 210 | call hi("DiffText", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 211 | call hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 212 | call hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 213 | call hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "") 214 | call hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "") 215 | call hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "") 216 | 217 | " Ruby highlighting 218 | call hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "") 219 | call hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "") 220 | call hi("rubyInterpolation", s:gui0B, "", s:cterm0B, "", "") 221 | call hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "") 222 | call hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "") 223 | call hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "") 224 | call hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "") 225 | 226 | " PHP highlighting 227 | call hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "") 228 | call hi("phpComparison", s:gui05, "", s:cterm05, "", "") 229 | call hi("phpParent", s:gui05, "", s:cterm05, "", "") 230 | 231 | " HTML highlighting 232 | call hi("htmlBold", s:gui0A, "", s:cterm0A, "", "") 233 | call hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "") 234 | call hi("htmlEndTag", s:gui05, "", s:cterm05, "", "") 235 | call hi("htmlTag", s:gui05, "", s:cterm05, "", "") 236 | 237 | " CSS highlighting 238 | call hi("cssBraces", s:gui05, "", s:cterm05, "", "") 239 | call hi("cssClassName", s:gui0E, "", s:cterm0E, "", "") 240 | call hi("cssColor", s:gui0C, "", s:cterm0C, "", "") 241 | 242 | " SASS highlighting 243 | call hi("sassidChar", s:gui08, "", s:cterm08, "", "") 244 | call hi("sassClassChar", s:gui09, "", s:cterm09, "", "") 245 | call hi("sassInclude", s:gui0E, "", s:cterm0E, "", "") 246 | call hi("sassMixing", s:gui0E, "", s:cterm0E, "", "") 247 | call hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "") 248 | 249 | " JavaScript highlighting 250 | call hi("javaScript", s:gui05, "", s:cterm05, "", "") 251 | call hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "") 252 | call hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "") 253 | 254 | " Python highlighting 255 | call hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "") 256 | call hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "") 257 | 258 | " Markdown highlighting 259 | call hi("markdownCode", s:gui0B, "", s:cterm0B, "", "") 260 | call hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "") 261 | call hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "") 262 | call hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "") 263 | 264 | " Git highlighting 265 | call hi("gitCommitOverflow", s:gui08, "", s:cterm08, "", "") 266 | call hi("gitCommitSummary", s:gui0B, "", s:cterm0B, "", "") 267 | 268 | " GitGutter highlighting 269 | call hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "") 270 | call hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "") 271 | call hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "") 272 | call hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "") 273 | 274 | " Signify highlighting 275 | call hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "") 276 | call hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "") 277 | call hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "") 278 | 279 | " NERDTree highlighting 280 | call hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "") 281 | call hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "") 282 | 283 | " Remove functions 284 | delf hi 285 | delf gui 286 | delf cterm 287 | 288 | " Remove color variables 289 | unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F 290 | unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F 291 | -------------------------------------------------------------------------------- /roles/common/files/color_prompt.sh: -------------------------------------------------------------------------------- 1 | # Reset 2 | Color_Off='\[\033[0m\]' # Text Reset 3 | 4 | # Regular Colors 5 | Black='\[\033[0;30m\]' # Black 6 | Red='\[\033[0;31m\]' # Red 7 | Green='\[\033[0;32m\]' # Green 8 | Yellow='\[\033[0;33m\]' # Yellow 9 | Blue='\[\033[0;34m\]' # Blue 10 | Purple='\[\033[0;35m\]' # Purple 11 | Cyan='\[\033[0;36m\]' # Cyan 12 | White='\[\033[0;37m\]' # White 13 | 14 | # Bold 15 | BBlack='\[\033[1;30m\]' # Black 16 | BRed='\[\033[1;31m\]' # Red 17 | BGreen='\[\033[1;32m\]' # Green 18 | BYellow='\[\033[1;33m\]' # Yellow 19 | BBlue='\[\033[1;34m\]' # Blue 20 | BPurple='\[\033[1;35m\]' # Purple 21 | BCyan='\[\033[1;36m\]' # Cyan 22 | BWhite='\[\033[1;37m\]' # White 23 | 24 | # Underline 25 | UBlack='\[\033[4;30m\]' # Black 26 | URed='\[\033[4;31m\]' # Red 27 | UGreen='\[\033[4;32m\]' # Green 28 | UYellow='\[\033[4;33m\]' # Yellow 29 | UBlue='\[\033[4;34m\]' # Blue 30 | UPurple='\[\033[4;35m\]' # Purple 31 | UCyan='\[\033[4;36m\]' # Cyan 32 | UWhite='\[\033[4;37m\]' # White 33 | 34 | # Background 35 | On_Black='\[\033[40m\]' # Black 36 | On_Red='\[\033[41m\]' # Red 37 | On_Green='\[\033[42m\]' # Green 38 | On_Yellow='\[\033[43m\]' # Yellow 39 | On_Blue='\[\033[44m\]' # Blue 40 | On_Purple='\[\033[45m\]' # Purple 41 | On_Cyan='\[\033[46m\]' # Cyan 42 | On_White='\[\033[47m\]' # White 43 | 44 | # High Intensity 45 | IBlack='\[\033[0;90m\]' # Black 46 | IRed='\[\033[0;91m\]' # Red 47 | IGreen='\[\033[0;92m\]' # Green 48 | IYellow='\[\033[0;93m\]' # Yellow 49 | IBlue='\[\033[0;94m\]' # Blue 50 | IPurple='\[\033[0;95m\]' # Purple 51 | ICyan='\[\033[0;96m\]' # Cyan 52 | IWhite='\[\033[0;97m\]' # White 53 | 54 | # Bold High Intensity 55 | BIBlack='\[\033[1;90m\]' # Black 56 | BIRed='\[\033[1;91m\]' # Red 57 | BIGreen='\[\033[1;92m\]' # Green 58 | BIYellow='\[\033[1;93m\]' # Yellow 59 | BIBlue='\[\033[1;94m\]' # Blue 60 | BIPurple='\[\033[1;95m\]' # Purple 61 | BICyan='\[\033[1;96m\]' # Cyan 62 | BIWhite='\[\033[1;97m\]' # White 63 | 64 | # High Intensity backgrounds 65 | On_IBlack='\[\033[0;100m\]' # Black 66 | On_IRed='\[\033[0;101m\]' # Red 67 | On_IGreen='\[\033[0;102m\]' # Green 68 | On_IYellow='\[\033[0;103m\]' # Yellow 69 | On_IBlue='\[\033[0;104m\]' # Blue 70 | On_IPurple='\[\033[0;105m\]' # Purple 71 | On_ICyan='\[\033[0;106m\]' # Cyan 72 | On_IWhite='\[\033[0;107m\]' # White 73 | # CUSTOM_PROMPT=\'"${Cyan}┌ \[\033[0m\033[0;32m\]\u${Color_Off} @ ${Green}\h\[\033[0m\033[0;32m\] ─ \[\033[0m\]\t \d\[\033[0;32m\] ─ \[\033[0;31m\]\w\[\033[0;32m\] \[\$(__git_ps1)\]\n${Cyan}└▶ \[\033[0m\033[0;32m\]\$\[\033[0m\]"\' 74 | CUSTOM_PROMPT=\'"${Blue}┌ ${Cyan}\u${Red} @ ${Blue}\h${Blue} ─ ${Purple}\t \d${Blue} ─ ${Red}\w\[\033[0;32m\] \[\$(__git_ps1)\]\n${Blue}└▶ ${White}\$ ${Color_Off}"\' 75 | 76 | PS1="${CUSTOM_PROMPT}" 77 | echo "${CUSTOM_PROMPT}" 78 | -------------------------------------------------------------------------------- /roles/common/files/keyboard-color.sh: -------------------------------------------------------------------------------- 1 | ##000 - Off 2 | ##111 - White 3 | ##100 - Green 4 | ##010 - Red 5 | ##001 - Blue 6 | ##110 - Yellow 7 | ##011 - Purple 8 | ##101 - Aqua 9 | if [ "$#" -ne 2 ]; then 10 | echo " " 11 | echo "locations: left, right, middle or all" 12 | echo "colors: white, green, red, blue, yellow, purple, aqua or off" 13 | fi 14 | 15 | case "$2" in 16 | "off") 17 | KEYBOARD_COLOR=000 18 | ;; 19 | "white") 20 | KEYBOARD_COLOR=111 21 | ;; 22 | "green") 23 | KEYBOARD_COLOR=100 24 | ;; 25 | "red") 26 | KEYBOARD_COLOR=010 27 | ;; 28 | "blue") 29 | KEYBOARD_COLOR=001 30 | ;; 31 | "yellow") 32 | KEYBOARD_COLOR=110 33 | ;; 34 | "purple") 35 | KEYBOARD_COLOR=011 36 | ;; 37 | "aqua") 38 | KEYBOARD_COLOR=101 39 | ;; 40 | *) 41 | KEYBOARD_COLOR=000 42 | ;; 43 | esac 44 | 45 | 46 | case "$1" in 47 | "all") 48 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/left" 49 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/middle" 50 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/right" 51 | ;; 52 | "left") 53 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/$1" 54 | ;; 55 | "middle") 56 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/$1" 57 | ;; 58 | "right") 59 | sudo su -c "echo $KEYBOARD_COLOR > /sys/devices/platform/clevo_wmi/kbled/$1" 60 | ;; 61 | *) 62 | echo " " 63 | echo "locations: left, right, middle or all" 64 | echo "colors: white, green, red, blue, yellow, purple, aqua or off" 65 | esac 66 | -------------------------------------------------------------------------------- /roles/common/files/plank.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Exec=/usr/bin/plank 4 | Hidden=false 5 | NoDisplay=false 6 | X-GNOME-Autostart-enabled=true 7 | Name[en_CA]=Plank 8 | Name=Plank 9 | Comment[en_CA]=Launcher 10 | Comment=Launcher 11 | -------------------------------------------------------------------------------- /roles/common/files/setup: -------------------------------------------------------------------------------- 1 | # sublime text 3 2 | sudo add-apt-repository ppa:webupd8team/sublime-text-3 3 | sudo apt-get update && sudo apt-get install sublime-text-installer 4 | 5 | # chromium 6 | sudo apt-get install chromium-browser 7 | 8 | # chrome stable 9 | wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 10 | sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' 11 | sudo apt-get update && sudo apt-get install google-chrome-stable 12 | 13 | # Numix 14 | sudo add-apt-repository ppa:numix/ppa 15 | sudo apt-get update && sudo apt-get install numix-icon-theme-circle 16 | sudo apt-get install gnome-tweak-tool 17 | gsettings set org.gnome.desktop.interface icon-theme Numix-Circle 18 | sudo apt-get install numix-gtk-theme 19 | gsettings set org.gnome.desktop.interface gtk-theme Numix 20 | 21 | # Plank 22 | sudo add-apt-repository ppa:ricotz/docky 23 | sudo apt-get update && sudo apt-get install plank 24 | 25 | sudo mkdir ~/.config/autostart 26 | echo """[Desktop Entry] 27 | Type=Application 28 | Exec=/usr/bin/plank 29 | Hidden=false 30 | NoDisplay=false 31 | X-GNOME-Autostart-enabled=true 32 | Name[en_CA]=plank 33 | Name=plank 34 | Comment[en_CA]=dock 35 | Comment=dock 36 | """ >> ~/.config/autostart/plank.desktop 37 | # TODO: can't figure out how to close the laucher on the left, only gconf setting isn't valid anymore 38 | 39 | #keypass 40 | sudo apt-get install keypass2 41 | 42 | # dropbox 43 | sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E 44 | sudo sh -c 'echo "deb http://linux.dropbox.com/ubuntu/ trusty main" >> /etc/apt/sources.list.d/dropbox.list' 45 | sudo apt-get update && sudo apt-get install dropbox 46 | dropbox start -i 47 | 48 | # laptop only 49 | # Screen dimming 50 | # TODO Automate 51 | # sudo subl /etc/default/grub 52 | # GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" ---> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1" 53 | # sudo update-grub 54 | 55 | # keyboard colors 56 | sudo apt-get install git build-essential linux-source 57 | mkdir ~/dev 58 | git clone git://git.code.sf.net/p/clevo-wmi/code ~/dev/clevo-wmi-code 59 | cd ~/dev/clevo-wmi-code 60 | make && sudo insmod ~/dev/clevo-wmi-code/clevo_wmi.ko 61 | sudo cp ~/dev/clevo-wmi-code/clevo_wmi.ko /lib/modules/`uname -r`/kernel/drivers/platform/x86/ 62 | sudo depmod -a 63 | # add `clevo_wmi` to /etc/modules 64 | 65 | # TODO: Copy keyboard file to home. keyboard-color.sh 66 | cd ~ && sudo chmod 755 keyboard-color.sh 67 | 68 | # variety wallpaper changer 69 | sudo add-apt-repository ppa:peterlevi/ppa 70 | sudo apt-get update && sudo apt-get install variety 71 | # start variety: /opt/extras.ubuntu.com/variety/bin/variety 72 | 73 | # source code pro font 74 | mkdir /tmp/adodefont 75 | cd /tmp/adodefont 76 | wget http://downloads.sourceforge.net/project/sourcecodepro.adobe/SourceCodePro_FontsOnly-1.017.zip 77 | unzip SourceCodePro_FontsOnly-1.017.zip 78 | mkdir -p ~/.fonts 79 | cp SourceCodePro_FontsOnly-1.017/OTF/*.otf ~/.fonts 80 | fc-cache -f -v 81 | cd ~ 82 | gconftool-2 --set /apps/gnome-terminal/profiles/Default/font --type string "Source Code Pro Semi-Bold 12" 83 | gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_system_font --type boolean false 84 | 85 | #base16 86 | git clone git@github.com:chriskempson/base16-gnome-terminal.git ~/dev/base16-gnome 87 | source ~/dev/base16-gnome/base16-monokai.dark.sh 88 | # no idea how to set it to the terminal default. 89 | gconftool-2 --set /apps/gnome-terminal/profiles/base-16-monokai-dark/font --type string "Source Code Pro Semi-Bold 12" 90 | gconftool-2 --set /apps/gnome-terminal/profiles/base-16-monokai-dark/use_system_font --type boolean false 91 | 92 | # work stuff 93 | # install vagrant from website for latest version 94 | # same with virtual box 95 | sudo apt-get install python-pip 96 | sudo apt-get install curl 97 | sudo apt-get install nodejs 98 | sudo apt-get install npm 99 | sudo pip install ansible 100 | sudo pip install virtualenvwrapper 101 | export WORKON_HOME=~/Envs 102 | mkdir -p $WORKON_HOME 103 | source /usr/local/bin/virtualenvwrapper.sh 104 | sudo apt-get install nfs-kernel-server nfs-common rpcbind 105 | # copy Wavevagrant.json 106 | sudo apt-get install tmux 107 | sudo pip install tmuxp 108 | # follow wave instructions 109 | 110 | #sch breeze 111 | git clone git://github.com/ndbroadbent/scm_breeze.git ~/dev/.scm_breeze 112 | ~/dev/.scm_breeze/install.sh 113 | 114 | # cusotmizations 115 | # uncomment #force_color_prompt=yes in .bashrc 116 | # copy django bash completion and bash customizations 117 | 118 | # export WORKON_HOME=$HOME/.virtualenvs 119 | # export PROJECT_HOME=$HOME/virtualenvProject 120 | # source /usr/local/bin/virtualenvwrapper.sh 121 | 122 | # source $HOME/.django_bash_completion.sh 123 | # if [ -f ~/.bash_customizations ]; then 124 | # . ~/.bash_customizations 125 | # fi 126 | 127 | # add to bash_profile: 128 | # export GITHUB_USERNAME="JBKahn" 129 | # export HIPCHAT_USERNAME=JBKahn 130 | 131 | #Vim 132 | sudo apt-get install vim 133 | wget -qO- https://github.com/BNOTIONS/horse.vim/raw/master/install.sh | sudo bash 134 | 135 | # Other 136 | sudo apt-get install vlc 137 | sudo apt-get install shutter 138 | sudo apt-get install gcolor2 139 | sudo apt-get install silversearcher-ag 140 | -------------------------------------------------------------------------------- /roles/common/files/variety.conf: -------------------------------------------------------------------------------- 1 | # change_on_start = 2 | change_on_start = False 3 | 4 | # change_enabled = 5 | change_enabled = True 6 | 7 | # change_interval = 8 | change_interval = 3600 9 | 10 | # download_enabled = 11 | download_enabled = True 12 | 13 | # download_interval = 14 | download_interval = 3600 15 | 16 | # download_folder = - when not specified, the default is ~/.config/variety/Downloaded 17 | download_folder = ~/.config/variety/Downloaded 18 | 19 | # Determine if there the download folder sould not exceed a certain size (in megabytes) 20 | # quota_enabled = 21 | # quota_size = 22 | quota_enabled = True 23 | quota_size = 500 24 | 25 | # favorites_folder = - when not specified, the default is ~/.config/variety/Favorites 26 | favorites_folder = ~/.config/variety/Favorites 27 | 28 | # Prefer Copy to Favorites or Move to Favorites operation (or both), depending on the folder of the current image 29 | # favorites_operations = 30 | # The default is: Downloaded:Copy;Fetched:Move;Others:Copy 31 | # Order is important - the first matching entry will determine what operation(s) to show in the menu for a specific file 32 | # Special folder names you can use: Downloaded, Fetched and Others (same as "/" - use it as last entry to determine the default operation) 33 | # Example1: Downloaded:Copy;Fetched:Move;/pics/RandomImages:Move;/pics/OrganizedAlbums:Copy;Others:Copy 34 | # Example2: Others:Both - always show both Copy and Move to Favorites, no matter which image is shown 35 | # Move to Favorites is only shown when the user has write permissions over the file, otherwise we fallback to Copy 36 | favorites_operations = Downloaded:Copy;Fetched:Move;Others:Copy 37 | 38 | # fetch_folder = - when not specified, the default is ~/.config/variety/Fetched 39 | fetched_folder = ~/.config/variety/Fetched 40 | 41 | # Clipboard monitoring settings 42 | # clipboard_enabled = 43 | # clipboard_use_whitelist = 44 | # clipboard_hosts = 45 | clipboard_enabled = False 46 | clipboard_use_whitelist = True 47 | clipboard_hosts = "wallbase.cc,ns223506.ovh.net,wallpapers.net,flickr.com,imgur.com,deviantart.com,interfacelift.com,vladstudio.com" 48 | 49 | # Icon settings 50 | # icon = 51 | icon = Light 52 | 53 | # Prefer only images with this color: 54 | # desired_color_enabled = 55 | # desired_color = 56 | # DISCLAIMER: This feature is still experimental 57 | desired_color_enabled = False 58 | desired_color = 160 160 160 59 | 60 | # Minimum size of images to use, as a percentage of the screen resolution 61 | # min_size_enabled = 62 | # min_size = 63 | min_size_enabled = False 64 | min_size = 80 65 | 66 | # Should we use only landscape-oriented images? 67 | # use_landscape_enabled = 68 | use_landscape_enabled = True 69 | 70 | # Prefer light or dark images 71 | # lightness_enabled = 72 | # lightness_mode = <0 for Dark, 1 for Light> 73 | lightness_enabled = False 74 | lightness_mode = 0 75 | 76 | # Use a filter by rating? 77 | # min_rating_enabled = 78 | # min_rating = <1 | 2 | 3 | 4 | 5> 79 | min_rating_enabled = False 80 | min_rating = 4 81 | 82 | # Should we show the Rating menuitems in main and thumbs menus? 83 | # show_rating_enabled = , default is False 84 | show_rating_enabled = False 85 | 86 | # Facebook - should we show the Share On Facebook item in menu and should we ask for a message every time 87 | # facebook_enabled = 88 | # facebook_show_dialog = 89 | # facebook_message = 90 | facebook_enabled = True 91 | facebook_show_dialog = True 92 | facebook_message = "" 93 | 94 | # Folder to copy the wallpaper image to and make it world-readable. Provides LightDM support. 95 | # copyto_enabled = , default is False 96 | # copyto_folder = , the default is Default 97 | # Default means to use the XDG Pictures folder when home folder is unencrypted and /usr/share/backgrounds when it is encrypted. 98 | copyto_enabled = False 99 | copyto_folder = Default 100 | 101 | # Clock settings 102 | # clock_enabled = 103 | # clock_font = , default is "Ubuntu Condensed, 70" 104 | # clock_date_font = , default is "Ubuntu Condensed, 30" 105 | clock_enabled = False 106 | clock_font = "Ubuntu Condensed, 70" 107 | clock_date_font = "Ubuntu Condensed, 30" 108 | 109 | # clock_filter = 110 | # 111 | # The filter defines the ImageMagick command that Variety uses to render the clock on the wallpaper. 112 | # First some scaling is applied to get the image down to the screen size - this ensures 113 | # the final drawn clock won't be rescaled by the desktop wallpaper system. 114 | # Easiest way to see what's happening is to run variety with -v, enable clock and see what ImageMagick 115 | # commands Variety dumps in the log. 116 | # 117 | # The user may want to customize the following aspects: 118 | # fill - color of "filling" 119 | # stroke - color of outline 120 | # strokewidth - width of outline 121 | # gravity - in which corner to display the clock - SouthEast, NorthEast, SouthWest, NorthWest 122 | # annotate - these must be in the form 0x0+[%HOFFSET+X]+[%VOFFSET+Y], where you can edit X and Y - 123 | # distance from the screen corner defined by gravity. Write them in even if they are 0. 124 | # 125 | # The %HOFFSET and %VOFFSET parameters are there for Variety to replace in order to compensate for the 126 | # diferent dimensions of every image and screen. 127 | # The several %FONT parameters are there for Variety to replace with the font settings from the GUI. 128 | # 129 | # The texts can contain these symbols: 130 | # 131 | # %H - hours (24), %I - hours (12), %p - am or pm, %M - minutes, 132 | # %A - day of week (full), %a - day of week abbreviation, %B - month name, %b - month abbreviation, %d - day of month, %Y - year. 133 | # The full list for these can be seen here: http://docs.python.org/library/datetime.html#strftime-strptime-behavior 134 | # Have in mind that Variety will not update the clock more often than once every minute, so using seconds (%S) for example is pointless 135 | # 136 | # A tutorial on "annotating" with ImageMagick that you may use as a reference: http://www.imagemagick.org/Usage/annotating/ 137 | # You can get a very uniquely looking clock with some of the more advanced techniques (e.g. circle-shaped text, interesting colors and shading, etc....). 138 | 139 | clock_filter = "-density 100 -font `fc-match -f '%{file[0]}' '%CLOCK_FONT_NAME'` -pointsize %CLOCK_FONT_SIZE -gravity SouthEast -fill '#00000044' -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+108] '%H:%M' -fill white -annotate 0x0+[%HOFFSET+60]+[%VOFFSET+110] '%H:%M' -font `fc-match -f '%{file[0]}' '%DATE_FONT_NAME'` -pointsize %DATE_FONT_SIZE -fill '#00000044' -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+58] '%A, %B %d' -fill white -annotate 0x0+[%HOFFSET+60]+[%VOFFSET+60] '%A, %B %d'" 140 | 141 | # Quotes settings 142 | # quotes_enabled = 143 | # quotes_font = , default is Bitstream Charter 30 144 | # quotes_text_color = , default is 255 255 255 145 | # quotes_bg_color = , default is 80 80 80 146 | # quotes_bg_opacity = <0-100>, default is 55 147 | # quotes_width = <0-100>, default is 70 148 | # quotes_hpos = <0-100>, default is 100 149 | # quotes_vpos = <0-100>, default is 40 150 | # quotes_text_shadow = , default is False 151 | # quotes_disabled_sources = <|-separated list of disabled quote plugin names>, default is empty 152 | # quotes_tags = , default is empty 153 | # quotes_authors = , default is empty 154 | # quotes_change_enabled = 155 | # quotes_change_interval = , default is 300 156 | quotes_enabled = False 157 | quotes_font = Bitstream Charter 30 158 | quotes_text_color = 255 255 255 159 | quotes_bg_color = 80 80 80 160 | quotes_bg_opacity = 55 161 | quotes_text_shadow = False 162 | quotes_width = 70 163 | quotes_hpos = 100 164 | quotes_vpos = 40 165 | quotes_disabled_sources = QuotesDaddy 166 | quotes_tags = "" 167 | quotes_authors = "" 168 | quotes_change_enabled = False 169 | quotes_change_interval = 300 170 | smart_notice_shown = True 171 | smart_register_shown = True 172 | stats_notice_shown = True 173 | smart_enabled = True 174 | sync_enabled = True 175 | stats_enabled = True 176 | quotes_favorites_file = ~/.config/variety/favorite_quotes.txt 177 | 178 | # List of sources 179 | # Each source is srcX = 180 | # location depends on type - path or url or search options, or just a name for unconfigurable sources 181 | # Folders are included recursively 182 | # BE CAREFUL: all keys below (src1, src2, etc.) MUST be different 183 | [sources] 184 | src1 = False|favorites|The Favorites folder 185 | src2 = False|fetched|The Fetched folder 186 | src3 = False|folder|/usr/share/backgrounds 187 | src4 = True|desktoppr|Random wallpapers from Desktoppr.co 188 | src5 = True|apod|NASA's Astronomy Picture of the Day 189 | src6 = False|earth|World Sunlight Map - live wallpaper from Opentopia.com 190 | src7 = True|wn|http://wallpapers.net/nature-desktop-wallpapers.html 191 | src8 = True|wn|http://wallpapers.net/food-desktop-wallpapers.html 192 | src9 = True|flickr|user:www.flickr.com/photos/peter-levi/;user_id:93647178@N00; 193 | src10 = True|flickr|text:colorful;user:www.flickr.com/photos/pinksherbet/;user_id:40645538@N00; 194 | src11 = True|flickr|user:www.flickr.com/photos/isayx3/;user_id:52821721@N00; 195 | src12 = True|wallbase|autumn 196 | src13 = True|wallbase|http://wallbase.cc/search?q=&order_mode=desc&order=favs&purity=100&board=21 197 | src14 = True|wallbase|macro 198 | src15 = True|wallbase|leaves 199 | src16 = True|recommended|Recommended by Variety. Adapts to your taste as you mark images as favorite or trash. 200 | src17 = False|latest|Latest favorites by the other users of Variety. 201 | 202 | # Image filters to apply randomly to every wallpaper (ImageMagick is used for this) 203 | # Each filter is filterX = 204 | # BE CAREFUL: all keys below (filter1, filter2, etc.) MUST be different 205 | [filters] 206 | filter1 = False|Keep original| 207 | filter2 = False|Grayscale|-type Grayscale 208 | filter3 = False|Heavy blur|-blur 120x40 209 | filter4 = False|Soft blur|-blur 20x7 210 | filter5 = False|Oil painting|-paint 8 211 | filter6 = """False|Pencil sketch|-colorspace gray \( +clone -tile ~/.config/variety/pencil_tile.png -draw "color 0,0 reset" +clone +swap -compose color_dodge -composite \) -fx 'u*.2+v*.8'""" 212 | filter7 = False|Pointilism|-spread 10 -noise 3 213 | filter8 = False|Pixellate|-scale 3% -scale 3333% 214 | -------------------------------------------------------------------------------- /roles/common/files/variety.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Variety 3 | Comment=Variety Wallpaper Changer 4 | Icon=/opt/extras.ubuntu.com/variety/share/variety/media/variety.svg 5 | Exec=/opt/extras.ubuntu.com/variety/bin/variety 6 | Terminal=false 7 | Type=Application 8 | X-GNOME-Autostart-Delay=20 9 | -------------------------------------------------------------------------------- /roles/common/tasks/base16.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: base16 - checkout repo 3 | git: 4 | repo: https://github.com/chriskempson/base16-gnome-terminal.git 5 | dest: "{{ ansible_env.HOME }}/setup/base16-gnome" 6 | 7 | - name: base16 - copy monokai-dark 8 | copy: 9 | src: "{{ ansible_env.HOME }}/setup/base16-gnome/base16-monokai.dark.sh" 10 | dest: "{{ ansible_env.HOME }}/base16-monokai.dark.sh" 11 | mode: 0755 12 | 13 | - name: base16 - install monokai dark 14 | command: "{{ ansible_env.HOME }}/base16-monokai.dark.sh" 15 | 16 | - name: base16 - set system font to source code pro 17 | gconftool2: 18 | key: /apps/gnome-terminal/profiles/base-16-monokai-dark/font 19 | string: "Source Code Pro Semi-Bold 12" 20 | 21 | - name: base16 - dont use default system font in terminal 22 | gconftool2: 23 | key: /apps/gnome-terminal/profiles/base-16-monokai-dark/use_system_font 24 | bool: false 25 | 26 | - name: base16 - set default terminal profile 27 | gconftool2: 28 | key: /apps/gnome-terminal/global/default_profile 29 | string: "base-16-monokai-dark" 30 | 31 | - name: base-16 - get base16-shell so that colors show up correctly in vim 32 | git: 33 | repo: https://github.com/chriskempson/base16-shell.git 34 | dest: "{{ ansible_env.HOME }}/.config/base16-shell" 35 | -------------------------------------------------------------------------------- /roles/common/tasks/bash_customizations.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: bash customizations - force color prompt 3 | lineinfile: 4 | dest: "{{ ansible_env.HOME }}/.bashrc" 5 | regexp: "force_color_prompt=" 6 | line: "force_color_prompt=yes" 7 | 8 | - name: bash customizations - download django bash completion 9 | get_url: 10 | url: https://raw.githubusercontent.com/django/django/master/extras/django_bash_completion 11 | dest: "{{ ansible_env.HOME }}/.django_bash_completion.sh" 12 | mode: 0755 13 | 14 | - name: bash customizations - copy .bash_customizations file 15 | copy: 16 | src: .bash_customizations 17 | dest: "{{ ansible_env.HOME }}/.bash_customizations" 18 | mode: 0755 19 | 20 | - name: bash customizations - run .bash_customizations from .bash_rc 21 | lineinfile: 22 | dest: "{{ ansible_env.HOME }}/.bashrc" 23 | line: "test -f ~/.bash_customizations && source ~/.bash_customizations" 24 | 25 | - name: bash customizations - add github username to .bash_customizations 26 | lineinfile: 27 | dest: "{{ ansible_env.HOME }}/.bash_customizations" 28 | line: 'export GITHUB_USERNAME="{{ github_username }}"' 29 | -------------------------------------------------------------------------------- /roles/common/tasks/bumblebee.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install bumblebee - add bumblebee ppa 3 | apt_repository: 4 | repo: 'ppa:bumblebee/stable' 5 | state: present 6 | update_cache: yes 7 | sudo: yes 8 | 9 | - name: install bumblebee 10 | apt: 11 | name: "{{ item }}" 12 | state: installed 13 | update_cache: yes 14 | with_items: 15 | - bumblebee 16 | - bumblebee-nvidia 17 | - primus 18 | - linux-headers-generic 19 | sudo: yes 20 | -------------------------------------------------------------------------------- /roles/common/tasks/chrome.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install chromium browser 3 | apt: 4 | name: chromium-browser 5 | update_cache: yes 6 | sudo: yes 7 | 8 | - name: add google repo key 9 | apt_key: 10 | url: https://dl-ssl.google.com/linux/linux_signing_key.pub 11 | state: present 12 | sudo: yes 13 | 14 | - name: install chrome stable - add to google.list 15 | lineinfile: 16 | dest: /etc/apt/sources.list.d/google.list 17 | line: "deb http://dl.google.com/linux/chrome/deb/ stable main" 18 | create: yes 19 | sudo: yes 20 | 21 | - name: install chrome stable 22 | apt: 23 | name: google-chrome-stable 24 | update_cache: yes 25 | force: yes 26 | sudo: yes 27 | -------------------------------------------------------------------------------- /roles/common/tasks/dropbox.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install dropbox - add dropbox key 3 | apt_key: 4 | keyserver: pgp.mit.edu 5 | state: present 6 | id: 5044912E 7 | sudo: yes 8 | 9 | - name: install dropbox - add to dropbox.list 10 | lineinfile: 11 | dest: /etc/apt/sources.list.d/dropbox.list 12 | line: "deb http://linux.dropbox.com/ubuntu/ trusty main" 13 | create: yes 14 | sudo: yes 15 | 16 | - name: install dropbox 17 | apt: 18 | name: dropbox 19 | update_cache: yes 20 | sudo: yes 21 | 22 | - name: install libappindicator1 23 | apt: 24 | name: libappindicator1 25 | update_cache: yes 26 | sudo: yes 27 | -------------------------------------------------------------------------------- /roles/common/tasks/font.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install source-code-pro - make temp dir 3 | file: 4 | path: "{{ ansible_env.HOME }}/setup/adobe_font" 5 | state: directory 6 | 7 | - name: install source-code-pro - download font 8 | get_url: 9 | url: https://github.com/adobe-fonts/source-code-pro/archive/1.017R.zip 10 | dest: "{{ ansible_env.HOME }}/setup/adobe_font/source_code_pro.zip" 11 | mode: 0755 12 | 13 | - name: install source-code-pro - unzip downloaded font 14 | unarchive: 15 | src: "{{ ansible_env.HOME }}/setup/adobe_font/source_code_pro.zip" 16 | dest: "{{ ansible_env.HOME }}/setup/adobe_font" 17 | 18 | - name: install source-code-pro - make fonts directory 19 | file: 20 | path: "{{ ansible_env.HOME }}/.fonts" 21 | state: directory 22 | 23 | - name: install source-code-pro - copy fonts 24 | copy: 25 | src: "{{ ansible_env.HOME }}/setup/adobe_font/source-code-pro-1.017R/OTF/" 26 | dest: "{{ ansible_env.HOME }}/.fonts" 27 | mode: 0755 28 | register: fonts_copied 29 | 30 | - name: install source-code-pro - font cache 31 | command: fc-cache -f -v 32 | sudo: yes 33 | when: fonts_copied|changed 34 | 35 | - name: install source-code-pro - set system font 36 | gconftool2: 37 | key: /apps/gnome-terminal/profiles/Default/font 38 | string: "Source Code Pro Semi-Bold 12" 39 | 40 | - name: install source-code-pro - dont use default system font in terminal 41 | gconftool2: 42 | key: /apps/gnome-terminal/profiles/Default/use_system_font 43 | bool: false 44 | -------------------------------------------------------------------------------- /roles/common/tasks/keepass2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install keepass2 3 | apt: 4 | name: keepass2 5 | update_cache: yes 6 | sudo: yes 7 | -------------------------------------------------------------------------------- /roles/common/tasks/laptop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: screen dimming - alter grub file 3 | lineinfile: 4 | dest: /etc/default/grub 5 | regexp: "^GRUB_CMDLINE_LINUX_DEFAULT=" 6 | line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1"' 7 | sudo: yes 8 | register: grubfile 9 | tags: sager 10 | 11 | - name: screen dimming - update grub 12 | command: sudo update-grub 13 | sudo: yes 14 | when: grubfile|changed 15 | tags: sager 16 | 17 | - name: keyboard colors - requirements 18 | apt: 19 | pkg: "{{ item }}" 20 | state: installed 21 | with_items: 22 | - build-essential 23 | - linux-source 24 | sudo: yes 25 | tags: sager 26 | 27 | - name: keyboard colors - Make sure setup directory exists 28 | file: 29 | path: "{{ ansible_env.HOME }}/setup" 30 | state: directory 31 | tags: sager 32 | 33 | - name: keyboard colors - checkout clevo-wmi-code 34 | git: 35 | repo: https://github.com/thunderbirdtr/clevo_backlit.git 36 | dest: "{{ ansible_env.HOME }}/setup/clevo-wmi-code" 37 | accept_hostkey: yes 38 | tags: sager 39 | 40 | - name: keyboard colors - build clevo-wmi 41 | command: make 42 | args: 43 | chdir: "{{ ansible_env.HOME }}/setup/clevo-wmi-code/clevo_wmi-0.0.1" 44 | tags: sager 45 | 46 | - name: keyboard colors - link clevo-wmi to kernel check 47 | command: cat /etc/modules 48 | sudo: yes 49 | register: running_modules 50 | tags: sager 51 | 52 | - name: keyboard colors - link clevo-wmi to kernel 53 | command: "sudo insmod {{ ansible_env.HOME }}/setup/clevo-wmi-code/clevo_wmi-0.0.1/clevo_wmi.ko" 54 | sudo: yes 55 | # when: running_modules.stdout.find('clevo_wmi') == -1 56 | tags: sager 57 | ignore_errors: True 58 | 59 | - name: keyboard colors - copy to kernel drivers 60 | copy: 61 | src: "{{ ansible_env.HOME }}/setup/clevo-wmi-code/clevo_wmi-0.0.1/clevo_wmi.ko" 62 | dest: "/lib/modules/{{ ansible_kernel }}/kernel/drivers/platform/x86/" 63 | sudo: yes 64 | tags: sager 65 | 66 | - name: keyboard colors - handle dependencies 67 | command: sudo depmod -a 68 | sudo: yes 69 | tags: sager 70 | 71 | - name: keyboard colors- add to etc/modules 72 | lineinfile: 73 | dest: /etc/modules 74 | line: clevo_wmi 75 | sudo: yes 76 | tags: sager 77 | 78 | - name: keyboard colors - copy kbbl script 79 | copy: 80 | src: keyboard-color.sh 81 | dest: "{{ ansible_env.HOME }}/keyboard-color.sh" 82 | mode: 0755 83 | tags: sager 84 | -------------------------------------------------------------------------------- /roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include: pre.yml 3 | - include: sublime.yml 4 | - include: chrome.yml 5 | - include: numix.yml 6 | - include: plank.yml 7 | - include: keepass2.yml 8 | - include: laptop.yml 9 | when: sager_laptop == true 10 | - include: variety.yml 11 | - include: font.yml 12 | - include: base16.yml 13 | - include: work.yml 14 | - include: ruby_scm_breeze.yml 15 | - include: vim.yml 16 | - include: spacemacs.yml 17 | - include: other_requirements.yml 18 | - include: dropbox.yml 19 | - include: bash_customizations.yml 20 | - include: bumblebee.yml 21 | when: bumblebee == true 22 | -------------------------------------------------------------------------------- /roles/common/tasks/numix.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install numix theme - add numix ppa 3 | apt_repository: 4 | repo: 'ppa:numix/ppa' 5 | state: present 6 | update_cache: yes 7 | sudo: yes 8 | 9 | - name: install numix theme - install circle icon theme 10 | apt: 11 | name: numix-icon-theme-circle 12 | update_cache: yes 13 | sudo: yes 14 | 15 | - name: install numix theme - install gtk theme 16 | apt: 17 | name: numix-gtk-theme 18 | update_cache: yes 19 | sudo: yes 20 | 21 | - name: install numix theme - install gnome tweak tool 22 | apt: 23 | name: gnome-tweak-tool 24 | update_cache: yes 25 | sudo: yes 26 | 27 | - name: install numix theme - set icons to circle 28 | gsettings: 29 | schema: org.gnome.desktop.interface 30 | key: icon-theme 31 | string: Numix-Circle 32 | 33 | - name: install numix theme - set gtk theme to Numix 34 | gsettings: 35 | schema: org.gnome.desktop.interface 36 | key: gtk-theme 37 | string: Numix 38 | -------------------------------------------------------------------------------- /roles/common/tasks/other_requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install shutter - gcolor2 - silversearcher-ag - vlc 3 | apt: 4 | pkg: "{{ item }}" 5 | state: installed 6 | with_items: 7 | - shutter 8 | - gcolor2 9 | - silversearcher-ag 10 | - vlc 11 | sudo: yes 12 | 13 | - name: install virtualenvwrapper 14 | pip: 15 | name: virtualenvwrapper 16 | sudo: yes 17 | 18 | - name: download fixubuntu 19 | get_url: 20 | url: https://raw.githubusercontent.com/sans-dfir/sift-files/master/fixubuntu.sh 21 | dest: "{{ ansible_env.HOME }}/setup/fixubuntu.sh" 22 | mode: 0755 23 | 24 | - name: run fixubuntu 25 | command: "{{ ansible_env.HOME }}/setup/fixubuntu.sh" 26 | sudo: true 27 | 28 | - name: enable workspaces - two horizontal 29 | gsettings: 30 | schema: org.compiz.core:/org/compiz/profiles/unity/plugins/core/ 31 | key: hsize 32 | int: 2 33 | 34 | - name: enable workspaces - two vertical 35 | gsettings: 36 | schema: org.compiz.core:/org/compiz/profiles/unity/plugins/core/ 37 | key: vsize 38 | int: 2 39 | 40 | - name: download steam 41 | get_url: 42 | url: https://steamcdn-a.akamaihd.net/client/installer/steam.deb 43 | dest: "{{ ansible_env.HOME }}/setup/steam.deb" 44 | mode: 0755 45 | 46 | - name: accept steams licencing agreement - purge 47 | command: 'echo "steam steam/purge note" | sudo debconf-set-selections' 48 | sudo: true 49 | 50 | - name: accept steams licencing agreement - licence 51 | command: 'echo "steam steam/license note" | sudo debconf-set-selections' 52 | sudo: true 53 | 54 | - name: accept steams licencing agreement - question 55 | command: 'echo "steam steam/question select I AGREE" | sudo debconf-set-selections ' 56 | sudo: true 57 | 58 | - name: install steam 59 | apt: 60 | deb: "{{ ansible_env.HOME }}/setup/steam.deb" 61 | sudo: yes 62 | -------------------------------------------------------------------------------- /roles/common/tasks/plank.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install plank - add plank ppa 3 | apt_repository: 4 | repo: 'ppa:ricotz/docky' 5 | state: present 6 | update_cache: yes 7 | sudo: yes 8 | 9 | - name: install plank 10 | apt: 11 | name: plank 12 | update_cache: yes 13 | sudo: yes 14 | 15 | - name: install plank - Make sure that the autostart directory exsists 16 | file: 17 | path: "{{ ansible_env.HOME }}/.config/autostart" 18 | state: directory 19 | 20 | - name: install plank - Make Plank autostart 21 | copy: 22 | src: plank.desktop 23 | dest: "{{ ansible_env.HOME }}/.config/autostart/plank.desktop" 24 | mode: 0755 25 | 26 | - name: gnome-terminal launcher-hide-mode 27 | dconf: 28 | key: /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 29 | int: 1 30 | -------------------------------------------------------------------------------- /roles/common/tasks/pre.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Make sure that the setup directory exsists 3 | file: 4 | path: "{{ ansible_env.HOME }}/setup" 5 | state: directory 6 | mode: 0755 7 | 8 | - name: Make sure git is installed 9 | apt: 10 | name: git 11 | update_cache: yes 12 | sudo: yes 13 | -------------------------------------------------------------------------------- /roles/common/tasks/ruby_scm_breeze.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install scm-breeze - checkout repo 3 | git: 4 | repo: https://github.com/ndbroadbent/scm_breeze.git 5 | dest: "{{ ansible_env.HOME }}/setup/scm_breeze" 6 | 7 | - name: install scm-breeze - run script 8 | command: "{{ ansible_env.HOME }}/setup/scm_breeze/install.sh" 9 | 10 | - name: remove ruby 11 | apt: 12 | name: ruby 13 | state: absent 14 | sudo: yes 15 | tags: rub 16 | 17 | - name: download rvm installer 18 | get_url: 19 | url: https://get.rvm.io 20 | dest: "{{ ansible_env.HOME }}/setup/rvm-install.sh" 21 | sudo: yes 22 | tags: ruby 23 | 24 | - name: Import GPG keys for rvm 25 | command: 'gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3' 26 | register: rvm_keys_result 27 | ignore_errors: True 28 | 29 | - name: Import GPG keys for rvm (backup) 30 | command: 'gpg --keyserver keyserver.ubuntu.com --recv-keys D39DC0E3' 31 | when: rvm_keys_result|failed 32 | 33 | - name: install rvm with ruby 34 | command: "bash {{ ansible_env.HOME }}/setup/rvm-install.sh stable --ruby" 35 | # sudo: yes 36 | tags: ruby 37 | 38 | - name: remove troublesome rvm line from .bashrc 39 | lineinfile: 40 | dest: "{{ ansible_env.HOME }}/.bashrc" 41 | state: absent 42 | regexp: '"$PATH:$HOME/.rvm/bin"' 43 | 44 | - name: remove troublesome scm_breeze line from .bashrc 45 | lineinfile: 46 | dest: "{{ ansible_env.HOME }}/.bashrc" 47 | state: absent 48 | regexp: '"/home/joseph/.scm_breeze/scm_breeze.sh"' 49 | 50 | - name: add rvm line to profile 51 | lineinfile: 52 | dest: "{{ ansible_env.HOME }}/.bashrc" 53 | state: present 54 | line: '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' 55 | 56 | - name: Install sass gem 57 | shell: "{{ ansible_env.HOME }}/.rvm/bin/rvm all do gem install sass" 58 | sudo: yes 59 | -------------------------------------------------------------------------------- /roles/common/tasks/spacemacs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: download emacs source 3 | get_url: 4 | url: "{{ emacs_url }}" 5 | dest: "{{ ansible_env.HOME }}/setup/emacs.tar.gz" 6 | mode: 0755 7 | 8 | - name: make sure the emacs source directory exists 9 | file: 10 | path: "{{ ansible_env.HOME }}/setup/emacs_source" 11 | state: directory 12 | mode: 0777 13 | sudo: yes 14 | 15 | - name: unzip emacs source 16 | unarchive: 17 | src: "{{ ansible_env.HOME }}/setup/emacs.tar.gz" 18 | dest: "{{ ansible_env.HOME }}/setup/emacs_source" 19 | 20 | - name: install spacemacs dependencies 21 | apt: 22 | name: "build-essential" 23 | update_cache: yes 24 | sudo: yes 25 | 26 | - name: install emacs dependencies 27 | apt: 28 | name: emacs24 29 | update_cache: yes 30 | state: "build-dep" 31 | sudo: yes 32 | 33 | - name: configure 34 | command: ./configure 35 | args: 36 | chdir: "{{ ansible_env.HOME }}/setup/emacs_source/emacs-24.4/" 37 | 38 | - name: make 39 | command: make 40 | args: 41 | chdir: "{{ ansible_env.HOME }}/setup/emacs_source/emacs-24.4/" 42 | 43 | - name: make install 44 | command: make install 45 | args: 46 | chdir: "{{ ansible_env.HOME }}/setup/emacs_source/emacs-24.4/" 47 | sudo: yes 48 | 49 | - name: download spacemacs 50 | git: 51 | repo: https://github.com/syl20bnr/spacemacs 52 | dest: "{{ ansible_env.HOME }}/.emacs.d" 53 | 54 | - name: spacemacs config 55 | copy: 56 | src: .spacemacs 57 | dest: "{{ ansible_env.HOME }}/.spacemacs" 58 | mode: 0755 59 | -------------------------------------------------------------------------------- /roles/common/tasks/sublime.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install sublime text - add sublime text ppa 3 | apt_repository: 4 | repo: 'ppa:webupd8team/sublime-text-3' 5 | state: present 6 | update_cache: yes 7 | sudo: yes 8 | 9 | - name: install sublime text 10 | apt: 11 | name: sublime-text-installer 12 | update_cache: yes 13 | sudo: yes 14 | -------------------------------------------------------------------------------- /roles/common/tasks/variety.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install variety - add ppa 3 | apt_repository: 4 | repo: 'ppa:peterlevi/ppa' 5 | state: present 6 | update_cache: yes 7 | sudo: yes 8 | 9 | - name: install variety 10 | apt: 11 | name: variety 12 | update_cache: yes 13 | sudo: yes 14 | 15 | - name: install variety - Make variety autostart 16 | copy: 17 | src: variety.desktop 18 | dest: "{{ ansible_env.HOME }}/.config/autostart/variety.desktop" 19 | mode: 0755 20 | 21 | - name: install variety - make sure the varienty config directory exists 22 | file: 23 | path: "{{ ansible_env.HOME }}/.config/variety" 24 | state: directory 25 | 26 | - name: install variety - Set variety config 27 | copy: 28 | src: variety.conf 29 | dest: "{{ ansible_env.HOME }}/.config/variety/variety.conf" 30 | mode: 0755 31 | -------------------------------------------------------------------------------- /roles/common/tasks/vim.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: horse vim - download vim 3 | apt: 4 | name: vim 5 | update_cache: yes 6 | sudo: yes 7 | 8 | - name: horse vim - make sure vim automload directory exists 9 | file: 10 | path: "{{ ansible_env.HOME }}/.vim/autoload" 11 | state: directory 12 | mode: 0777 13 | sudo: yes 14 | 15 | - name: horse vim - make sure nvim config directory exists 16 | file: 17 | path: "{{ ansible_env.HOME }}/.local/share/nvim/site/autoload" 18 | state: directory 19 | mode: 0777 20 | sudo: yes 21 | 22 | - name: horse vim - get vim-plug 23 | get_url: 24 | url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" 25 | dest: "{{ ansible_env.HOME }}/.vim/autoload/plug.vim" 26 | mode: 0755 27 | 28 | - name: horse vim - get vim-plug for neovim 29 | get_url: 30 | url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" 31 | dest: "{{ ansible_env.HOME }}/.local/share/nvim/site/autoload/plug.vim" 32 | mode: 0755 33 | 34 | - name: horse vim - checkout repo 35 | git: 36 | repo: https://github.com/JBKahn/horse.vim.git 37 | dest: "{{ ansible_env.HOME }}/horse.vim" 38 | 39 | - name: horse vim - copy .vimrc file 40 | file: 41 | src: "{{ ansible_env.HOME }}/horse.vim/.vimrc" 42 | dest: "{{ ansible_env.HOME }}/.vimrc" 43 | mode: 0755 44 | state: link 45 | 46 | - name: horse vim - copy .vimrc.bundles file 47 | file: 48 | src: "{{ ansible_env.HOME }}/horse.vim/.vimrc.bundles" 49 | dest: "{{ ansible_env.HOME }}/.vimrc.bundles" 50 | mode: 0755 51 | state: link 52 | 53 | - name: horse vim - make sure vim colors directory exists 54 | file: 55 | path: "{{ ansible_env.HOME }}/.vim/colors" 56 | state: directory 57 | mode: 0777 58 | sudo: yes 59 | 60 | - name: horse vim - copy color to config to avoid error 61 | copy: 62 | src: base16-monokai.vim 63 | dest: "{{ ansible_env.HOME }}/.vim/colors/base16-monokai.vim" 64 | mode: 0755 65 | 66 | # Commented out since Neovim bug causes it not to close. 67 | # - name: horse vim - run PlugInstall 68 | # command: vim +PlugInstall +qall 69 | 70 | - name: horse vim - add NeoVim ppa 71 | apt_repository: 72 | repo: 'ppa:neovim-ppa/unstable' 73 | state: present 74 | update_cache: yes 75 | sudo: yes 76 | 77 | - name: horse vim - install neovim 78 | apt: 79 | name: neovim 80 | update_cache: yes 81 | sudo: yes 82 | 83 | - name: horse vim - make sure nvim config directory exists 84 | file: 85 | path: "{{ ansible_env.HOME }}/.config/nvim" 86 | state: directory 87 | mode: 0777 88 | sudo: yes 89 | 90 | - name: horse vim - symlink nvimrc 91 | file: 92 | src: "{{ ansible_env.HOME }}/horse.vim/.vimrc" 93 | dest: "{{ ansible_env.HOME }}/.config/nvim/init.vim" 94 | mode: 0755 95 | state: link 96 | 97 | - name: horse vim - symlink nvim 98 | file: 99 | src: "{{ ansible_env.HOME }}/.vim" 100 | dest: "{{ ansible_env.HOME }}/.nvim" 101 | mode: 0755 102 | state: link 103 | -------------------------------------------------------------------------------- /roles/common/tasks/work.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: download vagrant .deb package 3 | get_url: 4 | url: "{{ vagrant_url }}" 5 | dest: "{{ ansible_env.HOME }}/setup/vagrant.deb" 6 | mode: 0755 7 | 8 | - name: get currently installed vagrant version 9 | command: "vagrant --version" 10 | sudo: yes 11 | register: result 12 | ignore_errors: True 13 | always_run: True 14 | 15 | - name: install vagrant 16 | apt: 17 | deb: "{{ ansible_env.HOME }}/setup/vagrant.deb" 18 | sudo: yes 19 | when: "result.rc !=0 or 'A later version is already installed' in result.stderr" 20 | 21 | - name: download virtualbox .deb package 22 | get_url: 23 | url: "{{ virtualbox_url }}" 24 | dest: "{{ ansible_env.HOME }}/setup/virtualbox.deb" 25 | mode: 0755 26 | 27 | - name: get currently installed virtualbox version 28 | command: "vboxmanage --version" 29 | sudo: yes 30 | register: result 31 | ignore_errors: True 32 | always_run: True 33 | 34 | - name: install virtualbox 35 | apt: 36 | deb: "{{ ansible_env.HOME }}/setup/virtualbox.deb" 37 | sudo: yes 38 | when: "result.rc !=0" 39 | 40 | - name: install wave dependencies 41 | apt: 42 | name: "{{ item }}" 43 | state: installed 44 | update_cache: yes 45 | with_items: 46 | - python-pip 47 | - curl 48 | - nfs-kernel-server 49 | - nfs-common 50 | - rpcbind 51 | - tmux 52 | - libjpeg-dev 53 | - libfreetype6-dev 54 | - zlib1g-dev 55 | - libpng12-dev 56 | - python-dev 57 | - libpq-dev 58 | - python-dev 59 | sudo: yes 60 | 61 | - name: download nvm source 62 | git: 63 | repo: "https://github.com/creationix/nvm.git" 64 | dest: "{{ ansible_env.HOME }}/setup/.nvm" 65 | version: v0.26.1 66 | tags: nodejs 67 | 68 | - name: install node with nvm 69 | shell: "source {{ ansible_env.HOME }}/setup/.nvm/nvm.sh && nvm install 5.3.0 && nvm alias default v5.3.0" 70 | args: 71 | chdir: "{{ ansible_env.HOME }}/setup/.nvm" 72 | executable: /bin/bash 73 | tags: nodejs 74 | 75 | - name: download npm installer 76 | get_url: 77 | url: https://www.npmjs.com/install.sh 78 | dest: /tmp/npm-install.sh 79 | validate_certs: false 80 | tags: nodejs 81 | 82 | - name: install npm 83 | shell: "source {{ ansible_env.HOME }}/setup/.nvm/nvm.sh && source /tmp/npm-install.sh" 84 | args: 85 | chdir: "{{ ansible_env.HOME }}/setup/.nvm" 86 | executable: /bin/bash 87 | tags: nodejs 88 | 89 | - name: install global nodejs packages 90 | npm: 91 | name: "{{ item.name }}" 92 | version: "{{ item.version|default('') }}" 93 | state: present 94 | global: yes 95 | tags: nodejs 96 | with_items: 97 | - {name: 'bower'} 98 | - {name: 'coffee-script', version: '1.7.1'} 99 | - {name: 'grunt-cli'} 100 | - {name: 'less'} 101 | - {name: 'jshint'} 102 | - {name: 'coffee-jshint'} 103 | - {name: 'localtunnel'} 104 | 105 | - name: install tmuxp 106 | pip: 107 | name: tmuxp 108 | sudo: yes 109 | 110 | - name: copy tmuxp config 111 | copy: 112 | src: .tmux.conf 113 | dest: "{{ ansible_env.HOME }}/.tmux.conf" 114 | mode: 0755 115 | 116 | - name: install ipython 117 | pip: 118 | name: ipython 119 | sudo: yes 120 | -------------------------------------------------------------------------------- /roles/common/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sager_laptop: false 3 | vagrant_url: https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb 4 | virtualbox_url: http://download.virtualbox.org/virtualbox/4.3.22/virtualbox-4.3_4.3.22-98236~Ubuntu~raring_amd64.deb 5 | bumblebee: false 6 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | sudo apt-get install python-setuptools aptitude git python-dev libxml2-dev libxslt-dev 2 | 3 | sudo easy_install pip 4 | 5 | cd ~ 6 | mkdir -p setup 7 | cd setup 8 | git clone https://github.com/JBKahn/provisioning-local.git 9 | cd provisioning-local 10 | 11 | sudo pip install -r requirements.txt 12 | 13 | echo -e "please make sure to edit the config.json file followed by [ENTER]" && read USELESS_VAR 14 | 15 | ansible-playbook setup.yml -i HOSTS --ask-sudo-pass --module-path ./ansible_modules --extra-vars "@config.json" 16 | 17 | dropbox start -i > /dev/null 2>&1 & 18 | /opt/extras.ubuntu.com/variety/bin/variety > /dev/null 2>&1 & 19 | plank > /dev/null 2>&1 & 20 | steam > /dev/null 2>&1 & 21 | emacs > /dev/null 2>&1 & 22 | 23 | source ~/.bashrc 24 | exit 0 25 | -------------------------------------------------------------------------------- /setup.yml: -------------------------------------------------------------------------------- 1 | - name: a playbook to setup my local machine with my basic customizations 2 | hosts: local 3 | connection: local 4 | roles: 5 | - common 6 | --------------------------------------------------------------------------------