aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-15 12:53:02 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-15 12:53:02 +0200
commit8bf3a3166a147adeee5094cfcfc8646ba2e96803 (patch)
treefe1e62dcded75767003cefe04548a4381762258f
parent9279d013bb1ce88860c560a04dbc926ce55f3093 (diff)
parente9530ee0b4e9706fb0fcb82fa3cb87d57a5b540d (diff)
downloaddotfiles-8bf3a3166a147adeee5094cfcfc8646ba2e96803.tar.gz
dotfiles-8bf3a3166a147adeee5094cfcfc8646ba2e96803.tar.bz2
dotfiles-8bf3a3166a147adeee5094cfcfc8646ba2e96803.zip
Merge branch 'master' into carbon
-rw-r--r--.alacritty.yml43
-rw-r--r--.bashrc88
-rw-r--r--.ghci2
-rw-r--r--.pluggins.vim34
-rw-r--r--.vimrc190
-rw-r--r--.zsh_aliases35
-rw-r--r--.zshrc21
-rw-r--r--grep.vim23
-rwxr-xr-xinstall.sh44
-rw-r--r--redshift.conf2
-rw-r--r--xmonad.hs28
11 files changed, 348 insertions, 162 deletions
diff --git a/.alacritty.yml b/.alacritty.yml
new file mode 100644
index 0000000..ddfce65
--- /dev/null
+++ b/.alacritty.yml
@@ -0,0 +1,43 @@
+#############
+# alacritty #
+#############
+
+# font
+font:
+ size: 9
+ normal:
+ family: Fira Code
+
+
+ offset:
+ x: 0
+ y: 0
+
+# colorscheme (Dracula)
+colors:
+ # Default colors
+ primary:
+ background: '#282a36'
+ foreground: '#f8f8f2'
+
+ # Normal colors
+ normal:
+ black: '#000000'
+ red: '#ff5555'
+ green: '#50fa7b'
+ yellow: '#f1fa8c'
+ blue: '#caa9fa'
+ magenta: '#ff79c6'
+ cyan: '#8be9fd'
+ white: '#bfbfbf'
+
+ # Bright colors
+ bright:
+ black: '#575b70'
+ red: '#ff6e67'
+ green: '#5af78e'
+ yellow: '#f4f99d'
+ blue: '#caa9fa'
+ magenta: '#ff92d0'
+ cyan: '#9aedfe'
+ white: '#e6e6e6'
diff --git a/.bashrc b/.bashrc
index 9f2f3d0..a7c7c06 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,85 +1,12 @@
-# don't put duplicate lines or lines starting with space in the history.
-# See bash(1) for more options
-HISTCONTROL=ignoreboth
-
-# append to the history file, don't overwrite it
-shopt -s histappend
-
-# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
-HISTSIZE=1000
-HISTFILESIZE=2000
-
-# check the window size after each command and, if necessary,
-# update the values of LINES and COLUMNS.
-shopt -s checkwinsize
-
-# set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
- debian_chroot=$(cat /etc/debian_chroot)
-fi
-
-# set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
- xterm-color|*-256color) color_prompt=yes;;
-esac
-
-if [ -n "$force_color_prompt" ]; then
- if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
- # We have color support; assume it's compliant with Ecma-48
- # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
- # a case would tend to support setf rather than setaf.)
- color_prompt=yes
- else
- color_prompt=
- fi
-fi
-
-if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
-else
- PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
-fi
-unset color_prompt force_color_prompt
-
-# If this is an xterm set the title to user@host:dir
-case "$TERM" in
-xterm*|rxvt*)
- PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
- ;;
-*)
- ;;
-esac
-
-# enable color support of ls and also add handy aliases
-if [ -x /usr/bin/dircolors ]; then
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
- alias ls='ls --color=auto'
- alias dir='dir --color=auto'
- alias vdir='vdir --color=auto'
-
- alias grep='grep --color=auto'
- alias fgrep='fgrep --color=auto'
- alias egrep='egrep --color=auto'
-fi
+###########
+# .bashrc #
+###########
+alias ls='ls --color=auto'
+alias grep='grep --color=auto'
alias ll='ls -l'
alias la='ls -A'
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
-fi
-
-# enable programmable completion features (you don't need to enable
-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
-# sources /etc/bash.bashrc).
-if ! shopt -oq posix; then
- if [ -f /usr/share/bash-completion/bash_completion ]; then
- . /usr/share/bash-completion/bash_completion
- elif [ -f /etc/bash_completion ]; then
- . /etc/bash_completion
- fi
-fi
-
# adding superuser bin to PATH
export PATH="/sbin:$PATH"
@@ -94,9 +21,6 @@ export LESS_TERMCAP_us=$'\e[1;4;31m'
export PS1="\n\[$(tput bold)$(tput setaf 2)\]\w\n\[$(tput setaf 1)\]❯ \[$( tput sgr0)\]"
-# node alias
-alias node="nodejs"
-
-# set XDG stuff
+# set XDG paths
export XDG_CONFIG_HOME="/home/charles/.config/"
export XDG_DATA_HOME="/home/charles/.data/"
diff --git a/.ghci b/.ghci
index ec73138..31f559e 100644
--- a/.ghci
+++ b/.ghci
@@ -1 +1 @@
-:set prompt λ>
+:set prompt "λ "
diff --git a/.pluggins.vim b/.pluggins.vim
index 18cefbe..8ced0a6 100644
--- a/.pluggins.vim
+++ b/.pluggins.vim
@@ -1,13 +1,25 @@
-" plugins
+""""""""""""""""
+" vim pluggins "
+""""""""""""""""
+
call plug#begin()
- Plug 'dracula/vim', {'as': 'dracula' } " theme
- Plug 'ctrlpvim/ctrlp.vim' " Ctrl-P similar to vsc
- Plug 'tpope/vim-eunuch' " basic unix command in vim
- Plug 'tomtom/tcomment_vim' " mininal commenter
- Plug 'itchyny/lightline.vim' " minimal status bar
-
- " bloat??
- Plug 'romainl/vim-cool' " disable highlight after search
- Plug 'justinmk/vim-syntax-extra' " better syntax highlight
- Plug 'sheerun/vim-polyglot' " better syntax highlight
+ Plug 'ctrlpvim/ctrlp.vim' " Ctrl-P similar to vsc
+ Plug 'tpope/vim-eunuch' " basic unix command in vim
+ Plug 'tomtom/tcomment_vim' " mininal commenter
+ Plug 'itchyny/lightline.vim' " minimal status bar
+ Plug 'HappyTramp/vim-syntax-extra' " syntax highlight of C operators
+ Plug 'romainl/vim-cool' " disable highlight after search
+ Plug 'tikhomirov/vim-glsl' " glsl hightlight
+
+ " s19 at home
+ Plug 'pbondoer/vim-42header' " 42 header
+
+ " themes
+ " Plug 'joshdick/onedark.vim' " onedark
+ " Plug 'dracula/vim', {'as': 'vim'} " dracula
+ Plug 'altercation/vim-colors-solarized' " solarized
+
+ " intresting but not used
+ " Plug 'sheerun/vim-polyglot' " better syntax highlight
+ " Plug 'unblevable/quick-scope' " highlight first char to jump to word
call plug#end()
diff --git a/.vimrc b/.vimrc
index 212ad31..ac7d010 100644
--- a/.vimrc
+++ b/.vimrc
@@ -2,80 +2,117 @@
" vimrc "
""""""""""
-" load pluggins
+" load pluggins {{{
source $HOME/dotfiles/.pluggins.vim
+" }}}
-" common
+"""""""""""
+" options "
+"""""""""""
+
+" common {{{
let mapleader = ' ' " set leader key to space
let maplocalleader = '-' " set file local leader key to backslash
set nocompatible " not compatible with vi
set number " line number
-set relativenumber " line number relative to cursor
+" set relativenumber " line number relative to cursor
set numberwidth=1 " line numbers gutter autowidth
set cursorline " highlight current line
set noshowmatch " dont jump to pair bracket
set autoread " reload files when changes happen outside vim
+set autowrite " auto write buf on certain events
set hidden " keep change in buffer when quitting window
set noswapfile " disable swap files
set scrolloff=2 " line padding when scrolling
set textwidth=89 " when line wrap occurs
set encoding=utf-8 " utf-8 encoding
+set formatoptions-=t " do not auto break line > 89 character
filetype plugin indent on " allow to add specific rules for certain type of file
+" }}}
-" browse list with tab
+" browse list with tab {{{
set wildmode=longest,list,full
set wildmenu " tab to cycle through completion options
set path+=** " recursive :find
+"}}}
-" intuitif split opening
+" intuitif split opening {{{
set splitbelow
set splitright
-set fcs+=vert:\ " no split separator
+set fcs+=vert:│ " split separator
+" }}}
-" tab
+" tab {{{
set expandtab " tab to space
set tabstop=4 " tab size
set shiftwidth=4
set smarttab
set autoindent
set smartindent
+" }}}
-" file search
+" file search {{{
set ignorecase " case insensitive
set smartcase
set hlsearch " match highlight
set incsearch
+" }}}
-" status
+" status {{{
set laststatus=2 " always a statusline (all window)
set showcmd " show current partial command in the bottom right
set noshowmode " dont show current mode (i.e --INSERT--)
+" }}}
-" fold
+" fold {{{
set foldmethod=indent " create fold based on the text indent
-
-" ctrlp pluggin
-" directory to ignore when searching in file tree
-set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*
-" ctrlp ignore all stuff in the .gitignore
-let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
-
-" colorscheme
-let g:dracula_colorterm = 0 " actually dark background
-colorscheme dracula
+set nofoldenable " not folded by default
+" }}}
+
+"""""""""""""""
+" colorscheme "
+"""""""""""""""
+
+" one {{{
+" let g:onedark_terminal_italics=1
+" colorscheme onedark
+" }}}
+" dracula {{{
+" let g:dracula_bold = 1
+" let g:dracula_italic = 1
+" let g:dracula_colorterm = 0
+" colorscheme dracula
+" }}}
+" solarized {{{
+set t_Co=16
+let g:solarized_termcolors=16
+let g:solarized_visibility='low' " visibility of invisible chars with set list
+set background=dark
+colorscheme solarized
+" }}}
+" lightline {{{
let g:lightline = {}
-let g:lightline.colorscheme = 'dracula' " lightline theme to onedark
+let g:lightline.colorscheme = 'solarized' " lightline theme to solarized
+" let g:lightline.colorscheme = 'jellybeans' " lightline theme to onedark
+" }}}
""""""""""""
" mappings "
""""""""""""
-" split navigation
+" split navigation {{{
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
-
+" nnoremap <C-S-J> <C-W><S-J>
+" nnoremap <C-S-K> <C-W><S-K>
+" nnoremap <C-S-L> <C-W><S-L>
+" nnoremap <C-S-H> <C-W><S-H>
+nnoremap <leader>s= <C-W>=
+" }}}
+
+" common {{{
" 'Y' yank to the end of the line
noremap Y y$
" solves annoying delay went exiting insert mode
@@ -98,34 +135,113 @@ nnoremap ) 10j
" tag nagigation
nnoremap <leader>] <C-]>
nnoremap <leader>t <C-t>
-" buffer navigation
+" }}}
+
+" buffer navigation {{{
nnoremap <leader>n :bn<CR>
nnoremap <leader>p :bp<CR>
nnoremap <leader><TAB> :b#<CR>
nnoremap <leader>l :ls<CR>
-" file manipulation with leader
-nnoremap <leader>w :w<CR>
-nnoremap <leader>x :x<CR>
+" }}}
-" open vimrc in split
+" vimrc {{{
nnoremap <leader>rc :vsplit $MYVIMRC<cr>
-" source vimrc
nnoremap <leader>src :source $MYVIMRC<cr>
+" }}}
-" file toggle
-nnoremap <leader>z zi
-
+" c {{{
" create c function body from prototype
-nnoremap gcf A<BS><CR>{<CR><CR>}<ESC>
+nnoremap gcf A<BS><CR>{<CR><CR>}<ESC>j
+
+" initialise a school header file
+function PutHeaderBoilerPlate()
+ let l:filename = join(split(toupper(expand('%:t')), '\.'), "_")
+ " echom l:filename
+ call append(12, "#ifndef " . l:filename)
+ call append(13, "# define " . l:filename)
+ call append(15, "#endif")
+endfunction
+nnoremap gch :Stdheader<CR>:call PutHeaderBoilerPlate()<CR>
" put semicolon at the end of line
nnoremap <leader>; mqA;<ESC>`q
-
+" doxygen format comments
+autocmd Filetype c setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/
+autocmd Filetype cpp setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/
+" }}}
+
+" cpp {{{
+" Put Coplien Form boilerplate class
+function PutCoplienFormFunc(name)
+ let l:default_constructor = a:name . "();\n"
+ let l:copy_constructor = a:name . "(const " . a:name . "& other);\n"
+ let l:copy_operator = a:name . "& operator=(const " . a:name . "& other);\n"
+ let l:destructor = "~" . a:name . "();\n"
+
+ execute "normal iclass " . a:name . "\n{\npublic:\n" . l:default_constructor . l:copy_constructor . l:copy_operator . l:destructor . "\nprivate:\n};\n"
+ execute "normal <2{"
+endfunction
+" Put Coplien Form boilerplate according to filename
+command! PutCoplienFormFile call PutCoplienFormFunc(split(expand('%:t'), '\.')[0])
+command! -nargs=1 PutCoplienForm call PutCoplienFormFunc("<args>")
+" }}}
+
+" quickfix window toggle {{{
+nnoremap <leader>qt :call QuickfixToggle()<CR>
+nnoremap <leader>qn :cnext <CR>
+nnoremap <leader>qp :cprevious <CR>
+let g:quickfix_is_open = 0
+if !exists('*QuickfixToggle')
+ function QuickfixToggle()
+ if g:quickfix_is_open
+ cclose
+ let g:quickfix_is_open = 0
+ else
+ copen
+ let g:quickfix_is_open = 1
+ endif
+ endfunction
+endif
+" }}}
+
+" make {{{
+nnoremap <leader>m :make all <CR>
+" }}}
+
+" hook {{{
" remove trailing white space on save
autocmd BufWritePre * %s/\s\+$//e
+" }}}
-" initialise buf for fold toggle
-autocmd BufReadPre * :normal zMzi
-
+" filetype {{{
" real tab in c file for school projects
+autocmd BufReadPre,BufNewFile *.h,*.c set filetype=c
autocmd Filetype c setlocal noexpandtab
+" std::cout << ... << std::endl; shortcut
+autocmd Filetype cpp nnoremap <leader>cout istd::cout << << std::endl;<ESC>2F<hi
+" vim fold method to marker
+autocmd Filetype vim setlocal foldmethod=marker
+" }}}
+
+""""""""""""
+" pluggins "
+""""""""""""
+
+" ctrlp {{{
+" directory to ignore when searching in file tree
+set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*
+" ctrlp ignore all stuff in the .gitignore
+let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
+let g:ctrlp_working_path_mode = 'rw'
+" }}}
+
+" quick-scope {{{
+let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
+" }}}
+
+" man-plugin {{{
+runtime! ftplugin/man.vim
+let g:ft_man_open_mode = 'vert' " open in a vertical split
+let g:ft_man_no_sect_fallback = 2 " if page specified fallback to page 2 (syscall pages)
+" autocmd Filetype man unmap <buffer> q: hmmmm??
+" }}}
diff --git a/.zsh_aliases b/.zsh_aliases
index 1fe984a..676940a 100644
--- a/.zsh_aliases
+++ b/.zsh_aliases
@@ -18,7 +18,7 @@ alias sudo="sudo " # enable color (the search for aliases continues)
# ls
alias ll="ls -lFh"
alias la="ls -a"
-alias lla="ls -al"
+alias lla="ls -alh"
alias lss="ls -Ssh"
# tree
@@ -29,9 +29,17 @@ alias t3="tree -L 3"
alias treeI="tree -I '__pycache__' -I '*.o' -I vendor"
# man
-alias m="man"
-alias m2="man 2"
-alias m3="man 3"
+alias ma="man"
+alias ma1="man 1"
+alias ma2="man 2"
+alias ma3="man 3"
+alias manv="man -P 'vim -M +MANPAGER -'" # vim has man pager
+alias manv2="man 2 -P 'vim -M +MANPAGER -'"
+alias manv3="man 3 -P 'vim -M +MANPAGER -'"
+alias manv5="man 5 -P 'vim -M +MANPAGER -'"
+
+# make
+alias m="make"
# git
alias ga="git add"
@@ -48,6 +56,7 @@ alias glgo="git log --oneline --no-decorate"
alias gp="git push"
alias gcl="git clone --recurse-submodules"
alias gst="git status"
+alias gs="git status"
alias gss="git status --short"
alias gco="git checkout"
alias gsta="git stash push"
@@ -57,7 +66,7 @@ alias gstp="git stash pop"
alias lpassp="lpass show --password --clip" # put password in clipboard
# helper to switch between dual and single monitor setup
-alias dual='xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --auto'
+alias dual='xrandr --output LVDS1 --primary --below VGA1 --output VGA1 --auto'
alias single='xrandr --output VGA1 --off'
# edit config files
@@ -67,5 +76,21 @@ alias vimrc="vim $DOTFILES/.vimrc"
alias vimplugrc="vim $DOTFILES/.pluggins.vim"
alias xmonadrc="vim $DOTFILES/xmonad.hs"
+
# other
alias date="date -R"
+
+# parent directory jump
+alias ..='cd ..'
+alias ...='cd ../..'
+alias ....='cd ../../..'
+
+alias norm='ruby -I/home/charles/norminette/vendor/bundle/ruby/2.7.0/gems/parseconfig-1.0.8/lib/ ~/norminette/norminette.rb'
+
+getrfc() {
+ curl "https://ietf.org/rfc/rfc$1.txt" > "$HOME/rfc/rfc$1.txt"
+}
+
+# bluetooth
+alias bton='echo power on | bluetoothctl'
+alias btoff='echo power off | bluetoothctl'
diff --git a/.zshrc b/.zshrc
index 6704db9..13d9389 100644
--- a/.zshrc
+++ b/.zshrc
@@ -52,7 +52,7 @@ function chpwd() {
# add command-not-found package suggestion
#source /etc/zsh_command_not_found
-# color in man
+# color in man (less pager)
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
@@ -60,16 +60,23 @@ export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
-
-# XDG
+export LESS_TERMCAP_mr=$(tput rev)
+export LESS_TERMCAP_mh=$(tput dim)
+export LESS_TERMCAP_ZN=$(tput ssubm)
+export LESS_TERMCAP_ZV=$(tput rsubm)
+export LESS_TERMCAP_ZO=$(tput ssupm)
+export LESS_TERMCAP_ZW=$(tput rsupm)
+
+#XDG
export XDG_CONFIG_HOME="/home/charles/.config/"
export XDG_DATA_HOME="/home/charles/.data/"
export EDITOR="vim"
-export TERM="xterm-256color"
+export TERM="st-256color"
+# export TERM="xterm-256color"
-# set tab to 4 spaces
-tabs 4
+# mail
+export MAIL='charles.cabergs@gmail.com'
# ignore filetypes in autocomplete
fignore=(o hi)
@@ -80,3 +87,5 @@ source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # prompt
export YSU_MESSAGE_POSITION="after" # you-should-use message after command output
source $HOME/.zsh/zsh-you-should-use/you-should-use.plugin.zsh # alias reminder
+# set tab to 4 spaces
+tabs 4
diff --git a/grep.vim b/grep.vim
new file mode 100644
index 0000000..32181f7
--- /dev/null
+++ b/grep.vim
@@ -0,0 +1,23 @@
+nnoremap <leader>g :set operatorfunc=<SID>GrepOp<CR>g@
+vnoremap <leader>g :<C-u>call <SID>GrepOp(visualmode())<CR>
+
+function! s:GrepOp(type)
+ let saved = @@
+
+ if a:type ==# 'v'
+ execute "normal! `<v`>y"
+ elseif a:type ==# 'char'
+ execute "normal! `[v`]y"
+ else
+ return
+ endif
+
+ silent execute "grep! -R " . shellescape(@@) . " ."
+ silent redraw!
+ let g:quickfix_is_open = 1
+ copen
+ let @@ = saved
+endfunction
+
+nnoremap <leader>gn :cnext<CR>
+nnoremap <leader>gp :cprevious<CR>
diff --git a/install.sh b/install.sh
index 63298c6..ff71c27 100755
--- a/install.sh
+++ b/install.sh
@@ -1,5 +1,16 @@
#!/bin/sh
+create_dotfile_link()
+{
+ ln -sf $DOTDIR/$1 $HOME/$2
+ echo "Created link for $1 to $HOME/$2"
+}
+
+create_dotfile_link_same()
+{
+ create_dotfile_link $1 $1
+}
+
###########################
# dotfiles install script #
###########################
@@ -8,18 +19,21 @@
[ -z $DOTDIR ] && DOTDIR=`pwd`
# Creating links
-ln -sf $DOTDIR/.zshrc $HOME/.zshrc
-ln -sf $DOTDIR/.vimrc $HOME/.vimrc
+create_dotfile_link_same .zshrc
+create_dotfile_link_same .bashrc
+create_dotfile_link_same .vimrc
+[ ! -d $HOME/.vim/plugin ] && mkdir -p $HOME/.vim/plugin
+create_dotfile_link grep.vim .vim/plugin/grep.vim
[ ! -d $HOME/.xmonad ] && mkdir $HOME/.xmonad
-ln -sf $DOTDIR/xmonad.hs $HOME/.xmonad/xmonad.hs
+create_dotfile_link xmonad.hs .xmonad/xmonad.hs
-ln -sf $DOTDIR/.gdbinit $HOME/.gdbinit
-ln -sf $DOTDIR/.ghci $HOME/.ghci
-ln -sf $DOTDIR/.gitconfig $HOME/.gitconfig
+create_dotfile_link_same .gdbinit
+create_dotfile_link_same .ghci
+create_dotfile_link_same .gitconfig
[ ! -d $HOME/.config ] && mkdir $HOME/.config
-ln -sf $DOTDIR/redshift.conf $HOME/.config/redshift.conf
+create_dotfile_link redshift.conf .config/redshift.conf
ln -sf $DOTDIR/.xinitrc $HOME/.xinitrc
ln -sf $DOTDIR/.zprofile $HOME/.zprofile
@@ -28,22 +42,28 @@ ln -sf $DOTDIR/.zprofile $HOME/.zprofile
# dependencies #
################
+[ $# -ge 1 ] || [ "$1" = "--ln" ] && exit 0
+echo "Installing Dependencies"
+
# vim Plug
-curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
- https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+PLUGFILE=$HOME/.vim/autoload/plug.vim
+PLUGURL='https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
+[ ! -f $PLUGFILE ] && echo "Downloading plug.vim" && \
+ curl -fLo $PLUGFILE --create-dirs $PLUGURL
+echo "Installing plug.vim Pluggins"
vim -c "PlugInstall" -c "qa"
# zsh pluggins
[ ! -d $HOME/.zsh ] && make $HOME/.zsh
# pure theme
-[ ! -d $HOME/.zsh/pure ] && \
+[ ! -d $HOME/.zsh/pure ] && echo "Installing zsh pure theme" && \
git clone https://github.com/sindresorhus/pure \
$HOME/.zsh/pure
# syntax hightlighting
-[ ! -d $HOME/.zsh/zsh-syntax-highlighting ] && \
+[ ! -d $HOME/.zsh/zsh-syntax-highlighting ] && echo "Installing zsh syntax highlighting plugin" && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting \
$HOME/.zsh/zsh-syntax-highlighting
# you should use
-[ ! -d $HOME/.zsh/zsh-you-should-use ] && \
+[ ! -d $HOME/.zsh/zsh-you-should-use ] && echo "Installing zsh you should use plugin" && \
git clone https://github.com/MichaelAquilina/zsh-you-should-use \
$HOME/.zsh/zsh-you-should-use
diff --git a/redshift.conf b/redshift.conf
index f012aba..32fff4f 100644
--- a/redshift.conf
+++ b/redshift.conf
@@ -1,5 +1,5 @@
[redshift]
-temp-day=3000
+temp-day=2800
temp-night=2600
; transition day/night
diff --git a/xmonad.hs b/xmonad.hs
index c22c11b..5420664 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -8,6 +8,9 @@ import XMonad.Util.EZConfig(additionalKeysP)
-- Layouts
import XMonad.Layout.NoBorders
+-- Hooks
+import XMonad.Hooks.InsertPosition
+
main = do
xmonad $ desktopConfig
@@ -18,14 +21,25 @@ main = do
, normalBorderColor = "#292d3e"
, focusedBorderColor = "#bbc5ff"
, layoutHook = myLayouts
+ , startupHook = myStartupHook
+ , manageHook = myManageHook
} `additionalKeysP` myKeys
-myLayouts = tiled ||| Mirror tiled ||| noBorders Full
- where tiled = Tall 1 (3 / 100) (1 / 2)
+myLayouts = tiledBigMaster -- bigger master for code and smaller slave for compiling
+ ||| Mirror tiledEven -- 50/50 horizontal split
+ ||| noBorders Full -- disable borders for fullscreen layout
+ where tiledBigMaster = Tall 1 (3 / 100) (3 / 5)
+ tiledEven = Tall 1 (3 / 100) (1 / 2)
+
+myStartupHook = do
+ spawnOnce "redshift -c /home/charles/.config/redshift.conf &" -- start redshift
+ spawnOnce "xinput disable 'ETPS/2 Elantech Touchpad' &" -- disable touchpad
+
+myManageHook = insertPosition End Newer -- insert new window at the end of the current layout
-myKeys = [ ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up")
- , ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down")
- , ("<XF86AudioMute>", spawn "pulseaudio-ctl mute")
- , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5")
- , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
+myKeys = [ ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up") -- volume up
+ , ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down") -- volume down
+ , ("<XF86AudioMute>", spawn "pulseaudio-ctl mute") -- volume mute
+ , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5") -- backlight up
+ , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5") -- backlight down
]