diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-10-15 20:56:41 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-10-15 20:56:41 -0400 |
| commit | eefbd029b55b2782b0d7b11b4989ce0ca9b256cd (patch) | |
| tree | 535511fd3154342117d67171e28a312bd30c7f87 | |
| parent | 5840f413825e053b645a338d71c1916a06094335 (diff) | |
| download | dotfiles-eefbd029b55b2782b0d7b11b4989ce0ca9b256cd.tar.gz dotfiles-eefbd029b55b2782b0d7b11b4989ce0ca9b256cd.tar.xz | |
Massive organization of my dotfiles
| -rw-r--r-- | .gitignore | 3 | ||||
| -rwxr-xr-x | build/vim (renamed from vim-build.sh) | 2 | ||||
| -rw-r--r-- | crt/ibm-amber.json | 26 | ||||
| -rw-r--r-- | crt/ibm-blue.json | 26 | ||||
| -rw-r--r-- | crt/ibm-green.json | 26 | ||||
| -rw-r--r-- | crt/ibm-grey-color.json | 26 | ||||
| -rw-r--r-- | crt/ibm-grey.json | 26 | ||||
| -rw-r--r-- | crt/profont-color.json | 26 | ||||
| l--------- | keys/barracuda.txt | 1 | ||||
| l--------- | keys/personal.txt | 1 | ||||
| -rwxr-xr-x | linux/kernel/package.sh (renamed from kernel_package.sh) | 0 | ||||
| -rwxr-xr-x | linux/kernel/upgrade.sh (renamed from kernel_upgrade.sh) | 0 | ||||
| l--------- | mkshrc.txt | 1 | ||||
| -rw-r--r-- | net/vlan.sh | 48 | ||||
| -rw-r--r-- | net/workstation.sh | 48 | ||||
| -rwxr-xr-x | openbsd_net.sh | 83 | ||||
| -rw-r--r-- | send.sh | 23 | ||||
| -rwxr-xr-x | shell/build.sh | 17 | ||||
| -rw-r--r-- | shell/conf | 23 | ||||
| -rw-r--r-- | snap/btrfs.sh (renamed from btrfs-snap.sh) | 0 | ||||
| -rw-r--r-- | snap/lvm.sh (renamed from lvm-snapshot.sh) | 0 | ||||
| -rw-r--r-- | tmux/tmux.conf (renamed from tmux.conf) | 10 | ||||
| -rw-r--r-- | tmux/tmux_helper.sh (renamed from tmux_helper.sh) | 0 | ||||
| -rw-r--r-- | tmux/tmx.sh (renamed from tmx.sh) | 0 | ||||
| -rw-r--r-- | util/hexify.c | 11 | ||||
| -rw-r--r-- | util/terminal-colors (renamed from terminal-colors) | 0 | ||||
| -rwxr-xr-x | util/zram.sh (renamed from zram.sh) | 0 | ||||
| -rw-r--r-- | vimrc | 50 |
28 files changed, 80 insertions, 397 deletions
@@ -1,5 +1,2 @@ *.txz *.7z -mkshrc -ashrc -bashrc @@ -1,4 +1,6 @@ #!/bin/sh +# Build vim from source code, with my usual options + set -e set -x diff --git a/crt/ibm-amber.json b/crt/ibm-amber.json deleted file mode 100644 index 98f63e9..0000000 --- a/crt/ibm-amber.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 0, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#ffaa00", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "ibm-amber" -} diff --git a/crt/ibm-blue.json b/crt/ibm-blue.json deleted file mode 100644 index 8c59f09..0000000 --- a/crt/ibm-blue.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 0, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#0055ff", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "ibm-blue" -} diff --git a/crt/ibm-green.json b/crt/ibm-green.json deleted file mode 100644 index 2e1a0a6..0000000 --- a/crt/ibm-green.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 0, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#00ff5b", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "ibm-green" -} diff --git a/crt/ibm-grey-color.json b/crt/ibm-grey-color.json deleted file mode 100644 index 89cffb7..0000000 --- a/crt/ibm-grey-color.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 1, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#afafaf", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "ibm-grey-color" -} diff --git a/crt/ibm-grey.json b/crt/ibm-grey.json deleted file mode 100644 index 77023e5..0000000 --- a/crt/ibm-grey.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 0, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#afafaf", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "ibm-grey" -} diff --git a/crt/profont-color.json b/crt/profont-color.json deleted file mode 100644 index 32ebd48..0000000 --- a/crt/profont-color.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ambientLight": 0, - "backgroundColor": "#000000", - "bloom": 0.4, - "brightness": 0.5, - "burnIn": 0, - "chromaColor": 1, - "contrast": 0.85, - "customCommand": "", - "flickering": 0, - "fontColor": "#afafaf", - "fontName": "IBM_3278", - "fontWidth": 1, - "frameName": "NO_FRAME", - "glowingLine": 0, - "horizontalSync": 0, - "jitter": 0, - "rasterization": 0, - "rbgShift": 0, - "saturationColor": 0.9743, - "screenCurvature": 0.1, - "staticNoise": 0, - "useCustomCommand": false, - "windowOpacity": 1, - "name": "profont-color" -} diff --git a/keys/barracuda.txt b/keys/barracuda.txt deleted file mode 120000 index 5c238a3..0000000 --- a/keys/barracuda.txt +++ /dev/null @@ -1 +0,0 @@ -barracuda
\ No newline at end of file diff --git a/keys/personal.txt b/keys/personal.txt deleted file mode 120000 index 1a6df4b..0000000 --- a/keys/personal.txt +++ /dev/null @@ -1 +0,0 @@ -personal
\ No newline at end of file diff --git a/kernel_package.sh b/linux/kernel/package.sh index 14a23b2..14a23b2 100755 --- a/kernel_package.sh +++ b/linux/kernel/package.sh diff --git a/kernel_upgrade.sh b/linux/kernel/upgrade.sh index dab1518..dab1518 100755 --- a/kernel_upgrade.sh +++ b/linux/kernel/upgrade.sh diff --git a/mkshrc.txt b/mkshrc.txt deleted file mode 120000 index 81ef8a0..0000000 --- a/mkshrc.txt +++ /dev/null @@ -1 +0,0 @@ -mkshrc
\ No newline at end of file diff --git a/net/vlan.sh b/net/vlan.sh deleted file mode 100644 index 2ca1f0c..0000000 --- a/net/vlan.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -set -e -# A short script to setup the network on a server creating bridges for each -# vlan specified. - -# Why? NetworkManager sucks and so do other network utilities. This is simple -# and fits the need of creating a virtual machine host that can place VMs -# on any one of the vlans. - -defaultrouter="10.9.8.7" -nameservers="10.11.12.13 10.12.14.16" -vlan_ifs="eth0 eth1 eth3" -eth0_vlan_ids="10" -eth0_vlan_10_inet="10.10.1.2/24" -eth1_vlan_ids="20 34 38 60 160 240 432" -eth1_vlan_60_inet="10.60.8.2/24" -eth3_vlan_ids=50 -eth3_vlan_50_inet="10.50.0.1/24" -echo="echo" - -for if in $vlan_ifs ; do - $echo ip link set up $if - eval vlan_ids="\$${if}_vlan_ids" - - for id in $vlan_ids; do - $echo ip link add link $if name ${if}.${id} type vlan id ${id} - $echo brctl addbr vlan${id} - $echo brctl addif vlan${id} ${if}.${id} - $echo ip link set up ${if}.${id} - - eval inet="\$${if}_vlan_${id}_inet" - if ! [ -z "$inet" ] ; then - $echo ip -4 addr add "$inet" dev ${if}.${id}. - fi - done -done - -$echo ip route add default via $defaultrouter - -$echo truncate -s 0 /etc/resolv.conf -for ns in $nameservers ; do - if ! [ -z "$echo" ] ; then - echo echo nameserver $ns '>>' /etc/resolv.conf - else - echo nameserver $ns >> /etc/resolv.conf - fi -done - diff --git a/net/workstation.sh b/net/workstation.sh deleted file mode 100644 index 7639a6e..0000000 --- a/net/workstation.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# net.sh -# Sets up a bridged network specifically for use on a laptop or workstation. -# Called by `/etc/rc.local` on my Void Linux machine - -bridges="vbr0 br0" - -br0_ifs="enp2s0" -# vbr0_ifs="" -vbr0_inet="10.33.33.1/24" -vbr0_inet6="fc00:333::1/64" - -assign_inet_for_if() { -_if="$1" ; shift -eval _inet="\$${_if}_inet" -for addr in $_inet ; do - ip -4 addr add $addr dev $br -done -} - -assign_inet6_for_if() { -_if="$1" ; shift -eval _inet="\$${_if}_inet6" -for addr in $_inet ; do - ip -6 addr add $addr dev $br -done -} - -for br in $bridges ; do - brctl addbr $br - ip link set up "$br" - - eval _ifs="\$${br}_ifs" - for _if in $_ifs ; do - brctl addif "$br" "$_if" - ip link set up "$_if" - done - - assign_inet_for_if "${br}" - assign_inet6_for_if "${br}" -done - -for _if in $_ifs ; do - assign_inet_for_if "$_if" - assign_inet6_for_if "$_if" - - ip link set up "$_if" -done diff --git a/openbsd_net.sh b/openbsd_net.sh deleted file mode 100755 index ad8993d..0000000 --- a/openbsd_net.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -set -e - -# No trailing slash -conf_dir="/etc/net" -interface="iwn0" - -help(){ -cat <<EOF -Usage: $0 [option] - -$0 Allows you to set, edit, or display saved interface configurations placed -in "$conf_dir". - -Configurations are in the standard hostname.if(5) format. - -Where option is: - -l List all of the available network names. - -s "\$name" Sets the network name - -e "\$name" Edit the configuration file of "\$name" - -d "\$name" Display the configuration file of "\$name" - -i "\$interface" Override the interface ($interface) set in the script. - -D Set the interface down and remove all IP addresses -EOF -if ! [ -z "$1" ] ; then - exit "$1" -else - exit 0 -fi -} - -list() { - find "$conf_dir" -type f | sed -e"s@$conf_dir/@@g" -} - -edit_net() { - if [ -z "$1" ] ; then - echo "Please pass in a file name!" - exit 1 - fi - _f="$1"; shift - "$EDITOR" "${conf_dir}/$_f" -} - -display_net() { - if [ -z "$1" ] ; then - echo "Please pass in a file name!" - exit 1 - fi - _f="$1"; shift - cat "${conf_dir}/$_f" -} - -set_net() { - if [ -z "$1" ] ; then - echo "Please pass in a file name!" - exit 1 - fi - _f="$1"; shift - - if [ -L "/etc/hostname.${interface}" ] ; then - rm "/etc/hostname.${interface}" - fi - ln -s "${conf_dir}/$_f" "/etc/hostname.${interface}" - sh /etc/netstart -} - -down_net() { - ifconfig "$interface" down -inet -inet6 -} - -if [ -z "$1" ] ; then - help -fi -while [ $# -gt 0 ] ; do case $1 in - -i) interface="$2"; shift; shift ;; - -l) shift; list ; break ;; - -s) shift; set_net "$@" ; break ;; - -d) shift; display_net "$@" ; break ;; - -e) shift; edit_net "$@" ; break ;; - -D) shift; down_net "$@" ; break ;; - *) help 1;; -esac ; done diff --git a/send.sh b/send.sh deleted file mode 100644 index 7db7c7a..0000000 --- a/send.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -set -e -# set -x - -# Simple shell script to package and send over my dotfiles to a remote machine - -package="$(mktemp -d)" - -for _f in bashrc mkshrc tmux.conf tmux_helper.sh ; do - cp "$_f" "$package/.$_f" -done - -touch "$package/.tmux.conf.local" - -echo "Sending: " -ls -AF "$package" | sed -e's/^/ /' - -for host in "$@" ; do - echo "Operating on host: $host" - tar -C "$package" -czf - . | ssh "$host" "tar -xzf -" -done - -rm -rf "$package" diff --git a/shell/build.sh b/shell/build.sh index 85b648c..3a6c129 100755 --- a/shell/build.sh +++ b/shell/build.sh @@ -2,7 +2,6 @@ cat \ notice \ - ksh \ aliases \ utils \ colors \ @@ -10,19 +9,3 @@ cat \ update \ conf \ > ../mkshrc - -cat \ - notice \ - aliases \ - utils \ - colors \ - bash \ - > ../bashrc - -cat \ - notice \ - aliases \ - utils \ - colors \ - ash \ - > ../ashrc @@ -1,11 +1,15 @@ SHELL_CONFIG=".mkshrc" COLOR=0 +case "$TERM" in + xterm*) COLOR=1;; + *256color) COLOR=1;; +esac export EDITORS="ed vi vim " export PATH="$HOME/bin:$PATH" -UPDATE_URL="https://www.rygel.us/etc/" +UPDATE_URL="https://git.riedstra.us/mitch/dotfiles.git/plain/" VIM_GIT_URL="https://git.riedstra.us/mitch/vim-cfg.git" VIM_BASIC_URL="https://git.riedstra.us/mitch/vim-cfg.git/plain/basic.vim" @@ -23,33 +27,30 @@ fi set_pager set_editor # requires misc -set_go +# set_go setaliases setsudoaliases + +# checkSSHAgent # Nasty conditional for support of many different shells if + ! [ -z "$KSH_VERSION" ] || [ $SHELL = "/bin/ksh" ] || [ $SHELL = "/bin/mksh" ] || [ $SHELL = "/usr/bin/mksh" ] || - [ $SHELL = "/usr/local/bin/mksh" ] || - ! [ -z "$KSH_VERSION" ] + [ $SHELL = "/usr/local/bin/mksh" ] then export HISTFILE="$HOME/.ksh_history" set -o emacs bind ^L=clear-screen - if [ $COLOR -eq 1 ] ; then - set_prompt - else - set_basic_prompt - fi elif [ $SHELL = "/bin/sh" ] && [ "$(uname)" = "FreeBSD" ] ; then set -o emacs export PS1="$(whoami)"'@\h:\w \$ ' -else - [ $SHELL = "/bin/sh" ] && export PS1="$ " +elif ! [ -z "$BASH" ] ; then + export PROMPT_COMMAND="set_my_title" fi if [ $COLOR -eq 1 ] ; then diff --git a/btrfs-snap.sh b/snap/btrfs.sh index cc2e5a9..cc2e5a9 100644 --- a/btrfs-snap.sh +++ b/snap/btrfs.sh diff --git a/lvm-snapshot.sh b/snap/lvm.sh index 4991495..4991495 100644 --- a/lvm-snapshot.sh +++ b/snap/lvm.sh diff --git a/tmux.conf b/tmux/tmux.conf index d1b3dc0..c80958d 100644 --- a/tmux.conf +++ b/tmux/tmux.conf @@ -8,8 +8,9 @@ # New way: set -g status-style "fg=green,bg=black" set-window-option -g window-status-current-style "bg=green,fg=black" -set -g status-right "#[fg=black,bg=green] #(whoami)@#h|m:#(sh $HOME/.tmux_helper.sh memory)|l:#(sh $HOME/.tmux_helper.sh load)|#(sh $HOME/.tmux_helper.sh s_uptime)" - +set -g status-right "#[fg=black,bg=green] #(whoami)@#h|m:#(sh $HOME/.tmux_helper.sh memory)|l:#(sh $HOME/.tmux_helper.sh load)|#(sh $HOME/.tmux_helper.sh uptime)" +# For a basic tmux configuration without the helper +# set -g status-right "#[fg=black,bg=green] #(whoami)@#h" # Pretty nifty little option to mirror input for all panes bind M-s setw synchronize-panes @@ -29,7 +30,7 @@ setw -g mode-keys vi # This seems to fix that problem, it may cause other issues but I'm going to # keep an eye on it -set-option -g default-terminal "xterm-256color" +set-option -g default-terminal "tmux-256color" set-option -ga terminal-overrides ",xterm*:Tc" @@ -60,14 +61,13 @@ bind-key M-l select-pane -R # Reload configuration bind-key r source ~/.tmux.conf -# Respawn the pane ( Useful with certain +# Respawn the pane # Useful if you have `set -g remain-on-exit on` or so bind-key M-r respawn-pane # Change the status line a little bit, most are close to defaults set -g status-left-length 16 set -g status-left "[#S] " -set -g status-right "#[fg=green,bg=black] #(whoami)@#h|m:#(sh $HOME/.tmux_helper.sh memory)|l:#(sh $HOME/.tmux_helper.sh load)|#(sh $HOME/.tmux_helper.sh uptime)" set -g status-right-length 40 set -g window-status-format "#I:#W#F" diff --git a/tmux_helper.sh b/tmux/tmux_helper.sh index 7ce68bd..7ce68bd 100644 --- a/tmux_helper.sh +++ b/tmux/tmux_helper.sh diff --git a/util/hexify.c b/util/hexify.c new file mode 100644 index 0000000..3aec576 --- /dev/null +++ b/util/hexify.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +int main() { + int c; + while ((c = getchar()) != EOF) { + printf("\\x%X", c); + if ( c == '\n' ) { + puts(""); + } + } +} diff --git a/terminal-colors b/util/terminal-colors index cbd7dcb..cbd7dcb 100644 --- a/terminal-colors +++ b/util/terminal-colors @@ -0,0 +1,50 @@ +" See the full vim configuration: https://git.riedstra.us/mitch/vim-cfg.git/about/ +" Basic vimrc for systems you don't want to copy the full one to +set encoding=utf-8 " The encoding displayed. +set fileencoding=utf-8 " The encoding written to file. +set background=dark " Since most terminals I have dark backgrounds +set nu " Line 'nu'mbers +set listchars=tab:▸\ ,eol:¬,trail:• " Listchars are used to show normally + " invisible chars such as tabs, EOL and + " trailing whitespace +" set listchars=tab:\|\ " Alternative listchars w/o special chars. +set colorcolumn=80 " Sets a "coloured" coloumn to tell you where your line + " breaks should be so you don't piss off people using + " a terminal. +set ic " Case insensitive search by default +set hls " Highlight my searches by default +set updatecount=0 " Do not write swap files +set nocompatible " Don't be compatbile with 'vi' +set tabstop=4 " Tab width +set shiftwidth=4 +set noexpandtab " Do **NOT** turn tabs into spaces by default +" Be smart about the mouse +set mouse+=a +if &term =~ '^screen' + " tmux knows the extended mouse mode + set ttymouse=xterm2 +endif +syntax on " Syntax highlighting by default + + +set nomodeline " I know how to setup my editor, I don't need your + " changes to my vim configuration. + +" Use \-n in normal mode to toggle line numbers +nmap <leader>n :set invnu<CR> +" Use \-l in normal mode to toggle listchars +nmap <leader>l :set list!<CR> + +" Use \-s to pop open a spelling menu. use ]s to search forwards and [s to go +" backwards. +" Apparently this also doesn't work if spell checking isn't enabled +" at the time you enable it. +set spell +nnoremap \s ea<C-X><C-S> +set nospell + +" set hidden " This will allow you to change buffers w/o saving + +" Omni completion, c-x c-o in insert/append mode +" filetype plugin on +" set omnifunc=syntaxcomplete#Complete |
