More fixes and cleanup
This commit is contained in:
parent
85eab2155c
commit
5100983350
13 changed files with 68 additions and 61 deletions
2
Makefile
2
Makefile
|
@ -3,4 +3,4 @@ MAKEFILE_PATH ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|||
default: install
|
||||
|
||||
install:
|
||||
${MAKEFILE_PATH}/setup.bash
|
||||
cd ${MAKEFILE_PATH} && ./setup.bash
|
||||
|
|
|
@ -387,7 +387,7 @@ margin-bottom = ${env:WINDOW_GAP:0}
|
|||
|
||||
[module/microphone]
|
||||
type = custom/script
|
||||
exec = $DOTFILES_PATH/apps/de/polybar/mic.bash
|
||||
exec = $DOTFILES_PATH/apps/de/polybar/mic.sh
|
||||
tail = true
|
||||
format = <label>
|
||||
label-foreground = ${colors.icon}
|
||||
|
|
|
@ -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
|
||||
kill "$(cat "${pidfile}")" > /dev/null 2>&1
|
|
@ -228,7 +228,7 @@ XF86AudioPrev
|
|||
|
||||
# open rofi as a window switcher
|
||||
super + w
|
||||
"$DOTFILES_PATH/scripts/bin/app-launcher" -modi window,run -show window
|
||||
"app-launcher" -modi window,run -show window
|
||||
|
||||
# close the current application
|
||||
super + c
|
||||
|
@ -258,8 +258,5 @@ super + d
|
|||
super + ctrl + c
|
||||
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
|
||||
tmux new-window 'sh -ci tmuxswitcher'
|
||||
|
|
|
@ -52,7 +52,7 @@ fi
|
|||
. maybe_source_env_file .hidden/bashrc
|
||||
|
||||
# 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
|
||||
if [ "$PWD" = "$HOME" ] || [ "$PWD" = "$NICE_HOME" ]; then
|
||||
|
|
|
@ -141,6 +141,7 @@ alias dd "dd status=progress"
|
|||
alias wifi "sudo nmtui"
|
||||
alias year 'cal (date +%Y)'
|
||||
alias y year
|
||||
alias pa pulsemixer
|
||||
|
||||
# games aliases
|
||||
# this sometimes fixes steam dynamic library issues?
|
||||
|
|
|
@ -4,56 +4,26 @@ 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
|
||||
$DOTFILES_PATH/bin/prelude
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# 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
|
||||
for f in key-bindings colors prompt aliases
|
||||
source $DOTFILES_PATH/apps/shell/fish/$f.fish
|
||||
end
|
||||
|
||||
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 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
|
||||
if has_command nvim
|
||||
alias vim nvim
|
||||
alias ovim 'command vim'
|
||||
set -U EDITOR nvim
|
||||
|
@ -64,7 +34,7 @@ end
|
|||
maybe_source_env_file 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'
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
function fish_user_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"
|
||||
|
||||
|
@ -16,5 +16,7 @@ function fish_user_key_bindings
|
|||
|
||||
bind -M insert \cp up-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
|
||||
|
|
|
@ -1,10 +1,30 @@
|
|||
#!/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/.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
|
||||
has_command python && set -U fish_user_paths (python -m site --user-base)"/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 SCROTS_PATH $NICE_HOME/img/scrots
|
||||
set -U USER_LOGS_PATH $NICE_HOME/doc/logs
|
||||
|
|
|
@ -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 "#[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
|
||||
set -g pane-active-border-style bg=black,fg=blue
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||
XDG_DESKTOP_DIR="$HOME/desktop"
|
||||
XDG_DOCUMENTS_DIR="$HOME/../doc"
|
||||
XDG_DOWNLOAD_DIR="$HOME/../dl"
|
||||
XDG_MUSIC_DIR="$HOME/Music"
|
||||
XDG_MUSIC_DIR="$HOME/../music"
|
||||
XDG_PICTURES_DIR="$HOME/../img"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||
XDG_TEMPLATES_DIR="$HOME/Templates"
|
||||
XDG_VIDEOS_DIR="$HOME/Videos"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/public"
|
||||
XDG_TEMPLATES_DIR="$HOME/templates"
|
||||
XDG_VIDEOS_DIR="$HOME/../video"
|
||||
|
|
16
bin/paths
16
bin/paths
|
@ -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"
|
||||
|
||||
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}"
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
prelude
|
||||
|
||||
sess="$1"; shift
|
||||
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"
|
||||
chmod 600 "$f"
|
||||
tmux capture-pane -pS -1000000000 > "$f"
|
||||
echo "$f"
|
||||
|
|
Reference in a new issue