Giter Club home page Giter Club logo

mrcotter_dotfiles's Introduction

mrcotter_dotfiles

Configuration dot files for OS X, Homebrew, MPV, etc. For 🍼Developers.

Screenshot of Terminal

Dotfiles might be the most important files on any Unix, Linux or Mac system. They backup, restore, and sync the prefs and settings for your system and apps.

It is convenient that adding dotfiles to GitHub, and I do encourage you to do the same. Thanks to the community, I learned from some previous works and made my own version within two days.

Well, let's get started and see how to use my dotfiles.

First things first

  • Install Xcode.
  • Install Command Line Tools for Xcode in Terminal: xcode-select --install.
  • Install the latest version of XQuartz for your OS. Many projects may require the up-to-date libraries.
  • For Java development, Java SE Development Kit is required. You can install both Apple's Java 6 and Oracle's Java 8.

Reminder: Java 6 is now deprecated and not supported, and the current OS X El Capitan GM has issues installing Java 6 and running application that requires the legacy Java version.

Download dotfiles

- Using Git

You can clone my repository wherever you want (e.g. ~/Documents/dotfiles). Don't execute the bootstrap script right now because several settings in my dotfiles required some other dependencies. We are gonna install them via Homebrew in the next step.

git clone https://github.com/mrcotter/mrcotter_dotfiles.git

To update later on, just run the command below in the folder of the repository:

git pull origin master

Install Homebrew

After that, you may want to install some common Homebrew formulae as many developers do. Homebrew helps you to install and manage a host of command-line tools.

cd homebrew
./brew_install.sh
./brew_recipes.sh

In the recipes script, you can simply comment out or delete those fomulae that you don't want to install. But beware, there are also configurations in dotfiles that relate to some of them. Make sure you understand the files and edit the fomulae properly. For instance, GNU core utilities, Bash, Ant, Maven and Jenv.

- Update Bash Shell

From the recipes, Homebrew installed Bash 4 to /usr/local/opt/bash/bin. Using the following commands, we’ll initiate a shell as the root user, append new shell path to a file of whitelisted system shells, and then change the system shell globally.

sudo echo /usr/local/opt/bash/bin/bash >> /etc/shells

Enter

chsh

Change

Shell: /bin/bash

To

Shell: /usr/local/opt/bash/bin/bash

:wq to save and quit, restart the Terminal and then enter:

echo $BASH_VERSION

The output result should be 4.3.33(1)-release or above. Congratulations! You can now use some new commands in the Terminal, for example:

echo -e '\e[0;33;1mHello\e[0m World'

Install Dotfiles

To install, cd into your local dotfiles repository and then:

source bootstrap.sh

To update form my repository, simply run the command above again. The bootstrapper script will pull in the latest version and copy the files to your local folder.

- About $PATH

If there is a need to extend or modify $PATH, locate to ~/.path. This is the one which is sourced along with the other files. Like this:

sudo nano ~/.path

- Solarized Theme for iTerm2 / Terminal

I use a custom bash prompt based on the Solarized color palette. It's quite common to install iTerm2 (a cool Terminal replacement) and import Solarized Dark.itermcolors (The files are in the folder solarized_theme, Solarized Dark xterm-256color.terminal is for build-in Terminal).

- Powerline-shell for Bash

Powerline-shell is a python daemon that supplies a consistent, nicely formated status line information that can be used in any terminal shell such as Bash, ZSH and Fish. To install, cd into powerline-shell directory and then:

cd powerline-shell
./install.sh

The script will do all the jobs, including install the patched fonts. After that, you just need to select one of these fonts in the iTerm2/terminal preferences. Personally, I use the font Droid Sans Mono for Powerline.

Setting up OS X defaults

You may want to set some sensible OS X defaults too:

cd osx_defaults
./.osx

Install MPV

MPV Screenshot

MPV is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more. I find MPV the best video player so far on Mac for its high quality video output and better support on different formats of subtitles compare to Movist.

MPV is essentially a CLI media player for its current progress. It lacks of full GUI mode to control or adjust settings other than the OSC (On Screen Controller). All other settings must be configured via command lines, or user can put user-specifuc configuration files and lua scripts in ~/.config/mpv.

The script in mpv will install MPV via Homebrew as well as setting it up using my configuration files and two other lua scripts. In addition, duti will be installed to select MPV the default application for the most common video types.

cd mpv
./install.sh

- configuation files and lua scripts in ~/.config/mpv:

  • mpv.conf - The config file is read per-user. Most options from man page can be put into the configuration file by dropping the preceding --. See full documentation here.
  • input.conf - User-defined key bindings for mpv.
  • lua-settings/osc.conf - The config file can do limited configuation to the OSC. For instance, changing the layout for the OSC, avaiable values are: box, slimbox, bottombar and topbar.
  • scripts/autoload.lua - Automatically load playlist entries before and after the currently playing file, by scanning the directory.
  • scripts/vo_battery.lua - Choose the vo based on if the laptop is on battery or not. For instance, when on ac power, the vo is set to opengl-hq:interpolation:icc-profile-auto:icc-cache=~/.config/mpv/tmp/icc-cache:blend-subtitles=yes; when on battery, the vo is set to opengl:icc-profile-auto.

Reminder: opengl-hq should be only used when your laptop has Intel HD 4000 graphics or above. Otherwise, stick to opengl for the vo. When equipped with a dedicated video card, you could try adding interpolation to the vo to reduce stuttering caused by mismatches in the video fps and display refresh rate.

Feedback

Suggestions/improvements welcome!

Thanks to…

mrcotter_dotfiles's People

Contributors

mrcotter avatar

Watchers

Magic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.