summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2022-09-01 02:08:18 -0500
committerMitsuo Tokumori <[email protected]>2022-09-01 02:08:18 -0500
commit637de36e40185e67c51d2d85b6d61fafb3835248 (patch)
treede6aaf15dd1e014568aae2e88874d05ab9438cdc
parentd19f39580a3adddca8b2c26edc97b331dded495d (diff)
downloaddotfiles-637de36e40185e67c51d2d85b6d61fafb3835248.tar.gz
dotfiles-637de36e40185e67c51d2d85b6d61fafb3835248.tar.bz2
dotfiles-637de36e40185e67c51d2d85b6d61fafb3835248.zip
Tidy up directory and install script. Add test.sh
-rw-r--r--bash/bash_aliases (renamed from bash_aliases)0
-rw-r--r--bash/bashrc (renamed from bashrc)2
-rw-r--r--bash/inputrc (renamed from inputrc)0
-rw-r--r--bash/profile (renamed from profile)0
-rwxr-xr-x[-rw-r--r--]install.sh72
-rwxr-xr-xtest.sh12
-rw-r--r--tmux/tmux.conf (renamed from tmux.conf)4
-rw-r--r--tmux/tmux.conf.local (renamed from tmux.conf.local)14
-rw-r--r--vim/vimrc_windows (renamed from vimrc_windows)0
9 files changed, 66 insertions, 38 deletions
diff --git a/bash_aliases b/bash/bash_aliases
index 9131407..9131407 100644
--- a/bash_aliases
+++ b/bash/bash_aliases
diff --git a/bashrc b/bash/bashrc
index f26c754..0bdac5a 100644
--- a/bashrc
+++ b/bash/bashrc
@@ -99,7 +99,7 @@ export LESS
export TLDR_CONFIG_DIR="$XDG_CONFIG_HOME"
# gpg
-export GPG=TTY=$(tty)
+export GPG_TTY=$(tty)
# tmux
export TERM="xterm-256color"
diff --git a/inputrc b/bash/inputrc
index f40f4a2..f40f4a2 100644
--- a/inputrc
+++ b/bash/inputrc
diff --git a/profile b/bash/profile
index 956694c..956694c 100644
--- a/profile
+++ b/bash/profile
diff --git a/install.sh b/install.sh
index 9fcd2fa..36c84b6 100644..100755
--- a/install.sh
+++ b/install.sh
@@ -10,54 +10,70 @@
# Note: This solution is lazy and causes some problems. Like not being able to
# track vim pluggins.
-
# Config
# ======
-platform="linux" # linux,windows
-mode="copy" # copy,slink
+mode=$1 # copy,slink
+
+# Prepare
+# =======
-# Auto config
-# ===========
+# HOME variable must be available
+
+if [[ -z $XDG_CONFIG_HOME ]]; then
+ XDG_CONFIG_HOME="$HOME/.config"
+ mkdir -p $XDG_CONFIG_HOME
+fi
-# Append ~ later (bash only does 1 substitution of variables)
-if [[ $platform = "linux" ]]; then
- VIMFILES=".vim"
-elif [[ $platform = "windows" ]]; then
- VIMFILES="vimfiles"
+if [[ $mode = "copy" ]]; then
+ cp_or_ln="cp"
+elif [[ $mode = "slink" ]]; then
+ cp_or_ln="ln -s" # if you are fearless add the `-f` option
+else
+ echo "Usage: $0 copy|slink"
+ exit
fi
-[[ $mode = "copy" ]] && cp_or_ln="cp"
-[[ $mode = "slink" ]] && cp_or_ln="ln -s"
+VIMFILES="$HOME/.vim" # In windows it's `%userprofile%/vimfiles/`
-# Commands
-# ========
+# Install
+# =======
-# bash ( eval concatenates and executes)
+# bash (`eval` concatenates and executes)
-eval $cp_or_ln " ${PWD}/profile ~/.profile"
-eval $cp_or_ln " ${PWD}/bash_aliases ~/.bash_aliases"
-eval $cp_or_ln " ${PWD}/bashrc ~/.bashrc"
-eval $cp_or_ln " ${PWD}/inputrc ~/.inputrc"
+eval $cp_or_ln " ${PWD}/bash/profile $HOME/.profile"
+eval $cp_or_ln " ${PWD}/bash/bashrc $HOME/.bashrc"
+eval $cp_or_ln " ${PWD}/bash/bash_aliases $HOME/.bash_aliases"
+eval $cp_or_ln " ${PWD}/bash/inputrc $HOME/.inputrc"
# vim
-# ~/.vimrc takes priority over ~/.vim/vimrc, so remove the former first
+# `~/.vimrc` takes priority over `~/.vim/vimrc`. Remove the former if it exists
-mkdir -p ~/$VIMFILES/{undo,swap,backup,plugins}
-chmod 0700 ~/.vim/swap # swap files should only be readable by owner
+mkdir -p $VIMFILES/{undo,swap,backup,plugins}
+chmod 0700 $VIMFILES/swap # swap files should only be readable by owner
-eval $cp_or_ln " ${PWD}/vim/vimrc ~/$VIMFILES/vimrc"
-eval $cp_or_ln " ${PWD}/vim/fun.vim ~/$VIMFILES/fun.vim"
+eval $cp_or_ln " ${PWD}/vim/vimrc $VIMFILES/vimrc"
+eval $cp_or_ln " ${PWD}/vim/fun.vim $VIMFILES/fun.vim"
# git
-[ -d ~/.config/git ] || mkdir -p ~/.config/git
-eval $cp_or_ln " ${PWD}/git/ignore ~/.config/git/ignore"
-eval $cp_or_ln " ${PWD}/git/config ~/.config/git/config"
-eval $cp_or_ln " ${PWD}/git/git-prompt.sh ~/.git-prompt.sh"
+[ -d $XDG_CONFIG_HOME/git ] || mkdir -p $XDG_CONFIG_HOME/git
+eval $cp_or_ln " ${PWD}/git/ignore $XDG_CONFIG_HOME/git/ignore"
+eval $cp_or_ln " ${PWD}/git/config $XDG_CONFIG_HOME/git/config"
+eval $cp_or_ln " ${PWD}/git/git-prompt.sh $HOME/.git-prompt.sh"
+
+# zathura
+
+mkdir -p $XDG_CONFIG_HOME/zathura
+eval $cp_or_ln " ${PWD}/other/zathurarc $XDG_CONFIG_HOME/zathura/zathurarc"
+
+# tmux
+
+eval $cp_or_ln " ${PWD}/tmux/tmux.conf $HOME/.tmux.conf"
+eval $cp_or_ln " ${PWD}/tmux/tmux.conf.local $HOME/.tmux.conf.local"
# done
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..6aaee71
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Test installation script
+
+HOME=build
+XDG_CONFIG_HOME=build/.config
+mkdir -p build/.config
+
+./install.sh $1
+
+tree -a build
+#rm -r build
diff --git a/tmux.conf b/tmux/tmux.conf
index 961e6b3..9f4b070 100644
--- a/tmux.conf
+++ b/tmux/tmux.conf
@@ -17,8 +17,8 @@ set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
-set -g prefix2 C-a # GNU-Screen compatible prefix
-bind C-a send-prefix -2
+#set -g prefix2 C-a # GNU-Screen compatible prefix
+#bind C-a send-prefix -2
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
diff --git a/tmux.conf.local b/tmux/tmux.conf.local
index 2770c1f..dd8d84f 100644
--- a/tmux.conf.local
+++ b/tmux/tmux.conf.local
@@ -235,7 +235,7 @@ tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see
# - #{username}
# - #{username_ssh}
tmux_conf_theme_status_left=" โ #S | โ†‘#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} "
-tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} "
+tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} "
# status left style
tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8"
@@ -279,8 +279,8 @@ tmux_conf_theme_synchronized_bg="none"
tmux_conf_theme_synchronized_attr="none"
# battery bar symbols
-tmux_conf_battery_bar_symbol_full="โ—ผ"
-tmux_conf_battery_bar_symbol_empty="โ—ป"
+tmux_conf_battery_bar_symbol_full="๐Ÿ”‹"
+tmux_conf_battery_bar_symbol_empty="๐Ÿชซ"
#tmux_conf_battery_bar_symbol_full="โ™ฅ"
#tmux_conf_battery_bar_symbol_empty="ยท"
@@ -311,10 +311,10 @@ tmux_conf_battery_vbar_palette="gradient"
#tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
# symbols used to indicate whether battery is charging or discharging
-tmux_conf_battery_status_charging="โ†‘" # U+2191
-tmux_conf_battery_status_discharging="โ†“" # U+2193
-#tmux_conf_battery_status_charging="๐Ÿ”Œ" # U+1F50C
-#tmux_conf_battery_status_discharging="๐Ÿ”‹" # U+1F50B
+#tmux_conf_battery_status_charging="โ†‘" # U+2191
+#tmux_conf_battery_status_discharging="โ†“" # U+2193
+tmux_conf_battery_status_charging="๐Ÿ”Œ" # U+1F50C
+tmux_conf_battery_status_discharging="๐Ÿ”‹" # U+1F50B
# clock style (when you hit <prefix> + t)
# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
diff --git a/vimrc_windows b/vim/vimrc_windows
index 8ce69cd..8ce69cd 100644
--- a/vimrc_windows
+++ b/vim/vimrc_windows