Git Product home page Git Product logo

dotfiles's Introduction

dotfiles

My dotfiles compatible with bash and zsh

Introduction

Logic behind bash dotfiles, from this example, .bashrc has to be sourced from .bash_profile

> ssh Starli0n@localhost
> .bash_profile

> /bin/bash
> .bashrc

Following this logic, I created a .starrc dotfile which is sourced from .bashrc or .zshhrc so that environment is shared with both.

The .bash_profile dotfile only includes .profile and .bashrc.

The .profile dotfile does nothing specific but I prefer to keep it into source control in case an installer changes it.

Prerequisite

Before Installation

$ cd
$ mkdir -p $HOME/src/github.com/Starli0n
$ cd $HOME/src/github.com/Starli0n
$ git clone https://github.com/Starli0n/dotfiles.git
$ cd dotfiles

Assuming the command above was followed, the default source directory is set to

  • $SRC_DIR = $HOME\src (parent of parent of parent of this repository)

The folder src can be changed to something like Develop/Sources therefore the variable $SRC_DIR will be computed as a consequence.

Alternatively, the variable $SRC_DIR could be set manually with export SRC_DIR=path-to-source before installation if the architecture $SRC_DIR/organization/user is not respected.

macOS

Installation

  • Linux or macOS
    • make all
  • Ubuntu
    • make ubuntu
  • Windows (Check $HOME before)
    • make win

Add some specific into the .extra dotfile like proxy etc...

# Add here extra paths
export PATH:$PATH:$EXTRA_PATH

root(){
    if [ -f $HOME/.shell_zsh_sesu.sh ]; then
        source $HOME/.shell_zsh_sesu.sh
    fi
}

proxy () {
	echo -n "Login:"
	read -s PROXY_USER
	echo
	echo -n "Password:"
	read -s PROXY_PASS
	echo
	export http_proxy=http://$PROXY_USER:$PROXY_PASS@proxy-url:8080
	export https_proxy=http://$PROXY_USER:$PROXY_PASS@proxy-url:8080
	export HTTP_PROXY=http://$PROXY_USER:$PROXY_PASS@proxy-url:8080
	export HTTPS_PROXY=http://$PROXY_USER:$PROXY_PASS@proxy-url:8080
	export no_proxy="localhost,127.0.0.1,localaddress,.localdomain,127.*,192.168.*,172.*,10.*"
	export NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain,127.*,192.168.*,172.*,10.*"
	export PIP_INDEX_URL=https://$PROXY_USER:$PROXY_PASS@repository.com
	export npm_config_proxy=$http_proxy
	export npm_config_https_proxy=$https_proxy
}

# On a headless server => make headless
export EDITOR='vim'
export GIT_EDITOR=$EDITOR
export GIT_NO_GUI=--git-no-gui # Used in ~/gitools.sh for difftool
export GIT_OPEN_URL=echo

The .extra dotfile enables to override default variables and is not tracked.

Git

The variable $GIT_EDITOR define the editor used by git.

Requirements for git tools:

  • bcomp should be defined for Linux or macOS (ex: ln -s /usr/bin/bcompare $APPS/bin/bcomp)
  • $WINMERGE_BIN should be defined in .extra dotfile (C:\Program Files (x86)\WinMerge\WinMergeU.exe)

The variable $GIT_OPEN_URL define the way to open the URL git:

  • open on Linux
  • start on Windows
  • echo on a headless server (Override the variable in the .extra dotfile)

Ubuntu

Keyboard Shortcuts

Custom Shortcuts

Activate Firefox
wmctrl -x -a Navigator.Firefox
Super + F

Activate Gedit
wmctrl -x -a org.gnome.gedit.Org.gnome.gedit
Ctrl + <

Activate Nautilus
wmctrl -x -a org.gnome.Nautilus.Org.gnome.Nautilus
Super + E

Activate Terminal
wmctrl -x -a gnome-terminal-server.Gnome-terminal
Ctrl + ²

List apps: wmctrl -lx

Install Docker (TODO)

dotfiles's People

Contributors

starli0n avatar

Watchers

 avatar  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.