From ba8ec1f5248f1c30c7ab69f73cd05ca223631712 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 9 Jan 2020 19:02:31 -0600 Subject: [PATCH 1/5] Fix some dock stuff, erlang with wx --- bin/dotfiles-update | 5 +++++ bin/lib/arch-linux/provisioning/2-essentials.bash | 2 +- bin/workdock | 3 ++- setup | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 bin/dotfiles-update diff --git a/bin/dotfiles-update b/bin/dotfiles-update new file mode 100755 index 0000000..ea41dbe --- /dev/null +++ b/bin/dotfiles-update @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# TODO: implement + +echo "Not implemented" diff --git a/bin/lib/arch-linux/provisioning/2-essentials.bash b/bin/lib/arch-linux/provisioning/2-essentials.bash index b1d2532..cc027bc 100755 --- a/bin/lib/arch-linux/provisioning/2-essentials.bash +++ b/bin/lib/arch-linux/provisioning/2-essentials.bash @@ -13,7 +13,7 @@ pacaur --needed -S \ htop `# Process Management and System Resources Monitoring` \ openssh mosh `# Remote Access` \ openssl `# Crypto` \ - elixir `# Elixir Language` \ + erlang elixir `# Elixir Language` \ nodejs npm yarn `# JavaScript Runtime` \ python python-pip `# Python 3 Language` \ pass `# Password Management` \ diff --git a/bin/workdock b/bin/workdock index d91677b..1a5beb4 100755 --- a/bin/workdock +++ b/bin/workdock @@ -1,10 +1,11 @@ #!/usr/bin/env bash resrc -source "$HOME/.workdock.env" +source "$EDFP/workdock" --just-vars "${DOTFILES_PATH}/apps/de/x/loadresources" lodpi autorandr --change "${DOTFILES_PATH}/apps/de/bspwm/bspwmrc" "${DOTFILES_PATH}/apps/de/x/loadresources" lodpi restartbar "${HOME}/.fehbg" +source "$EDFP/workdock" diff --git a/setup b/setup index 06b2c48..5ff2e5f 100755 --- a/setup +++ b/setup @@ -133,6 +133,7 @@ touches=( "$edfp/bspwm" "$edfp/polybar" "$edfp/app-launcher" + "$edfp/workdock" ) for t in "${touches[@]}"; do From 2f1af8411adec6ae34d122dfb02b666ea3b4f097 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 16 Jan 2020 13:28:23 -0600 Subject: [PATCH 2/5] Stuff --- apps/de/sway/config | 2 +- apps/de/sway/init | 3 ++- apps/tmpfiles/disable-lid-wakeup | 1 + apps/udev-rules/lowbat | 2 ++ .../usb-device-plugin} | 0 apps/udev-rules/wifi-powersave | 1 + bin/lib/arch-linux/provisioning/3-extras.bash | 1 + bin/lib/sudo_setup | 14 +++++++++++--- 8 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 apps/tmpfiles/disable-lid-wakeup create mode 100644 apps/udev-rules/lowbat rename apps/{de/udev-rules/90-usb-device-plugin.rules => udev-rules/usb-device-plugin} (100%) create mode 100644 apps/udev-rules/wifi-powersave diff --git a/apps/de/sway/config b/apps/de/sway/config index 4cd73a3..fa37494 100644 --- a/apps/de/sway/config +++ b/apps/de/sway/config @@ -13,7 +13,7 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec -- output * bg $HOME/.wallpaper fill # TODO: configured displays? -# output eDP-1 res 3200x1800 pos 0 0 scale 2 +output eDP-1 res 3200x1800 pos 0 0 scale 2 # output DP-3 res 3440x1440 pos 1600 0 ### Input configuration diff --git a/apps/de/sway/init b/apps/de/sway/init index 714a829..1c58eaa 100755 --- a/apps/de/sway/init +++ b/apps/de/sway/init @@ -19,6 +19,7 @@ export MOZ_ENABLE_WAYLAND=1 # configuration flag for some of my dotfiles scripts export IS_WAYLAND=1 -exec mako +killall -9 dunst &> /dev/null +mako & sway diff --git a/apps/tmpfiles/disable-lid-wakeup b/apps/tmpfiles/disable-lid-wakeup new file mode 100644 index 0000000..9ded313 --- /dev/null +++ b/apps/tmpfiles/disable-lid-wakeup @@ -0,0 +1 @@ +w /proc/acpi/wakeup - - - - LID diff --git a/apps/udev-rules/lowbat b/apps/udev-rules/lowbat new file mode 100644 index 0000000..2077231 --- /dev/null +++ b/apps/udev-rules/lowbat @@ -0,0 +1,2 @@ +# Suspend the system when battery level drops to 3% or lower +SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl hibernate" diff --git a/apps/de/udev-rules/90-usb-device-plugin.rules b/apps/udev-rules/usb-device-plugin similarity index 100% rename from apps/de/udev-rules/90-usb-device-plugin.rules rename to apps/udev-rules/usb-device-plugin diff --git a/apps/udev-rules/wifi-powersave b/apps/udev-rules/wifi-powersave new file mode 100644 index 0000000..334068d --- /dev/null +++ b/apps/udev-rules/wifi-powersave @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="net", KERNEL=="wl*", RUN+="/usr/bin/iw dev $name set power_save on" diff --git a/bin/lib/arch-linux/provisioning/3-extras.bash b/bin/lib/arch-linux/provisioning/3-extras.bash index 258e354..3f1bb24 100755 --- a/bin/lib/arch-linux/provisioning/3-extras.bash +++ b/bin/lib/arch-linux/provisioning/3-extras.bash @@ -11,6 +11,7 @@ fi pacaur --needed -S \ bluez bluz-libs bluez-utils bluez-tools \ pigz `# Multi-core gzipping` \ + iw `# WiFi Power Saving` \ arc-gtk-theme `# GTK Theme` \ elementary-icon-theme `# GUI File Explorer Icons` \ thunar thunar-volman gvfs `# GUI File Explorer + Volume Management/Auto-Mount Disks)` \ diff --git a/bin/lib/sudo_setup b/bin/lib/sudo_setup index aed4efc..795eac9 100755 --- a/bin/lib/sudo_setup +++ b/bin/lib/sudo_setup @@ -13,11 +13,19 @@ source "${dfp}/bin/lib/setup_helpers.bash" links=( # display manager files - "$dfp/apps/de/sway/init" "/usr/bin/sway-lytedev" - "$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/sway-lytedev.desktop" + "$dfp/apps/de/sway/init" "/usr/bin/sway-lytedev" + "$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/sway-lytedev.desktop" # touchpad - "$dfp/apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf" + "$dfp/apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf" + + # udev rules + "$dfp/apps/udev-rules/lowbat" "/etc/udev/rules.d/99-lowbat.rules" + # TODO: laptop-specific setup? + "$dfp/apps/udev-rules/wifi-powersave" "/etc/udev/rules.d/81-wifi-powersave.rules" + + # tmpfiles + "$dfp/apps/tmpfiles/disable-lid-wakeup" "/etc/tmpfiles.d/disable-lid-wakeup.conf" ) _dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-root-files.lock" "${links[@]}" From fb0389eea4124d2b3a1866aef846c42c389a69e3 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 16 Jan 2020 13:30:35 -0600 Subject: [PATCH 3/5] Fiiiish --- bin/lib/arch-linux/provisioning/2-essentials.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/lib/arch-linux/provisioning/2-essentials.bash b/bin/lib/arch-linux/provisioning/2-essentials.bash index cc027bc..4cee9c1 100755 --- a/bin/lib/arch-linux/provisioning/2-essentials.bash +++ b/bin/lib/arch-linux/provisioning/2-essentials.bash @@ -50,6 +50,8 @@ pacaur --needed -S \ docker docker-compose `# Yummy containers` \ inotify-tools `# Watching` \ luajit lua luarocks `# Lua` \ + fish `# Shell` \ + pkgfile `# Package File Metadata` \ swaks `# SMTP CLI` \ --noconfirm --noedit From 26f32a0c6b5934fbbfe3dabd03e945957df4a0f6 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 16 Jan 2020 17:01:59 -0600 Subject: [PATCH 4/5] WIP fish configuration --- apps/shell/bash/{bashrc => rc} | 1 - apps/shell/fish/aliases.fish | 164 ++++++++++++++++++++++++++++++ apps/shell/fish/colors.fish | 28 +++++ apps/shell/fish/config.fish | 62 +++++++++++ apps/shell/fish/fish_variables | 47 +++++++++ apps/shell/fish/key-bindings.fish | 17 ++++ apps/shell/fish/paths.fish | 12 +++ apps/shell/fish/prompt.fish | 43 ++++++++ setup | 3 +- 9 files changed, 375 insertions(+), 2 deletions(-) rename apps/shell/bash/{bashrc => rc} (98%) create mode 100644 apps/shell/fish/aliases.fish create mode 100755 apps/shell/fish/colors.fish create mode 100644 apps/shell/fish/config.fish create mode 100644 apps/shell/fish/fish_variables create mode 100755 apps/shell/fish/key-bindings.fish create mode 100644 apps/shell/fish/paths.fish create mode 100644 apps/shell/fish/prompt.fish diff --git a/apps/shell/bash/bashrc b/apps/shell/bash/rc similarity index 98% rename from apps/shell/bash/bashrc rename to apps/shell/bash/rc index 137550e..38c4f7f 100644 --- a/apps/shell/bash/bashrc +++ b/apps/shell/bash/rc @@ -17,7 +17,6 @@ NICE_HOME="$HOME" [[ -e "${EDFP}/.nice_home" ]] && NICE_HOME="$(cat "${EDFP}/.nice_home")" export NICE_HOME -export NOTES_DIR="$NICE_HOME/doc/notes" # set our PATH source "$DOTFILES_PATH/apps/shell/bash/paths" diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish new file mode 100644 index 0000000..6d053d3 --- /dev/null +++ b/apps/shell/fish/aliases.fish @@ -0,0 +1,164 @@ +#!/usr/bin/env fish + +# ls aliases +alias lx 'ls -lXB' # order by filetype +alias lk 'ls -lSr' # order by filesize reversed +alias lt 'ls -ltr' # order by file modified time +alias lc 'ls -ltcr' # order by filectime +alias lu 'ls -ltur' # order by file access time +alias ls 'ls -h --color --group-directories-first' # flat view w/ directories first +alias l 'ls -h --color --group-directories-first' # same as above +alias ll 'ls -lv --group-directories-first' # non-flat view +alias lm 'll | more' +alias lr 'll -R' # please don't - why is this even here...? +alias la 'll -A' # show all + +# other file aliases +alias tree 'tree -Csuh' +alias f fzf +alias cp 'rsync -ah --progress' + +# gets the newest file in the current directory (or the specified directory +# if one is provided) +function ltl + set d $argv[1] . + set -l l "" + for f in $d[1]/* + if test -z $l; set l $f; continue; end + if command test $f -nt $l; and test ! -d $f + set l $f + end + end + echo $l +end + +function ltld + set d $argv[1] . + set -l l "" + for f in $d[1]/* + if test -z $l; set l $f; continue; end + if command test $f -nt $l; and test -d $f + set l $f + end + end + echo $l +end + +alias vltl "vim (ltl)" +alias cdltl "cd (ltld)" +alias ltlv vltl + +# navigation aliases +function c + if count $argv + cd $NICE_HOME && cd $argv[1] || exit 1 + else + cd $NICE_HOME || exit 1 + end +end +alias cd.. "cd .." +alias cdd "cd $DOTFILES_PATH" # go to dotfiles +alias cde "cd $ENV_DOTFILES_PATH" # go to env dotfiles +alias cdc "cd $XDG_CONFIG_HOME" # go to ~/.config +alias cdn "cd $NOTES_PATH" +alias cdl "cd $NICE_HOME/dl" +alias cdg "cd $NICE_HOME/games" + +# quick parent-directory aliases +alias .. "cd .." +alias ... "cd ../.." +alias .... "cd ../../.." +alias ..... "cd ../../../.." +alias ...... "cd ../../../../.." +alias ....... "cd ../../../../../.." +alias ........ "cd ../../../../../../.." +alias ......... "cd ../../../../../../../.." + +# tmux aliases +# TODO: see if this can be worked around? +alias tmux 'env TERM=screen-256color-bce tmux' # syntax higlighting for vim in tmux +alias tmnew "tmux new -s" +alias tmls "tmux list-sessions" +alias tmatt "tmux attach -t" +alias tu "tmux attach -t utils || tmux new -s utils" +alias tdf "tmux attach -t dotfiles || tmux new -s dotfiles -c $DOTFILES_PATH" +alias tmon "tmux attach -t monitoring || tmux new -s monitoring" +alias tcom "tmux attach -t comms || tmux new -s comms" +alias tn "tmux attach -t notes || tmux new -s notes -c $NOTES_PATH" +alias tm "tmux attach -t music || tmux new -s music" + +# git aliases +# TODO: make these git aliases in the gitconfig? +function g + if count $argv >/dev/null + git $argv + else + git status + end +end +alias gs "git status" +alias gd "git diff" +alias gds "git diff --staged" +# alias gdv "git dv" # TODO: what is this? +alias gpl "git pull" +alias gp "git push" +alias gpa "git push --all && git push --tags" +alias gpt "git push && git push --tags" +alias gpf "git push --force-with-lease" +alias gac "git add -A && git commit" +alias gacnv "git add -A && git commit --no-verify" +alias gsur "git submodule update --remote" +alias glf "git ls-files" +alias gl "git log --pretty=format:\"%h %ad%x09%an%x09%s\" --date=short" + +# docker aliases +alias dlf "docker logs --tail=500 -f" +alias dclf "docker-compose logs --tail=500 -f" +alias ctop "docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest" + +# misc aliases +alias p "ping 8.8.8.8" +alias C "clear && clear" +alias r "ranger" +alias rn "/usr/bin/watch -n 1" +alias sctl "sudo systemctl" +alias sctlu "systemctl --user" +alias logs "sudo journalctl" +alias logsr "sudo journalctl -r" +alias logsf "sudo journalctl -f" +alias bt "sudo bluetoothctl" +alias btctl "bt" +alias btctl "sudo bluetoothctl" +alias pbcopy "clip" +alias pt "htop -t" # experimental htop tree-view-by-default +alias resrc "source $HOME/.bashrc" +alias redshift "redshift -r -l 39.0997:-94.5786 -t 6500K:2500K" +alias gpmdpe "electron --app=/usr/share/gpmdp/resources/app.asar" +alias t "task" +alias sc "sc-im" +alias scs "sc-im $NOTES_PATH/_scratch.sc" +alias disks "lsblk && df -h" +alias dd "dd status=progress" +alias wifi "sudo nmtui" +alias year 'cal (date +%Y)' +alias y year + +# games aliases +# this sometimes fixes steam dynamic library issues? +alias lsteam "env LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so' steam" + +# override the man commands with vim +alias _man "\\man" +alias man "vman" + +# neomutt is better +alias mutt "neomutt" + +# fsw aliases +alias fsw-mix-test 'fsw "mix test" ./**/*.{ex,exs,erl,hrl,xrl,yrl}' + +# weechat aliases +function chat + set -l pass (pass weechat-passphrase | head -n 1) + env WEECHAT_PASSPHRASE $pass weechat +end diff --git a/apps/shell/fish/colors.fish b/apps/shell/fish/colors.fish new file mode 100755 index 0000000..992915b --- /dev/null +++ b/apps/shell/fish/colors.fish @@ -0,0 +1,28 @@ +#!/usr/bin/env fish + +set -U fish_color_autosuggestion 555\x1ebrblack +set -U fish_color_cancel \x2dred +set -U fish_color_command white +set -U fish_color_comment brblack +set -U fish_color_cwd magenta +set -U fish_color_cwd_root red +set -U fish_color_end green +set -U fish_color_error red +set -U fish_color_escape yellow +set -U fish_color_history_current white +set -U fish_color_host normal +set -U fish_color_match \x2d\x2dbackground\x3dbrblue +set -U fish_color_normal normal +set -U fish_color_operator blue +set -U fish_color_param white +set -U fish_color_quote yellow +set -U fish_color_redirection blue +set -U fish_color_search_match bryellow\x1e\x2d\x2dbackground\x3dbrblack +set -U fish_color_selection white\x1e\x2d\x2dbackground\x3dbrblack +set -U fish_color_user blue +set -U fish_color_valid_path \x2d\x2dunderline + +set -U fish_pager_color_completion \x1d +set -U fish_pager_color_description yellow\x1eyellow +set -U fish_pager_color_prefix white\x1e\x2d\x2dunderline +set -U fish_pager_color_progress brwhite\x1e\x2d\x2dbackground\x3dcyan diff --git a/apps/shell/fish/config.fish b/apps/shell/fish/config.fish new file mode 100644 index 0000000..a8a4eb9 --- /dev/null +++ b/apps/shell/fish/config.fish @@ -0,0 +1,62 @@ +set -U XDG_CONFIG_HOME "$HOME/.config" +set -U DOTFILES_PATH "$XDG_CONFIG_HOME/dotfiles" +set -U ENV_DOTFILES_PATH "$DOTFILES_PATH/env" +set -U EDFP "$ENV_DOTFILES_PATH" + +# TODO: better logic for auto-detecting alternative home directories? +# 1. check dirname(basename $HOME)) matches username +# 2. check if /home/$username +set -U NICE_HOME $HOME +test (basename $HOME) = .home && set -U NICE_HOME (realpath $HOME/..) +test -e $HOME/.nice_home && set -U NICE_HOME (cat $HOME/.nice_home) +test -e $EDFP/.nice_home && set -U NICE_HOME (cat $EDFP/.nice_home) + +# setup paths +source $DOTFILES_PATH/apps/shell/fish/paths.fish + +# stop parsing here on a non-interactive shell +status --is-interactive || exit + +# TODO: autocompletions? +# TODO: ctrl-r history fzf +# TODO: ctrl-p files fzf +# TODO: forever history ignoring certain commands +# TODO: per-env configuration + +source $DOTFILES_PATH/apps/shell/fish/key-bindings.fish +source $DOTFILES_PATH/apps/shell/fish/colors.fish +source $DOTFILES_PATH/apps/shell/fish/prompt.fish +source $DOTFILES_PATH/apps/shell/fish/aliases.fish + +set -U _JAVA_AWT_WM_NONREPARENTING 1 +set -U LS_COLORS 'ow=01;36;40' +set -U LESS -x2 # less tab size of 2 spaces +set -U TERMINAL urxvtc +set -U BROWSER firefox-developer-edition +set -U ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history + +# set our EDITOR to neovim if we've got it +set -U EDITOR vim +if command -v nvim 2>&1 >/dev/null + alias vim nvim + alias ovim 'command vim' + set -U EDITOR nvim +end + +_make_paths + +command -v fd 2>&1 >/dev/null && set -U FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git' + +# we assume the user uses "$HOME" to just store their mess of dotfiles and other +# nonsense that clutters it up and that they have a preferred starting +# directory where they keep the stuff they actually care about +# we only do this if the user is opening a shell at $HOME +test $PWD = $HOME && cd $NICE_HOME || cd || exit + +test -f ~/.fzf/shell/key-bindings.fish && source ~/.fzf/shell/key-bindings.fish + +if test -d $HOME/.asdf/; and test -f $HOME/.asdf/asdf.sh + source $HOME/.asdf/asdf.sh +else if test -d /opt/asdf-vm/; and test -f /opt/asdf-vm/asdf.sh + source $HOME/opt/asdf-vm/asdf.sh +end diff --git a/apps/shell/fish/fish_variables b/apps/shell/fish/fish_variables new file mode 100644 index 0000000..59e06f1 --- /dev/null +++ b/apps/shell/fish/fish_variables @@ -0,0 +1,47 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR BROWSER:firefox\x2ddeveloper\x2dedition +SETUVAR --path DOTFILES_PATH:/home/daniel/\x2ehome/\x2econfig/dotfiles +SETUVAR EDFP:/home/daniel/\x2ehome/\x2econfig/dotfiles/\x2eenv +SETUVAR EDITOR:nvim +SETUVAR --path ENV_DOTFILES_PATH:/home/daniel/\x2ehome/\x2econfig/dotfiles/env +SETUVAR ERL_AFLAGS:\x2dkernel\x20shell_history\x20enabled\x20\x2dkernel\x20shell_history_file_bytes\x201024000 +SETUVAR FZF_DEFAULT_COMMAND:fd\x20\x2d\x2dtype\x20f\x20\x2d\x2dhidden\x20\x2d\x2dfollow\x20\x2d\x2dexclude\x20\x2egit +SETUVAR LESS:\x2dx2 +SETUVAR LS_COLORS:ow\x3d01\x3b36\x3b40 +SETUVAR NICE_HOME:/home/daniel +SETUVAR --path NOTES_PATH:/home/daniel/doc/notes +SETUVAR TERMINAL:urxvtc +SETUVAR XDG_CONFIG_HOME:/home/daniel/\x2ehome/\x2econfig +SETUVAR _JAVA_AWT_WM_NONREPARENTING:1 +SETUVAR __fish_init_2_39_8:\x1d +SETUVAR __fish_init_2_3_0:\x1d +SETUVAR __fish_init_3_x:\x1d +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dred +SETUVAR fish_color_command:white +SETUVAR fish_color_comment:brblack +SETUVAR fish_color_cwd:magenta +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:green +SETUVAR fish_color_error:red +SETUVAR fish_color_escape:yellow +SETUVAR fish_color_history_current:white +SETUVAR fish_color_host:normal +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:blue +SETUVAR fish_color_param:white +SETUVAR fish_color_quote:yellow +SETUVAR fish_color_redirection:blue +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_user:blue +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell +SETUVAR fish_key_bindings:fish_vi_key_bindings +SETUVAR fish_pager_color_completion:\x1d +SETUVAR fish_pager_color_description:yellow\x1eyellow +SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_user_paths:/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2ego\x1e/home/daniel/\x2ehome/\x2ego/bin\x1e/home/daniel/\x2ehome/\x2econfig/dotfiles/bin\x1e/home/daniel/\x2ehome/\x2econfig/dotfiles/\x2eenv/bin\x1e/home/daniel/\x2ehome/\x2ebin\x1e/home/daniel/\x2ehome/\x2ecargo/bin\x1e/home/daniel/\x2ehome/\x2eyarn/bin diff --git a/apps/shell/fish/key-bindings.fish b/apps/shell/fish/key-bindings.fish new file mode 100755 index 0000000..f6705c5 --- /dev/null +++ b/apps/shell/fish/key-bindings.fish @@ -0,0 +1,17 @@ +#!/usr/bin/env fish + +function fish_user_key_bindings + fish_vi_key_bindings + fzf_key_bindings + + set vi_esc "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end" + bind -M insert jk $vi_esc + bind -M insert Jk $vi_esc + bind -M insert JK $vi_esc + bind -M insert jj $vi_esc + bind -M insert Jj $vi_esc + bind -M insert JJ $vi_esc + bind -M insert JJ $vi_esc + + bind -M insert \cf 'fzf-cd-widget' +end diff --git a/apps/shell/fish/paths.fish b/apps/shell/fish/paths.fish new file mode 100644 index 0000000..ccb3c33 --- /dev/null +++ b/apps/shell/fish/paths.fish @@ -0,0 +1,12 @@ +#!/usr/bin/env fish + +set -U fish_user_paths $HOME/.go $GOPATH/bin $DOTFILES_PATH/bin $EDFP/bin $HOME/.bin $HOME/.cargo/bin $HOME/.yarn/bin +test -d $HOME/.local/bin && set -U fish_user_paths $HOME/.local/bin $fish_user_paths +test -d $HOME/.bin && set -U fish_user_paths $HOME/.local/bin $fish_user_paths + +command -v python 2>&1 >/dev/null && set -U fish_user_paths (python -m site --user-base)"/bin" $fish_user_paths +command -v ruby 2>&1 >/dev/null && set -U fish_user_paths (ruby -e 'print Gem.user_dir')"/bin" $fish_user_paths + +set -U NOTES_PATH $NICE_HOME/doc/notes + +function _make_paths; mkdir -p $NOTES_PATH; end diff --git a/apps/shell/fish/prompt.fish b/apps/shell/fish/prompt.fish new file mode 100644 index 0000000..e3bd8b0 --- /dev/null +++ b/apps/shell/fish/prompt.fish @@ -0,0 +1,43 @@ +#!/usr/bin/env fish + +# TODO: if root, background instead? + +set MAX_PATH_PIECE_CHARS $BASH_PROMPT_MAX_PATH_PIECE_CHARS 3 + +# prompt rendering functions +function preprocess_pwd + test (pwd) = / && echo "/" && return 1 + test (pwd) = $NICE_HOME && echo "~" && return 0 + # with ellipsis + #echo "$(<<< "$p" cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{if(length(p[k])>'"$((MAX_PATH_PIECE_CHARS+1))"'){printf "/%.'"$((MAX_PATH_PIECE_CHARS))"'s…",p[k]}else{printf "/%s",p[k]}}}}')" + # without ellipsis + echo (pwd) | cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{printf "/%.'$MAX_PATH_PIECE_CHARS[1]'s",p[k]}}}' +end + +function fish_prompt + if test $status -eq 0 + set_color blue + else + set_color red + end + printf $USER"@"$hostname" " + set_color magenta + printf (preprocess_pwd)" " +end + +function fish_mode_prompt + set_color brblack + switch $fish_bind_mode + case default + echo 'N' + case insert + echo 'I' + case replace_one + echo 'R' + case replace + echo 'R' + case visual + echo 'V' + end + echo -n ' ' + end diff --git a/setup b/setup index 5ff2e5f..aa48de4 100755 --- a/setup +++ b/setup @@ -45,10 +45,11 @@ links=( "$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors" # shell files - "$dfp/apps/shell/bash/bashrc" "$HOME/.bashrc" + "$dfp/apps/shell/bash/rc" "$HOME/.bashrc" "$dfp/apps/shell/bash/bash_profile" "$HOME/.bash_profile" "$dfp/apps/shell/tmux/tmux.conf" "$HOME/.tmux.conf" "$dfp/apps/shell/tmux/layouts" "$HOME/.tmux/layouts" + "$dfp/apps/shell/fish/" "$XDG_CONFIG_HOME/fish" # text editor files "$dfp/apps/neovim/" "$XDG_CONFIG_HOME/nvim" From 46793bb7353dc964191c67162c416bdd372a992d Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 17 Jan 2020 03:02:53 -0600 Subject: [PATCH 5/5] Whew --- .gitignore | 14 ++- Makefile | 2 +- apps/de/bspwm/bspwmrc | 65 ---------- apps/de/bspwm/config | 17 +-- apps/de/bspwm/rc | 35 ++++++ apps/de/dunst/{dunstrc => rc} | 0 apps/de/polybar/run | 6 +- apps/de/sway/config | 2 +- apps/de/sxhkd/{sxhkdrc => rc} | 0 apps/de/x/init | 19 +++ apps/de/x/initrc | 46 -------- apps/de/x/loadresources | 55 ++------- apps/de/x/profile | 58 ++------- apps/de/x/resources | 5 +- apps/mutt/{muttrc => rc} | 0 apps/neovim/init.vim | 4 +- apps/neovim/settings.vim | 2 +- apps/shell/bash/paths | 34 ------ apps/shell/bash/{bash_profile => profile} | 4 +- apps/shell/bash/rc | 138 +++++++--------------- apps/shell/fish/aliases.fish | 0 apps/shell/fish/config.fish | 29 +++-- apps/shell/fish/fish_variables | 8 +- apps/shell/fish/key-bindings.fish | 6 +- apps/shell/fish/paths.fish | 2 +- apps/shell/fish/prompt.fish | 5 +- apps/shell/tmux/tmux.conf | 2 +- bin/app-launcher | 5 +- bin/dotfiles-make-env | 28 +++++ bin/ezln | 4 +- bin/has_command | 3 + bin/lib/colors/vim | 10 -- bin/lib/setup_helpers.bash | 2 +- bin/maybe_source_env_file | 4 + bin/paths | 18 +++ bin/pipeline | 2 +- bin/pipelines/b64/transform | 4 + bin/pipelines/base64/transform | 4 + bin/pipelines/linewise/transform | 4 + bin/pipelines/test/transform | 4 + bin/pipelines/xxd/transform | 4 + bin/prelude | 21 ++++ bin/source_if_exists | 4 + bin/workdock | 5 +- env/laptop/app-launcher | 0 env/laptop/bar | 7 ++ env/laptop/bash | 3 + env/laptop/bspwm | 3 + env/laptop/polybar | 9 ++ env/laptop/vim | 0 env/laptop/workdock | 9 ++ env/laptop/x/init | 0 env/laptop/x/lodpi-resources | 19 +++ env/laptop/x/profile | 0 env/laptop/x/resources | 10 ++ setup | 56 ++------- 56 files changed, 357 insertions(+), 443 deletions(-) delete mode 100755 apps/de/bspwm/bspwmrc create mode 100755 apps/de/bspwm/rc rename apps/de/dunst/{dunstrc => rc} (100%) rename apps/de/sxhkd/{sxhkdrc => rc} (100%) create mode 100644 apps/de/x/init delete mode 100644 apps/de/x/initrc rename apps/mutt/{muttrc => rc} (100%) delete mode 100644 apps/shell/bash/paths rename apps/shell/bash/{bash_profile => profile} (57%) mode change 100644 => 100755 apps/shell/fish/aliases.fish mode change 100644 => 100755 apps/shell/fish/config.fish mode change 100644 => 100755 apps/shell/fish/fish_variables mode change 100644 => 100755 apps/shell/fish/paths.fish mode change 100644 => 100755 apps/shell/fish/prompt.fish create mode 100755 bin/dotfiles-make-env create mode 100755 bin/has_command create mode 100755 bin/maybe_source_env_file create mode 100644 bin/paths create mode 100755 bin/pipelines/b64/transform create mode 100755 bin/pipelines/base64/transform create mode 100755 bin/pipelines/linewise/transform create mode 100755 bin/pipelines/test/transform create mode 100755 bin/pipelines/xxd/transform create mode 100755 bin/prelude create mode 100755 bin/source_if_exists create mode 100755 env/laptop/app-launcher create mode 100755 env/laptop/bar create mode 100755 env/laptop/bash create mode 100755 env/laptop/bspwm create mode 100755 env/laptop/polybar create mode 100755 env/laptop/vim create mode 100755 env/laptop/workdock create mode 100755 env/laptop/x/init create mode 100755 env/laptop/x/lodpi-resources create mode 100755 env/laptop/x/profile create mode 100755 env/laptop/x/resources diff --git a/.gitignore b/.gitignore index 02979f9..2819057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,15 @@ -colors/gen/vendor -colors/gen/tmp *.lock *.log *.pid *.tmp *.secret -/.repositories -/.env/ +/.curenv + +# TODO: should be unnecessary once color generation is homegrown +/colors/gen/vendor +/colors/gen/tmp + +# keep the pipelines but hide their results +/bin/pipelines/*/*/* + +/env/*/.hidden diff --git a/Makefile b/Makefile index e5e6c15..617ff50 100644 --- a/Makefile +++ b/Makefile @@ -3,4 +3,4 @@ MAKEFILE_PATH ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) default: install install: - ./setup + ${MAKEFILE_PATH}/setup diff --git a/apps/de/bspwm/bspwmrc b/apps/de/bspwm/bspwmrc deleted file mode 100755 index f764531..0000000 --- a/apps/de/bspwm/bspwmrc +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -source "$HOME/.bashrc" - -# NO_COMPTON=1 -BORDER_WIDTH=5 # change in bspwm_config, here for launcher -START_BAR=1 -BAR_COMMAND="$DOTFILES_PATH/apps/de/polybar/run" - -if [[ -z "$XDG_CONFIG_HOME" ]]; then - export XDG_CONFIG_HOME="$HOME/.config" -fi -if [[ -z "$DOTFILES_PATH" ]]; then - export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" -fi - -BSPWM_STATE_FILE="$HOME/.bspwm_state" - -if [ -e "$BSPWM_STATE" ] ; then - bspc wm -l "$BSPWM_STATE" - rm "$BSPWM_STATE" -fi - -source "$DOTFILES_PATH/apps/de/bspwm/config" - -# TODO: switch to alacritty -if command -v urxvtd >/dev/null 2>&1; then - urxvtd & -fi - -if command -v dunst >/dev/null 2>&1; then - dunst & -fi - -if command -v sxhkd >/dev/null 2>&1; then - # export HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\(.*\)$/\1/p' | head -n 1) - export NICE_HOME - sxhkd -m -1 & -fi - -if [ -f "$DOTFILES_PATH/apps/de/x/loadresources" ]; then - "$DOTFILES_PATH/apps/de/x/loadresources" -fi - -if [ -f "$HOME/.fehbg" ]; then - "$HOME/.fehbg" & -fi - -# launch optional and helpful apps -if command -v unclutter >/dev/null 2>&1; then - unclutter & -fi - -if command -v compton >/dev/null 2>&1; then - if [[ "$NO_COMPTON" -ne 1 ]]; then - compton & - fi -fi - -# launch bar -if [[ $START_BAR -eq 1 ]]; then - ${BAR_COMMAND} & -fi - -bspc wm -o diff --git a/apps/de/bspwm/config b/apps/de/bspwm/config index 27a9d34..7ab65fa 100755 --- a/apps/de/bspwm/config +++ b/apps/de/bspwm/config @@ -5,17 +5,14 @@ export WINDOW_GAP=25 DESKTOPS=(dev web gfx env play chat misc mon out util) BSPWM_MONITORS=$(bspc query -M | tac) -MONITOR_COUNT=$(echo "${BSPWM_MONITORS}" | wc -w | awk '{ printf $1 }') +MONITOR_COUNT=$(<<< "${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 "$EDFP/bspwm" ]; then - source "$EDFP/bspwm" -fi +. maybe_source_env_file bspwm -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')" bspc config focused_border_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')" bspc config active_border_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')" bspc config presel_feedback_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')" @@ -26,8 +23,7 @@ bspc config gapless_monocle true bspc config pointer_modifier "mod4" bspc config remove_unplugged_monitors true bspc config remove_disabled_monitors true - -bspc config window_gap "$WINDOW_GAP" +bspc config window_gap "$WINDOW_GAP" bspc rule -a "*" split_dir=right @@ -53,7 +49,4 @@ if [[ $REVERSE_DESKTOP_ORDERING -eq 1 ]]; then done fi -# allow a per-device config to override options -if [ -f "$EDFP/bspwm-after" ]; then - source "$EDFP/bspwm-after" -fi +. maybe_source_env_file bspwm-after diff --git a/apps/de/bspwm/rc b/apps/de/bspwm/rc new file mode 100755 index 0000000..84d1c33 --- /dev/null +++ b/apps/de/bspwm/rc @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +source "$HOME/.bashrc" + +# NO_COMPTON=1 +BORDER_WIDTH=5 # change in bspwm_config, here for launcher +START_BAR=1 +BAR_COMMAND="$DOTFILES_PATH/apps/de/polybar/run" + +if [[ -z "$XDG_CONFIG_HOME" ]]; then + export XDG_CONFIG_HOME="$HOME/.config" +fi +if [[ -z "$DOTFILES_PATH" ]]; then + export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" +fi + +BSPWM_STATE_FILE="$HOME/.bspwm_state" + +if [ -e "$BSPWM_STATE" ] ; then + bspc wm -l "$BSPWM_STATE" + rm "$BSPWM_STATE" +fi + +source "$DOTFILES_PATH/apps/de/bspwm/config" + +[ -f "$DOTFILES_PATH/apps/de/x/loadresources" ] && "$DOTFILES_PATH/apps/de/x/loadresources" +[ -f "$HOME/.fehbg" ] && "$HOME/.fehbg" & +has_command urxvtd && urxvtd & +has_command dunst && dunst & +has_command sxhkd && sxhkd -m -1 & +has_command unclutter && unclutter & +[[ "$NO_COMPTON" -ne 1 ]] && has_command compton && compton & +[[ $START_BAR -eq 1 ]] && ${BAR_COMMAND} & + +bspc wm -o diff --git a/apps/de/dunst/dunstrc b/apps/de/dunst/rc similarity index 100% rename from apps/de/dunst/dunstrc rename to apps/de/dunst/rc diff --git a/apps/de/polybar/run b/apps/de/polybar/run index 8be080f..feebe63 100755 --- a/apps/de/polybar/run +++ b/apps/de/polybar/run @@ -21,11 +21,7 @@ export BAR_BOTTOM="false" export BAR_VERTICAL_MARGIN=0 export POS_Y=0 -# allow a per-device config to override options -echo "$EDFP" -if [ -f "$EDFP/polybar" ]; then - source "$EDFP/polybar" -fi +. maybe_source_env_file polybar export MONITOR_WIDTH=$(xrandr | grep "^$BAR_MONITOR " | grep -Po ' \d+' | head -n 1) diff --git a/apps/de/sway/config b/apps/de/sway/config index fa37494..53eb549 100644 --- a/apps/de/sway/config +++ b/apps/de/sway/config @@ -128,4 +128,4 @@ input * { focus_follows_mouse no # include /etc/sway/config.d/* -include $EDFP/sway/config.d/* +include $ENV_PATH/sway/config.d/* diff --git a/apps/de/sxhkd/sxhkdrc b/apps/de/sxhkd/rc similarity index 100% rename from apps/de/sxhkd/sxhkdrc rename to apps/de/sxhkd/rc diff --git a/apps/de/x/init b/apps/de/x/init new file mode 100644 index 0000000..ac65283 --- /dev/null +++ b/apps/de/x/init @@ -0,0 +1,19 @@ +#!/bin/sh + +# as far as I can tell, this file is only executed when you run startx from the +# TTY - you probably want to modify xprofile + +[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config" +[ -z "$DOTFILES_PATH" ] && export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" + +echo xinit >> /tmp/xstartup + +[ -f "$HOME/.xprofile" ] && . "$HOME/.xprofile" +[ -f "$HOME/.xmodmap" ] && xmodmap "$HOME/.xmodmap" + +eval "$(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)" +export SSH_AUTH_SOCK + +# TODO: env? [ -f "$HOME/.env_xinitrc" ] && . "$HOME/.env_xinitrc" + +exec "$DOTFILES_PATH/apps/de/bspwm/wmstart" diff --git a/apps/de/x/initrc b/apps/de/x/initrc deleted file mode 100644 index 4981713..0000000 --- a/apps/de/x/initrc +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -# as far as I can tell, this file is only executed when you run startx from the -# TTY - -# you probably want to modify xprofile - -echo '' > "$HOME/.xstartup_log" -echo "xinitrc" >> "$HOME/.xstartup_log" - -# load our xprofile -if [ -f "$HOME/.xprofile" ]; then - source "$HOME/.xprofile" -fi - -# allow a per-device config to override options -if [ -f "$HOME/.env_xinitrc" ]; then - source "$HOME/.env_xinitrc" -fi - -if [ -f "$HOME/.xmodmap" ]; then - xmodmap "$HOME/.xmodmap" -fi - -echo "a" > ~/.xinitrc.log -echo "initrc" > ~/.xstartup_log - -eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh) -export SSH_AUTH_SOCK - -# xcape -e 'Control_L=Escape' & - -# pulseaudio --start & - -# xset s off -dpms & - -# redshift & - -# urxvtd & - -# autocutsel -fork & -# autocutsel -selection PRIMARY -fork & -# autocutsel -selection SECONDARY -fork & - -# fire up wm -exec "$DOTFILES_PATH/apps/de/bspwm/wmstart" diff --git a/apps/de/x/loadresources b/apps/de/x/loadresources index bb2e680..6391302 100755 --- a/apps/de/x/loadresources +++ b/apps/de/x/loadresources @@ -1,51 +1,21 @@ #!/usr/bin/env bash -ENV_TYPE="${1}" +echo "xload init" > /tmp/xload +echo "ep: $ENV_PATH" > /tmp/xload +xqm() { + f="$1"; shift; [ -f "$f" ] && xrdb -merge "$f" "$@" &>/dev/null && echo "xqm LOADING $f" >> /tmp/xload +} -if [[ "$ENV_TYPE" = "auto" ]]; then - if [[ "$(xrandr --listmonitors | grep 'Monitors:' | awk '{print $2}')" -gt 1 ]]; then - ENV_TYPE="lodpi" - else - ENV_TYPE="" - fi -fi +xqm "/etc/X11/xinit/.Xresources" +xqm "$HOME/.Xresources" +xqm "$DOTFILES_PATH/bin/lib/colors/xresources" +xqm "$ENV_PATH/x/resources" -if [[ -z "$ENV_TYPE" ]]; then - ENV_TYPE="" -else - ENV_TYPE="${ENV_TYPE}-" -fi - -sysresources="/etc/X11/xinit/.Xresources" sysmodmap="/etc/X11/xinit/.Xmodmap" -userresources="$HOME/.Xresources" -usercolors="$DOTFILES_PATH/bin/lib/colors/xresources" -userenv="$EDFP/x/${ENV_TYPE}resources" -usermodmap="$EDFP/x/modmap" +usermodmap="$ENV_PATH/x/modmap" -if [ -f "$sysresources" ]; then - xrdb -merge "$sysresources" >/dev/null 2>&1 -fi - -if [ -f "$sysmodmap" ]; then - xmodmap "$sysmodmap" >/dev/null 2>&1 -fi - -if [ -f "$userresources" ]; then - xrdb -merge "$userresources" >/dev/null 2>&1 -fi - -if [ -f "$usercolors" ]; then - xrdb -merge "$usercolors" >/dev/null 2>&1 -fi - -if [ -f "$userenv" ]; then - xrdb -merge "$userenv" >/dev/null 2>&1 -fi - -if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" >/dev/null 2>&1 -fi +[ -f "$sysmodmap" ] && xmodmap "$sysmodmap" &>/dev/null +[ -f "$usermodmap" ] && xmodmap "$usermodmap" &>/dev/null if [ -d "/etc/X11/xinit/xinitrc.d" ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do @@ -53,4 +23,3 @@ if [ -d "/etc/X11/xinit/xinitrc.d" ] ; then done unset f fi - diff --git a/apps/de/x/profile b/apps/de/x/profile index d847757..e14a85b 100644 --- a/apps/de/x/profile +++ b/apps/de/x/profile @@ -1,57 +1,25 @@ #!/bin/sh -if [[ -z "$XDG_CONFIG_HOME" ]]; then - export XDG_CONFIG_HOME="$HOME/.config" -fi -if [[ -z "$DOTFILES_PATH" ]]; then - export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" -fi +[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config" +[ -z "$DOTFILES_PATH" ] && export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" -if command -v autorandr >/dev/null 2>&1; then - autorandr -c -fi - -echo "xprofile ($DOTFILES_PATH)" >> "$HOME/.xstartup_log" - -# keyrepeat settings -xset r rate 250 80 & +. "$DOTFILES_PATH/bin/prelude" # no screen blanking # xset -dpms & # xset s noblank & # xset s off & -if command -v xss-lock >/dev/null 2>&1; then - if command -v dm-tool >/dev/null 2>&1; then - # xss-lock -- dm-tool switch-to-greeter & - : - fi -fi +# has_command xss-lock && has_command dm-tool && xss-lock -- dm-tool switch-to-greeter & -if command -v redshift >/dev/null 2>&1; then - redshift -r -l 39.0997:-94.5786 -t 6500K:3000K & -fi +[ -f "$DOTFILES_PATH/apps/de/x/loadresources" ] && "$DOTFILES_PATH/apps/de/x/loadresources" +[ -f "$HOME/.xmodmap" ] && xmodmap "$HOME/.xmodmap" +has_command xcape && xcape -e 'Control_L=Escape' & +has_command autocutsel && autocutsel -fork & +has_command libinput-gestures-setup && libinput-gestures-setup start +has_command autorandr && autorandr -c +has_command redshift && redshift -r -l 39.1:-94.6 -t 6500K:3000K & -if [ -f "$HOME/.xmodmap" ]; then - xmodmap "$HOME/.xmodmap" -fi +xset r rate 250 80 & # keyrepeat -if [ -f "$DOTFILES_PATH/apps/de/x/loadresources" ]; then - "$DOTFILES_PATH/apps/de/x/loadresources" -fi - -if command -v xcape >/dev/null 2>&1; then - xcape -e 'Control_L=Escape' & -fi - -if command -v autocutsel &> /dev/null; then - autocutsel -fork & -fi - -if command -v libinput-gestures-setup &> /dev/null; then - libinput-gestures-setup start -fi - -if [ -f "$HOME/.env_xprofile" ]; then - source "$HOME/.env_xprofile" -fi +. maybe_source_env_file x/profile diff --git a/apps/de/x/resources b/apps/de/x/resources index 47dd74f..aadb9ae 100755 --- a/apps/de/x/resources +++ b/apps/de/x/resources @@ -15,8 +15,8 @@ *.boldFont: xft:Iosevka Term Bold:pixelsize=14,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 *.letterSpace: 0 -# URxvt.transparent: true -# URxvt.shading: 70 +## URxvt.transparent: true +## URxvt.shading: 70 ## rxvt-unicode configuration URxvt.termName: rxvt-unicode @@ -44,6 +44,7 @@ dpi: 92 .dpi: 92 *dpi: 92 Xft.dpi: 92 + *autohint: 0 *lcdfilter: lcddefault *hintstyle: hintfull diff --git a/apps/mutt/muttrc b/apps/mutt/rc similarity index 100% rename from apps/mutt/muttrc rename to apps/mutt/rc diff --git a/apps/neovim/init.vim b/apps/neovim/init.vim index 59907f0..148d814 100644 --- a/apps/neovim/init.vim +++ b/apps/neovim/init.vim @@ -50,8 +50,10 @@ exec 'source ' . commandsfile let bindingsfile=$vimdir.'/bindings.vim' exec 'source ' . bindingsfile +" colors +let &t_Co=16 + " load a per-environment file if one exists if filereadable(expand('$HOME/.env_init_after.vim')) source "$HOME/.env_init_after.vim" endif - diff --git a/apps/neovim/settings.vim b/apps/neovim/settings.vim index 88eb70a..b2f39aa 100644 --- a/apps/neovim/settings.vim +++ b/apps/neovim/settings.vim @@ -90,7 +90,7 @@ if has('autocmd') endif " color scheme -let base16colorspace=256 +let base16colorspace=16 set background=dark syntax enable colorscheme base16-donokai diff --git a/apps/shell/bash/paths b/apps/shell/bash/paths deleted file mode 100644 index db31b9a..0000000 --- a/apps/shell/bash/paths +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -export GOPATH="$HOME/.go" - -# PATH=$PATH:$APPENDED_PATH -export PATH=$PATH:"$GOPATH/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" - -if [ -d "$HOME/.local/bin" ]; then - export PATH=$PATH:"$HOME/.local/bin" -fi - -if [ -d "$HOME/.bin" ]; then - export PATH=$PATH:"$HOME/.bin" -fi - -if command -v python >/dev/null 2>&1; then - export PATH="$(python -m site --user-base)/bin:$PATH" -fi - -if command -v ruby >/dev/null 2>&1; then - export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" -fi - -export NOTES_PATH="$NICE_HOME/doc/notes" - -_make_paths() { - mkdir -p "${NOTES_PATH}" -} -export -f _make_paths diff --git a/apps/shell/bash/bash_profile b/apps/shell/bash/profile similarity index 57% rename from apps/shell/bash/bash_profile rename to apps/shell/bash/profile index faf3831..cd7ca39 100644 --- a/apps/shell/bash/bash_profile +++ b/apps/shell/bash/profile @@ -2,6 +2,6 @@ # bash_profile is executed immediately after logging in -if [ -f ~/.bashrc ]; then - source ~/.bashrc +if [[ -f "$HOME/.bashrc" ]]; then + source "$HOME/.bashrc" fi diff --git a/apps/shell/bash/rc b/apps/shell/bash/rc index 38c4f7f..d882e30 100644 --- a/apps/shell/bash/rc +++ b/apps/shell/bash/rc @@ -1,127 +1,69 @@ #!/usr/bin/env bash -# these are all paths used across many of the dotfiles and should be assumed to -# be loaded and properly set by every script - this means you are responsible -# 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? -# 1. check dirname(basename $HOME)) matches username -# 2. check /home/$username -[[ $(basename "${HOME}") = ".home" ]] && NICE_HOME="$(realpath "$HOME/..")" -[[ -e "${HOME}/.nice_home" ]] && NICE_HOME="$(cat "${HOME}/.nice_home")" -[[ -e "${EDFP}/.nice_home" ]] && NICE_HOME="$(cat "${EDFP}/.nice_home")" +. "$DOTFILES_PATH/bin/prelude" -export NICE_HOME +[[ ! $- == *i* ]] && return # stop parsing on a non-interactive shell -# set our PATH -source "$DOTFILES_PATH/apps/shell/bash/paths" +. "$DOTFILES_PATH/apps/shell/bash/aliases" +. "$DOTFILES_PATH/apps/shell/bash/autocompletions" +. "$DOTFILES_PATH/apps/shell/bash/prompt" -# stop parsing on a non-interactive shell -[ -z "$PS1" ] && return - -# load our key binds -case $- in - *i*) bind -f "$DOTFILES_PATH/apps/shell/inputrc";; - *) ;; -esac - -# import our aliases -source "$DOTFILES_PATH/apps/shell/bash/aliases" - -# import our autocompletions -source "$DOTFILES_PATH/apps/shell/bash/autocompletions" - -# load our vconsole colors -if [ "${TERM%%-*}" = 'linux' ] && [[ $- == *i* ]]; then - BASE16_SHELL="$DOTFILES_PATH/bin/lib/colors/vconsole" - [[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL" +stty -ixon # disable ctrl-s terminal freezing +bind -f "$DOTFILES_PATH/apps/shell/inputrc" # load our key +# load our vconsole colors if in a tty +if [[ "${TERM%%-*}" = 'linux' ]]; then + c="$DOTFILES_PATH/bin/lib/colors/vconsole" + [[ -s "$c" ]] && . "$c" fi -# load our terminal colors -BASE16_SHELL="$DOTFILES_PATH/bin/lib/colors/shell" -[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL" - -# disable ctrl-s terminal freeze -[[ $- == *i* ]] && stty -ixon - -# allow ** recursive wildcard globbing -shopt -s globstar - -# import our prompt -source "$DOTFILES_PATH/apps/shell/bash/prompt" - -# prevents binds or commands pulling from history from insta-sending, and -# instead places them in the readline for editing -shopt -s histverify - -# always _append_ to bash history -shopt -s histappend +# load our shell colors +c="$DOTFILES_PATH/bin/lib/colors/shell" +[[ -s "$c" ]] && . "$c" # prevents some Java GUI apps from not working or rendering properly due to # using wacky window managers export _JAVA_AWT_WM_NONREPARENTING=1 - -LS_COLORS='ow=01;36;40' -export LS_COLORS - -# less tab size of 2 spaces -LESS="-x2" -export LESS +export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" +has_command fd && export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' +export LS_COLORS='ow=01;36;40' +export LESS="-x2" # less tab size of 2 spaces +export TERMINAL="urxvtc" +export BROWSER="firefox-developer-edition" +export HISTFILESIZE="10000000" # "unlimited" history +export HISTSIZE="10000000" # "unlimited" history +export HISTCONTROL=ignoreboth # ignore duplicates and commands starting with space (" ") +shopt -s globstar # allow ** recursive wildcard globbing +# prevents binds or commands pulling from history from insta-sending, and +# instead places them in the readline for editing +shopt -s histverify +shopt -s histappend # always _append_ to bash history +shopt -s cmdhist # ensure command history is comprised of single lines +HISTIGNORE='ls:ll:la' # ignore certain commands # set our EDITOR to neovim if we've got it export EDITOR="vim" -if command -v nvim >/dev/null 2>&1; then +if has_command nvim; then alias vim="nvim" alias ovim="\\vim" export EDITOR="nvim" fi -export TERMINAL="urxvtc" - -export BROWSER="firefox-developer-edition" - -# "unlimited" history -export HISTFILESIZE="10000000" -export HISTSIZE="10000000" - -# ignore duplicates and commands starting with space (" ") -export HISTCONTROL=ignoreboth - -# ignore certain commands -HISTIGNORE='ls:ll:la' - -# ensure command history is comprised of single lines -shopt -s cmdhist - # load a per-device config last so anything can be overridden -if [ -a "$EDFP/bash" ]; then - source "$EDFP/bash" -fi +. maybe_source_env_file bash -# we assume the user uses "$HOME" to just store their mess of dotfiles and other -# nonsense that clutters it up and that they have a preferred starting -# directory where they keep the stuff they actually care about -# we only do this if the user is opening a shell at $HOME -if [ "$PWD" = "$HOME" ]; then - cd "$NICE_HOME" || cd || return -fi +# create paths we kind of expect to exist in some scripts +mkdir -p "${NOTES_PATH}" -# TODO: check if fd command exists -export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' +# open nice home instead if we're opening at home +[ "$PWD" = "$HOME" ] && cd "$NICE_HOME" || cd || return -export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" +[ -f "$HOME/.fzf.bash" ] && . "$HOME/.fzf.bash" -_make_paths - -[ -f ~/.fzf.bash ] && source ~/.fzf.bash - -if [[ -d ~/.asdf/ ]] && [[ -f ~/.asdf/asdf.sh ]]; then - source "~/.asdf/asdf.sh" +if [[ -d "$HOME/.asdf/" ]] && [[ -f "$HOME/.asdf/asdf.sh" ]]; then + . "$HOME/.asdf/asdf.sh" elif [[ -d /opt/asdf-vm/ ]] && [[ -f /opt/asdf-vm/asdf.sh ]]; then - source "/opt/asdf-vm/asdf.sh" + . "/opt/asdf-vm/asdf.sh" fi diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish old mode 100644 new mode 100755 diff --git a/apps/shell/fish/config.fish b/apps/shell/fish/config.fish old mode 100644 new mode 100755 index a8a4eb9..fe6b391 --- a/apps/shell/fish/config.fish +++ b/apps/shell/fish/config.fish @@ -1,7 +1,22 @@ -set -U XDG_CONFIG_HOME "$HOME/.config" -set -U DOTFILES_PATH "$XDG_CONFIG_HOME/dotfiles" -set -U ENV_DOTFILES_PATH "$DOTFILES_PATH/env" -set -U EDFP "$ENV_DOTFILES_PATH" +#!/usr/bin/env fish + +set -U XDG_CONFIG_HOME $HOME/.config +set -U DOTFILES_PATH $XDG_CONFIG_HOME/dotfiles +set -U ENV_PATH $HOME/.env + +$DOTFILES_PATH/bin/lib/colors/shell + +function source_if_exists + test -f $ENV_PATH/$argv[1] && source $argv[1] +end + +function maybe_source_env_file + source_if_exists $ENV_PATH/$argv[1] +end + +function has_command + command -v $argv[1] 2>&1 >/dev/null +end # TODO: better logic for auto-detecting alternative home directories? # 1. check dirname(basename $HOME)) matches username @@ -9,7 +24,7 @@ set -U EDFP "$ENV_DOTFILES_PATH" set -U NICE_HOME $HOME test (basename $HOME) = .home && set -U NICE_HOME (realpath $HOME/..) test -e $HOME/.nice_home && set -U NICE_HOME (cat $HOME/.nice_home) -test -e $EDFP/.nice_home && set -U NICE_HOME (cat $EDFP/.nice_home) +test -e $ENV_PATH/.nice_home && set -U NICE_HOME (cat $ENV_PATH/.nice_home) # setup paths source $DOTFILES_PATH/apps/shell/fish/paths.fish @@ -29,7 +44,7 @@ source $DOTFILES_PATH/apps/shell/fish/prompt.fish source $DOTFILES_PATH/apps/shell/fish/aliases.fish set -U _JAVA_AWT_WM_NONREPARENTING 1 -set -U LS_COLORS 'ow=01;36;40' +# set -U LS_COLORS 'ow=01;36;40' set -U LESS -x2 # less tab size of 2 spaces set -U TERMINAL urxvtc set -U BROWSER firefox-developer-edition @@ -51,7 +66,7 @@ command -v fd 2>&1 >/dev/null && set -U FZF_DEFAULT_COMMAND 'fd --type f --hidde # nonsense that clutters it up and that they have a preferred starting # directory where they keep the stuff they actually care about # we only do this if the user is opening a shell at $HOME -test $PWD = $HOME && cd $NICE_HOME || cd || exit +if test $PWD = $HOME; cd $NICE_HOME || cd; end test -f ~/.fzf/shell/key-bindings.fish && source ~/.fzf/shell/key-bindings.fish diff --git a/apps/shell/fish/fish_variables b/apps/shell/fish/fish_variables old mode 100644 new mode 100755 index 59e06f1..7fdf4c6 --- a/apps/shell/fish/fish_variables +++ b/apps/shell/fish/fish_variables @@ -2,17 +2,18 @@ # VERSION: 3.0 SETUVAR BROWSER:firefox\x2ddeveloper\x2dedition SETUVAR --path DOTFILES_PATH:/home/daniel/\x2ehome/\x2econfig/dotfiles -SETUVAR EDFP:/home/daniel/\x2ehome/\x2econfig/dotfiles/\x2eenv SETUVAR EDITOR:nvim SETUVAR --path ENV_DOTFILES_PATH:/home/daniel/\x2ehome/\x2econfig/dotfiles/env +SETUVAR --path ENV_PATH:/home/daniel/\x2ehome/\x2eenv SETUVAR ERL_AFLAGS:\x2dkernel\x20shell_history\x20enabled\x20\x2dkernel\x20shell_history_file_bytes\x201024000 SETUVAR FZF_DEFAULT_COMMAND:fd\x20\x2d\x2dtype\x20f\x20\x2d\x2dhidden\x20\x2d\x2dfollow\x20\x2d\x2dexclude\x20\x2egit SETUVAR LESS:\x2dx2 -SETUVAR LS_COLORS:ow\x3d01\x3b36\x3b40 +SETUVAR LS_COLORS:\x1d SETUVAR NICE_HOME:/home/daniel SETUVAR --path NOTES_PATH:/home/daniel/doc/notes SETUVAR TERMINAL:urxvtc SETUVAR XDG_CONFIG_HOME:/home/daniel/\x2ehome/\x2econfig +SETUVAR ZZZ:test SETUVAR _JAVA_AWT_WM_NONREPARENTING:1 SETUVAR __fish_init_2_39_8:\x1d SETUVAR __fish_init_2_3_0:\x1d @@ -36,6 +37,7 @@ SETUVAR fish_color_quote:yellow SETUVAR fish_color_redirection:blue SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack SETUVAR fish_color_selection:white\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red SETUVAR fish_color_user:blue SETUVAR fish_color_valid_path:\x2d\x2dunderline SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell @@ -44,4 +46,4 @@ SETUVAR fish_pager_color_completion:\x1d SETUVAR fish_pager_color_description:yellow\x1eyellow SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan -SETUVAR fish_user_paths:/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2ego\x1e/home/daniel/\x2ehome/\x2ego/bin\x1e/home/daniel/\x2ehome/\x2econfig/dotfiles/bin\x1e/home/daniel/\x2ehome/\x2econfig/dotfiles/\x2eenv/bin\x1e/home/daniel/\x2ehome/\x2ebin\x1e/home/daniel/\x2ehome/\x2ecargo/bin\x1e/home/daniel/\x2ehome/\x2eyarn/bin +SETUVAR fish_user_paths:/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2elocal/bin\x1e/home/daniel/\x2ehome/\x2ego\x1e/home/daniel/\x2ehome/\x2ego/bin\x1e/home/daniel/\x2ehome/\x2econfig/dotfiles/bin\x1e/home/daniel/\x2ehome/\x2eenv/bin\x1e/home/daniel/\x2ehome/\x2ebin\x1e/home/daniel/\x2ehome/\x2ecargo/bin\x1e/home/daniel/\x2ehome/\x2eyarn/bin diff --git a/apps/shell/fish/key-bindings.fish b/apps/shell/fish/key-bindings.fish index f6705c5..b7db3dc 100755 --- a/apps/shell/fish/key-bindings.fish +++ b/apps/shell/fish/key-bindings.fish @@ -1,8 +1,8 @@ #!/usr/bin/env fish function fish_user_key_bindings - fish_vi_key_bindings fzf_key_bindings + fish_vi_key_bindings set vi_esc "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end" bind -M insert jk $vi_esc @@ -13,5 +13,7 @@ function fish_user_key_bindings bind -M insert JJ $vi_esc bind -M insert JJ $vi_esc - bind -M insert \cf 'fzf-cd-widget' + bind -M insert \cp up-or-search + bind -M insert \cn down-or-search + bind -M insert \cf fzf-cd-widget end diff --git a/apps/shell/fish/paths.fish b/apps/shell/fish/paths.fish old mode 100644 new mode 100755 index ccb3c33..3599f48 --- a/apps/shell/fish/paths.fish +++ b/apps/shell/fish/paths.fish @@ -1,6 +1,6 @@ #!/usr/bin/env fish -set -U fish_user_paths $HOME/.go $GOPATH/bin $DOTFILES_PATH/bin $EDFP/bin $HOME/.bin $HOME/.cargo/bin $HOME/.yarn/bin +set -U fish_user_paths $HOME/.go $GOPATH/bin $DOTFILES_PATH/bin $ENV_PATH/bin $HOME/.bin $HOME/.cargo/bin $HOME/.yarn/bin test -d $HOME/.local/bin && set -U fish_user_paths $HOME/.local/bin $fish_user_paths test -d $HOME/.bin && set -U fish_user_paths $HOME/.local/bin $fish_user_paths diff --git a/apps/shell/fish/prompt.fish b/apps/shell/fish/prompt.fish old mode 100644 new mode 100755 index e3bd8b0..406fcf0 --- a/apps/shell/fish/prompt.fish +++ b/apps/shell/fish/prompt.fish @@ -25,7 +25,9 @@ function fish_prompt printf (preprocess_pwd)" " end -function fish_mode_prompt +function fish_mode_prompt; end + +function fish_right_prompt set_color brblack switch $fish_bind_mode case default @@ -39,5 +41,4 @@ function fish_mode_prompt case visual echo 'V' end - echo -n ' ' end diff --git a/apps/shell/tmux/tmux.conf b/apps/shell/tmux/tmux.conf index dd0b16a..d72bd97 100644 --- a/apps/shell/tmux/tmux.conf +++ b/apps/shell/tmux/tmux.conf @@ -11,7 +11,7 @@ bind r source-file ~/.tmux.conf set -as terminal-overrides ',xterm*:smxx=\E[9m' # sane defaults -set -g default-terminal "tmux-256color" +# set -g default-terminal "tmux-256color" set-option -g mouse on # honestly not exactly sure? diff --git a/bin/app-launcher b/bin/app-launcher index 40e1f60..7a628d4 100755 --- a/bin/app-launcher +++ b/bin/app-launcher @@ -10,10 +10,7 @@ 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 +. maybe_source_env_file app-launcher rofi \ -combi-modi run,window \ diff --git a/bin/dotfiles-make-env b/bin/dotfiles-make-env new file mode 100755 index 0000000..133898e --- /dev/null +++ b/bin/dotfiles-make-env @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +edfp="$ENV_PATH/$1" +mkdir -p "$edfp/" +mkdir -p "$edfp/.hidden/bash.d/" +mkdir -p "$edfp/bin/" +mkdir -p "$edfp/x/" +mkdir -p "$edfp/sway/waybar" +mkdir -p "$edfp/sway/config.d" +mkdir -p "$HOME/.bin/" + +touches=( + "$edfp/bash" + "$edfp/x/init" + "$edfp/x/profile" + "$edfp/x/resources" + "$edfp/vim" + "$edfp/bspwm" + "$edfp/polybar" + "$edfp/app-launcher" + "$edfp/workdock" +) + +for t in "${touches[@]}"; do + touch "$t" +done + +chmod 700 -R "$edfp" diff --git a/bin/ezln b/bin/ezln index 475ff64..2c0ea0f 100755 --- a/bin/ezln +++ b/bin/ezln @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SOURCE=$(realpath "$1") -DEST=$(realpath -m "$2") +SOURCE=$(realpath "$1") # this one exists +DEST=$(realpath -m "$2") # this is the link to what exists ln -s "$SOURCE" "$DEST" diff --git a/bin/has_command b/bin/has_command new file mode 100755 index 0000000..99beb7c --- /dev/null +++ b/bin/has_command @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +command -v "$1" >/dev/null 2>&1 diff --git a/bin/lib/colors/vim b/bin/lib/colors/vim index 7fbf468..9bea0ce 100644 --- a/bin/lib/colors/vim +++ b/bin/lib/colors/vim @@ -1,16 +1,6 @@ " Base16 Donokai (https://github.com/chriskempson/base16) " Scheme: Daniel Flanagan(https://lytedev.io) -" This enables the coresponding base16-shell script to run so that -" :colorscheme works in terminals supported by base16-shell scripts -" User must set this variable in .vimrc -" let g:base16_shell_path=base16-builder/output/shell/ -if !has('gui_running') - if exists("g:base16_shell_path") - execute "silent !/bin/sh ".g:base16_shell_path."/base16-donokai.".&background.".sh" - endif -endif - " GUI color definitions let s:gui00 = "111111" let s:gui01 = "383830" diff --git a/bin/lib/setup_helpers.bash b/bin/lib/setup_helpers.bash index eb97710..c36adca 100644 --- a/bin/lib/setup_helpers.bash +++ b/bin/lib/setup_helpers.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../../" && pwd) -source "${dfp}/apps/shell/bash/bashrc" +source "${dfp}/apps/shell/bash/rc" USER_DISAGREE_CODE=120 NO_AGREEMENT_CODE=121 diff --git a/bin/maybe_source_env_file b/bin/maybe_source_env_file new file mode 100755 index 0000000..1096607 --- /dev/null +++ b/bin/maybe_source_env_file @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +f="$1"; shift +. source_if_exists "$ENV_PATH/$f" "$@" diff --git a/bin/paths b/bin/paths new file mode 100644 index 0000000..e8c9fc1 --- /dev/null +++ b/bin/paths @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +echo "paths" + +export GOPATH="$HOME/.go" + +# PATH=$PATH:$APPENDED_PATH +PATH="$DOTFILES_PATH/bin":$PATH +PATH="$ENV_PATH/bin":$PATH +[ -d "$HOME/.bin" ] && PATH=$PATH:"$HOME/.bin" +PATH=$PATH:"$HOME/.cargo/bin" +PATH=$PATH:"$HOME/.yarn/bin" +PATH=$PATH:"$GOPATH/bin" +[ -d "$HOME/.local/bin" ] && PATH=$PATH:"$HOME/.local/bin" +has_command python && PATH="$(python -m site --user-base)/bin:$PATH" +has_command ruby && PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" + +export PATH +export NOTES_PATH="${NOTES_PATH:-$NICE_HOME/doc/notes}" diff --git a/bin/pipeline b/bin/pipeline index fb42f12..dff7961 100755 --- a/bin/pipeline +++ b/bin/pipeline @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SAVED_PIPELINE_DIR="$EDFP/pipelines" +SAVED_PIPELINE_DIR="$DOTFILES_PATH/bin/pipelines" mkdir -p "$SAVED_PIPELINE_DIR" if [[ ! -z "${1+x}" ]]; then diff --git a/bin/pipelines/b64/transform b/bin/pipelines/b64/transform new file mode 100755 index 0000000..7b9b530 --- /dev/null +++ b/bin/pipelines/b64/transform @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# for /home/daniel/.home/.config/dotfiles/.env/pipelines/b64/pipeline.VRMehQda + +base64 diff --git a/bin/pipelines/base64/transform b/bin/pipelines/base64/transform new file mode 100755 index 0000000..49c4c74 --- /dev/null +++ b/bin/pipelines/base64/transform @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# for /home/daniel/.home/.config/dotfiles/.env/pipelines/base64/tmp_pipeline.ca7uoTRo + +base64 diff --git a/bin/pipelines/linewise/transform b/bin/pipelines/linewise/transform new file mode 100755 index 0000000..ef0705d --- /dev/null +++ b/bin/pipelines/linewise/transform @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# for /home/daniel/.home/.config/dotfiles/.env/pipelines/linewise/tmp_pipeline.epyGqDjQ + +linewise base64 diff --git a/bin/pipelines/test/transform b/bin/pipelines/test/transform new file mode 100755 index 0000000..493b8bf --- /dev/null +++ b/bin/pipelines/test/transform @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# for /home/daniel/.home/.config/dotfiles/.env/pipelines/test/pipeline.Zpgm8j42 + +base64 diff --git a/bin/pipelines/xxd/transform b/bin/pipelines/xxd/transform new file mode 100755 index 0000000..6f7cfc4 --- /dev/null +++ b/bin/pipelines/xxd/transform @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# for /home/daniel/.home/.config/dotfiles/.env/pipelines/xxd/tmp_pipeline.dmXdfyZv + +hexyl diff --git a/bin/prelude b/bin/prelude new file mode 100755 index 0000000..bc5d252 --- /dev/null +++ b/bin/prelude @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +echo "prelude" + +# these are all paths used across many of the dotfiles and should be assumed to +# be loaded and properly set by every script - this means you are responsible +# for making sure they're loaded! +export XDG_CONFIG_HOME="$HOME/.config" +export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" +export ENV_PATH="$HOME/.env" + +# TODO: better logic for auto-detecting alternative home directories? +# 1. check dirname(basename $HOME)) matches username +# 2. check /home/$username +NICE_HOME="$HOME" +[ "$(basename "${HOME}")" = ".home" ] && NICE_HOME="$(realpath "$HOME/..")" +[ -e "${HOME}/.nice_home" ] && NICE_HOME="$(cat "${HOME}/.nice_home")" +[ -e "${ENV_PATH}/.nice_home" ] && NICE_HOME="$(cat "${ENV_PATH}/.nice_home")" +export NICE_HOME + +. "$DOTFILES_PATH/bin/paths" + diff --git a/bin/source_if_exists b/bin/source_if_exists new file mode 100755 index 0000000..9b4f71c --- /dev/null +++ b/bin/source_if_exists @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +f="$1"; shift +[ -f "$f" ] && . "$f" "$@" diff --git a/bin/workdock b/bin/workdock index 1a5beb4..ef3f2fa 100755 --- a/bin/workdock +++ b/bin/workdock @@ -1,11 +1,12 @@ #!/usr/bin/env bash +# TODO: move to laptop env resrc -source "$EDFP/workdock" --just-vars +. maybe_source_env_file workdock "${DOTFILES_PATH}/apps/de/x/loadresources" lodpi autorandr --change "${DOTFILES_PATH}/apps/de/bspwm/bspwmrc" "${DOTFILES_PATH}/apps/de/x/loadresources" lodpi restartbar "${HOME}/.fehbg" -source "$EDFP/workdock" +. maybe_source_env_file workdock diff --git a/env/laptop/app-launcher b/env/laptop/app-launcher new file mode 100755 index 0000000..e69de29 diff --git a/env/laptop/bar b/env/laptop/bar new file mode 100755 index 0000000..c173cf3 --- /dev/null +++ b/env/laptop/bar @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +export BAR_SIDE_MARGIN=0 +export BAR_HEIGHT=80 + +[[ -v OVERRIDE_BAR_MONITOR ]] && export BAR_MONITOR="$OVERRIDE_BAR_MONITOR" +[[ -v OVERRIDE_BAR_HEIGHT ]] && export BAR_HEIGHT="$OVERRIDE_BAR_HEIGHT" diff --git a/env/laptop/bash b/env/laptop/bash new file mode 100755 index 0000000..4be8608 --- /dev/null +++ b/env/laptop/bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +. maybe_source_env_file .hidden/bash diff --git a/env/laptop/bspwm b/env/laptop/bspwm new file mode 100755 index 0000000..2cdb35e --- /dev/null +++ b/env/laptop/bspwm @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +export WINDOW_GAP=0 diff --git a/env/laptop/polybar b/env/laptop/polybar new file mode 100755 index 0000000..7c46a11 --- /dev/null +++ b/env/laptop/polybar @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +export BAR_SIDE_MARGIN=0 +export BAR_HEIGHT=80 + +[[ -v OVERRIDE_BAR_MONITOR ]] && export BAR_MONITOR="$OVERRIDE_BAR_MONITOR" +[[ -v OVERRIDE_BAR_HEIGHT ]] && export BAR_HEIGHT="$OVERRIDE_BAR_HEIGHT" + +return 0 diff --git a/env/laptop/vim b/env/laptop/vim new file mode 100755 index 0000000..e69de29 diff --git a/env/laptop/workdock b/env/laptop/workdock new file mode 100755 index 0000000..b473ba2 --- /dev/null +++ b/env/laptop/workdock @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +export OVERRIDE_BAR_MONITOR="DP1" +export OVERRIDE_BAR_HEIGHT="24" +export BAR_ICON_FONT_SIZE="9" + +xrdb -merge "$ENV_PATH/lodpi-resource" + +xrandr --output eDP1 --scale-from 1600x900 --filter nearest --mode 3200x1800 diff --git a/env/laptop/x/init b/env/laptop/x/init new file mode 100755 index 0000000..e69de29 diff --git a/env/laptop/x/lodpi-resources b/env/laptop/x/lodpi-resources new file mode 100755 index 0000000..6ff83c5 --- /dev/null +++ b/env/laptop/x/lodpi-resources @@ -0,0 +1,19 @@ +## *.font: xft:Iosevka Nerd Font Mono:pixelsize=16,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +## *.boldFont: xft:Iosevka Nerd Font Mono:style=bold:pixelsize=16,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +## URxvt.font: xft:Iosevka Nerd Font Mono:pixelsize=16,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +## URxvt.boldFont: xft:Iosevka Nerd Font Mono:style=bold:pixelsize=16,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 + +## *.font: xft:scientifica:pixelsize=11,xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=11,xft:FreeSans:pixelsize=12 +## *.boldFont: xft:scientifica:pixelsize=11,xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=11,xft:FreeSans:pixelsize=12 +## URxvt.font: xft:scientifica:pixelsize=11,xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=11,xft:FreeSans:pixelsize=12 +## URxvt.boldFont: xft:scientifica:pixelsize=11,xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=11,xft:FreeSans:pixelsize=12 + +*.font: xft:curie:pixelsize=11,xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=8,xft:FreeSans:pixelsize=12 +*.boldFont: xft:curie:pixelsize=11,xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=8,xft:FreeSans:pixelsize=12 +URxvt.font: xft:curie:pixelsize=11,xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=8,xft:FreeSans:pixelsize=12 +URxvt.boldFont: xft:curie:pixelsize=11,xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=8,xft:FreeSans:pixelsize=12 + +dpi: 92 +.dpi: 92 +*dpi: 92 +Xft.dpi: 92 diff --git a/env/laptop/x/profile b/env/laptop/x/profile new file mode 100755 index 0000000..e69de29 diff --git a/env/laptop/x/resources b/env/laptop/x/resources new file mode 100755 index 0000000..4ab0276 --- /dev/null +++ b/env/laptop/x/resources @@ -0,0 +1,10 @@ +*.font: xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +*.boldFont: xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +URxvt.font: xft:Iosevka Nerd Font Mono:pixelsize=32,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +URxvt.boldFont: xft:Iosevka Nerd Font Mono:style=bold:pixelsize=32,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +Emacs.font: Iosevka Term +Emacs.faceName: Iosevka Term +dpi: 190 +.dpi: 190 +*dpi: 190 +Xft.dpi: 190 diff --git a/setup b/setup index aa48de4..49c0d6b 100755 --- a/setup +++ b/setup @@ -1,21 +1,9 @@ #!/usr/bin/env bash -# # -# _ _ _ # -# | |_ _| |_,___ __| | _____ __ # -# | | | | | __/ _ \/ ,` |/ _ \ \ / / # -# | | |_| | || __/ (_| | __/\ V / # -# |_|\__, |\__\___|\__,_|\___| \_/ # -# \__/ # -# # -# D O T F I L E S # -# # - -# TODO: quiet mode? +# TODO: quiet/auto-agree mode for curl | bash automagic? dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd) source "${dfp}/bin/lib/setup_helpers.bash" -edfp="${dfp}/.env" INTERACTIVE=1 @@ -30,23 +18,23 @@ done links=( # desktop environment files - "$dfp/apps/de/bspwm/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" + "$dfp/apps/de/bspwm/rc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" "$dfp/apps/de/bspwm/fehbg" "$HOME/.fehbg" "$dfp/apps/de/sway/config" "$XDG_CONFIG_HOME/sway/config" - "$dfp/apps/de/sxhkd/sxhkdrc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc" + "$dfp/apps/de/sxhkd/rc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc" "$dfp/apps/de/x/resources" "$HOME/.Xresources" - "$dfp/apps/de/x/initrc" "$HOME/.xinitrc" - "$dfp/apps/de/x/initrc" "$HOME/.vnc/xstartup" + "$dfp/apps/de/x/init" "$HOME/.xinitrc" + "$dfp/apps/de/x/init" "$HOME/.vnc/xstartup" "$dfp/apps/de/x/profile" "$HOME/.xprofile" "$dfp/apps/de/x/modmap" "$HOME/.xmodmap" "$dfp/apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf" - "$dfp/apps/de/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc" + "$dfp/apps/de/dunst/rc" "$XDG_CONFIG_HOME/dunst/dunstrc" "$dfp/apps/de/mako/" "$XDG_CONFIG_HOME/mako" "$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors" # shell files "$dfp/apps/shell/bash/rc" "$HOME/.bashrc" - "$dfp/apps/shell/bash/bash_profile" "$HOME/.bash_profile" + "$dfp/apps/shell/bash/profile" "$HOME/.bash_profile" "$dfp/apps/shell/tmux/tmux.conf" "$HOME/.tmux.conf" "$dfp/apps/shell/tmux/layouts" "$HOME/.tmux/layouts" "$dfp/apps/shell/fish/" "$XDG_CONFIG_HOME/fish" @@ -100,8 +88,8 @@ links=( "$dfp/apps/ranger/" "$XDG_CONFIG_HOME/ranger" # mutt config - "$dfp/apps/mutt/muttrc" "$XDG_CONFIG_HOME/.muttrc" - "$dfp/apps/mutt/muttrc" "$HOME/.muttrc" + "$dfp/apps/mutt/rc" "$XDG_CONFIG_HOME/.muttrc" + "$dfp/apps/mutt/rc" "$HOME/.muttrc" # neofetch config "$dfp/apps/neofetch/config" "$XDG_CONFIG_HOME/neofetch/config" @@ -116,32 +104,6 @@ links=( "$dfp/apps/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs" ) -mkdir -p "$edfp/" -[[ ! -e "$HOME/.env" ]] && ln -s "$edfp/" "$HOME/.env" -mkdir -p "$edfp/bash.d/" -mkdir -p "$edfp/bin/" -mkdir -p "$edfp/x/" -mkdir -p "$edfp/sway/waybar" -mkdir -p "$edfp/sway/config.d" -mkdir -p "$HOME/.bin/" - -touches=( - "$edfp/bash" - "$edfp/x/init" - "$edfp/x/profile" - "$edfp/x/resources" - "$edfp/vim" - "$edfp/bspwm" - "$edfp/polybar" - "$edfp/app-launcher" - "$edfp/workdock" -) - -for t in "${touches[@]}"; do - touch "$t" -done - -chmod 700 -R "$edfp" chmod 700 -R "$HOME/.bin" # TODO: pass interactive?