Compare commits
44 Commits
master
...
feature/an
Author | SHA1 | Date | |
---|---|---|---|
c076a7ae9e | |||
b2a3bb723a | |||
9d05b29000 | |||
f5af1d9952 | |||
e54bebad64 | |||
ca2981a954 | |||
b3761b361f | |||
4510552267 | |||
5fd630c948 | |||
0ba4593214 | |||
ef0e3c01c7 | |||
521cbd0c2d | |||
3b1c3037f3 | |||
0af1e2d9d1 | |||
8a26df4c74 | |||
75a18fd7c6 | |||
65252ffe9f | |||
ce711ca6d5 | |||
925065127f | |||
a456bf734c | |||
0e928f9f34 | |||
7dd3ac24fc | |||
e0d6ead5f5 | |||
e1d80ce73f | |||
f1d3ef2616 | |||
1c0cd58364 | |||
7f7a2c7725 | |||
73808aad2a | |||
5433ec428d | |||
06814fbb4a | |||
5829a06604 | |||
2cab93bad9 | |||
29d1870eb3 | |||
60930b0206 | |||
51db0dbd95 | |||
337228c244 | |||
8bf03bbed6 | |||
1369ee6d15 | |||
02aa2898a5 | |||
bbc5f85972 | |||
cc9072dbc5 | |||
72412817c7 | |||
c678ce8f14 | |||
0440bdc0dd |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,4 @@
|
|||||||
.stfolder
|
.stfolder
|
||||||
|
main.retry
|
||||||
|
/private
|
||||||
|
.env
|
||||||
|
66
README.md
66
README.md
@ -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
|
- Using stow (quicker, easier, less features)
|
||||||
usage: sync.sh [-h] [-t] [-c] [-b] [-s] [-d]
|
|
||||||
|
|
||||||
optional arguements:
|
git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync
|
||||||
-h Show this help message and exit
|
cd ~/sync
|
||||||
-t Syncs tmux configuration file
|
stow skel
|
||||||
-c Syncs other configuration files
|
# For private
|
||||||
-b Syncs Vim bundles
|
git clone https://gitea.austenwares.com/stonewareslord/private
|
||||||
-s Syncs computer with server applications in server.txt
|
stow private/skel
|
||||||
-d Syncs computer with desktop applications in desktop.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, install vim bundles and vimrc, customizing which bundles you use first (requires `curl` and `vim` packages):
|
- Stow oneliner
|
||||||
|
|
||||||
```sh
|
command -v stow >/dev/null && git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync && cd ~/sync && stow skel && git clone git@gitea.austenwares.com:stonewareslord/private && stow private/skel
|
||||||
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"
|
|
||||||
```
|
|
||||||
|
|
||||||
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
|
### Examples
|
||||||
curl -k -o /tmp/tmprc https://98.26.78.121/gitlab/stonewareslord/Sync/raw/master/tmprc && . /tmp/tmprc ; rm /tmp/tmprc
|
#### 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
|
#### Sync for root
|
||||||
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.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
|
||||||
|
17
main.yml
Normal file
17
main.yml
Normal 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
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
ansible
|
13
roles/clean/tasks/main.yml
Normal file
13
roles/clean/tasks/main.yml
Normal 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"
|
6
roles/core/tasks/main.yml
Normal file
6
roles/core/tasks/main.yml
Normal 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
|
31
roles/default/tasks/main.yml
Normal file
31
roles/default/tasks/main.yml
Normal 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
15
roles/dns/tasks/main.yml
Normal 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
|
22
roles/private/tasks/main.yml
Normal file
22
roles/private/tasks/main.yml
Normal 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'
|
11
roles/secure/handlers/main.yml
Normal file
11
roles/secure/handlers/main.yml
Normal 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"
|
41
roles/secure/tasks/main.yml
Normal file
41
roles/secure/tasks/main.yml
Normal 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
7
roles/vim/tasks/main.yml
Normal 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/"
|
29
roles/youcompleteme/tasks/main.yml
Normal file
29
roles/youcompleteme/tasks/main.yml
Normal 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"
|
@ -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
|
|
@ -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%}"
|
|
257
shells/tmprc
257
shells/tmprc
@ -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
|
|
@ -1,5 +1,5 @@
|
|||||||
!URxvt.boldFont: -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
|
!URxvt.boldFont: -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
|
||||||
!URxvt.font: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
URxvt.font: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
!URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
!URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
!URxvt.font: xft:Fixed:style=SemiCondensed:size=10
|
!URxvt.font: xft:Fixed:style=SemiCondensed:size=10
|
||||||
!URxvt.font: xft:Inconsolata:size=12
|
!URxvt.font: xft:Inconsolata:size=12
|
||||||
@ -7,7 +7,8 @@
|
|||||||
!URxvt.font: xft:Neep:size=13
|
!URxvt.font: xft:Neep:size=13
|
||||||
!URxvt.font: xft:Courier New:size=12
|
!URxvt.font: xft:Courier New:size=12
|
||||||
!URxvt.font: xft:Gohu GohuFont:size=12
|
!URxvt.font: xft:Gohu GohuFont:size=12
|
||||||
URxvt.font: xft:Misc Termsynu:size=13
|
!URxvt.font: xft:Misc Termsynu:size=13
|
||||||
|
!URxvt.font: xft:Unifont:size=13
|
||||||
!URxvt.faceName: -*-*-*-*-*-*-10-*-*-*-*-*-*-*
|
!URxvt.faceName: -*-*-*-*-*-*-10-*-*-*-*-*-*-*
|
||||||
!URxvt.font: xft:Fixed:style=SemiCondensed:size=16
|
!URxvt.font: xft:Fixed:style=SemiCondensed:size=16
|
||||||
|
|
@ -1,2 +1 @@
|
|||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
|
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
|
||||||
PS1="$ "
|
|
4
skel/.conf.d/gitconfig.custom
Normal file
4
skel/.conf.d/gitconfig.custom
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# This file can be replaced by using the private tag
|
||||||
|
[user]
|
||||||
|
email =
|
||||||
|
name =
|
230
skel/.config/dunstrc
Normal file
230
skel/.config/dunstrc
Normal 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
|
||||||
|
#
|
@ -1,3 +1,5 @@
|
|||||||
|
[include]
|
||||||
|
path = .conf.d/gitconfig.custom
|
||||||
[alias]
|
[alias]
|
||||||
i = "!git br&&git st"
|
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"
|
# 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"
|
||||||
@ -49,3 +51,5 @@
|
|||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
process = git-lfs filter-process
|
process = git-lfs filter-process
|
||||||
|
[pager]
|
||||||
|
branch = false
|
@ -53,6 +53,8 @@ bindsym XF86AudioLowerVolume exec "amixer set Master 7%- unmute"
|
|||||||
bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle;amixer set Master 0%"
|
bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle;amixer set Master 0%"
|
||||||
# Toggle toucpad
|
# Toggle toucpad
|
||||||
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
|
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
|
||||||
|
# Toggle tap to click
|
||||||
|
bindsym $mod+shift+backslash exec "synclient TapButton2=$(($(synclient -l | grep -c 'TapButton1.*=.*0') * 3));synclient TapButton1=$(synclient -l | grep -c 'TapButton1.*=.*0')"
|
||||||
# Movement
|
# Movement
|
||||||
bindsym $mod+o workspace back_and_forth
|
bindsym $mod+o workspace back_and_forth
|
||||||
bindsym $mod+bracketleft workspace prev
|
bindsym $mod+bracketleft workspace prev
|
||||||
@ -73,6 +75,11 @@ bindsym $mod+shift+Left move left
|
|||||||
bindsym $mod+shift+Down move down
|
bindsym $mod+shift+Down move down
|
||||||
bindsym $mod+shift+Up move up
|
bindsym $mod+shift+Up move up
|
||||||
bindsym $mod+shift+Right move right
|
bindsym $mod+shift+Right move right
|
||||||
|
# Moving to corners
|
||||||
|
bindsym $mod+ctrl+h exec "~/.i3/run.sh move left"
|
||||||
|
bindsym $mod+ctrl+j exec "~/.i3/run.sh move bottom"
|
||||||
|
bindsym $mod+ctrl+k exec "~/.i3/run.sh move top"
|
||||||
|
bindsym $mod+ctrl+l exec "~/.i3/run.sh move right"
|
||||||
# Fullscreen
|
# Fullscreen
|
||||||
bindsym $mod+f fullscreen
|
bindsym $mod+f fullscreen
|
||||||
bindsym $mod+shift+f fullscreen global
|
bindsym $mod+shift+f fullscreen global
|
||||||
@ -82,7 +89,7 @@ bindsym $mod+w layout tabbed
|
|||||||
bindsym $mod+e layout toggle split
|
bindsym $mod+e layout toggle split
|
||||||
bindsym $mod+shift+space floating toggle
|
bindsym $mod+shift+space floating toggle
|
||||||
bindsym $mod+space focus mode_toggle
|
bindsym $mod+space focus mode_toggle
|
||||||
#bindsym $mod+space exec "~/.i3/run.sh window"
|
bindsym $mod+comma exec "~/.i3/run.sh window"
|
||||||
bindsym $mod+1 $x_switch 1
|
bindsym $mod+1 $x_switch 1
|
||||||
bindsym $mod+2 $x_switch 2
|
bindsym $mod+2 $x_switch 2
|
||||||
bindsym $mod+3 $x_switch 3
|
bindsym $mod+3 $x_switch 3
|
||||||
@ -110,6 +117,8 @@ bindsym $mod+r mode "resize"
|
|||||||
bindsym $mod+u focus parent
|
bindsym $mod+u focus parent
|
||||||
bindsym $mod+shift+u focus child
|
bindsym $mod+shift+u focus child
|
||||||
bindsym --release $mod+n exec "~/.i3/run.sh paste"
|
bindsym --release $mod+n exec "~/.i3/run.sh paste"
|
||||||
|
# Reload i3
|
||||||
|
bindsym $mod+shift+r reload;exec notify-send -a i3 Reloaded
|
||||||
# Exit/restart i3
|
# Exit/restart i3
|
||||||
bindsym $mod+q restart
|
bindsym $mod+q restart
|
||||||
#bindsym $mod+shift+q exec "i3-nagbar -m 'NMRestart/Shutdown/Restart/Logout' -t warning -b NMRestart 'nmcli radio wifi off;sleep 1;nmcli radio wifi on' -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'amixer set Master 0% mute;slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'"
|
#bindsym $mod+shift+q exec "i3-nagbar -m 'NMRestart/Shutdown/Restart/Logout' -t warning -b NMRestart 'nmcli radio wifi off;sleep 1;nmcli radio wifi on' -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'amixer set Master 0% mute;slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'"
|
||||||
@ -135,7 +144,9 @@ set $yw #ccdc90
|
|||||||
set $gn #88b090
|
set $gn #88b090
|
||||||
set $rd #e89393
|
set $rd #e89393
|
||||||
# border background text
|
# border background text
|
||||||
client.focused #2f2f2f #2f2f2f #ffffff
|
#client.focused #2f2f2f #2f2f2f #ffffff
|
||||||
|
#client.focused #ffffff #ffffff #000000
|
||||||
|
client.focused #6a6a6a #6a6a6a #ffffff
|
||||||
client.unfocused $bg $bg $ia
|
client.unfocused $bg $bg $ia
|
||||||
client.focused_inactive $bg $bg $ac
|
client.focused_inactive $bg $bg $ac
|
||||||
client.urgent $rd $rd $tx
|
client.urgent $rd $rd $tx
|
||||||
@ -175,6 +186,18 @@ mode "resize" {
|
|||||||
bindsym Escape mode "default"
|
bindsym Escape mode "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Minecraft mode
|
||||||
|
mode "minecraft" {
|
||||||
|
bindsym $mod+r exec "xdotool mousedown 3"
|
||||||
|
bindsym $mod+shift+r exec "xdotool mouseup 3";mode "default"
|
||||||
|
bindsym $mod+d exec "xdotool mousedown 1"
|
||||||
|
bindsym $mod+shift+d exec "xdotool mouseup 1";mode "default"
|
||||||
|
bindsym $mod+s exec "sleep 1;xdotool keydown Shift_R;sleep 1;xdotool mousedown 3"
|
||||||
|
bindsym $mod+shift+s exec "xdotool keyup Shift_R;xdotool mouseup 3";mode "default"
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
bindsym $mod+m mode "minecraft"
|
||||||
|
|
||||||
# Startup
|
# Startup
|
||||||
# Monitor setup
|
# Monitor setup
|
||||||
@ -188,7 +211,7 @@ exec --no-startup-id xmodmap ~/.xmodmap
|
|||||||
#exec --no-startup-id ~/xmodmap.sh
|
#exec --no-startup-id ~/xmodmap.sh
|
||||||
# Misc
|
# Misc
|
||||||
# Compositor
|
# Compositor
|
||||||
exec --no-startup-id compton
|
#exec --no-startup-id compton
|
||||||
# Spawn a terminal
|
# Spawn a terminal
|
||||||
#TODO: Currently the terminal will spawn in the current workspace
|
#TODO: Currently the terminal will spawn in the current workspace
|
||||||
exec --no-startup-id /usr/bin/urxvt
|
exec --no-startup-id /usr/bin/urxvt
|
||||||
@ -202,10 +225,10 @@ exec --no-startup-id /usr/bin/numlockx
|
|||||||
# Run firefox/firefox-bin
|
# Run firefox/firefox-bin
|
||||||
exec --no-startup-id firefox -p a || firefox-bin -p a
|
exec --no-startup-id firefox -p a || firefox-bin -p a
|
||||||
# Start syncthing if it hasn't already been started
|
# Start syncthing if it hasn't already been started
|
||||||
#exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing ~/bin/syncthing'
|
exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing ~/bin/syncthing'
|
||||||
exec --no-startup-id nextcloud
|
exec --no-startup-id nextcloud
|
||||||
# Start kdeconnect
|
# Start kdeconnect
|
||||||
exec --no-startup-id "~/bin/indicator-kdeconnect"
|
#exec --no-startup-id "~/bin/indicator-kdeconnect"
|
||||||
# riot
|
# riot
|
||||||
exec --no-startup-id riot-web --hidden
|
exec --no-startup-id riot-web --hidden
|
||||||
# vim: ts=2:sw=2:et
|
# vim: ts=2:sw=2:et
|
62
skel/.i3/i3status.conf
Normal file
62
skel/.i3/i3status.conf
Normal 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
|
@ -1,5 +1,22 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
if [ "$1" = "lock" ];then
|
ARG="$1"
|
||||||
|
shift
|
||||||
|
if [ "$ARG" = "move" ]; then
|
||||||
|
shift
|
||||||
|
eval "$(xdotool getwindowfocus getwindowgeometry | grep Geometry: | perl -pe 's/^\s*Geometry: /WinH=/;s/x/\nWinW=/g')"
|
||||||
|
eval "$(xdotool getwindowfocus getwindowgeometry | grep Position: | perl -pe 's/^\s*Position: /WinY=/;s/,/\nWinX=/g;s/\s\(.+//')"
|
||||||
|
eval "$(xrandr | grep -w connected | perl -pe 's/.+?(\d+x\d+)\+\d+\+\d+.*/\1/g;s/^/MonH=/;s/x/\nMonW=/;' | head -n2)"
|
||||||
|
if [ "$ARG" = "top" ]; then
|
||||||
|
echo $((WinY))
|
||||||
|
xdotool getwindowfocus windowmove $((WinY - 1)) 0
|
||||||
|
elif [ "$ARG" = "right" ]; then
|
||||||
|
xdotool getwindowfocus windowmove $((MonH - WinH)) $((WinX - 1))
|
||||||
|
elif [ "$ARG" = "left" ]; then
|
||||||
|
xdotool getwindowfocus windowmove 0 $((WinX - 1))
|
||||||
|
elif [ "$ARG" = "bottom" ]; then
|
||||||
|
xdotool getwindowfocus windowmove $((WinY - 1)) $((MonW - WinW))
|
||||||
|
fi
|
||||||
|
elif [ "$ARG" = "lock" ];then
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
declare -i ID
|
declare -i ID
|
||||||
@ -14,19 +31,19 @@ if [ "$1" = "lock" ];then
|
|||||||
echo "Touchpad enabled."
|
echo "Touchpad enabled."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "pass" ];then
|
if [ "$ARG" = "pass" ];then
|
||||||
pass -c $(ls ~/.password-store/*/*|cut -b-37 --complement|rofi -dmenu|sed -e 's/\.gpg//')
|
pass -c $(ls ~/.password-store/*/*|cut -b-37 --complement|rofi -dmenu|sed -e 's/\.gpg//')
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "screensaver" ];then
|
if [ "$ARG" = "screensaver" ];then
|
||||||
cat /tmp/noss||i3lock -di `shuf -n1 -e ~/.i3/wall/*`
|
cat /tmp/noss||i3lock -di `shuf -n1 -e ~/.i3/wall/*`
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "wall" ];then
|
if [ "$ARG" = "wall" ];then
|
||||||
#if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi;
|
#if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi;
|
||||||
#feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)"
|
#feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)"
|
||||||
#feh --bg-scale ~/.i3/image.png
|
#feh --bg-scale ~/.i3/image.png
|
||||||
feh --bg-scale "$(shuf -n1 <(realpath /home/stonewareslord/sync/wallpaper/"$(hostname)"/*))"
|
feh --bg-scale "$(shuf -n1 <(realpath /home/stonewareslord/sync/wallpaper/"$(hostname)"/*))"
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "swap" ];then
|
if [ "$ARG" = "swap" ];then
|
||||||
python << EOF
|
python << EOF
|
||||||
import i3
|
import i3
|
||||||
swap = [output for output in i3.get_outputs() if output['active']]
|
swap = [output for output in i3.get_outputs() if output['active']]
|
||||||
@ -36,7 +53,7 @@ if len(swap) == 2:
|
|||||||
i3.command('move', 'workspace to output right')
|
i3.command('move', 'workspace to output right')
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "boot" ];then
|
if [ "$ARG" = "boot" ];then
|
||||||
test -f ~/.screenlayout/default.sh && ~/.screenlayout/default.sh
|
test -f ~/.screenlayout/default.sh && ~/.screenlayout/default.sh
|
||||||
/usr/bin/xset -b
|
/usr/bin/xset -b
|
||||||
/usr/bin/xset +fp /usr/share/fonts/X11/misc
|
/usr/bin/xset +fp /usr/share/fonts/X11/misc
|
||||||
@ -58,7 +75,7 @@ if [ "$1" = "boot" ];then
|
|||||||
xinput --set-prop 'Logitech USB Optical Mouse' 'Device Accel Constant Deceleration' 3
|
xinput --set-prop 'Logitech USB Optical Mouse' 'Device Accel Constant Deceleration' 3
|
||||||
$(which ck-launch-session 2>/dev/null) $(which i3)
|
$(which ck-launch-session 2>/dev/null) $(which i3)
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "screen-lock" ];then
|
if [ "$ARG" = "screen-lock" ];then
|
||||||
revert(){
|
revert(){
|
||||||
xset dpms 0 0 0
|
xset dpms 0 0 0
|
||||||
}
|
}
|
||||||
@ -67,11 +84,11 @@ if [ "$1" = "screen-lock" ];then
|
|||||||
slock
|
slock
|
||||||
revert
|
revert
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "paste" ]; then
|
if [ "$ARG" = "paste" ]; then
|
||||||
sleep 2
|
sleep 2
|
||||||
DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel)
|
DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel)
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "ping" ]; then
|
if [ "$ARG" = "ping" ]; then
|
||||||
shift
|
shift
|
||||||
# Return code
|
# Return code
|
||||||
local RET=0
|
local RET=0
|
||||||
@ -80,35 +97,35 @@ if [ "$1" = "ping" ]; then
|
|||||||
# -4 : ipv4 only
|
# -4 : ipv4 only
|
||||||
# check if nc has -z
|
# check if nc has -z
|
||||||
if nc -h |& grep -q -- -z; then
|
if nc -h |& grep -q -- -z; then
|
||||||
nc -w 1 -z4 "$1" "$2" >& /dev/null && RET=1
|
nc -w 1 -z4 "$ARG" "$1" >& /dev/null && RET=1
|
||||||
# check if nc has --transfer (-x)
|
# check if nc has --transfer (-x)
|
||||||
elif nc -h |& grep -q -- --transfer; then
|
elif nc -h |& grep -q -- --transfer; then
|
||||||
nc -w 1 -4 "$1" "$2" -x </dev/null >& /dev/null && RET=1
|
nc -w 1 -4 "$ARG" "$1" -x </dev/null >& /dev/null && RET=1
|
||||||
fi
|
fi
|
||||||
echo $RET
|
echo $RET
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "ip" ]; then
|
if [ "$ARG" = "ip" ]; then
|
||||||
shift
|
shift
|
||||||
local RET=0
|
local RET=0
|
||||||
if [ "$(hostname)" = "MMLin" ]; then
|
if [ "$(hostname)" = "MMLin" ]; then
|
||||||
if grep -q "$1" < <(ifconfig enp2s0f0); then
|
if grep -q "$ARG" < <(ifconfig enp2s0f0); then
|
||||||
RET=1
|
RET=1
|
||||||
fi
|
fi
|
||||||
elif [ "$(hostname)" = "G2" ]; then
|
elif [ "$(hostname)" = "G2" ]; then
|
||||||
if grep -q "$1" < <(ifconfig enp1s0;ifconfig wlp2s0); then
|
if grep -q "$ARG" < <(ifconfig enp1s0;ifconfig wlp2s0); then
|
||||||
RET=1
|
RET=1
|
||||||
fi
|
fi
|
||||||
elif [ "$(hostname)" = "SGen" ]; then
|
elif [ "$(hostname)" = "SGen" ]; then
|
||||||
if grep -q "$1" < <(ifconfig enp0s25); then
|
if grep -q "$ARG" < <(ifconfig enp0s25); then
|
||||||
RET=1
|
RET=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo $RET
|
echo $RET
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "copy" ]; then
|
if [ "$ARG" = "copy" ]; then
|
||||||
(printf '-chegg ';xsel | perl -pe 's/[^a-zA-Z ]//g;chomp()') | xsel && notify-send "Copied" || notify-send "Error"
|
(printf '-chegg ';xsel | perl -pe 's/[^a-zA-Z ]//g;chomp()') | xsel && notify-send "Copied" || notify-send "Error"
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "screenshot" ]; then
|
if [ "$ARG" = "screenshot" ]; then
|
||||||
\rm -f ~/last-photo/*(N)
|
\rm -f ~/last-photo/*(N)
|
||||||
sleep .2
|
sleep .2
|
||||||
#DISPLAY=:0.0 xfce4-screenshooter -r -s ~/last-photo
|
#DISPLAY=:0.0 xfce4-screenshooter -r -s ~/last-photo
|
||||||
@ -118,7 +135,7 @@ if [ "$1" = "screenshot" ]; then
|
|||||||
#DISPLAY=:0.0 scrot -s "$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
#DISPLAY=:0.0 scrot -s "$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
||||||
\cp ~/last-photo/* ~/Pictures
|
\cp ~/last-photo/* ~/Pictures
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "shutdownprompt" ]; then
|
if [ "$ARG" = "shutdownprompt" ]; then
|
||||||
RESP=$(printf 'Sleep\nNMRestart\nShutdown\nRestart\nLogout\n' | rofi -i -dmenu 2>/dev/null)
|
RESP=$(printf 'Sleep\nNMRestart\nShutdown\nRestart\nLogout\n' | rofi -i -dmenu 2>/dev/null)
|
||||||
if [[ ! -z "$RESP" ]]; then
|
if [[ ! -z "$RESP" ]]; then
|
||||||
case "$RESP" in
|
case "$RESP" in
|
||||||
@ -143,13 +160,13 @@ if [ "$1" = "shutdownprompt" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "run" ]; then
|
if [ "$ARG" = "run" ]; then
|
||||||
PATH="$HOME/bin:/usr/games/bin:$PATH" rofi -show run
|
PATH="$HOME/bin:/usr/games/bin:$PATH" rofi -show run
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "window" ]; then
|
if [ "$ARG" = "window" ]; then
|
||||||
rofi -show window
|
rofi -show window
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "clip" ]; then
|
if [ "$ARG" = "clip" ]; then
|
||||||
# Get the rofi-selected index of what to paste
|
# Get the rofi-selected index of what to paste
|
||||||
local INDEX="$(gpaste-client --oneline | colrm 80 | rofi -dmenu | perl -pe 's/:.*//')"
|
local INDEX="$(gpaste-client --oneline | colrm 80 | rofi -dmenu | perl -pe 's/:.*//')"
|
||||||
# If they made a selection, select it
|
# If they made a selection, select it
|
||||||
@ -157,3 +174,32 @@ if [ "$1" = "clip" ]; then
|
|||||||
gpaste-client select "$INDEX"
|
gpaste-client select "$INDEX"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ "$ARG" = "ssh_helper" ]; then
|
||||||
|
if [ -f /proc/net/wireless ]; then
|
||||||
|
WIRELESS_DEV="$(perl -ne 'print if s/(\w+):.*/\1/' </proc/net/wireless)"
|
||||||
|
SSID="$(iw dev $WIRELESS_DEV link | perl -ne 'printf if s/\s*SSID: //')"
|
||||||
|
elif command -v iwgetid >/dev/null; then
|
||||||
|
SSID="$(iwgetid wlan0 -r)"
|
||||||
|
elif command -v nmcli >/dev/null; then
|
||||||
|
SSID="$(nmcli -t -f active,ssid dev wifi | perl -ne 'print if s/yes://;')"
|
||||||
|
elif command -v termux-wifi-connectioninfo >/dev/null; then
|
||||||
|
# Android device (termux)
|
||||||
|
SSID="$(termux-wifi-connectioninfo | perl -ne 'print if s/^\s*"ssid": "(.+)",$/\1/')"
|
||||||
|
fi
|
||||||
|
case "$(hostname)" in
|
||||||
|
sgen|egen|runner2)
|
||||||
|
SSID=ATTskUYuI2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
logger "Found SSID for $(hostname): $SSID"
|
||||||
|
case "$SSID" in
|
||||||
|
ATTskUYuI2)
|
||||||
|
logger "ssh -q -W ${1} 192.168.1.200"
|
||||||
|
ssh -q -W "${1}" 192.168.1.200
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
logger "ssh -q -W ${1} -p 23 austenwares.com"
|
||||||
|
ssh -q -W "${1}" -p 23 austenwares.com
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
@ -1,4 +1,3 @@
|
|||||||
set-option -g default-shell /bin/zsh
|
|
||||||
#set -g mouse on
|
#set -g mouse on
|
||||||
set -g status-bg black
|
set -g status-bg black
|
||||||
set -g status-fg white
|
set -g status-fg white
|
||||||
@ -15,10 +14,6 @@ set -g prefix C-a
|
|||||||
bind C-a send-prefix
|
bind C-a send-prefix
|
||||||
unbind C-b
|
unbind C-b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bind-key -n M-v split-window -h
|
bind-key -n M-v split-window -h
|
||||||
bind-key -n M-V split-window -v
|
bind-key -n M-V split-window -v
|
||||||
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
|
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
|
||||||
@ -35,9 +30,6 @@ bind-key -n M-[ previous-window
|
|||||||
bind-key -n M-] next-window
|
bind-key -n M-] next-window
|
||||||
bind-key -n M-f resize-pane -Z
|
bind-key -n M-f resize-pane -Z
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bind-key H resize-pane -L 5
|
bind-key H resize-pane -L 5
|
||||||
bind-key J resize-pane -D 5
|
bind-key J resize-pane -D 5
|
||||||
bind-key K resize-pane -U 5
|
bind-key K resize-pane -U 5
|
@ -2,23 +2,19 @@
|
|||||||
if has('conceal')
|
if has('conceal')
|
||||||
set conceallevel=2 concealcursor=i
|
set conceallevel=2 concealcursor=i
|
||||||
endif
|
endif
|
||||||
let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
"let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
||||||
let g:formatters_cpp = ['my_custom_cpp']
|
"let g:formatters_cpp = ['my_custom_cpp']
|
||||||
let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
"let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
||||||
let g:formatters_java = ['my_custom_java']
|
"let g:formatters_java = ['my_custom_java']
|
||||||
let g:UltiSnipsUsePythonVersion=3
|
|
||||||
command! WW %!sudo tee > /dev/null %
|
command! WW %!sudo tee > /dev/null %
|
||||||
"TODO: Fix this
|
"TODO: Fix this
|
||||||
"let g:rbpt_loadcmd_toggle = 1
|
"let g:rbpt_loadcmd_toggle = 1
|
||||||
let g:indent_guides_auto_colors = 0
|
"let g:indent_guides_auto_colors = 0
|
||||||
"Required for CSC216, not needed for current classes
|
|
||||||
"autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab
|
|
||||||
"au FileType twig let b:AutoPairs['%']='%'
|
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
set grepprg=grep\ -nH\ $*
|
set grepprg=grep\ -nH\ $*
|
||||||
let g:tex_flavor='latex'
|
"let g:tex_flavor='latex'
|
||||||
|
|
||||||
"match Error /\s\+$/
|
"match Error /\s\+$/
|
||||||
" Basic, very important mappings {
|
" Basic, very important mappings {
|
||||||
@ -33,81 +29,79 @@ let g:tex_flavor='latex'
|
|||||||
vnoremap j gj
|
vnoremap j gj
|
||||||
vnoremap k gk
|
vnoremap k gk
|
||||||
"Horizontal
|
"Horizontal
|
||||||
nnoremap Y y$
|
noremap H ^
|
||||||
nnoremap H ^
|
|
||||||
nnoremap L $
|
nnoremap L $
|
||||||
vnoremap L $h
|
vnoremap L $h
|
||||||
vnoremap H ^
|
|
||||||
|
nnoremap Y y$
|
||||||
"Move to end of line
|
"Move to end of line
|
||||||
inoremap jk <End>
|
inoremap jk <End>
|
||||||
inoremap kj <End>
|
inoremap kj <End>
|
||||||
"Move to last character of last line
|
"Move to last character of last line
|
||||||
nnoremap G G$
|
noremap G G$
|
||||||
vnoremap G G$
|
noremap G G$
|
||||||
" }
|
" }
|
||||||
" Buffers {
|
" Buffers {
|
||||||
"Control-key movement
|
"Control-key movement
|
||||||
nnoremap <C-h> <C-w>h
|
noremap <C-h> <C-w>h
|
||||||
nnoremap <C-j> <C-w>j
|
noremap <C-j> <C-w>j
|
||||||
nnoremap <C-k> <C-w>k
|
noremap <C-k> <C-w>k
|
||||||
nnoremap <C-l> <C-w>l
|
noremap <C-l> <C-w>l
|
||||||
"Arrow keys
|
"Arrow keys
|
||||||
nnoremap <Up> <C-w>w
|
noremap <Up> <C-w>w
|
||||||
nnoremap <Down> <C-w>W
|
noremap <Down> <C-w>W
|
||||||
nnoremap <Left> :bp<CR>
|
noremap <Left> :bp<CR>
|
||||||
nnoremap <Right> :bn<CR>
|
noremap <Right> :bn<CR>
|
||||||
"Vertical and horizontal split
|
"Vertical and horizontal split
|
||||||
nnoremap <C-w>\| <C-w>v<C-w>l
|
noremap <C-w>\| <C-w>v<C-w>l
|
||||||
nnoremap <C-w>- <C-w>s<C-w>j
|
noremap <C-w>- <C-w>s<C-w>j
|
||||||
"Close buffer
|
"Close buffer
|
||||||
nnoremap <C-d> <C-w>q
|
"noremap <C-d> <C-w>q
|
||||||
"Fullscreen buffer
|
"Fullscreen buffer
|
||||||
nnoremap <C-w>z <C-w>_<C-w>\|
|
noremap <C-w>z <C-w>_<C-w>\|
|
||||||
"Go to last buffer
|
"Go to last buffer
|
||||||
nnoremap <Leader><Leader> <C-^>
|
noremap <Leader><Leader> <C-^>
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
vnoremap <silent> * :call VisualSelection('f')<CR>
|
vnoremap <silent> * :call VisualSelection('f')<CR>
|
||||||
vnoremap <silent> # :call VisualSelection('b')<CR>
|
vnoremap <silent> # :call VisualSelection('b')<CR>
|
||||||
vnoremap ; :
|
vnoremap ; :
|
||||||
nnoremap ! :!
|
|
||||||
vnoremap < <gv
|
vnoremap < <gv
|
||||||
vnoremap > >gv
|
vnoremap > >gv
|
||||||
|
noremap ! :!
|
||||||
"Disable F1
|
"Disable F1
|
||||||
nnoremap <F1> <nop>
|
noremap <F1> <nop>
|
||||||
inoremap <F1> <nop>
|
noremap! <F1> <nop>
|
||||||
vnoremap <F1> <nop>
|
|
||||||
"F2 toggle paste
|
"F2 toggle paste
|
||||||
nnoremap <F2> :set invpaste<CR>
|
noremap <F2> :set invpaste<CR>
|
||||||
"Better searching
|
"Better searching
|
||||||
nnoremap / /\v
|
noremap / /\v
|
||||||
vnoremap / /\v
|
|
||||||
"Addition and subtraction
|
"Addition and subtraction
|
||||||
nnoremap + <C-a>
|
"nnoremap + <C-a>
|
||||||
nnoremap - <C-x>
|
"nnoremap - <C-x>
|
||||||
"Backspace remove highlights
|
"Backspace remove highlights
|
||||||
nnoremap <BS> :nohlsearch<CR>g<C-g>zo
|
noremap <BS> :nohlsearch<CR>g<C-g>
|
||||||
"Better save
|
"Better save
|
||||||
nnoremap <Enter> :up<CR>:silent! call sy#start()<CR>
|
nnoremap <Enter> :up<CR>
|
||||||
"Unmap Q
|
"Unmap Q
|
||||||
nnoremap Q <Nop>
|
noremap Q <Nop>
|
||||||
" }
|
" }
|
||||||
" }
|
" }
|
||||||
" Plugin mappings {
|
" Plugin mappings {
|
||||||
"Easymotion
|
"Easymotion
|
||||||
map , <Plug>(easymotion-prefix)
|
map , <Plug>(easymotion-prefix)
|
||||||
"Ctrl-p
|
"Ctrl-p
|
||||||
nnoremap <Leader><C-p> :CtrlPFunky<CR>
|
"nnoremap <Leader><C-p> :CtrlPFunky<CR>
|
||||||
"Gundo
|
"Gundo
|
||||||
nnoremap <F5> :GundoToggle<CR>
|
"nnoremap <F5> :GundoToggle<CR>
|
||||||
"Easytags
|
"Easytags
|
||||||
"nnoremap <Leader><Space> :CtrlPTag<CR>
|
"nnoremap <Leader><Space> :CtrlPTag<CR>
|
||||||
"Replacing easytags with ctrl p buffer
|
"Replacing easytags with ctrl p buffer
|
||||||
nnoremap <Leader><Space> :CtrlPBuffer<CR>
|
"nnoremap <Leader><Space> :CtrlPBuffer<CR>
|
||||||
"Tagbar
|
"Tagbar
|
||||||
"nnoremap <Leader><Space> :Tagbar<CR>
|
"nnoremap <Leader><Space> :Tagbar<CR>
|
||||||
"Add a bundle from clipboard
|
"Add a bundle from clipboard
|
||||||
nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
|
"nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
|
||||||
"Automatic if/else/for/while wrappers
|
"Automatic if/else/for/while wrappers
|
||||||
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
|
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
|
||||||
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
|
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
|
||||||
@ -121,8 +115,12 @@ let g:tex_flavor='latex'
|
|||||||
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
|
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
|
||||||
" }
|
" }
|
||||||
" Trial mappings {
|
" Trial mappings {
|
||||||
nnoremap <Leader>o m`o<Esc>``
|
"nnoremap <Leader>o m`o<Esc>``
|
||||||
nnoremap <Leader>O m`O<Esc>``
|
"nnoremap <Leader>O m`O<Esc>``
|
||||||
|
" Always search in the forward direction
|
||||||
|
nnoremap # #/<CR><C-o>
|
||||||
|
noremap <expr> n (v:searchforward ? 'n' : 'N')
|
||||||
|
noremap <expr> N (v:searchforward ? 'N' : 'n')
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
|
||||||
@ -141,19 +139,15 @@ let g:tex_flavor='latex'
|
|||||||
set conceallevel=0
|
set conceallevel=0
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
set tabstop=2 shiftwidth=2 expandtab
|
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
|
||||||
set tags=./tags;/
|
set tags=./tags;/
|
||||||
set wildmode=longest,list,full
|
set wildmode=longest,list,full
|
||||||
set formatoptions-=r
|
set formatoptions-=rot
|
||||||
set formatoptions-=o
|
|
||||||
set diffopt+=iwhite
|
set diffopt+=iwhite
|
||||||
set noesckeys
|
set noesckeys
|
||||||
set shiftwidth=2
|
|
||||||
set tabstop=2
|
|
||||||
set modeline
|
set modeline
|
||||||
set softtabstop=2
|
|
||||||
set expandtab
|
set expandtab
|
||||||
set history=1000
|
set history=2048
|
||||||
set hidden
|
set hidden
|
||||||
"set cursorline
|
"set cursorline
|
||||||
set incsearch
|
set incsearch
|
||||||
@ -165,8 +159,7 @@ let g:tex_flavor='latex'
|
|||||||
set backup
|
set backup
|
||||||
set backupdir=~/.vim/backup
|
set backupdir=~/.vim/backup
|
||||||
set directory=~/.vim/tmp
|
set directory=~/.vim/tmp
|
||||||
set undolevels=1000
|
set undolevels=2048
|
||||||
set history=500
|
|
||||||
set ttyfast
|
set ttyfast
|
||||||
set fileformat=unix
|
set fileformat=unix
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
@ -174,7 +167,6 @@ let g:tex_flavor='latex'
|
|||||||
set foldmethod=indent
|
set foldmethod=indent
|
||||||
set foldnestmax=10
|
set foldnestmax=10
|
||||||
set foldlevel=2
|
set foldlevel=2
|
||||||
set relativenumber
|
|
||||||
set number
|
set number
|
||||||
set background=dark
|
set background=dark
|
||||||
set t_Co=256
|
set t_Co=256
|
||||||
@ -182,76 +174,47 @@ let g:tex_flavor='latex'
|
|||||||
set nocompatible
|
set nocompatible
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set textwidth=0
|
set textwidth=0
|
||||||
|
set path+=**
|
||||||
syntax on
|
syntax on
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
"lacheck does not work
|
||||||
|
let b:ale_linters = {'tex': [ "alex", "chktex", "proselint", "redpen", "vale", "write-good" ]}
|
||||||
"Polyglot conflicts with another latex editor
|
"Polyglot conflicts with another latex editor
|
||||||
let g:polyglot_disabled = ['latex']
|
let g:polyglot_disabled = ['latex']
|
||||||
"Symfony
|
|
||||||
let g:symfony_app_console_caller="php"
|
|
||||||
let g:symfony_app_console_path="bin/console"
|
|
||||||
"Signify
|
"Signify
|
||||||
let g:signify_vcs_list = [ 'git', 'svn' ]
|
let g:signify_vcs_list = [ 'git', 'svn' ]
|
||||||
let g:signify_difftool = 'diff'
|
let g:signify_difftool = 'diff'
|
||||||
"CtrlP
|
"CtrlP
|
||||||
let g:ctrlp_root_markers = ['.cproot']
|
"let g:ctrlp_root_markers = ['.cproot']
|
||||||
let g:ctrlp_custom_ignore = {
|
"let g:ctrlp_custom_ignore = {
|
||||||
\ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
|
" \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
|
||||||
\ 'file': '\v\.(exe|so|dll|class)$',
|
" \ 'file': '\v\.(exe|so|dll|class)$',
|
||||||
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
" \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
||||||
\ }
|
" \ }
|
||||||
let g:ctrlp_extensions=['funky']
|
"let g:ycm_show_diagnostics_ui=0
|
||||||
"Airline
|
"let g:ycm_path_to_python_interpreter='/usr/bin/python2.7'
|
||||||
let g:airline_left_sep='▶'
|
|
||||||
let g:airline_right_sep='◀'
|
|
||||||
let g:airline#extensions#syntastic#enabled=0
|
|
||||||
let g:ycm_show_diagnostics_ui=0
|
|
||||||
let g:ycm_path_to_python_interpreter='/usr/bin/python2.7'
|
|
||||||
"let g:syntastic_cpp_compiler = 'clang++'
|
|
||||||
"let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
|
|
||||||
let g:syntastic_cpp_compiler_options = ' -std=c++11'
|
|
||||||
let g:airline#extensions#whitespace#enabled=0
|
|
||||||
let g:airline#extensions#whitespace#show_message=0
|
|
||||||
let g:airline#extensions#tmuxline#enabled=1
|
|
||||||
"Autoformat
|
|
||||||
let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
|
|
||||||
let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
|
|
||||||
let g:formatter_cpp = ['formatdef_my_custom_cpp']
|
|
||||||
let g:formatter_php = ['formatdef_my_custom_php']
|
|
||||||
"let g:formatprg_cpp="astyle"
|
"let g:formatprg_cpp="astyle"
|
||||||
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
|
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
|
||||||
" These flags don't work for some reason
|
" These flags don't work for some reason
|
||||||
" -xn -xc -xl -S
|
" -xn -xc -xl -S
|
||||||
"Syntastic
|
|
||||||
let g:syntastic_java_javac_classpath = "~/applications/java/junit-4.12.jar:~/applications/java/hamcrest-core-1.3.jar:~/wpilib/java/current/lib/WPILib.jar:~/wpilib/java/current/lib/NetworkTables.jar:~/git/ford-java/src"
|
|
||||||
"IndentGuides
|
|
||||||
let g:indent_guides_start_level=1
|
|
||||||
let g:indent_guides_guide_size=1
|
|
||||||
let g:indent_guides_enable_on_vim_startup=1
|
|
||||||
let g:php_refactor_command='php /usr/local/bin/refactor.phar'
|
|
||||||
function! g:UltiSnips_Complete()
|
|
||||||
call UltiSnips#ExpandSnippet()
|
|
||||||
if g:ulti_expand_res == 0
|
|
||||||
if pumvisible()
|
|
||||||
return "\<C-n>"
|
|
||||||
else
|
|
||||||
call UltiSnips#JumpForwards()
|
|
||||||
if g:ulti_jump_forwards_res == 0
|
|
||||||
return "\<TAB>"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return ""
|
|
||||||
endfunction
|
|
||||||
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
"inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
"inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
let g:UltiSnipsJumpForwardTrigger="<C-S-Q>"
|
let g:UltiSnipsUsePythonVersion=3
|
||||||
let g:UltiSnipsExpandTrigger="<S-Tab>"
|
|
||||||
let g:UltiSnipsListSnippets="<C-e>"
|
"let g:UltiSnipsJumpForwardTrigger="<Tab>"
|
||||||
let g:UltiSnipsEditSplit="vertical"
|
"let g:UltiSnipsExpandTrigger="<S-Tab>"
|
||||||
let g:ycm_key_list_select_completion = []
|
let g:UltiSnipsExpandTrigger = "<tab>"
|
||||||
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
let g:UltiSnipsJumpForwardTrigger = "<tab>"
|
||||||
let loaded_matchit=1
|
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
|
||||||
|
let g:SuperTabDefaultCompletionType = '<C-n>'
|
||||||
|
|
||||||
|
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '$':'$'}
|
||||||
|
|
||||||
|
"let g:UltiSnipsExpandTrigger="<C-n>"
|
||||||
|
"let g:UltiSnipsListSnippets="<C-e>"
|
||||||
|
"let g:UltiSnipsEditSplit="vertical"
|
||||||
|
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
filetype off
|
filetype off
|
||||||
if has("win32")
|
if has("win32")
|
||||||
call plug#begin('~/vimfiles/plugged')
|
call plug#begin('~/vimfiles/plugged')
|
||||||
@ -259,23 +222,23 @@ else
|
|||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
endif
|
endif
|
||||||
" Code writing {
|
" Code writing {
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'}
|
"Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'}
|
||||||
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat
|
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-surround'
|
Plug 'https://gitea.austenwares.com/vim/vim-surround'
|
||||||
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
|
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
|
||||||
Plug 'https://gitea.austenwares.com/vim/syntastic'
|
"Plug 'https://gitea.austenwares.com/vim/syntastic'
|
||||||
"Syntax checker | https://github.com/scrooloose/syntastic
|
"Syntax checker | https://github.com/scrooloose/syntastic
|
||||||
Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' }
|
"Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||||
"File browser | https://github.com/scrooloose/nerdtree
|
"File browser | https://github.com/scrooloose/nerdtree
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-easymotion'
|
Plug 'https://gitea.austenwares.com/vim/vim-easymotion'
|
||||||
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
|
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
|
||||||
"Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' }
|
"Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' }
|
||||||
"Visual undo | https://github.com/sjl/gundo.vim
|
"Visual undo | https://github.com/sjl/gundo.vim
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-exchange'
|
"Plug 'https://gitea.austenwares.com/vim/vim-exchange'
|
||||||
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange
|
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-repeat'
|
"Plug 'https://gitea.austenwares.com/vim/vim-repeat'
|
||||||
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat
|
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-fugitive'
|
"Plug 'https://gitea.austenwares.com/vim/vim-fugitive'
|
||||||
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
|
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
|
||||||
Plug 'https://gitea.austenwares.com/vim/ctrlp.vim'
|
Plug 'https://gitea.austenwares.com/vim/ctrlp.vim'
|
||||||
"Fuzzy file search | https://github.com/kien/ctrlp.vim
|
"Fuzzy file search | https://github.com/kien/ctrlp.vim
|
||||||
@ -283,6 +246,8 @@ endif
|
|||||||
"Quickly make tables in vim | https://github.com/godlygeek/tabular
|
"Quickly make tables in vim | https://github.com/godlygeek/tabular
|
||||||
Plug 'https://gitea.austenwares.com/vim/UltiSnips'
|
Plug 'https://gitea.austenwares.com/vim/UltiSnips'
|
||||||
"Adds snippet support | https://github.com/sirver/UltiSnips
|
"Adds snippet support | https://github.com/sirver/UltiSnips
|
||||||
|
"Plug 'https://github.com/ajh17/VimCompletesMe'
|
||||||
|
"Supposed to be a good tab plugin
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-snippets'
|
Plug 'https://gitea.austenwares.com/vim/vim-snippets'
|
||||||
"Add snippets | https://github.com/honza/vim-snippets
|
"Add snippets | https://github.com/honza/vim-snippets
|
||||||
Plug 'https://gitea.austenwares.com/vim/eregex.vim'
|
Plug 'https://gitea.austenwares.com/vim/eregex.vim'
|
||||||
@ -291,11 +256,11 @@ endif
|
|||||||
"Git information inline | https://github.com/mhinz/vim-signify
|
"Git information inline | https://github.com/mhinz/vim-signify
|
||||||
Plug 'https://gitea.austenwares.com/vim/auto-pairs'
|
Plug 'https://gitea.austenwares.com/vim/auto-pairs'
|
||||||
"Automatic pairs | https://github.com/jiangmiao/auto-pairs
|
"Automatic pairs | https://github.com/jiangmiao/auto-pairs
|
||||||
Plug 'https://gitea.austenwares.com/vim/YouCompleteMe'
|
"Plug 'https://gitea.austenwares.com/vim/YouCompleteMe'
|
||||||
"Autocompletion | https://github.com/Valloric/YouCompleteMe
|
"Autocompletion | https://github.com/Valloric/YouCompleteMe
|
||||||
"Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git'
|
"Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git'
|
||||||
"Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git
|
"Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git
|
||||||
Plug 'https://gitea.austenwares.com/vim/double-tap.git'
|
"Plug 'https://gitea.austenwares.com/vim/double-tap.git'
|
||||||
"Double tap for comments
|
"Double tap for comments
|
||||||
" }
|
" }
|
||||||
" Style {
|
" Style {
|
||||||
@ -309,24 +274,26 @@ endif
|
|||||||
"256 color vim in terminal | https://github.com/godlygeek/csapprox
|
"256 color vim in terminal | https://github.com/godlygeek/csapprox
|
||||||
" }
|
" }
|
||||||
" Syntax {
|
" Syntax {
|
||||||
Plug 'https://gitea.austenwares.com/vim/vimtex'
|
"Plug 'https://gitea.austenwares.com/vim/vimtex'
|
||||||
"Latex | https://github.com/lervag/vimtex
|
"Latex | https://github.com/lervag/vimtex
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-polyglot'
|
Plug 'https://gitea.austenwares.com/vim/vim-polyglot'
|
||||||
"Many languages | https://github.com/sheerun/vim-polyglot
|
"Many languages | https://github.com/sheerun/vim-polyglot
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-vimperator'
|
"Plug 'https://gitea.austenwares.com/vim/vim-vimperator'
|
||||||
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator
|
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator
|
||||||
Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax'
|
"Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax'
|
||||||
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
|
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] }
|
"Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] }
|
||||||
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
|
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-gnupg'
|
"Plug 'https://gitea.austenwares.com/vim/vim-gnupg'
|
||||||
"GPG support | https://github.com/jamessan/vim-gnupg
|
"GPG support | https://github.com/jamessan/vim-gnupg
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste'
|
Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste'
|
||||||
"Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste
|
"Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste
|
||||||
Plug 'https://gitea.austenwares.com/vim/HiCursorWords'
|
"Plug 'https://gitea.austenwares.com/vim/HiCursorWords'
|
||||||
"Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306
|
"Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306
|
||||||
|
"Plug 'https://github.com/chrisbra/NrrwRgn'
|
||||||
|
"Narrow region | https://github.com/chrisbra/NrrwRgn
|
||||||
" }
|
" }
|
||||||
" Unused {
|
" Unused {
|
||||||
"Plug 'https://gitea.austenwares.com/vim/mirror.vim'
|
"Plug 'https://gitea.austenwares.com/vim/mirror.vim'
|
||||||
@ -335,6 +302,8 @@ endif
|
|||||||
" Staging {
|
" Staging {
|
||||||
"Plug 'https://gitea.austenwares.com/vim/vim-symfony'
|
"Plug 'https://gitea.austenwares.com/vim/vim-symfony'
|
||||||
"Plug 'dracula/vim'
|
"Plug 'dracula/vim'
|
||||||
|
Plug 'https://gitea.austenwares.com/vim/ale'
|
||||||
|
Plug 'https://gitea.austenwares.com/vim/supertab'
|
||||||
|
|
||||||
"Plug 'idanarye/vim-vebugger'
|
"Plug 'idanarye/vim-vebugger'
|
||||||
"Debugger | https://github.com/idanarye/vim-vebugger
|
"Debugger | https://github.com/idanarye/vim-vebugger
|
||||||
@ -345,8 +314,7 @@ if exists("+undofile")
|
|||||||
if isdirectory($HOME . '/.vim/undo')==0
|
if isdirectory($HOME . '/.vim/undo')==0
|
||||||
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
||||||
endif
|
endif
|
||||||
set undodir=./.vim-undo//
|
set undodir=~/.vim/undo/
|
||||||
set undodir+=~/.vim/undo//
|
|
||||||
set undofile
|
set undofile
|
||||||
endif
|
endif
|
||||||
augroup autosave
|
augroup autosave
|
||||||
@ -362,15 +330,11 @@ augroup vimrcEx
|
|||||||
\ exe "normal g`\"" |
|
\ exe "normal g`\"" |
|
||||||
\ endif
|
\ endif
|
||||||
augroup END
|
augroup END
|
||||||
if has('gui_running')
|
"if has('gui_running')
|
||||||
set guioptions-=T
|
" set guioptions-=T
|
||||||
else
|
"else
|
||||||
set t_Co=256
|
" set t_Co=256
|
||||||
if &term=='xterm' || &term=='screen'
|
"endif
|
||||||
set t_Co=256
|
|
||||||
endif
|
|
||||||
"colorscheme torte
|
|
||||||
endif
|
|
||||||
silent! colorscheme fruity
|
silent! colorscheme fruity
|
||||||
function! Initialize()
|
function! Initialize()
|
||||||
if has("win32")
|
if has("win32")
|
||||||
@ -386,27 +350,15 @@ function! Initialize()
|
|||||||
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
|
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
|
||||||
silent! so ~/_vimrc
|
silent! so ~/_vimrc
|
||||||
else
|
else
|
||||||
silent !mkdir -p ~/.vim/autoload
|
silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp
|
||||||
silent !mkdir -p ~/.vim/plugin
|
|
||||||
silent !mkdir -p ~/.vim/backup
|
|
||||||
silent !mkdir -p ~/.vim/undo
|
|
||||||
silent !mkdir -p ~/.vim/tmp
|
|
||||||
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
silent! so ~/.vimrc
|
silent! so ~/.vimrc
|
||||||
endif
|
endif
|
||||||
silent! PlugClean!
|
silent !vim +"PlugClean" +"PlugInstall" +"PlugUpdate" +"qa"
|
||||||
silent! PlugUpdate
|
|
||||||
silent! PlugInstall
|
|
||||||
q
|
q
|
||||||
endfunction
|
endfunction
|
||||||
if !exists('g:ycm_semantic_triggers')
|
set guifont=jmk\ Neep\ 10
|
||||||
let g:ycm_semantic_triggers = {}
|
"inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
|
||||||
endif
|
"map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
|
||||||
let g:ycm_semantic_triggers.tex = [
|
"map <Leader>a O<Esc>:Autoformat<CR>:v/\S/d<CR>:nohlsearch<CR>
|
||||||
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*'
|
"inoremap <expr> <CR> getline(".") =~ '^\s*\([#"]\)\s*$' ? "\<C-u>" : "\<CR>"
|
||||||
\ ]
|
|
||||||
set guifont=Gohu\ GohuFont
|
|
||||||
inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
|
|
||||||
map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
|
|
||||||
map <Leader>a O<Esc>:Autoformat<CR>:v/\S/d<CR>:nohlsearch<CR>
|
|
||||||
inoremap <expr> <CR> getline(".") =~ '^\s*\([#"]\)\s*$' ? "\<C-u>" : "\<CR>"
|
|
@ -1,15 +1,15 @@
|
|||||||
b-list() {
|
b-list() {
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
column -t <(borg list "$BORG_REPO")
|
column -t <(borg list "::")
|
||||||
else
|
else
|
||||||
borg list "$BORG_REPO::$1"
|
borg list "::$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
b-delete() {
|
b-delete() {
|
||||||
while (( $# > 0 )); do
|
while (( $# > 0 )); do
|
||||||
if [[ ! -z "$1" ]]; then
|
if [[ ! -z "$1" ]]; then
|
||||||
echo "Deleting... $1"
|
echo "Deleting... $1"
|
||||||
borg delete "$BORG_REPO::$1"
|
borg delete "::$1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -24,16 +24,16 @@ b-create() {
|
|||||||
if [[ -f "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount" ]]; then
|
if [[ -f "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount" ]]; then
|
||||||
"$SUDO" "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount"
|
"$SUDO" "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount"
|
||||||
fi
|
fi
|
||||||
"$SUDO" borg create -vpsx --exclude-caches --compression lzma,7 --exclude-from "$IGNORE_FILE" $BORG_REPO::$(hostname)-$(uuidgen) / /boot /home
|
"$SUDO" borg create -vpsx --exclude-caches --compression lzma,7 --exclude-from "$IGNORE_FILE" "::$(hostname)-$(uuidgen)" / /boot /home
|
||||||
}
|
}
|
||||||
b-rename() {
|
b-rename() {
|
||||||
borg rename -v "$BORG_REPO::$1" "$2"
|
borg rename -v "::$1" "$2"
|
||||||
}
|
}
|
||||||
b-info() {
|
b-info() {
|
||||||
borg info "$BORG_REPO::$1"
|
borg info "::$1"
|
||||||
}
|
}
|
||||||
b-diff() {
|
b-diff() {
|
||||||
borg list "$BORG_REPO"
|
borg list "::"
|
||||||
echo -n "First ID: "
|
echo -n "First ID: "
|
||||||
read ID1
|
read ID1
|
||||||
echo -n "Second ID: "
|
echo -n "Second ID: "
|
||||||
@ -60,8 +60,8 @@ b-diff() {
|
|||||||
echo "FILE_SIZE_LIST2: $FILE_SIZE_LIST2"
|
echo "FILE_SIZE_LIST2: $FILE_SIZE_LIST2"
|
||||||
echo "COMPLETED_FILE1: $COMPLETED_FILE1"
|
echo "COMPLETED_FILE1: $COMPLETED_FILE1"
|
||||||
echo "COMPLETED_FILE2: $COMPLETED_FILE2"
|
echo "COMPLETED_FILE2: $COMPLETED_FILE2"
|
||||||
borg list --short "$BORG_REPO::$ID1" | pv -N "Getting List 1" > "$FILE_LIST1"
|
borg list --short "::$ID1" | pv -N "Getting List 1" > "$FILE_LIST1"
|
||||||
borg list --short "$BORG_REPO::$ID2" | pv -N "Getting List 2" > "$FILE_LIST2"
|
borg list --short "::$ID2" | pv -N "Getting List 2" > "$FILE_LIST2"
|
||||||
# Find differences and calculate them
|
# Find differences and calculate them
|
||||||
diff <(pv -cN "List 1 Diff" "$FILE_LIST1") <(pv -cN "List 1 Diff" "$FILE_LIST2") > >(ag '^<' | perl -pe 's/^< //' > "$A_DIFFS") > >(ag '^>' | perl -pe 's/^> //' > "$B_DIFFS")
|
diff <(pv -cN "List 1 Diff" "$FILE_LIST1") <(pv -cN "List 1 Diff" "$FILE_LIST2") > >(ag '^<' | perl -pe 's/^< //' > "$A_DIFFS") > >(ag '^>' | perl -pe 's/^> //' > "$B_DIFFS")
|
||||||
# Truncate everything
|
# Truncate everything
|
||||||
@ -88,7 +88,7 @@ b-diff() {
|
|||||||
echo "$COMPLETED_FILE2"
|
echo "$COMPLETED_FILE2"
|
||||||
}
|
}
|
||||||
b-size() {
|
b-size() {
|
||||||
borg list "$BORG_REPO"
|
borg list "::"
|
||||||
echo -n "ID: "
|
echo -n "ID: "
|
||||||
read ID
|
read ID
|
||||||
if [ -z "$ID" ]; then
|
if [ -z "$ID" ]; then
|
||||||
@ -101,7 +101,7 @@ b-size() {
|
|||||||
echo "FILE_LIST: $FILE_LIST"
|
echo "FILE_LIST: $FILE_LIST"
|
||||||
echo "FILE_SIZE_LIST: $FILE_SIZE_LIST"
|
echo "FILE_SIZE_LIST: $FILE_SIZE_LIST"
|
||||||
echo "COMPLETED_FILE: $COMPLETED_FILE"
|
echo "COMPLETED_FILE: $COMPLETED_FILE"
|
||||||
borg list --short "$BORG_REPO::$ID" | pv -N "Getting List" > "$FILE_LIST"
|
borg list --short "::$ID" | pv -N "Getting List" > "$FILE_LIST"
|
||||||
while read i
|
while read i
|
||||||
do
|
do
|
||||||
test -f /"$i" && du -sh /"$i" 2>/dev/null >> "$FILE_SIZE_LIST"
|
test -f /"$i" && du -sh /"$i" 2>/dev/null >> "$FILE_SIZE_LIST"
|
||||||
@ -114,8 +114,8 @@ b-size() {
|
|||||||
b-extract() {
|
b-extract() {
|
||||||
local BACKUP="$1"
|
local BACKUP="$1"
|
||||||
shift
|
shift
|
||||||
borg extract "$BORG_REPO::$BACKUP" $*
|
borg extract "::$BACKUP" $*
|
||||||
}
|
}
|
||||||
b-cmd() {
|
b-cmd() {
|
||||||
echo "$BORG_REPO" $*
|
echo "::" $*
|
||||||
}
|
}
|
@ -15,19 +15,10 @@ export HISTFILE="$HOME/.zsh_history"
|
|||||||
setopt APPEND_HISTORY
|
setopt APPEND_HISTORY
|
||||||
setopt EXTENDED_HISTORY
|
setopt EXTENDED_HISTORY
|
||||||
setopt APPEND_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS
|
setopt APPEND_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS
|
||||||
export DISABLE_AUTO_TITLE=true
|
|
||||||
export EDITOR='vim'
|
export EDITOR='vim'
|
||||||
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
|
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
|
||||||
zstyle ':completion:*' use-cache on
|
zstyle ':completion:*' use-cache on
|
||||||
zstyle ':completion:*' cache-path ~/.cache/zsh
|
zstyle ':completion:*' cache-path ~/.cache/zsh
|
||||||
compress(){
|
|
||||||
INFILE="${1:r}.tpxz"
|
|
||||||
if [ -f "$INFILE" ]; then
|
|
||||||
echo "Won't replace $1" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
tar --xattrs -I pixz -cpf "$INFILE" $*
|
|
||||||
}
|
|
||||||
# Check if a command exists
|
# Check if a command exists
|
||||||
ex() {
|
ex() {
|
||||||
command -v "$1" >/dev/null
|
command -v "$1" >/dev/null
|
||||||
@ -42,65 +33,22 @@ else
|
|||||||
fi
|
fi
|
||||||
# For pasting in commands that start with $
|
# For pasting in commands that start with $
|
||||||
$ () {
|
$ () {
|
||||||
$*
|
"$@"
|
||||||
}
|
}
|
||||||
# A service implementation
|
|
||||||
sv () {
|
|
||||||
command="${@: -1}"
|
|
||||||
while (( $# > 1 )); do
|
|
||||||
if [[ "$command" == "i" ]]; then
|
|
||||||
echo "Status of $1"
|
|
||||||
rc-service "$1" status
|
|
||||||
shift
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
sudo true || return 2
|
|
||||||
if [[ "$1" == "sshd" ]] || [[ "$1" == "ssh" ]]; then
|
|
||||||
echo "Checking sshd config..."
|
|
||||||
sudo sshd -t && echo "Config good. Continuing" || (echo "Aborting due to bad ssh config";return 1)
|
|
||||||
fi
|
|
||||||
if [[ "$command" == "r" ]]; then
|
|
||||||
echo "Restarting $1"
|
|
||||||
sudo rc-service "$1" restart
|
|
||||||
elif [[ "$command" == "s" ]]; then
|
|
||||||
echo "Starting $1"
|
|
||||||
sudo rc-service "$1" start
|
|
||||||
elif [[ "$command" == "x" ]]; then
|
|
||||||
echo "Stopping $1"
|
|
||||||
sudo rc-service "$1" stop
|
|
||||||
else
|
|
||||||
sudo rc-service "$1" "$command"
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
compdef _services sv
|
|
||||||
# Run gui application as root by copying xauth credentials
|
# Run gui application as root by copying xauth credentials
|
||||||
asroot() {
|
asroot() {
|
||||||
# Use temporary file for added security
|
# Use temporary file for added security
|
||||||
TEMPFILE=$(tempfile)
|
TEMPFILE="$(tempfile)"
|
||||||
xauth extract $TEMPFILE $DISPLAY
|
xauth extract "$TEMPFILE" "$DISPLAY"
|
||||||
sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';"
|
sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';"
|
||||||
}
|
}
|
||||||
# De-symlink
|
# De-symlink
|
||||||
dsl() {
|
dsl() {
|
||||||
while (( $# > 0 )); do
|
while (( $# > 0 )); do
|
||||||
readlink $1 2>&1 >/dev/null && mv $(readlink $1) $1
|
readlink "$1" 2>&1 >/dev/null && mv "$(readlink "$1")" "$1"
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
# Update the sync project
|
|
||||||
update-sync-project() {
|
|
||||||
if [[ ! -L ~/.zshrc ]]; then
|
|
||||||
echo "zshrc isn't a link"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
local ABSPATH="$(\dirname "$(\dirname "$(\readlink -e ~/.zshrc)")")"
|
|
||||||
git -C "$ABSPATH" pull origin master
|
|
||||||
if (( $# > 0 )); then
|
|
||||||
"$ABSPATH/scripts/sync.sh" $*
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# Remove directory by removing subdirectories up a level
|
# Remove directory by removing subdirectories up a level
|
||||||
dedir() {
|
dedir() {
|
||||||
# Try removing the directory if it's empty, fail silently if you can't
|
# Try removing the directory if it's empty, fail silently if you can't
|
||||||
@ -130,7 +78,7 @@ mt(){
|
|||||||
syncthing) sudo multitail /var/log/syncthing.{err,log};;
|
syncthing) sudo multitail /var/log/syncthing.{err,log};;
|
||||||
g) sudo watch -c genlop -tc;;
|
g) sudo watch -c genlop -tc;;
|
||||||
sync) watch grep -e Dirty: -e Writeback: /proc/meminfo;;
|
sync) watch grep -e Dirty: -e Writeback: /proc/meminfo;;
|
||||||
*) multitail "$1"
|
*) multitail "$@"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
run() {
|
run() {
|
||||||
@ -138,103 +86,31 @@ run(){
|
|||||||
echo "Building..." >&2
|
echo "Building..." >&2
|
||||||
gcc -Wall -g -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}")
|
gcc -Wall -g -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}")
|
||||||
}
|
}
|
||||||
upload() {
|
ex vim && alias vi='vim'
|
||||||
tar -cf - "$*" | base64 | curl --data-urlencode text@- -d title="File uploaded at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)" -d name=$USER -d expire="1440" https://austenwares.com/paste/api/create | sed -e 's/view/view\/raw/'
|
ex rc-service && alias service='rc-service'
|
||||||
}
|
ex ip && alias ip='ip -c'
|
||||||
download() {
|
ex adb && alias apush="adb push -p"
|
||||||
URL="$(printf $1 | perl -pe 's/\/paste\/view(?!\/raw)/\/paste\/view\/raw/')"
|
ex adb && alias apull="adb pull -p"
|
||||||
curl "$URL" | base64 -d | tar -xf -
|
ex mtr && alias mtr='mtr -t'
|
||||||
}
|
ex telegram-cli && alias tg='telegram-cli -NWA --disable-link-preview'
|
||||||
update-tool() {
|
ex eix && alias eix="eix -F"
|
||||||
if [ "$EUID" -ne 0 ]; then
|
ex tmux && alias tmux='tmux -2'
|
||||||
echo "This function should be run as root"
|
ex tree && alias tree='tree -C'
|
||||||
return 1
|
ex ocp && alias ocp="ocp -vs0 -dcurses"
|
||||||
fi
|
alias jupyter='docker run --rm --user="$(id -u):$(id -g)" -v "$PWD":/home/jovyan/work -p 8888:8888 jupyter/scipy-notebook'
|
||||||
local RESP=""
|
|
||||||
while [[ "$RESP" != "q" ]]; do
|
|
||||||
CMD=${RESP:0:1}
|
|
||||||
case "$CMD" in
|
|
||||||
u) update -q;;
|
|
||||||
l) layman -S ;;
|
|
||||||
g) upgrade;;
|
|
||||||
e) etc-update;;
|
|
||||||
p) emerge -Av @preserved-rebuild --usepkg=n --keep-going=y;;
|
|
||||||
m) emerge -Av @module-rebuild --usepkg=n;;
|
|
||||||
d) emerge -Ava --depclean;;
|
|
||||||
h) haskell-updater -- --usepkg=n;;
|
|
||||||
c) perl-cleaner --reallyall;;
|
|
||||||
y) python-updater;;
|
|
||||||
r) revdep-rebuild;;
|
|
||||||
q) return;;
|
|
||||||
esac
|
|
||||||
RESP=${RESP:1}
|
|
||||||
if [[ ! -z "$RESP" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo "Commands:"
|
|
||||||
echo "u: update"
|
|
||||||
echo "l: layman -S"
|
|
||||||
echo "g: upgrade"
|
|
||||||
echo "e: etc-update"
|
|
||||||
echo "p: emerge @preserved-rebuild --usepkg=n --keep-going=y"
|
|
||||||
echo "m: emerge @module-rebuild --usepkg=n"
|
|
||||||
echo "d: emerge --ask --depclean"
|
|
||||||
echo "h: haskell-updater -- --usepkg=n"
|
|
||||||
echo "c: perl-cleaner --reallyall"
|
|
||||||
echo "y: python-updater"
|
|
||||||
echo "r: revdep-rebuild"
|
|
||||||
echo "q: quit"
|
|
||||||
echo -n '\a> '
|
|
||||||
read RESP
|
|
||||||
done
|
|
||||||
}
|
|
||||||
if ex vim; then
|
|
||||||
alias vi='vim'
|
|
||||||
fi
|
|
||||||
if ex rc-service; then
|
|
||||||
alias service='rc-service'
|
|
||||||
fi
|
|
||||||
if ex ip; then
|
|
||||||
alias ip='ip -c'
|
|
||||||
fi
|
|
||||||
if ex adb; then
|
|
||||||
alias apush="adb push -p"
|
|
||||||
alias apull="adb pull -p"
|
|
||||||
fi
|
|
||||||
alias cleaner="sudo ~/run.sh 'perl-cleaner --reallyall' 'python-updater' 'haskell-updater -- --usepkg=n'"
|
|
||||||
alias jsonpretty='python -m json.tool'
|
|
||||||
alias nmrestart='nmcli radio wifi off;nmcli radio wifi on'
|
|
||||||
if ex mtr; then
|
|
||||||
alias mtr='mtr -t'
|
|
||||||
fi
|
|
||||||
if ex telegram-cli; then
|
|
||||||
alias tg='telegram-cli -NWA --disable-link-preview'
|
|
||||||
fi
|
|
||||||
alias perm='stat -c "%a %n"'
|
|
||||||
alias afci='git x ./autoformat.sh;git commit -am "Autoformatted"'
|
alias afci='git x ./autoformat.sh;git commit -am "Autoformatted"'
|
||||||
if ex eix; then
|
alias con='git x php bin/console'
|
||||||
alias eix="eix -F"
|
alias disphost='export DISPLAY=:0.0'
|
||||||
fi
|
alias l='ls -CF'
|
||||||
|
alias la='ls -A'
|
||||||
|
alias less='less -R'
|
||||||
|
alias ll='ls -AlhF'
|
||||||
|
alias logout='sudo pkill -u "$USER"'
|
||||||
alias mouse1="xmodmap <(echo pointer = 1 2 3)"
|
alias mouse1="xmodmap <(echo pointer = 1 2 3)"
|
||||||
alias mouse2="xmodmap <(echo pointer = 3 2 1)"
|
alias mouse2="xmodmap <(echo pointer = 3 2 1)"
|
||||||
if ex ocp; then
|
alias nmrestart='nmcli radio wifi off;sleep 1;nmcli radio wifi on'
|
||||||
alias ocp="ocp -vs0 -dcurses"
|
|
||||||
fi
|
|
||||||
alias con='git x php bin/console'
|
|
||||||
alias srm='shred -uzv'
|
|
||||||
alias disphost='export DISPLAY=:0.0'
|
|
||||||
alias ll='ls -AlhF'
|
|
||||||
alias la='ls -A'
|
|
||||||
alias l='ls -CF'
|
|
||||||
alias logout='sudo pkill -u $USER'
|
|
||||||
if ex tmux; then
|
|
||||||
alias tmux='tmux -2'
|
|
||||||
fi
|
|
||||||
alias less='less -R'
|
|
||||||
if ex tree; then
|
|
||||||
alias tree='tree -C'
|
|
||||||
fi
|
|
||||||
alias resource='. ~/.zshrc'
|
alias resource='. ~/.zshrc'
|
||||||
|
alias srm='shred -uzv'
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
# Not Mac
|
# Not Mac
|
||||||
export PATH="$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.cargo/bin"
|
export PATH="$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.cargo/bin"
|
||||||
@ -257,43 +133,18 @@ if test -f /etc/gentoo-release; then
|
|||||||
sudo echo "Args: $*"
|
sudo echo "Args: $*"
|
||||||
# Beep, verbose, ask
|
# Beep, verbose, ask
|
||||||
sudo emerge --autounmask-write -Ava $*
|
sudo emerge --autounmask-write -Ava $*
|
||||||
echo "\a"
|
tput bel
|
||||||
}
|
}
|
||||||
|
if ex eix-sync; then
|
||||||
|
alias update="sudo eix-sync; tput bel"
|
||||||
|
elif eix emaint; then
|
||||||
|
alias update="sudo emaint sync -A; tput bel"
|
||||||
|
fi
|
||||||
upgrade() {
|
upgrade() {
|
||||||
# Sudo echo so we have immediate results on weather sudo worked
|
# Sudo echo so we have immediate results on weather sudo worked
|
||||||
sudo echo "Args: $*"
|
sudo echo "Args: $*"
|
||||||
sudo emerge --update --newuse --deep --verbose --tree --keep-going=y --verbose-conflicts --alert --ask --binpkg-respect-use=y --binpkg-changed-deps=y --backtrack=30 $* @world
|
sudo emerge --update --newuse --deep --verbose --tree --keep-going=y --verbose-conflicts --alert --ask --binpkg-respect-use=y --binpkg-changed-deps=y --backtrack=30 $* @world
|
||||||
echo "\\a"
|
tput bel
|
||||||
}
|
|
||||||
# For emerging with absolute paths
|
|
||||||
em(){
|
|
||||||
# Beep, verbose, ask
|
|
||||||
EMERGE_ARGS="-Ava"
|
|
||||||
X=""
|
|
||||||
for var in "$@"
|
|
||||||
do
|
|
||||||
if [[ "$var" =~ ^- ]]; then
|
|
||||||
EMERGE_ARGS="$EMERGE_ARGS $var"
|
|
||||||
else
|
|
||||||
X="$X =$var"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo sudo emerge "$EMERGE_ARGS""$X"
|
|
||||||
sudo emerge "$EMERGE_ARGS""$X"
|
|
||||||
echo "\a"
|
|
||||||
}
|
|
||||||
update(){
|
|
||||||
# If this is a server computer
|
|
||||||
sudo rm -f '/usr/portage/metadata/timestamp.chk'
|
|
||||||
if ex eix-update; then
|
|
||||||
sudo zsh -c "emaint sync -a&&eix-update"
|
|
||||||
else
|
|
||||||
sudo emaint sync -a
|
|
||||||
fi
|
|
||||||
sudo -k
|
|
||||||
if [ "$1" != "-q" ]; then
|
|
||||||
echo '\a'
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
elif test -f /etc/lsb-release; then
|
elif test -f /etc/lsb-release; then
|
||||||
# Ubuntu
|
# Ubuntu
|
||||||
@ -319,9 +170,7 @@ alias ............='k ../../../../../../../../../../..'
|
|||||||
alias .............='k ../../../../../../../../../../../..'
|
alias .............='k ../../../../../../../../../../../..'
|
||||||
alias ..............='k ../../../../../../../../../../../../..'
|
alias ..............='k ../../../../../../../../../../../../..'
|
||||||
alias ...............='k ../../../../../../../../../../../../../..'
|
alias ...............='k ../../../../../../../../../../../../../..'
|
||||||
if ex youtube-dl; then
|
ex youtube-dl && alias ytdl="youtube-dl -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
||||||
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
|
||||||
fi
|
|
||||||
if ex wemux; then
|
if ex wemux; then
|
||||||
alias tux="wemux"
|
alias tux="wemux"
|
||||||
elif ex tmux; then
|
elif ex tmux; then
|
||||||
@ -330,10 +179,9 @@ fi
|
|||||||
if ex git; then
|
if ex git; then
|
||||||
alias g="git"
|
alias g="git"
|
||||||
fi
|
fi
|
||||||
alias stdns="sudo sh -c 'echo nameserver 8.8.8.8 > /etc/resolv.conf'"
|
alias stdns="sudo sh -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'"
|
||||||
alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\""
|
#alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\""
|
||||||
alias fk='k `fzf --no-mouse -m -1 -x`'
|
alias fk='k `fzf --no-mouse -m -1 -x`'
|
||||||
#alias susp="sudo true&&((slock;sleep 2;nmcli radio wifi off;nmcli radio wifi on)&echo mem | sudo tee /sys/power/state >/dev/null);sudo -k"
|
|
||||||
alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)"
|
alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)"
|
||||||
if ex sudo; then
|
if ex sudo; then
|
||||||
alias s='sudo -Hu'
|
alias s='sudo -Hu'
|
||||||
@ -346,11 +194,14 @@ if ex rsync; then
|
|||||||
fi
|
fi
|
||||||
alias -g nify=" > /dev/null 2>&1 &"
|
alias -g nify=" > /dev/null 2>&1 &"
|
||||||
alias -g nifyd=" > /dev/null 2>&1 & disown"
|
alias -g nifyd=" > /dev/null 2>&1 & disown"
|
||||||
alias -g L="2>&1|less"
|
alias -g L="|& less"
|
||||||
|
if ex mktemp; then
|
||||||
|
alias mtmp='pushd "$(mktemp -d)" >/dev/null'
|
||||||
|
fi
|
||||||
if ex rg; then
|
if ex rg; then
|
||||||
alias -g G='|& rg'
|
alias -g G='|& rg'
|
||||||
alias rg='rg -i'
|
alias rg='rg -i'
|
||||||
# I'm so sorry ggreer
|
# I'm so sorry, ggreer
|
||||||
alias ag=rg
|
alias ag=rg
|
||||||
elif ex ag; then
|
elif ex ag; then
|
||||||
alias -g G='|& ag'
|
alias -g G='|& ag'
|
||||||
@ -359,6 +210,7 @@ elif ex egrep; then
|
|||||||
elif ex grep; then
|
elif ex grep; then
|
||||||
alias -g G='|& grep'
|
alias -g G='|& grep'
|
||||||
fi
|
fi
|
||||||
|
alias bp="tput bel"
|
||||||
timer() {
|
timer() {
|
||||||
for i in {1.."$1"}; do
|
for i in {1.."$1"}; do
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -366,7 +218,7 @@ timer() {
|
|||||||
done | pv -Sptels "$1" >/dev/null
|
done | pv -Sptels "$1" >/dev/null
|
||||||
}
|
}
|
||||||
fixsh() {
|
fixsh() {
|
||||||
sed -i -e $1"d" ~/.ssh/known_hosts
|
sed -i'' -e "${1}d" ~/.ssh/known_hosts
|
||||||
}
|
}
|
||||||
mv() { /bin/mv -v "$@" }
|
mv() { /bin/mv -v "$@" }
|
||||||
m() { mv "$@" }
|
m() { mv "$@" }
|
||||||
@ -389,65 +241,22 @@ linx() {
|
|||||||
elif (( $# == 1 )) && [[ -f "$1" ]]; then
|
elif (( $# == 1 )) && [[ -f "$1" ]]; then
|
||||||
linx < "$1"
|
linx < "$1"
|
||||||
else
|
else
|
||||||
tar -cf - $* | linx
|
tar -cf - "$@" | linx
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
grename() {
|
|
||||||
echo incomplete
|
|
||||||
return
|
|
||||||
FILES=($*)
|
|
||||||
REGEX='s///'
|
|
||||||
echo -n "Command (frneVVVq): "
|
|
||||||
while read input; do
|
|
||||||
case $input in
|
|
||||||
f)
|
|
||||||
echo "File list:"
|
|
||||||
printf '%s\n' $FILES
|
|
||||||
;;
|
|
||||||
r)
|
|
||||||
echo "Regex:"
|
|
||||||
echo "$REGEX"
|
|
||||||
;;
|
|
||||||
n)
|
|
||||||
echo "Simulated replacement:"
|
|
||||||
perl-rename -n "$REGEX" $FILES
|
|
||||||
;;
|
|
||||||
e)
|
|
||||||
echo "Editing regex..."
|
|
||||||
TEMPFILE=$(tempfile)
|
|
||||||
(cat <(printf '%s\n' $FILES);echo;echo "$REGEX") > $TEMPFILE
|
|
||||||
vim $TEMPFILE +'normal G$h'
|
|
||||||
REGEX=$(tac $TEMPFILE|grep -m1 '.')
|
|
||||||
rm $TEMPFILE
|
|
||||||
;;
|
|
||||||
VVV)
|
|
||||||
echo "Actual results:"
|
|
||||||
perl-rename -v $REGEX $FILES
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
q)
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo -n "Command (frneVVVq): "
|
|
||||||
done
|
|
||||||
}
|
|
||||||
bp(){
|
|
||||||
echo '\a'
|
|
||||||
}
|
|
||||||
ltar() {
|
ltar() {
|
||||||
tar -cf - $@|pv -WcN tar|xz|pv -WcN lzma
|
tar -cf - "$@"|pv -WcN tar|xz|pv -WcN lzma
|
||||||
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
||||||
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
||||||
}
|
}
|
||||||
ctar() {
|
ctar() {
|
||||||
tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip
|
tar -cf - "$@"|pv -WcN tar|gzip|pv -WcN gzip
|
||||||
}
|
}
|
||||||
offline() {
|
offline() {
|
||||||
if [ ! -z "$@" ] ; then
|
if [ ! -z "$@" ] ; then
|
||||||
sudo unshare -n -- sudo -u $USER zsh -c "$@"
|
sudo unshare -n -- sudo -u "$USER" zsh -c "$@"
|
||||||
else
|
else
|
||||||
sudo unshare -n -- sudo -u $USER LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
|
sudo unshare -n -- sudo -u "$USER" LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
dnstest() {
|
dnstest() {
|
||||||
@ -456,7 +265,7 @@ dnstest(){
|
|||||||
echo "Testing DNS:"
|
echo "Testing DNS:"
|
||||||
dig google.com
|
dig google.com
|
||||||
echo "Testing ping:"
|
echo "Testing ping:"
|
||||||
ping -c 2 8.8.8.8
|
ping -c 2 1.1.1.1
|
||||||
echo "Testing IP curl:"
|
echo "Testing IP curl:"
|
||||||
curl -L 178.33.250.62
|
curl -L 178.33.250.62
|
||||||
echo
|
echo
|
||||||
@ -464,12 +273,8 @@ dnstest(){
|
|||||||
curl -L portquiz.net
|
curl -L portquiz.net
|
||||||
}
|
}
|
||||||
tsh() {
|
tsh() {
|
||||||
ssh -X $*
|
ssh "$@"
|
||||||
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"
|
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
compdefas () {
|
compdefas () {
|
||||||
local a
|
local a
|
||||||
@ -504,26 +309,6 @@ create-repo(){
|
|||||||
read -s password
|
read -s password
|
||||||
curl --user "$username:$password" -d name="$1" -d private="$PRIVATE" https://gitea.austenwares.com/api/v1/user/repos
|
curl --user "$username:$password" -d name="$1" -d private="$PRIVATE" https://gitea.austenwares.com/api/v1/user/repos
|
||||||
}
|
}
|
||||||
hsh(){
|
|
||||||
FILE="$1"
|
|
||||||
ARGS=""
|
|
||||||
while (( $# > 0 )); do
|
|
||||||
if [[ "md5" = "$1" ]] || [[ "md5sum" = "$1" ]] || [[ "m" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "md5sum
|
|
||||||
elif [[ "sha1" = "$1" ]] || [[ "sha1sum" = "$1" ]] || [[ "s" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha1sum
|
|
||||||
elif [[ "sha2" = "$1" ]] || [[ "sha256sum" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha256sum
|
|
||||||
elif [[ "sha512" = "$1" ]] || [[ "sha512sum" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha512sum
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
ARGS=$(echo "$ARGS"|xargs)
|
|
||||||
echo "Calculating ($ARGS) of \"$FILE\""
|
|
||||||
echo pv "$FILE" \| pee $ARGS
|
|
||||||
pv "$FILE" | pee $(echo $ARGS)
|
|
||||||
}
|
|
||||||
rc() {
|
rc() {
|
||||||
case $1 in
|
case $1 in
|
||||||
z) vim ~/.zshrc;;
|
z) vim ~/.zshrc;;
|
||||||
@ -539,30 +324,6 @@ rc(){
|
|||||||
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords keywords license"
|
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords keywords license"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
pub-git-rm(){
|
|
||||||
if (( $# == 0 )) ; then
|
|
||||||
git remote rm local
|
|
||||||
git remote rm ncsu
|
|
||||||
git remote rm gitlab
|
|
||||||
git remote rm aws
|
|
||||||
fi
|
|
||||||
while (( $# > 0 )) ; do
|
|
||||||
git remote rm "$1"
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
pub-git-push(){
|
|
||||||
if (( $# == 0 )) ; then
|
|
||||||
git push local --all && git push local --tags
|
|
||||||
git push ncsu --all && git push ncsu --tags
|
|
||||||
git push gitlab --all && git push gitlab --tags
|
|
||||||
git push aws --all && git push aws --tags
|
|
||||||
fi
|
|
||||||
while (( $# > 0 )) ; do
|
|
||||||
git push "$1" --all && git push "$1" --tags
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
k() {
|
k() {
|
||||||
#More than 1 arguement
|
#More than 1 arguement
|
||||||
if [[ $# > 1 ]] ; then
|
if [[ $# > 1 ]] ; then
|
||||||
@ -620,16 +381,7 @@ if ex fasd; then
|
|||||||
eval "$(fasd --init auto)"
|
eval "$(fasd --init auto)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Old config options that are no longer in use
|
|
||||||
#alias pg="pcregrep -M"
|
|
||||||
#if command -v greadlink 2>&1 >/dev/null; then
|
|
||||||
# alias readlink='greadlink'
|
|
||||||
#fi
|
|
||||||
#alias steamo='sudo kill -9 `pidof steam`;sudo unshare -n -- sh -c "ifconfig lo up;sudo -u $USER steam" > /dev/null 2>&1 & disown'
|
|
||||||
#alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
#alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
||||||
#alias aoeu='setxkbmap -layout us -option "'
|
|
||||||
#alias asdf='setxkbmap -layout dvorak -option ""'
|
|
||||||
#alias sudo='sudo -H'
|
|
||||||
echo -ne '[# ]\r'
|
echo -ne '[# ]\r'
|
||||||
source ~/.zsh-git/lpr/liquidprompt
|
source ~/.zsh-git/lpr/liquidprompt
|
||||||
source ~/.zsh-git/omg/base.sh
|
source ~/.zsh-git/omg/base.sh
|
17
sync.sh
Executable file
17
sync.sh
Executable 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"
|
Loading…
Reference in New Issue
Block a user