Various fixes

This commit is contained in:
Daniel Flanagan 2020-04-21 16:38:58 -05:00
parent 151a649d94
commit d7af5e1d46
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
9 changed files with 55 additions and 30 deletions

View file

@ -260,4 +260,8 @@ super + Escape
pkill -USR1 -x sxhkd pkill -USR1 -x sxhkd
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 && kitty -o remember_window_size=no -o initial_window_width=66c -o initial_window_height=10c sh -c "cal -n 3 && printf 'Press [ENTER] to close.' && read"
super + ctrl + p
bspc rule -a '*' -o state=floating && \
kitty -o remember_window_size=no -o initial_window_width=122c -o initial_window_height=40c sh -c "{ env FZFP_PASS_OPTS='' FZFP_HEIGHT=100% fzfp | head -n 1 | sd '\n\$' '' | clip; } &"

View file

@ -59,12 +59,10 @@ if [ "$PWD" = "$HOME" ] || [ "$PWD" = "$NICE_HOME" ]; then
cd "$NICE_HOME" || cd || return cd "$NICE_HOME" || cd || return
fi fi
[ -f "$HOME/.fzf.bash" ] && . "$HOME/.fzf.bash" # 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
# . "/opt/asdf-vm/asdf.sh"
# fi
if [[ -d "$HOME/.asdf/" ]] && [[ -f "$HOME/.asdf/asdf.sh" ]]; then # [ -f ~/.fzf.bash ] && source ~/.fzf.bash
. "$HOME/.asdf/asdf.sh"
elif [[ -d /opt/asdf-vm/ ]] && [[ -f /opt/asdf-vm/asdf.sh ]]; then
. "/opt/asdf-vm/asdf.sh"
fi
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

View file

@ -192,3 +192,7 @@ function chat
set -l pass (pass config/weechat-passphrase | head -n 1) set -l pass (pass config/weechat-passphrase | head -n 1)
env WEECHAT_PASSPHRASE=$pass weechat env WEECHAT_PASSPHRASE=$pass weechat
end end
# grep aliases
alias rg "rg --text"
alias grep "rg"

View file

@ -15,14 +15,28 @@ function preprocess_pwd
end end
function fish_prompt function fish_prompt
if test $status -eq 0 set last_cmd_status $status
if test (id -u) -eq 0
if test $last_cmd_status -eq 0
set_color -b blue black
else
set_color -b red black
end
printf " SUDO $USER@$hostname"
else
if test $last_cmd_status -eq 0
set_color blue set_color blue
else else
set_color red set_color red
end end
printf $USER"@"$hostname" " printf "$USER@$hostname"
end
set_color normal
printf " "
set_color magenta set_color magenta
printf (preprocess_pwd)"" printf (preprocess_pwd)""
set_color normal
printf " "
end end
function fish_mode_prompt; end function fish_mode_prompt; end

View file

@ -105,7 +105,8 @@ bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" # bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# YANKING # YANKING
bind-key -Tcopy-mode-vi "y" send -X copy-selection # bind-key -T copy-mode-vi "y" send -X copy-selection
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel -X 'clip'
set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/tmux/plugins/" set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/tmux/plugins/"

View file

@ -1,10 +1,11 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# TODO: detect MIME type?
# can a `clip-once` script exist building on this?
# wl-copy `-o`, xclip `-l 1`?
if is_wayland; then if is_wayland; then
# echo "Clip: YES. THIS IS WAYLAND SPEAKING." >&2 wl-copy -n wl-copy --trim-newline "$@"
sed 's/^\s+//g' | sed 's/\s+$//g' | wl-copy "$@"
echo "Your trimmed input was stored in all clipboards."
else else
xclip -selection clipboard xclip -i -sel p -f "$@" | xclip -i -sel c "$@"
sleep 5 && killall xclip > /dev/null 2>&1 &
fi fi

View file

@ -1,8 +1,13 @@
#!/usr/bin/env sh #!/usr/bin/env sh
op="${1:--c}"; shift >&2 2>/dev/null FZFP_PASS_CMD="pass"
cd ~/.password-store || { echo "Could not cd to ~/.password-store"; exit 1; } FZFP_PASS_DIR="$HOME/.password-store"
pp="$(fd gpg | sd ".gpg" "" | fzf --height 40%)"
echo "pass $op $pp" FZFP_HEIGHT="${FZFP_HEIGHT:-40%}"
pass "$op" "$@" "$pp" FZFP_PROMPT="${FZFP_PROMPT:-"$FZFP_PASS_CMD@$FZFP_PASS_DIR> "}"
cd - || return 1 FZFP_PASS_OPTS="${FZFP_PASS_OPTS:-}"
cd "$FZFP_PASS_DIR" || { echo "Could not cd to $FZFP_PASS_DIR" >&2; exit 1; }
pp="$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" "$pp"
cd - >/dev/null || return 1

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
test "$IS_WAYLAND" == "1" || test -n "$WAYLAND_DISPLAY" || test -n "$SWAYSOCK" || test -z "$DISPLAY" loginctl show-session "$(loginctl | grep $(whoami) | field 1)" -p Type | grep -i wayland >/dev/null

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -xe
f="$1"; shift f="$1"; shift
[ -f "$f" ] && source "$f" "$@" [ -f "$f" ] && source "$f" "$@"
true true