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 *.tmp
*.secret *.secret
/.repositories /.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 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language
Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language
Plug 'neoclide/coc.nvim', {'branch': 'release'} " language server completion 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 'JakeBecker/elixir-ls', {'for': ['elixir', 'eelixir'], 'do': { -> g:elixirls.compile() }}
Plug 'tpope/vim-dadbod' " databasing in vim Plug 'tpope/vim-dadbod' " databasing in vim
Plug 'lytedev/elm-vim' " elm lang Plug 'lytedev/elm-vim' " elm lang

View File

@ -2,13 +2,18 @@
source "$DOTFILES_PATH/de/bar/bar.bash" --just-vars 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="$BAR_FONT"
LAUNCHER_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*=\([0-9]*\).*$/\1/p' | head -n 1) LAUNCHER_FONT_SIZE="$BAR_FONT_SIZE"
HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*color4*:\s*\(.*\)$/\1/p' | head -n 1) HIGHLIGHT_COLOR="$(xrq color4)"
HIGHLIGHT_FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1) HIGHLIGHT_FOREGROUND_COLOR="$(xrq background)"
BACKGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1) BACKGROUND_COLOR=$(xrq background)
FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*foreground:\s*\(.*\)$/\1/p' | head -n 1) FOREGROUND_COLOR=$(xrq foreground)
GAP=$(xrdb -query | sed -ne 's/.*internalBorder:\s*\(.*\)$/\1/p' | head -n 1) 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 \ rofi \
-combi-modi run,window \ -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 export POS_Y=0
# allow a per-device config to override options # allow a per-device config to override options
if [ -f "$HOME/.env_bar" ]; then echo "$EDFP"
source "$HOME/.env_bar" if [ -f "$EDFP/bar" ]; then
source "$EDFP/bar"
fi fi
export BAR_FONT_DECLARATION="${BAR_FONT}:pixelsize=${BAR_FONT_SIZE};1" 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 }') MONITOR_COUNT=$(echo "${BSPWM_MONITORS}" | wc -w | awk '{ printf $1 }')
NUM_DESKTOPS=${#DESKTOPS[@]} NUM_DESKTOPS=${#DESKTOPS[@]}
PER_MONITOR=$((NUM_DESKTOPS / MONITOR_COUNT)) PER_MONITOR=$((NUM_DESKTOPS / MONITOR_COUNT))
REVERSE_DESKTOP_ORDERING=0
# allow a per-device config to override options # allow a per-device config to override options
if [ -f "$HOME/.env_bspwm" ]; then if [ -f "$EDFP/bspwm" ]; then
source "$HOME/.env_bspwm" source "$EDFP/bspwm"
fi fi
bspc config normal_border_color "$(xrdb -query | sed -ne 's/.*background:\s*//p')" 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)) i=$((max + 1))
done done
# allow a per-device config to override options if [[ $REVERSE_DESKTOP_ORDERING -eq 1 ]]; then
if [ -f "$HOME/.env_bspwm_after" ]; then prev_mon=
source "$HOME/.env_bspwm_after" 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 fi

View File

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

View File

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

View File

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

36
setup
View File

@ -1,6 +1,10 @@
#!/usr/bin/env bash #!/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 INTERACTIVE=1
@ -13,9 +17,6 @@ while test $# -gt 0; do
esac esac
done done
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
source "${dfp}/scripts/setup_helpers.bash"
links=( links=(
# desktop environment files # desktop environment files
"$dfp/de/bspwm/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" "$dfp/de/bspwm/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc"
@ -98,6 +99,33 @@ links=(
"$dfp/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs" "$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? # TODO: pass interactive?
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}" _dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}"

View File

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