mainly tmux updates, ssh-askpass w/ pinentry

This commit is contained in:
Arthur Khachaturov 2024-08-24 23:57:32 +03:00
parent 3db255cc32
commit d2d85c8cff
No known key found for this signature in database
GPG key ID: CAC2B7EB6DF45D55
8 changed files with 64 additions and 8 deletions

View file

@ -50,7 +50,7 @@
class = Dunst class = Dunst
corner_radius = 0 corner_radius = 0
ignore_dbusclose = true ignore_dbusclose = false
mouse_left_click = close_current mouse_left_click = close_current
mouse_middle_click = do_action, close_current mouse_middle_click = do_action, close_current

View file

@ -3,27 +3,41 @@ unbind-key C-b
set-option -g prefix C-a set-option -g prefix C-a
bind-key C-a send-prefix bind-key C-a send-prefix
# moving # Moving
bind u previous-window bind u previous-window
bind i next-window bind i next-window
bind n "new-window -c '#{pane_current_path}'" bind n "new-window -c '#{pane_current_path}'"
# splits # Splits
bind h "split-window -hb -c '#{pane_current_path}'" bind h "split-window -hb -c '#{pane_current_path}'"
bind j "split-window -v -c '#{pane_current_path}'" bind j "split-window -v -c '#{pane_current_path}'"
bind k "split-window -v -b -c '#{pane_current_path}'" bind k "split-window -v -b -c '#{pane_current_path}'"
bind l "split-window -h -c '#{pane_current_path}'" bind l "split-window -h -c '#{pane_current_path}'"
# Rebind command key to ;
bind ';' "command-prompt" bind ';' "command-prompt"
# Reload config on C-r # Reload config
bind C-r "source-file ~/.config/tmux/tmux.conf" bind C-r "source-file ~/.config/tmux/tmux.conf"
# session binds # Session binds
bind C-n "new-session -c '#{pane_current_path}' -s '#{b:pane_current_path}'" bind C-n "new-session -c '#{pane_current_path}' -s '#{b:pane_current_path}'"
bind C-x "set-option -g detach-on-destroy on; kill-session" bind C-x "set-option -g detach-on-destroy on; kill-session"
bind X "set-option -g detach-on-destroy off; kill-session; set-option -g detach-on-destroy on" bind X "set-option -g detach-on-destroy off; kill-session; set-option -g detach-on-destroy on"
# Select mode
unbind-key -T copy-mode-vi y
unbind-key -T copy-mode-vi v
unbind-key -T copy-mode-vi V
unbind-key -T copy-mode-vi C-v
unbind-key -T copy-mode-vi C-c
unbind-key -T copy-mode-vi Escape
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi C-c send-keys -X cancel
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
# vim: ft=tmux # vim: ft=tmux

View file

@ -33,5 +33,6 @@ XDG_SESSION_DESKTOP="$XDG_CURRENT_DESKTOP"
WINDOW_MANAGER="dwm" WINDOW_MANAGER="dwm"
SUDO_ASKPASS="${HOME}/.local/bin/scripts/dmenu_askpass" SUDO_ASKPASS="${HOME}/.local/bin/scripts/dmenu_askpass"
SSH_ASKPASS="${HOME}/.local/bin/scripts/ssh-askpass"
set +a set +a

View file

@ -1,5 +1,7 @@
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
[ "$TERM" = "linux" ] && export TERM=fbterm
. ~/.cargo/env . ~/.cargo/env
# ls colors # ls colors
@ -95,6 +97,7 @@ bc() { unbuffer "$@" | bat; }; compdef _command bc
alias gitignore="cp ${HOME}/.local/share/gitignore-template ./.gitignore" alias gitignore="cp ${HOME}/.local/share/gitignore-template ./.gitignore"
alias gs="git status" alias gs="git status"
alias gc="git commit" alias gc="git commit"
alias gca="git commit --amend --no-edit"
alias gp="git push" alias gp="git push"
alias gl="git log" alias gl="git log"
alias ga="git add" alias ga="git add"
@ -106,6 +109,8 @@ alias gcl="git clone"
# docker aliases # docker aliases
alias dc="docker compose" alias dc="docker compose"
alias docker!="DOCKER_HOST=ssh://docker /usr/bin/docker"
alias dc!="docker! compose"
# tmux aliases # tmux aliases
tn() { tn() {

Binary file not shown.

View file

@ -50,4 +50,4 @@ fi
export GIT_AUTHOR_DATE="${date}" export GIT_AUTHOR_DATE="${date}"
export GIT_COMMITTER_DATE="${date}" export GIT_COMMITTER_DATE="${date}"
git commit -am "$@" git commit -m "$@"

30
.local/bin/scripts/ssh-askpass Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
log() {
echo "$@" >> /home/wzray/out
}
exec {OUTPUT_PIPE}<> <(:)
DESC="${1:-"Please enter your authentication passphrase:"}"
CMD=$(cat <<-EOF
SETDESC $DESC
SETPROMPT
GETPIN
EOF
)
{
while read -r out <&$OUTPUT_PIPE; do
log "$out"
if [[ "$out" = "D "* ]]; then
echo "${out#"D "}"
break
fi
done
} &
pinentry-curses -T "${GPG_TTY}" -C "en_US.UTF-8" -M "en_US.UTF-8" -g <<<"$CMD" >&$OUTPUT_PIPE
# vim: ft=sh

View file

@ -1,9 +1,15 @@
. "${HOME}"/.config/X11/xprofile . "${HOME}"/.config/X11/xprofile
[ -z "$DBUS_SESSION_BUS_ADDRESS" ] && eval $(/usr/bin/dbus-launch --exit-with-session --sh-syntax) [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && eval "$(/usr/bin/dbus-launch --exit-with-session --sh-syntax)"
dbus-update-activation-environment --verbose --all dbus-update-activation-environment --verbose --all
xr xr
. "${HOME}"/.config/X11/autostart . "${HOME}"/.config/X11/autostart
gpg-agent -d
export XDG_CURRENT_DESKTOP="gtk"
export XDG_SESSION_DESKTOP="$XDG_CURRENT_DESKTOP"
export WINDOW_MANAGER="dwm"
exec ssh-agent "${HOME}"/.local/src/dwm/dwm exec ssh-agent "${HOME}"/.local/src/dwm/dwm
# exec ssh-agent /usr/bin/dwm # exec ssh-agent /usr/bin/dwm