Compare commits

...

43 Commits

Author SHA1 Message Date
38461006cf Fix order 2018-07-22 10:24:52 -04:00
ecd49cdfdf Add checkout develop in one liner 2018-07-22 10:20:55 -04:00
4d48f02553 Merge branch 'feature/ansible' into develop 2018-07-22 10:20:22 -04:00
e54bebad64 Add stow oneliner 2018-07-22 10:14:01 -04:00
ca2981a954 Add remote src 2018-07-08 14:54:45 -04:00
b3761b361f Changes 2018-07-08 14:09:49 -04:00
4510552267 Modifications 2018-07-08 14:03:49 -04:00
5fd630c948 Changes 2018-07-08 14:03:22 -04:00
0ba4593214 Changes 2018-07-08 13:59:17 -04:00
ef0e3c01c7 Add dunstrc 2018-07-08 01:25:18 -04:00
521cbd0c2d Continue work 2018-07-08 00:51:09 -04:00
3b1c3037f3 Add base i3status.conf 2018-07-07 16:06:38 -04:00
0af1e2d9d1 Added private again 2018-07-07 13:51:42 -04:00
8a26df4c74 Added 2018-07-07 13:48:09 -04:00
75a18fd7c6 Default to home directory 2018-07-07 00:07:24 -04:00
65252ffe9f Continue documenting 2018-07-06 23:35:28 -04:00
ce711ca6d5 Document stow 2018-07-06 23:33:43 -04:00
925065127f Merge branch 'feature/ansible' of austenwares.com:stonewareslord/sync into feature/ansible 2018-07-06 13:41:44 -04:00
a456bf734c Added venv check 2018-07-06 13:39:37 -04:00
0e928f9f34 Correctly order plug cleaning 2018-07-05 17:18:54 -04:00
7dd3ac24fc Make cleaning directory work properly 2018-07-05 17:15:28 -04:00
e0d6ead5f5 Rework home and add notes to sync.sh 2018-07-05 17:07:42 -04:00
e1d80ce73f Update sync.sh 2018-07-04 14:03:35 -04:00
f1d3ef2616 Update gitconfig 2018-07-04 13:49:36 -04:00
1c0cd58364 Use private directory 2018-07-04 13:46:43 -04:00
7f7a2c7725 Merge branch 'feature/ansible' of austenwares.com:stonewareslord/sync into feature/ansible 2018-07-04 12:45:49 -04:00
73808aad2a Default to home directory 2018-07-04 12:45:46 -04:00
5433ec428d Add working vim sync 2018-07-04 12:39:19 -04:00
06814fbb4a Remove test role 2018-07-04 12:36:58 -04:00
5829a06604 Fix ansible setup 2018-07-02 23:23:08 -04:00
2cab93bad9 Remove update.sh 2018-07-02 22:29:20 -04:00
29d1870eb3 Modify readme 2018-07-02 22:24:45 -04:00
60930b0206 Changes 2018-07-02 22:22:26 -04:00
51db0dbd95 Merge changes from master 2018-07-02 16:01:13 -04:00
337228c244 Allow enabling and disabling password auth 2018-04-12 14:03:25 -04:00
8bf03bbed6 Don't restart networking 2018-04-12 13:46:28 -04:00
1369ee6d15 Use dns 2018-04-12 12:59:03 -04:00
02aa2898a5 Move sshd to handler 2018-04-12 12:39:55 -04:00
bbc5f85972 Continue ansible work 2018-04-07 22:38:20 +00:00
cc9072dbc5 Add ansible, create directory structure 2018-04-07 21:47:15 +00:00
72412817c7 Add skel.vim 2018-03-15 12:50:35 -04:00
c678ce8f14 Add readme 2018-03-15 10:52:14 -04:00
0440bdc0dd Move files to skel 2018-03-15 10:50:49 -04:00
51 changed files with 556 additions and 351 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
.stfolder
main.retry
/private
.env

View File

@ -1,38 +1,50 @@
Sync
=========
# Sync
Syncs austenwares.com offical bash/zsh/tmux/vim/... config files
Sync syncs tmux/vim/bash config files with one command
### Installation
- Using Ansible (more setup, easier syncing)
Usage:
git clone https://gitea.austenwares.com/stonewareslord/sync
cd sync
virtualenv .env
. .env/bin/activate
pip install -r requirements.txt
./sync.sh TAG[,TAG2...] [ANSIBLE-OPTS]
```sh
usage: sync.sh [-h] [-t] [-c] [-b] [-s] [-d]
- Using stow (quicker, easier, less features)
optional arguements:
-h Show this help message and exit
-t Syncs tmux configuration file
-c Syncs other configuration files
-b Syncs Vim bundles
-s Syncs computer with server applications in server.txt
-d Syncs computer with desktop applications in desktop.txt
```
git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync
cd ~/sync
stow skel
# For private
git clone https://gitea.austenwares.com/stonewareslord/private
stow private/skel
Or, install vim bundles and vimrc, customizing which bundles you use first (requires `curl` and `vim` packages):
- Stow oneliner
```sh
mkdir -p ~/.vim/plugin/ ~/.vim/backup/ ~/.vim/undo/ ~/.vim/tmp/ ~/.vim/bundle/ ~/.vim/bundle/ ; if [ ! -f ~/.vim/plugin/sessionman.vim ] ; then curl -o ~/.vim/plugin/sessionman.vim http://www.vim.org/scripts/download_script.php?src_id=15599 ; fi ; if [ ! -d ~/.vim/bundle/vundle/ ] ; then git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle ; fi ; curl -o ~/.vimrc -k https://austenwares.com/gitlab/stonewareslord/Sync/raw/master/vimrc ; vim ~/.vimrc +"execute \"normal /Bundle 'gmarik\/vundle'\<CR>\"" +"execute \"normal :nohlsearch\<CR>:function Save()\<CR>w\<CR>BundleInstall\<CR>qa\<CR>endfunction\<CR>\"" +"nnoremap <F2> :call Save()<CR>:so ~/.vimrc<CR>:BundleInstall<CR>" ; echo "Installation should be complete. Run \"vim\" to check"
```
command -v stow >/dev/null && git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync && cd ~/sync && stow skel && git checkout develop && git clone git@gitea.austenwares.com:stonewareslord/private && stow private/skel
Usage: run this command and it will automatically load the bundle list with descriptions of each. Delete the ones you don't want to install and press `F2` in normal mode to install al at once.
- Installing vim
Or, temporarily load the bashrc (requires `curl` package):
vim +'call Initialize()'
```sh
curl -k -o /tmp/tmprc https://98.26.78.121/gitlab/stonewareslord/Sync/raw/master/tmprc && . /tmp/tmprc ; rm /tmp/tmprc
```
### Examples
#### Sync all config and remove existing files
Or, clone the sync project and add all origins automatically:
./sync.sh clean --extra-vars 'overwrite_existing=yes'
```sh
mkdir sync&&cd sync&&git init&&git remote add testorigin https://98.26.78.121/gitlab/stonewareslord/Sync.git&&git config http.sslVerify false&&git pull testorigin master&&. bashrc&&git remote rm testorigin&&initify stonewareslord Sync -r
```
#### Sync for root
./sync.sh default --become --ask-become-pass
#### Secure SSH
./sync.sh secure --ask-become-pass --tags
#### Disable SSH password authentication
./sync.sh secure --extra-vars 'disable_passwordauth=true' --ask-become-pass
#### Use 1.1.1.1 dns
./sync.sh dns --ask-become-pass

2
hosts Normal file
View File

@ -0,0 +1,2 @@
[local]
127.0.0.1

17
main.yml Normal file
View File

@ -0,0 +1,17 @@
---
- hosts: all
vars:
install_path: "{{ ansible_env.HOME }}"
sync_path: "{{ install_path }}/sync"
disable_passwordauth: false
enable_passwordauth: false
private_repo: "git@austenwares.com:stonewareslord/private"
overwrite_existing: no
roles:
- {role: core, tags: [core,default]}
- {role: clean, tags: [clean]}
- {role: default, tags: [default]}
- {role: private, tags: [private]}
- {role: youcompleteme, tags: [youcompleteme]}
- {role: secure, become: yes, tags: [secure]}
- {role: dns, tags: [dns]}

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
ansible

View File

@ -0,0 +1,13 @@
- name: Remove files
file:
path: "{{ install_path }}/{{ item.path }}"
state: absent
with_filetree: "skel/"
when: item.state == 'file'
- name: Remove cloned repositories
file:
path: "{{ install_path }}/{{ item }}"
state: absent
loop:
- ".fzf"
- ".vim"

View File

@ -0,0 +1,6 @@
- name: Clone sync project
git:
repo: "https://gitea.austenwares.com/stonewareslord/sync.git"
dest: "{{ sync_path }}"
clone: yes
update: yes

View File

@ -0,0 +1,31 @@
- name: Create directories
file:
path: "{{ install_path }}/{{ item.path }}"
state: directory
force: "{{ overwrite_existing }}"
with_filetree: "skel/"
when: item.state == 'directory'
- name: Delete existing private files
file:
path: "{{ install_path }}/{{ item.path }}"
state: absent
with_filetree: "private/skel/"
when: item.state == 'file'
- name: Link files
file:
src: "{{ sync_path }}/skel/{{ item.path }}"
dest: "{{ install_path }}/{{ item.path }}"
remote_src: yes
state: link
force: "{{ overwrite_existing }}"
with_filetree: "skel/"
when: item.state == 'file'
- name: Clone fzf
git:
repo: "https://gitea.austenwares.com/stonewareslord/fzf.git"
dest: "{{ install_path }}/.fzf"
clone: yes
update: yes
force: yes
- name: Install fzf
shell: "{{ install_path|quote }}/.fzf/install --bin"

15
roles/dns/tasks/main.yml Normal file
View File

@ -0,0 +1,15 @@
- name: Change DNS
lineinfile:
path: /etc/dhcp/dhclient.conf
regexp: '^\s*prepend\s+domain-name-servers'
insertafter: 'prepend\s+domain-name-servers'
state: 'present'
line: 'prepend domain-name-servers 1.0.0.1;'
become: yes
register: changed_dns
#- name: Restart networking
# service:
# name: network
# state: restarted
# become: yes
# when: changed_dns.changed

View File

@ -0,0 +1,22 @@
- name: Clone private repo
git:
repo: "{{ private_repo }}"
dest: "{{ sync_path }}/private"
clone: yes
update: yes
- name: Create priavte directories
file:
path: "{{ install_path }}/{{ item.path }}"
state: directory
force: "{{ overwrite_existing }}"
with_filetree: "private/skel/"
when: item.state == 'directory'
- name: Copy priavte files
copy:
src: "{{ sync_path }}/private/skel/{{ item.path }}"
dest: "{{ install_path }}/{{ item.path }}"
remote_src: yes
mode: 0600
force: "yes"
with_filetree: "private/skel/"
when: item.state == 'file'

View File

@ -0,0 +1,11 @@
- name: Check sshd
shell:
cmd: sshd -t
become: yes
listen: "restart_sshd"
- name: Restart sshd
service:
name: sshd
state: restarted
become: yes
listen: "restart_sshd"

View File

@ -0,0 +1,41 @@
- name: Secure SSH
lineinfile:
path: /etc/ssh/sshd_config
regexp: "{{ item.regexp }}"
# insertbefore: '^\s*Match'
insertbefore: BOF
state: 'present'
line: "{{ item.line }}"
notify: restart_sshd
loop:
- { regexp: '^\s*Protocol\s+2', line: 'Protocol 2' }
- { regexp: '^\s*UseDNS\s+no', line: 'UseDNS no' }
- { regexp: '^\s*PermitEmptyPasswords\s+no', line: 'PermitEmptyPasswords no' }
- { regexp: '^\s*PermitRootLogin\s+without-password', line: 'PermitRootLogin without-password' }
- name: Disable passwordauth
lineinfile:
path: /etc/ssh/sshd_config
regexp: "{{ item.regexp }}"
insertbefore: '^\s*Match'
state: 'present'
line: "{{ item.line }}"
notify: restart_sshd
loop:
- { regexp: '^\s*ChallengeResponseAuthentication\s+no', line: 'ChallengeResponseAuthentication no' }
- { regexp: '^\s*PasswordAuthentication\s+no', line: 'PasswordAuthentication no' }
- { regexp: '^\s*AuthenticationMethods\s+publickey', line: 'AuthenticationMethods publickey' }
when: "disable_passwordauth"
- name: Enable passwordauth
lineinfile:
path: /etc/ssh/sshd_config
regexp: "{{ item.regexp }}"
insertbefore: '^\s*Match'
state: 'present'
line: "{{ item.line }}"
notify: restart_sshd
loop:
- { regexp: '^\s*ChallengeResponseAuthentication\s+yes', line: 'ChallengeResponseAuthentication yes' }
- { regexp: '^\s*PasswordAuthentication\s+yes', line: 'PasswordAuthentication yes' }
- { regexp: '^\s*AuthenticationMethods\s+publickey\s+keyboard-interactive', line: 'AuthenticationMethods publickey keyboard-interactive' }
when: "enable_passwordauth"
- meta: "flush_handlers"

7
roles/vim/tasks/main.yml Normal file
View File

@ -0,0 +1,7 @@
- name: Link files
file:
src: "{{ item.src }}"
dest: "{{ install_path }}/{{ item.path }}"
state: link
force: "{{ overwrite_existing }}"
with_filetree: "skel.vim/"

View File

@ -0,0 +1,29 @@
- name: Check if cargo is installed
shell: command -v cargo >/dev/null 2>&1
register: cargo_exists
ignore_errors: yes
- name: Check if go is installed
shell: command -v go >/dev/null 2>&1
register: go_exists
ignore_errors: yes
# TODO: Figure out how to transform cargo_flag.rc == 0 && echo --racer-completer
- name: Install youcompleteme
shell:
cmd: ./install.py
chdir: "~/.vim/plugged/YouCompleteMe"
when: "go_exists.rc != 0 and cargo_exists.rc != 0"
- name: Install youcompleteme with rust
shell:
cmd: ./install.py --racer-completer
chdir: "~/.vim/plugged/YouCompleteMe"
when: "go_exists.rc != 0 and cargo_exists.rc == 0"
- name: Install youcompleteme with go
shell:
cmd: ./install.py --gocode-completer
chdir: "~/.vim/plugged/YouCompleteMe"
when: "go_exists.rc == 0 and cargo_exists.rc != 0"
- name: Install youcompleteme with rust and go
shell:
cmd: ./install.py --gocode-completer --racer-completer
chdir: "~/.vim/plugged/YouCompleteMe"
when: "go_exists.rc == 0 and cargo_exists.rc == 0"

View File

@ -1,9 +0,0 @@
#!/bin/sh
for DIR in *; do
#[ -d "$DIR" ] && "cd "$DIR" ; pwd"
if [ -d "$DIR" ] ; then
cd "$DIR"
git up
cd ..
fi
done

View File

@ -1,44 +0,0 @@
# af-magic.zsh-theme
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
else
local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})"
fi
# primary prompt
PROMPT='$FG[032]%~\
$(git_prompt_info) \
$FG[105]%(!.#.$)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
# »
# color vars
eval my_gray='$FG[237]'
eval my_orange='$FG[214]'
# right prompt
if type "virtualenv_prompt_info" > /dev/null
then
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
else
RPROMPT='$(virtualenv_prompt_info)$my_red%n@%m%{$reset_color%}%'
fi
else
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
RPROMPT='$my_gray%n@%m%{$reset_color%}%'
else
RPROMPT='$my_red%n@%m%{$reset_color%}%'
fi
fi
# git settings
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"

View File

@ -1,257 +0,0 @@
case $- in
*i*) ;;
*) return;;
esac
HISTCONTROL=ignoreboth
shopt -s histappend
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
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
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
[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh
[[ -s /home/stonewareslord/.autojump/etc/profile.d/autojump.sh ]] && source /home/stonewareslord/.autojump/etc/profile.d/autojump.sh
export PATH=/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
complete -cf sudo man
#Alias definitions.
if [ "$(uname)" != "Darwin" ] ; then
alias ls='ls --color=always -F'
fi
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
#alias vim='vim +"au BufWritePost .vimrc so ~/.vimrc" +"au BufWritePost vimrc so ~/.vimrc"'
alias disphost='export DISPLAY=:0.0'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias logout='sudo pkill -u $USER'
alias fixsh='ssh-keygen -R'
alias tmux='tmux -2'
alias less='less -r'
alias tree='tree -C'
alias grep="grep --color=auto"
alias skim="(head -5; tail -5) <"
alias cp="cp -v"
alias mv="mv -v"
alias la='ls -lah $LS_COLOR'
alias dt='date "+%F %T"'
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
alias adk='/home/stonewareslord/applications/adk/bin/studio.sh&>/dev/null'
alias resource='. ~/.bashrc'
alias install='sudo apt-get install'
alias search='sudo apt-cache search'
alias remove='sudo apt-get remove'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
alias autoremove='sudo apt-get autoremove'
alias ..='k ..'
alias ...='k ../..'
alias ....='k ../../..'
alias .....='k ../../../..'
alias ......='k ../../../../..'
alias .......='k ../../../../../..'
alias ........='k ../../../../../../..'
alias .........='k ../../../../../../../..'
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
alias tux="tmux a||tmux"
alias rmgit="git remote rm origin;git remote rm https;git remote rm oOrigin;git remote rm oHttps"
alias g="git $@"
function mcl(){ mkdir "$@"&&cl "$@"; }
function cl(){ cd "$@" && ls; }
function k(){
if [ -d "$@" ] ; then
cd "$@" && ls
elif [ "$@" == "-" ] ; then
cd - && ls
elif [ -f "$@" ] ; then
vim "$@"
else
echo -n "Create? "
read a
if [ ! -z $a ] ; then
vim "$@"
fi
fi
}
complete -f k
function ovim(){ vim +"SessionOpen $@"; }
function ogvim(){ gvim +"SessionOpen $@"; }
function tsh(){
ssh $* -X
if which ponysay >/dev/null; then
ponysay "Connection closed!"
else
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
fi
}
#Functions
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.xz) tar xvf $1 ;;
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
export -f extract
function cinitify(){
mkdir $2
cd $2
git init
git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git
#Offline mode
git remote add oOrigin git@10.0.1.200:$1/$2.git
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
git remote -v
echo -n "Pull from: "
read from
git pull $FROM
git co master
}
export -f cinitify
function initify(){
git init
git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git
#Offline mode
git remote add oOrigin git@10.0.1.200:$1/$2.git
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
git remote -v
echo -n "Pull from: "
read from
git pull $FROM
git co master
}
export -f initify
#Color definitions
txtblk='\[\e[0;30m\]' # Black - Regular
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
bldblk='\[\e[1;30m\]' # Black - Bold
bldred='\[\e[1;31m\]' # Red
bldgrn='\[\e[1;32m\]' # Green
bldylw='\[\e[1;33m\]' # Yellow
bldblu='\[\e[1;34m\]' # Blue
bldpur='\[\e[1;35m\]' # Purple
bldcyn='\[\e[1;36m\]' # Cyan
bldwht='\[\e[1;37m\]' # White
unkblk='\[\e[4;30m\]' # Black - Underline
undred='\[\e[4;31m\]' # Red
undgrn='\[\e[4;32m\]' # Green
undylw='\[\e[4;33m\]' # Yellow
undblu='\[\e[4;34m\]' # Blue
undpur='\[\e[4;35m\]' # Purple
undcyn='\[\e[4;36m\]' # Cyan
undwht='\[\e[4;37m\]' # White
bakblk='\[\e[40m\]' # Black - Background
bakred='\[\e[41m\]' # Red
badgrn='\[\e[42m\]' # Green
bakylw='\[\e[43m\]' # Yellow
bakblu='\[\e[44m\]' # Blue
bakpur='\[\e[45m\]' # Purple
bakcyn='\[\e[46m\]' # Cyan
bakwht='\[\e[47m\]' # White
txtrst='\[\e[0m\]' # Text Reset
#History control
if [ "$BASH" ]; then
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | grep -oE '[^ ]+$'
}
prompt(){
a=`parse_git_branch`
hn=`hostname`
hn=${hn:0:3}
who=`whoami`
who=${who:0:3}
if [ -z $a ] ; then
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}>" $who $hn "$PWD"
else
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}{$txtblu%s$txtrst}>" $who $hn "$PWD" $(parse_git_branch)
fi
}
PS1=""
PROMPT_COMMAND='PS1=`prompt`'
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
#PROMPT_COMMAND='PS1="\(\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
export HISTFILE=~/.bash_eternal_history
alias ehistory='cat ~/.bash_eternal_history|grep $@'
readonly HOME
readonly HISTIGNORE
#readonly PROMPT_COMMAND
#readonly HISTSIZE
#readonly HISTFILE
#readonly HISTCONTROL
fi

View File

@ -0,0 +1,4 @@
# This file can be replaced by using the private tag
[user]
email =
name =

230
skel/.config/dunstrc Normal file
View File

@ -0,0 +1,230 @@
[global]
font = Monospace 9
# allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough<s/>
# <u>underline</u>
#
# for a complete reference see http://developer.gnome.org/pango/stable/PangoMarkupFormat.html
# If markup is not allowed, those tags will be stripped out of the message.
allow_markup = yes
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%a:</b> %s\n%b"
# Sort messages by urgency
sort = yes
# Show how many messages are currently hidden (because of geometry)
indicate_hidden = yes
# alignment of message text.
# Possible values are "left", "center" and "right"
alignment = left
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with 'word_wrap'.
# Set to 0 to disable
bounce_freq = 0
# show age of message if message is older than show_age_threshold seconds.
# set to -1 to disable
show_age_threshold = 60
# split notifications into multiple lines if they don't fit into geometry
word_wrap = yes
# ignore newlines '\n' in notifications
ignore_newline = no
# the geometry of the window
# geometry [{width}]x{height}][+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else in pixels. If the width
# is omitted but the height is given ("-geometry x2"), the message window
# expands over the whole screen (dmenu-like). If width is 0,
# the window expands to the longest message displayed.
# A positive x is measured from the left, a negative from the
# right side of the screen. Y is measured from the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
#geometry = "300x5-30+20"
# The transparency of the window. range: [0; 100]
# This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
transparency = 0
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 120
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option will be
# ignored.
follow = keyboard
# should a notification popped up from history be sticky or
# timeout as if it would normally do.
sticky_history = yes
# The height of a single line. If the height is smaller than the font height,
# it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0
# Draw a line of 'separatpr_height' pixel height between two notifications.
# Set to 0 to disable
separator_height = 2
# padding between text and separator
padding = 8
# horizontal padding
horizontal_padding = 8
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background
# * foreground: use the same color as the foreground
# * frame: use the same color as the frame.
# * anything else will be interpreted as a X color
separator_color = frame
# print a notification on startup
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = true
# dmenu path
dmenu = /usr/bin/dmenu -p dunst:
# browser for opening urls in context menu
browser = /usr/bin/firefox -new-tab
[frame]
width = 3
color = "#FFFFFF"
[shortcuts]
# shortcuts are specified as [modifier+][modifier+]...key
# available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
# and 'mod4' (windows-key)
# xev might be helpful to find names for keys
# close notification
#close = mod4+m
# close all notifications
#close_all = mod4+shift+m
# redisplay last message(s)
#history = mod4+n
# context menu
#context = mod4+shift+i
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the '#' and following would be interpreted as a comment.
background = "#121212"
foreground = "#FFFFFF"
timeout = 10
[urgency_normal]
background = "#121212"
foreground = "#FFFFFF"
timeout = 10
[urgency_critical]
background = "#FF0000"
foreground = "#FFFFFF"
timeout = 0
# Every section that isn't one of the above is interpreted as a rules
# to override settings for certain messages.
# Messages can be matched by 'appname', 'summary', 'body' or 'icon'
# and you can override the 'timeout', 'urgency', 'foreground', 'background'
# and 'format'.
# Shell-like globbing will get expanded.
#
# SCRIPTING
# you can specify a script that gets run when the rule matches by setting
# the 'script' option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format to ""
# NOTE: It might be helpful to run dunst -print in a terminal in order to find
# fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
## This notification will not be displayed
# summary = "foobar"
# format = ""
[riot]
appname = "Electron"
format = "<b>Riot:</b> %s\n%b"
[telegram]
appname = "Telegram Dektop"
format = "<b>Telegram:</b> %s\n%b"
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
# format = "%s "%b""
#
#[music]
# appname = Amarok
# summary = "Now playing"
# urgency = low
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#

View File

@ -1,3 +1,5 @@
[include]
path = .conf.d/gitconfig.custom
[alias]
i = "!git br&&git st"
# coa = "!for i in $(git branch -a|cut -b3-|grep remotes|sed -e 's/remotes\///'|cut -d/ -f1 --complement|cut -d\ -f1);do git checkout $i;done"
@ -23,7 +25,7 @@
ignore = update-index --assume-unchanged
noignore = update-index --no-assume-unchanged
rename-branch = branch -m
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
[push]
default = matching
[core]
@ -49,3 +51,5 @@
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[pager]
branch = false

View File

@ -197,7 +197,6 @@ mode "minecraft" {
}
bindsym $mod+m mode "minecraft"
# Startup
# Monitor setup
exec --no-startup-id "zsh -c 'xrandr --output eDP1 --primary || xrandr --output HDMI3 --primary'"

62
skel/.i3/i3status.conf Normal file
View File

@ -0,0 +1,62 @@
#i3status config
general {
output_format= "i3bar"
colors = true
#color_good = '#ffffff'
#color_degraded = '#ffffff'
#color_bad = '#ffffff'
color_good = '#00ff00'
color_degraded = '#ff0000'
color_bad = '#ff0000'
interval = 1
}
order += "disk /"
order += "cpu_usage"
order += "ethernet tun0"
order += "wireless wlp2s0"
order += "ethernet enp1s0"
order += "volume master"
order += "battery 1"
order += "tztime local"
ethernet tun0 {
# if you use %speed, i3status requires root privileges
format_up = "%ip"
format_down = "!T"
}
wireless wlp2s0 {
format_up = "%essid : %ip @ %quality"
format_down = "!W"
}
ethernet enp1s0 {
# if you use %speed, i3status requires root privileges
format_up = "%ip (%speed)"
format_down = "!E"
}
tztime local {
#format = "%a %b%e %r"
format = "%a %e %b %F %r"
#:%M:%S
}
load {
format = "%5min"
}
volume master {
format = "V:%volume"
format_muted = "V: 0%"
device = "default"
mixer = "Master"
mixer_idx = 0
}
battery 1 {
#format = "%status %remaining %emptytime"
format = "%status %percentage"
path = "/sys/class/power_supply/BAT1/uevent"
low_threshold = 20
}
disk "/" {
format = "%free"
}
cpu_usage {
format = "CPU: %usage"
}
# vim: ts=4:sw=4:et

View File

@ -14,10 +14,6 @@ set -g prefix C-a
bind C-a send-prefix
unbind C-b
bind-key -n M-v split-window -h
bind-key -n M-V split-window -v
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
@ -34,9 +30,6 @@ bind-key -n M-[ previous-window
bind-key -n M-] next-window
bind-key -n M-f resize-pane -Z
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5

View File

@ -337,11 +337,7 @@ function! Initialize()
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
silent! so ~/_vimrc
else
silent !mkdir -p ~/.vim/autoload
silent !mkdir -p ~/.vim/plugin
silent !mkdir -p ~/.vim/backup
silent !mkdir -p ~/.vim/undo
silent !mkdir -p ~/.vim/tmp
silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
silent! so ~/.vimrc
endif

17
sync.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
\cd "$(dirname $0)"
if [ -z "$1" ]; then
echo "Usage:"
echo "$0 TAG1[,TAG2] [ANSIBLE-OPTS]"
echo "Available tags:"
echo "$(\ls roles | tr '\n' ' ')"
echo "Example: $0 default,vim"
exit 1
fi
if [ -f .env/bin/activate ]; then
echo "Found virtualenv. Sourcing..."
source .env/bin/activate
fi
TAGS="$1"
shift
ansible-playbook -i 'localhost,' $* main.yml --tags "$TAGS"