More fixes and cleanup

This commit is contained in:
Daniel Flanagan 2020-01-20 14:01:06 -06:00
parent 85eab2155c
commit 5100983350
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
13 changed files with 68 additions and 61 deletions

View file

@ -3,4 +3,4 @@ MAKEFILE_PATH ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
default: install default: install
install: install:
${MAKEFILE_PATH}/setup.bash cd ${MAKEFILE_PATH} && ./setup.bash

View file

@ -387,7 +387,7 @@ margin-bottom = ${env:WINDOW_GAP:0}
[module/microphone] [module/microphone]
type = custom/script type = custom/script
exec = $DOTFILES_PATH/apps/de/polybar/mic.bash exec = $DOTFILES_PATH/apps/de/polybar/mic.sh
tail = true tail = true
format = <label> format = <label>
label-foreground = ${colors.icon} label-foreground = ${colors.icon}

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env sh
pidfile="/var/run/user/$UID/polybar-mic-script.pid" pidfile="/var/run/user/$(id -u)/polybar-mic-script.pid"
if [ -e "$pidfile" ]; then if [ -e "$pidfile" ]; then
kill "$(cat "${pidfile}")" > /dev/null 2>&1 kill "$(cat "${pidfile}")" > /dev/null 2>&1

View file

@ -228,7 +228,7 @@ XF86AudioPrev
# open rofi as a window switcher # open rofi as a window switcher
super + w super + w
"$DOTFILES_PATH/scripts/bin/app-launcher" -modi window,run -show window "app-launcher" -modi window,run -show window
# close the current application # close the current application
super + c super + c
@ -258,8 +258,5 @@ super + d
super + ctrl + c super + ctrl + c
bspc rule -a '*' -o state=floating && urxvt --geometry 64x9 -e sh -c "cal -n 3 && bash" bspc rule -a '*' -o state=floating && urxvt --geometry 64x9 -e sh -c "cal -n 3 && bash"
super + shift + v
kill -USR1 $(cat "/var/run/user/$UID/polybar-mic-script.pid")
super + v super + v
tmux new-window 'sh -ci tmuxswitcher' tmux new-window 'sh -ci tmuxswitcher'

View file

@ -52,7 +52,7 @@ fi
. maybe_source_env_file .hidden/bashrc . maybe_source_env_file .hidden/bashrc
# create paths we kind of expect to exist in some scripts # create paths we kind of expect to exist in some scripts
mkdir -p "${NOTES_PATH}" mkdir -p "$NOTES_PATH" "$SCROTS_PATH" "$USER_LOGS_PATH"
# open nice home instead if we're opening at home # open nice home instead if we're opening at home
if [ "$PWD" = "$HOME" ] || [ "$PWD" = "$NICE_HOME" ]; then if [ "$PWD" = "$HOME" ] || [ "$PWD" = "$NICE_HOME" ]; then

View file

@ -141,6 +141,7 @@ alias dd "dd status=progress"
alias wifi "sudo nmtui" alias wifi "sudo nmtui"
alias year 'cal (date +%Y)' alias year 'cal (date +%Y)'
alias y year alias y year
alias pa pulsemixer
# games aliases # games aliases
# this sometimes fixes steam dynamic library issues? # this sometimes fixes steam dynamic library issues?

View file

@ -4,56 +4,26 @@ set -U XDG_CONFIG_HOME $HOME/.config
set -U DOTFILES_PATH $XDG_CONFIG_HOME/dotfiles set -U DOTFILES_PATH $XDG_CONFIG_HOME/dotfiles
set -U ENV_PATH $HOME/.env 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
$DOTFILES_PATH/bin/prelude 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
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
# 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 $ENV_PATH/.nice_home && set -U NICE_HOME (cat $ENV_PATH/.nice_home)
# setup paths
source $DOTFILES_PATH/apps/shell/fish/paths.fish source $DOTFILES_PATH/apps/shell/fish/paths.fish
# stop parsing here on a non-interactive shell
status --is-interactive || exit status --is-interactive || exit
# TODO: autocompletions? for f in key-bindings colors prompt aliases
# TODO: ctrl-r history fzf source $DOTFILES_PATH/apps/shell/fish/$f.fish
# TODO: ctrl-p files fzf end
# 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 _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 kitty set -U TERMINAL kitty
set -U BROWSER firefox-developer-edition set -U BROWSER firefox-developer-edition
set -U ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history 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 our EDITOR to neovim if we've got it
set -U EDITOR vim set -U EDITOR vim
if command -v nvim 2>&1 >/dev/null if has_command nvim
alias vim nvim alias vim nvim
alias ovim 'command vim' alias ovim 'command vim'
set -U EDITOR nvim set -U EDITOR nvim
@ -64,7 +34,7 @@ end
maybe_source_env_file config.fish maybe_source_env_file config.fish
maybe_source_env_file .hidden/config.fish maybe_source_env_file .hidden/config.fish
mkdir -p $NOTES_PATH mkdir -p $NOTES_PATH $USER_LOGS_PATH $SCROTS_PATH
command -v fd 2>&1 >/dev/null && set -U FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git' command -v fd 2>&1 >/dev/null && set -U FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'

View file

@ -2,7 +2,7 @@
function fish_user_key_bindings function fish_user_key_bindings
fzf_key_bindings fzf_key_bindings
fish_vi_key_bindings fish_vi_key_bindings --no-erase
set vi_esc "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end" set vi_esc "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
@ -16,5 +16,7 @@ function fish_user_key_bindings
bind -M insert \cp up-or-search bind -M insert \cp up-or-search
bind -M insert \cn down-or-search bind -M insert \cn down-or-search
bind -M insert \cf fzf-cd-widget bind -M insert \cs fzf-cd-widget
bind -M insert \cf end-of-line
bind -M insert \cw forward-word
end end

View file

@ -1,10 +1,30 @@
#!/usr/bin/env fish #!/usr/bin/env fish
set -U fish_user_paths $HOME/.go $GOPATH/bin $DOTFILES_PATH/bin $ENV_PATH/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/.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 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 has_command python && 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 has_command ruby && set -U fish_user_paths (ruby -e 'print Gem.user_dir')"/bin" $fish_user_paths
if test (dirname (basename $HOME)) = $USER
set -U NICE_HOME $HOME
else
set -U NICE_HOME /home/$USER
end
for p in $NICE_HOME $HOME $ENV_PATH
test -f $p/.nice_home && set -U NICE_HOME (cat $p/.nice_home)
end
set -U NOTES_PATH $NICE_HOME/doc/notes set -U NOTES_PATH $NICE_HOME/doc/notes
set -U SCROTS_PATH $NICE_HOME/img/scrots
set -U USER_LOGS_PATH $NICE_HOME/doc/logs

View file

@ -63,7 +63,7 @@ set -g status-right "#[fg=colour4]#W#[fg=default]#[bg=default] #H"
set -g status-left-length 200 set -g status-left-length 200
set -g status-left "#[fg=colour7]#(tmux-session-list #S)" set -g status-left "#[fg=colour7]#(tmux-session-list #S)"
bind-key O run-shell "tmux-save-buffer #S" \; display-message "Saved buffer to ~/<date>.<session-name>.tmux-buffer.log" bind-key O display-message "#(tmux-save-buffer #S)"
# pane split line colors # pane split line colors
set -g pane-active-border-style bg=black,fg=blue set -g pane-active-border-style bg=black,fg=blue

View file

@ -1,8 +1,8 @@
XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOCUMENTS_DIR="$HOME/../doc" XDG_DOCUMENTS_DIR="$HOME/../doc"
XDG_DOWNLOAD_DIR="$HOME/../dl" XDG_DOWNLOAD_DIR="$HOME/../dl"
XDG_MUSIC_DIR="$HOME/Music" XDG_MUSIC_DIR="$HOME/../music"
XDG_PICTURES_DIR="$HOME/../img" XDG_PICTURES_DIR="$HOME/../img"
XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_PUBLICSHARE_DIR="$HOME/public"
XDG_TEMPLATES_DIR="$HOME/Templates" XDG_TEMPLATES_DIR="$HOME/templates"
XDG_VIDEOS_DIR="$HOME/Videos" XDG_VIDEOS_DIR="$HOME/../video"

View file

@ -14,4 +14,18 @@ has_command python && PATH="$(python -m site --user-base)/bin:$PATH"
has_command ruby && PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" has_command ruby && PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
export PATH export PATH
export NOTES_PATH="${NOTES_PATH:-$NICE_HOME/doc/notes}"
export XDG_DESKTOP_DIR="$HOME/desktop"
export XDG_PUBLICSHARE_DIR="$HOME/public"
export XDG_TEMPLATES_DIR="$HOME/templates"
export XDG_DOCUMENTS_DIR="$NICE_HOME/doc"
export XDG_DOWNLOAD_DIR="$NICE_HOME/dl"
export XDG_MUSIC_DIR="$NICE_HOME/music"
export XDG_PICTURES_DIR="$NICE_HOME/img"
export XDG_VIDEOS_DIR="$NICE_HOME/video"
export XDG_GAMES_DIR="$NICE_HOME/games"
export NOTES_PATH="${NOTES_PATH:-$XDG_DOCUMENTS_DIR/notes}"
export USER_LOGS_PATH="${USER_LOGS_PATH:-$XDG_DOCUMENTS_DIR/logs}"
export SCROTS_PATH="${SCROTS_PATH:-$XDG_PICTURES_DIR/scrots}"

View file

@ -1,8 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env sh
prelude
sess="$1"; shift sess="$1"; shift
d="$(date +%Y-%m-%d_%H-%M-%S)" d="$(date +%Y-%m-%d_%H-%M-%S)"
f="${HOME}/${d}.${sess}.tmux-buffer.log" f="${USER_LOGS_PATH}/${d}.${sess}.tmux-buffer.log"
touch "$f" touch "$f"
chmod 600 "$f" chmod 600 "$f"
tmux capture-pane -pS -1000000000 > "$f" tmux capture-pane -pS -1000000000 > "$f"
echo "$f"