Tons of cleanup and improve extensibility and consistency

This commit is contained in:
Daniel Flanagan 2019-10-30 08:52:55 -05:00
parent 6e911f59e0
commit 1ae7fdd439
64 changed files with 84 additions and 37 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ colors/gen/tmp
*.tmp
*.secret
/.repositories
/.env/

View file

@ -108,7 +108,6 @@ Plug 'sheerun/vim-polyglot' " vim plugin loa
Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language
Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language
Plug 'neoclide/coc.nvim', {'branch': 'release'} " language server completion
Plug 'neoclide/coc-json' " coc config ft
Plug 'JakeBecker/elixir-ls', {'for': ['elixir', 'eelixir'], 'do': { -> g:elixirls.compile() }}
Plug 'tpope/vim-dadbod' " databasing in vim
Plug 'lytedev/elm-vim' " elm lang

View file

@ -2,13 +2,18 @@
source "$DOTFILES_PATH/de/bar/bar.bash" --just-vars
LAUNCHER_FONT=$(xrdb -query | sed -ne 's/.*font:\s*xft:\([^: ]*\).*$/\1/p' | head -n 1)
LAUNCHER_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*=\([0-9]*\).*$/\1/p' | head -n 1)
HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*color4*:\s*\(.*\)$/\1/p' | head -n 1)
HIGHLIGHT_FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1)
BACKGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1)
FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*foreground:\s*\(.*\)$/\1/p' | head -n 1)
GAP=$(xrdb -query | sed -ne 's/.*internalBorder:\s*\(.*\)$/\1/p' | head -n 1)
LAUNCHER_FONT="$BAR_FONT"
LAUNCHER_FONT_SIZE="$BAR_FONT_SIZE"
HIGHLIGHT_COLOR="$(xrq color4)"
HIGHLIGHT_FOREGROUND_COLOR="$(xrq background)"
BACKGROUND_COLOR=$(xrq background)
FOREGROUND_COLOR=$(xrq foreground)
GAP=$(xrq internalBorder)
# load a per-device config last so anything can be overridden
if [ -a "$EDFP/app-launcher" ]; then
source "$EDFP/app-launcher"
fi
rofi \
-combi-modi run,window \

8
bin/xrq Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
if [[ -z $1 ]]; then
echo "No argument provided. Showing everything..." >&2
xrdb -query
fi
xrdb -query | sed -ne 's/.*'"$1"':\s*\(.*\)$/\1/p' | head -n 1

View file

@ -24,8 +24,9 @@ export BAR_VERTICAL_MARGIN=0
export POS_Y=0
# allow a per-device config to override options
if [ -f "$HOME/.env_bar" ]; then
source "$HOME/.env_bar"
echo "$EDFP"
if [ -f "$EDFP/bar" ]; then
source "$EDFP/bar"
fi
export BAR_FONT_DECLARATION="${BAR_FONT}:pixelsize=${BAR_FONT_SIZE};1"

View file

@ -8,10 +8,11 @@ BSPWM_MONITORS=$(bspc query -M | tac)
MONITOR_COUNT=$(echo "${BSPWM_MONITORS}" | wc -w | awk '{ printf $1 }')
NUM_DESKTOPS=${#DESKTOPS[@]}
PER_MONITOR=$((NUM_DESKTOPS / MONITOR_COUNT))
REVERSE_DESKTOP_ORDERING=0
# allow a per-device config to override options
if [ -f "$HOME/.env_bspwm" ]; then
source "$HOME/.env_bspwm"
if [ -f "$EDFP/bspwm" ]; then
source "$EDFP/bspwm"
fi
bspc config normal_border_color "$(xrdb -query | sed -ne 's/.*background:\s*//p')"
@ -42,7 +43,17 @@ for mon in ${BSPWM_MONITORS}; do
i=$((max + 1))
done
# allow a per-device config to override options
if [ -f "$HOME/.env_bspwm_after" ]; then
source "$HOME/.env_bspwm_after"
if [[ $REVERSE_DESKTOP_ORDERING -eq 1 ]]; then
prev_mon=
for mon in ${BSPWM_MONITORS}; do
if [[ ! -z $prev_mon ]]; then
bspc monitor "$mon" --swap "$prev_mon"
fi
prev_mon="$mon"
done
fi
# allow a per-device config to override options
if [ -f "$EDFP/bspwm-after" ]; then
source "$EDFP/bspwm-after"
fi

View file

@ -180,7 +180,7 @@ super + shift + Return
# spawn the app launcher
super + space
"$DOTFILES_PATH/scripts/bin/app-launcher" -modi run -show run
app-launcher -modi run -show run
# lock the desktop
super + ctrl + shift + l

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash
echo "xloadresources" >> "$HOME/.xstartup_log"
ENV_TYPE="${1}"
if [[ "$ENV_TYPE" = "auto" ]]; then
@ -10,23 +8,20 @@ if [[ "$ENV_TYPE" = "auto" ]]; then
else
ENV_TYPE=""
fi
echo "xloadresources auto env: $ENV_TYPE" >> "$HOME/.xstartup_log"
fi
if [[ -z "$ENV_TYPE" ]]; then
ENV_TYPE=""
else
ENV_TYPE=".${ENV_TYPE}"
ENV_TYPE="${ENV_TYPE}-"
fi
sysresources="/etc/X11/xinit/.Xresources"
sysmodmap="/etc/X11/xinit/.Xmodmap"
userresources="$HOME/.Xresources"
usercolors="$HOME/.Xresources.colors"
userenv="$HOME/.Xresources${ENV_TYPE}.env"
usermodmap="$HOME/.Xmodmap"
echo "userenv: $userenv" >> "$HOME/.xstartup_log"
usercolors="$DOTFILES_PATH/scripts/colors/xresources"
userenv="$EDFP/x/${ENV_TYPE}resources"
usermodmap="$EDFP/x/modmap"
if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources" >/dev/null 2>&1
@ -45,7 +40,6 @@ if [ -f "$usercolors" ]; then
fi
if [ -f "$userenv" ]; then
echo "Merging env Xresources: $userenv" >> ~/.xstartup_log
xrdb -merge "$userenv" >/dev/null 2>&1
fi

View file

@ -1,2 +0,0 @@
*
!.gitignore

36
setup
View file

@ -1,6 +1,10 @@
#!/usr/bin/env bash
# TODO: ascii art header
# TODO: ascii art header since I'm a leet haxx0r
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
source "${dfp}/scripts/setup_helpers.bash"
edfp="${dfp}/.env"
INTERACTIVE=1
@ -13,9 +17,6 @@ while test $# -gt 0; do
esac
done
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
source "${dfp}/scripts/setup_helpers.bash"
links=(
# desktop environment files
"$dfp/de/bspwm/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc"
@ -98,6 +99,33 @@ links=(
"$dfp/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs"
)
mkdir -p "$edfp/"
if [[ ! -L "$HOME/.env" ]]; then
ln -s "$edfp/" "$HOME/.env/"
fi
mkdir -p "$edfp/bash.d/"
mkdir -p "$edfp/bin/"
mkdir -p "$edfp/x/"
mkdir -p "$HOME/.bin/"
touches=(
"$edfp/bash"
"$edfp/x/init"
"$edfp/x/profile"
"$edfp/x/resources"
"$edfp/vim"
"$edfp/bspwm"
"$edfp/bar"
"$edfp/app-launcher"
)
for t in "${touches[@]}"; do
touch "$t"
done
chmod 700 -R "$edfp"
chmod 700 -R "$HOME/.bin"
# TODO: pass interactive?
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}"

View file

@ -5,6 +5,8 @@
# for making sure they're loaded!
export XDG_CONFIG_HOME="$HOME/.config"
export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles"
export ENV_DOTFILES_PATH="$DOTFILES_PATH/.env"
export EDFP="$ENV_DOTFILES_PATH" # shorter alias
NICE_HOME="$HOME"
# TODO: better logic for auto-detecting alternative home directories?
@ -98,8 +100,8 @@ HISTIGNORE='ls:ll:la'
shopt -s cmdhist
# load a per-device config last so anything can be overridden
if [ -a "$HOME/.env_bashrc" ]; then
source "$HOME/.env_bashrc"
if [ -a "$EDFP/bash" ]; then
source "$EDFP/bash"
fi
# we assume the user uses "$HOME" to just store their mess of dotfiles and other

View file

@ -4,9 +4,9 @@ export GOPATH="$HOME/.go"
# PATH=$PATH:$APPENDED_PATH
export PATH=$PATH:"$GOPATH/bin"
export PATH=$PATH:"$DOTFILES_PATH/scripts/bin"
export PATH=$PATH:"$DOTFILES_PATH/scripts/env_bin"
export PATH=$PATH:"$HOME/.env_bin"
export PATH=$PATH:"$DOTFILES_PATH/bin"
export PATH=$PATH:"$EDFP/bin"
export PATH=$PATH:"$HOME/.bin"
export PATH=$PATH:"$HOME/.cargo/bin"
export PATH=$PATH:"$HOME/.yarn/bin"