Compare commits
2
Commits
master
..
f249000d30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f249000d30 | ||
|
|
6260584877 |
@@ -3,5 +3,3 @@ files/helix/.config/helix/runtime
|
||||
kitty.conf.bak
|
||||
*.bak
|
||||
*.bak.*
|
||||
redmine-hints.py
|
||||
gerrit-hints.py
|
||||
|
||||
@@ -10,7 +10,7 @@ Use ./stow.sh --unstow <folder_name> to remove configuration
|
||||
|
||||
## Quirks
|
||||
- Install based on Ubuntu Desktop
|
||||
- Font: [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Iosevka.tar.xz)
|
||||
- Font: [BlexMono Nerd Font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/IBMPlexMono.zip)
|
||||
- Keyboard Layout: EurKey (enable extended in gnome-tweaks)
|
||||
- Environment Vairables exported using systemd in [envvars.conf](files/environment/.config/environment.d/envvars.conf)
|
||||
- LibreWolf from flatpak needs devices=all to read yubikeys
|
||||
@@ -29,8 +29,8 @@ Use ./stow.sh --unstow <folder_name> to remove configuration
|
||||
- gamemode configuration:
|
||||
- renice=10
|
||||
- ssh-agent:
|
||||
- agent-location: `cd $HOME/.oh-my-zsh/ && git apply $HOME/.dots/patches/ssh-agent-location.patch`
|
||||
- remove keys on lock: `ln -sSf $HOME/.dots/scripts/remove-ssh.service $HOME/.config/systemd/user/remove-ssh.service && systemctl --user start remove-ssh && systemctl --user enable remove-ssh`
|
||||
- agent-location: `cd $HOME/.oh-my-zsh/ && git apply $HOME/.dots/ssh-agent-location.patch`
|
||||
- remove keys on lock: `ln -sSf $HOME/.dots/remove-ssh.service $HOME/.config/systemd/user/remove-ssh.service && systemctl --user start remove-ssh && systemctl --user enable remove-ssh`
|
||||
|
||||
## Software
|
||||
|
||||
@@ -42,7 +42,7 @@ sudo apt install \
|
||||
```
|
||||
|
||||
```
|
||||
git clone https://github.com/ohmyzsh/ohmyzsh/ $HOME/.oh-my-zsh && bash $HOME/.dots/apply-zsh-patches.sh
|
||||
git clone https://github.com/ohmyzsh/ohmyzsh/ $HOME/.oh-my-zsh && cd $HOME/.oh-my-zsh && git apply $HOME/.dots/prompt.patch
|
||||
```
|
||||
|
||||
### Extended
|
||||
@@ -74,15 +74,15 @@ sudo snap install \
|
||||
zotero-snap \
|
||||
proton-mail \
|
||||
codium \
|
||||
steam
|
||||
```
|
||||
|
||||
### Manual
|
||||
|
||||
- [Helix](https://github.com/helix-editor/helix/releases) or [Helix Fork with Breadcrumbs](https://github.com/RoloEdits/helix/tree/breadcrumb)
|
||||
- [Helix](https://github.com/helix-editor/helix/releases)
|
||||
- [Signal](https://signal.org/download/linux/)
|
||||
- [Brave](https://brave.com/linux/)
|
||||
- [Rust](https://rustup.rs/)
|
||||
- [Steam](https://repo.steampowered.com/steam/)
|
||||
- [Nix](https://nixos.org/download/) (single-user installation)
|
||||
```
|
||||
# additionally, enable flakes
|
||||
@@ -101,8 +101,6 @@ sudo snap install \
|
||||
- quick-settings-audio-panel
|
||||
- quicksettings-audio-devices-hider (hide unused devices)
|
||||
- gamemodeshellextensions@trsnaqe.com
|
||||
- status-area-horizontal-spacing@mathematical.coffee.gmail.com
|
||||
- blur-my-shell@aunetx (custom panel, slightly darker with custom pipeline)
|
||||
|
||||
### Pre-installed
|
||||
- disable desktop icons
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
CURRENT=$(pwd)
|
||||
|
||||
cd $HOME/.oh-my-zsh
|
||||
git reset --hard 1> /dev/null
|
||||
git apply $HOME/.dots/patches/*
|
||||
|
||||
cd ${CURRENT}
|
||||
@@ -6,7 +6,6 @@
|
||||
[alias]
|
||||
a = add
|
||||
aa = add .
|
||||
b = branch
|
||||
bl = blame
|
||||
c = commit -v
|
||||
ca = commit -v --amend
|
||||
@@ -18,7 +17,6 @@
|
||||
pl = pull --rebase
|
||||
ps = push
|
||||
r = rebase -i
|
||||
rc = rebase --continue
|
||||
sh = show
|
||||
st = status -s
|
||||
wt = worktree
|
||||
|
||||
@@ -24,14 +24,16 @@ display-inlay-hints = true
|
||||
[keys.normal]
|
||||
"_" = ["extend_line_up", "extend_to_line_bounds"]
|
||||
"+" = ["extend_line_down", "extend_to_line_bounds"]
|
||||
"A-/" = "@*<space>/<ret><C-a>^"
|
||||
|
||||
# Normally `goto`, but `git` works aswell
|
||||
[keys.normal.g]
|
||||
"b" = ":sh git show %sh{git blame -L %{cursor_line},+1 %{buffer_name} | awk '{print $1}'}"
|
||||
|
||||
[keys.normal.space]
|
||||
"t" = ':lsp-workspace-command tinymist.pinMain "%sh{realpath %{buffer_name}}"'
|
||||
# N, like German _Nachricht_ to the lsp
|
||||
[keys.normal.n]
|
||||
"p" = ':lsp-workspace-command tinymist.pinMain "%sh{realpath %{buffer_name}}"'
|
||||
|
||||
# Z is everything with view, so soft-wrap fits well
|
||||
[keys.normal.z]
|
||||
s = ":set soft-wrap.enable true"
|
||||
S = ":set soft-wrap.enable false"
|
||||
|
||||
@@ -8,7 +8,9 @@ clipboard_control write-clipboard write-primary no-append
|
||||
|
||||
include current-theme.conf
|
||||
|
||||
font_family Iosevka Nerd Font
|
||||
font_family BlexMono Nerd Font Mono Text
|
||||
italic_font BlexMono Nerd Font Mono
|
||||
bold_font BlexMono Nerd Font Mono
|
||||
|
||||
font_size 12
|
||||
|
||||
@@ -28,13 +30,10 @@ hide_window_decorations yes
|
||||
|
||||
tab_bar_min_tabs 2
|
||||
tab_bar_edge top
|
||||
tab_bar_margin_width 2.0
|
||||
tab_bar_margin_height 5.0 0.0
|
||||
tab_bar_align left
|
||||
tab_bar_style separator
|
||||
tab_separator " | "
|
||||
tab_title_template "{title}"
|
||||
active_tab_title_template "{fmt.noitalic}{title}"
|
||||
tab_bar_margin_width 5.0
|
||||
tab_bar_margin_height 5.0 -5.0
|
||||
tab_bar_align center
|
||||
tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title} "
|
||||
# active_tab_foreground #000
|
||||
# active_tab_background #000
|
||||
# active_tab_font_style bold-italic
|
||||
@@ -44,7 +43,7 @@ active_tab_title_template "{fmt.noitalic}{title}"
|
||||
|
||||
### Keyboard
|
||||
|
||||
map ctrl+shift+t launch --cwd=current --type=tab zsh
|
||||
map ctrl+shift+t launch --cwd=current --type=tab
|
||||
|
||||
map alt+shift+1 goto_tab 1
|
||||
map alt+shift+2 goto_tab 2
|
||||
@@ -59,6 +58,3 @@ map alt+shift+9 goto_tab 9
|
||||
map shift+cmd+equal change_font_size all +1.0
|
||||
map shift+cmd+minus change_font_size all -1.0
|
||||
|
||||
map ctrl+shift+r kitten hints --customize-processing redmine-hints.py --window-title 'Choose Ticket ID'
|
||||
map ctrl+shift+g kitten hints --customize-processing gerrit-hints.py --window-title 'Choose Change ID'
|
||||
|
||||
|
||||
+5
-5
@@ -18,12 +18,12 @@ git_branch() {
|
||||
|
||||
nix_env() {
|
||||
if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then
|
||||
echo "nix@"
|
||||
echo "(nix)"
|
||||
fi
|
||||
}
|
||||
|
||||
HOST="\[\033[0;33m\]\h\[\033[m\]"
|
||||
GIT_NIX="\[\033[0;31m\]\$(nix_env)\$(git_branch)\[\033[m\]"
|
||||
GIT_NIX="\[\033[0;31m\]\$(git_branch)\$(nix_env)\[\033[m\]"
|
||||
DIR="\[\033[0;34m\]\w\[\033[m\]"
|
||||
NEWLINE=$'\n'
|
||||
|
||||
@@ -38,13 +38,13 @@ __prompt_command() {
|
||||
export PROMPT_DIRTRIM=0
|
||||
fi
|
||||
|
||||
export PS1="${HOST} :: ${DIR} ${GIT_NIX}"
|
||||
export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}"
|
||||
|
||||
if [ $EXIT != 0 ]
|
||||
then
|
||||
PS1+='\[\033[0;31m\]>\[\033[00m\] '
|
||||
PS1+='\[\033[0;31m\]$\[\033[00m\] '
|
||||
else
|
||||
PS1+='> '
|
||||
PS1+='\[\033[0;32m\]$\[\033[00m\] '
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,6 @@ alias rm='rm -i'
|
||||
### fzf
|
||||
alias c='cd $(fd --type d | fzf --reverse)'
|
||||
alias blame='git show $(git ls-files | fzf -e --reverse --bind "enter:become(git blame {1} | fzf -e --ansi --reverse | cut -f 1 -d \" \")")'
|
||||
unalias glg 2> /dev/null
|
||||
glg() {
|
||||
g lg --color | \
|
||||
fzf --reverse --ansi \
|
||||
--preview 'git show --color=always $(echo {} | grep -o "[a-f0-9]\{7,\}" | head -1)' \
|
||||
--preview-window=right:60% \
|
||||
--bind 'enter:execute(git show --color=always $(echo {} | grep -o "[a-f0-9]\{7,\}" | head -1) | less -R)' \
|
||||
--bind 'ctrl-d:preview-page-down' \
|
||||
--bind 'ctrl-u:preview-page-up'
|
||||
}
|
||||
|
||||
# nix
|
||||
alias nd="nix develop ."
|
||||
@@ -35,7 +25,7 @@ alias nupdate="nix-channel --update"
|
||||
alias typix="nix flake init --refresh -t github:loqusion/typix"
|
||||
alias twatch="typst watch"
|
||||
alias tbuild="tpst build"
|
||||
alias tlsp="nix-shell -p tinymist"
|
||||
alias tlsp="nix-shell -p tinymist --command zsh"
|
||||
|
||||
alias nlatex="nix-shell -p texlive.combined.scheme-full"
|
||||
|
||||
@@ -48,20 +38,10 @@ alias ls='ls --color --hyperlink'
|
||||
alias nssh='SSH_AUTH_SOCK= ssh'
|
||||
alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE`
|
||||
t() {
|
||||
# if remote, link agent so a stale env doesn't hurt agent
|
||||
if [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]] || [[ $SSH_AUTH_SOCK =~ "$HOME/.ssh/agent" ]]; then
|
||||
ln -sf $SSH_AUTH_SOCK /tmp/agent.sock
|
||||
export SSH_AUTH_SOCK=/tmp/agent.sock
|
||||
fi
|
||||
tmux new-session -A -s ${1:-tmux}
|
||||
}
|
||||
z() {
|
||||
# if remote, link agent so a stale zellij env doesn't hurt agent
|
||||
if [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]] || [[ $SSH_AUTH_SOCK =~ "$HOME/.ssh/agent" ]]; then
|
||||
ln -sf $SSH_AUTH_SOCK /tmp/agent.sock
|
||||
export SSH_AUTH_SOCK=/tmp/agent.sock
|
||||
fi
|
||||
zellij attach ${1:-$HOST} 2> /dev/null || zellij -s ${1:-$HOST}
|
||||
zellij attach ${1:-dev} 2> /dev/null || zellij -s ${1:-dev}
|
||||
}
|
||||
|
||||
# password hash (sed needed when using in docker-compose)
|
||||
|
||||
+12
-13
@@ -2,12 +2,23 @@ export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
ZSH_THEME="afowler"
|
||||
|
||||
# Uncomment the following line if pasting URLs and other text is messed up.
|
||||
# DISABLE_MAGIC_FUNCTIONS="true"
|
||||
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
# You can also set it to another string to have that shown instead of the default red dots.
|
||||
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
||||
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
plugins=(git colored-man-pages rust ssh-agent)
|
||||
|
||||
zstyle :omz:plugins:ssh-agent helper sshaskpass
|
||||
zstyle :omz:update mode disabled
|
||||
|
||||
bindkey ^F forward-word
|
||||
bindkey ^B backward-word
|
||||
@@ -18,15 +29,3 @@ source $ZSH/oh-my-zsh.sh
|
||||
|
||||
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
||||
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
||||
|
||||
function set_zellij_tab_to_working_dir() {
|
||||
local current_dir=$PWD
|
||||
if [[ $current_dir == $HOME ]]; then
|
||||
current_dir="~"
|
||||
else
|
||||
current_dir=${current_dir##*/}
|
||||
fi
|
||||
command nohup zellij action rename-tab $current_dir >/dev/null 2>&1
|
||||
}
|
||||
|
||||
[[ -n $ZELLIJ ]] && add-zsh-hook precmd set_zellij_tab_to_working_dir
|
||||
|
||||
+24
-52
@@ -1,16 +1,15 @@
|
||||
### Terminal
|
||||
# tmux.conf
|
||||
# ~ M. Thomas
|
||||
|
||||
set-option -g default-shell "$SHELL"
|
||||
######### Terminal Setup ##########
|
||||
# set default terminal
|
||||
set -g default-terminal "tmux-256color"
|
||||
|
||||
# enable true color terminal
|
||||
set -ga terminal-overrides ",*256col*:Tc,alacritty:Tc"
|
||||
|
||||
# enable hyperlinks
|
||||
set -as terminal-features ",*:hyperlinks"
|
||||
|
||||
### Keybinds
|
||||
|
||||
######### Keybinds ##########
|
||||
# new panes (open with current path)
|
||||
bind-key -n M-v split-window -h -c "#{pane_current_path}"
|
||||
bind-key -n M-s split-window -v -c "#{pane_current_path}"
|
||||
@@ -28,7 +27,7 @@ bind-key -n M-l select-pane -R
|
||||
bind-key -n M-f resize-pane -Z
|
||||
|
||||
# window rename
|
||||
bind-key -n M-, command-prompt -p "Rename tab:" "rename-window '%%'"
|
||||
bind-key -n M-, command-prompt -p "Rename window:" "rename-window '%%'"
|
||||
bind-key -n M-< set automatic-rename on
|
||||
|
||||
# navigate windows
|
||||
@@ -43,34 +42,27 @@ bind-key -n M-8 select-window -t 8
|
||||
bind-key -n M-9 select-window -t 9
|
||||
|
||||
# swap panes
|
||||
bind-key -n 'M-r' swap-pane -D
|
||||
bind-key -n 'M-R' swap-pane -U
|
||||
bind-key -n 'M-J' swap-pane -D
|
||||
bind-key -n 'M-K' swap-pane -U
|
||||
|
||||
# move panes to and from windows
|
||||
bind-key -n 'M-t' command-prompt -p "Move pane to tab:" "join-pane -t :'%%'"
|
||||
|
||||
# cycle layouts
|
||||
bind-key -n 'M-]' next-layout
|
||||
bind-key -n 'M-[' previous-layout
|
||||
bind-key -n 'M-t' command-prompt -p "Send pane to:" "join-pane -t :'%%'"
|
||||
bind-key -n 'M-!' select-layout even-horizontal
|
||||
bind-key -n 'M-@' select-layout even-vertical
|
||||
bind-key -n 'M-#' select-layout main-vertical
|
||||
|
||||
# move windows
|
||||
bind-key -n M-. command-prompt -p "Swab tab with:" "swap-window -t :'%%'"
|
||||
bind-key -n M-. command-prompt -p "Swap window with:" "swap-window -t :'%%'"
|
||||
|
||||
set -g main-pane-width 40%
|
||||
|
||||
# resize panes
|
||||
bind-key -n 'M-H' resize-pane -L 5
|
||||
bind-key -n 'M-L' resize-pane -R 5
|
||||
bind-key -n 'M-K' resize-pane -U 5
|
||||
bind-key -n 'M-J' resize-pane -D 5
|
||||
|
||||
# popups
|
||||
bind-key -n M-p if-shell -F '#{==:#{session_name},popup}' {
|
||||
detach-client
|
||||
} {
|
||||
display-popup -E -w 70% -h 70% "tmux new-session -A -s popup"
|
||||
}
|
||||
|
||||
### Misc
|
||||
bind-key -n 'M-Left' resize-pane -L 5
|
||||
bind-key -n 'M-Right' resize-pane -R 5
|
||||
bind-key -n 'M-Up' resize-pane -U 5
|
||||
bind-key -n 'M-Down' resize-pane -D 5
|
||||
|
||||
########## General ##########
|
||||
# alias
|
||||
set -s command-alias[1] respawn='respawn-pane -k'
|
||||
|
||||
@@ -87,40 +79,20 @@ set-option -g mouse on
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
|
||||
### Theme
|
||||
|
||||
set -g main-pane-width 40%
|
||||
|
||||
# set terminal window title (update every second)
|
||||
set-option -g status-interval 1
|
||||
set-option -g set-titles on
|
||||
set-option -g set-titles-string "#H: #W"
|
||||
|
||||
# Pane borders
|
||||
set -g pane-border-style fg=#dadbd2
|
||||
set -g pane-active-border-style fg=#96a193
|
||||
set -g pane-border-status top
|
||||
set -g pane-border-indicators off
|
||||
set -g pane-border-lines single
|
||||
set -g pane-border-format " #{?pane_active,#[bold],#[fg=#c3c6b2]}#{pane_index} "
|
||||
# Make inactive border a bit less noticeable
|
||||
set -g pane-border-style fg="#e3ddcc"
|
||||
|
||||
# Status
|
||||
set -g status off
|
||||
set -g status-position top
|
||||
set -g status-style bg=default
|
||||
set -g message-style bg=default
|
||||
set -g status-right "#[fg=yellow]#H(#S) #[fg=blue]#{=100:pane_current_path}#[fg=black]"
|
||||
set -g status-right-length 200
|
||||
set -g status-left ""
|
||||
set -g window-status-format "#[fg=#c3c6b2]#I:#W#[fg=default] "
|
||||
set -g window-status-current-format "#I:#W "
|
||||
set -g window-status-format "#I:#W "
|
||||
set -g window-status-current-format "#[underscore]#I:#W#[nounderscore] "
|
||||
|
||||
# Cooler status
|
||||
set -g @tmux-dotbar-bg "#fdf6e3"
|
||||
set -g @tmux-dotbar-fg "#5c6a72"
|
||||
set -g @tmux-dotbar-fg-current "#8da101"
|
||||
set -g @tmux-dotbar-fg-session "#96a193"
|
||||
set -g @tmux-dotbar-fg-prefix "#e66868"
|
||||
set -g @tmux-dotbar-fg-zoomed "#3a94c5"
|
||||
set -g @tmux-dotbar-rounded true
|
||||
run ~/.dots/scripts/dotbar.tmux
|
||||
|
||||
@@ -403,7 +403,7 @@ default_layout "compact"
|
||||
|
||||
// Path to the default editor to use to edit pane scrollbuffer
|
||||
// Default: $EDITOR or $VISUAL
|
||||
scrollback_editor "hx"
|
||||
// scrollback_editor "/usr/bin/vim"
|
||||
|
||||
// A fixed name to always give the Zellij session.
|
||||
// Consider also setting `attach_to_session true,`
|
||||
|
||||
@@ -4,7 +4,7 @@ Description=Remove SSH keys on lock
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=SSH_AUTH_SOCK=/tmp/agent.sock
|
||||
ExecStart=%h/.dots/scripts/remove-ssh.bash
|
||||
ExecStart=%h/.dots/remove-ssh.bash
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,122 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Original source:
|
||||
# https://github.com/vaaleyard/tmux-dotbar
|
||||
|
||||
get_tmux_option() {
|
||||
local option="$1"
|
||||
local default_value="$2"
|
||||
local option_value
|
||||
option_value=$(tmux show-options -gqv "$option")
|
||||
[ -n "$option_value" ] && echo "$option_value" || echo "$default_value"
|
||||
}
|
||||
|
||||
# Colors
|
||||
bg=$(get_tmux_option "@tmux-dotbar-bg" '#0B0E14')
|
||||
fg=$(get_tmux_option "@tmux-dotbar-fg" '#475266')
|
||||
fg_current=$(get_tmux_option "@tmux-dotbar-fg-current" '#BFBDB6')
|
||||
fg_session=$(get_tmux_option "@tmux-dotbar-fg-session" '#565B66')
|
||||
fg_prefix=$(get_tmux_option "@tmux-dotbar-fg-prefix" '#95E6CB')
|
||||
fg_zoomed=$(get_tmux_option "@tmux-dotbar-fg-zoomed" '#39BAE6')
|
||||
|
||||
# Options
|
||||
bold_status=$(get_tmux_option "@tmux-dotbar-bold-status" false)
|
||||
bold_current_window=$(get_tmux_option "@tmux-dotbar-bold-current-window" false)
|
||||
bold_session=$(get_tmux_option "@tmux-dotbar-bold-session" false)
|
||||
bold_status_right=$(get_tmux_option "@tmux-dotbar-bold-status-right" false)
|
||||
rounded=$(get_tmux_option "@tmux-dotbar-rounded" true)
|
||||
status=$(get_tmux_option "@tmux-dotbar-position" "bottom")
|
||||
justify=$(get_tmux_option "@tmux-dotbar-justify" "absolute-centre")
|
||||
left_state=$(get_tmux_option "@tmux-dotbar-left" true)
|
||||
right_state=$(get_tmux_option "@tmux-dotbar-right" false)
|
||||
|
||||
# Status Components
|
||||
session_text=$(get_tmux_option "@tmux-dotbar-session-text" " #S ")
|
||||
session_position=$(get_tmux_option "@tmux-dotbar-session-position" "left")
|
||||
time_text=$(get_tmux_option "@tmux-dotbar-status-right-text" " %H:%M ")
|
||||
|
||||
session_bold_attr="nobold"
|
||||
[ "$bold_session" = true ] && session_bold_attr="bold"
|
||||
|
||||
status_right_bold_attr="nobold"
|
||||
[ "$bold_status_right" = true ] && status_right_bold_attr="bold"
|
||||
|
||||
prefix_bold_attr="bold"
|
||||
if [ "$bold_status" = true ]; then
|
||||
session_bold_attr="bold"
|
||||
status_right_bold_attr="bold"
|
||||
prefix_bold_attr="nobold"
|
||||
fi
|
||||
|
||||
if [ "$rounded" = "true" ]; then
|
||||
edge_left=''
|
||||
edge_right=''
|
||||
# Trim 1 char from each side so edge glyphs replace the padding, keeping width stable.
|
||||
# Bash does not allow negative substring lengths, so compute a safe explicit length.
|
||||
if [ "${#session_text}" -gt 2 ]; then
|
||||
session_text_inner="${session_text:1:${#session_text}-2}"
|
||||
else
|
||||
session_text_inner="$session_text"
|
||||
fi
|
||||
session_component="#[bg=$bg,fg=$fg_session,$session_bold_attr]#{?client_prefix,#[fg=$fg_prefix]$edge_left,$session_text}#[bg=$fg_prefix,fg=$bg,$prefix_bold_attr]#{?client_prefix,$session_text_inner,}#[bg=$bg,fg=${fg_session},$session_bold_attr]#{?client_prefix,#[fg=$fg_prefix]$edge_right,}"
|
||||
else
|
||||
session_component="#[bg=$bg,fg=$fg_session,$session_bold_attr]#{?client_prefix,,$session_text}#[bg=$fg_prefix,fg=$bg,$prefix_bold_attr]#{?client_prefix,$session_text,}#[bg=$bg,fg=${fg_session},$session_bold_attr]"
|
||||
fi
|
||||
time_component="#[bg=$bg,fg=$fg_session,$status_right_bold_attr]$time_text#[bg=$bg,fg=${fg_session},$status_right_bold_attr]"
|
||||
|
||||
# Build Default Status Strings
|
||||
if [ "$session_position" = "right" ]; then
|
||||
default_left=""
|
||||
[ "$right_state" = "true" ] && default_right="$time_component$session_component" || default_right="$session_component"
|
||||
else
|
||||
default_left="$session_component"
|
||||
[ "$right_state" = "true" ] && default_right="$time_component" || default_right=""
|
||||
fi
|
||||
|
||||
status_left=$(get_tmux_option "@tmux-dotbar-status-left" "$default_left")
|
||||
status_right=$(get_tmux_option "@tmux-dotbar-status-right" "$default_right")
|
||||
|
||||
[ "$left_state" != "true" ] && status_left=""
|
||||
([ "$right_state" != "true" ] && [ "$session_position" != "right" ]) && status_right=""
|
||||
|
||||
# Window Format & SSH
|
||||
base_window_format=$(get_tmux_option "@tmux-dotbar-window-status-format" ' #W ')
|
||||
ssh_enabled=$(get_tmux_option "@tmux-dotbar-ssh-enabled" true)
|
||||
|
||||
if [ "$ssh_enabled" = true ]; then
|
||||
ssh_icon=$(get_tmux_option "@tmux-dotbar-ssh-icon" '')
|
||||
ssh_icon_only=$(get_tmux_option "@tmux-dotbar-ssh-icon-only" false)
|
||||
if [ "$ssh_icon_only" = true ]; then
|
||||
ssh_window_format=" ${ssh_icon}${base_window_format}"
|
||||
else
|
||||
ssh_window_format=" ${ssh_icon} #(host=\$(echo '#{pane_title}' | sed 's/^ssh //; s/ .*//; s/.*@//; s/:.*//'); if echo \"\$host\" | grep -qE '^[0-9.]+\$|^[0-9]'; then echo '#W'; else echo \"\$host\"; fi | cut -c1-20) "
|
||||
fi
|
||||
window_status_format="#{?#{==:#{pane_current_command},ssh},${ssh_window_format},${base_window_format}}"
|
||||
else
|
||||
window_status_format="${base_window_format}"
|
||||
fi
|
||||
|
||||
window_status_separator=$(get_tmux_option "@tmux-dotbar-window-status-separator" ' • ')
|
||||
maximized_pane_icon=$(get_tmux_option "@tmux-dotbar-maximized-icon" '')
|
||||
show_maximized_icon_for_all_tabs=$(get_tmux_option "@tmux-dotbar-show-maximized-icon-for-all-tabs" false)
|
||||
|
||||
# Apply Options
|
||||
tmux set-option -g status-position "$status"
|
||||
tmux set-option -g status-justify "$justify"
|
||||
tmux set-option -g status-left "$status_left"
|
||||
tmux set-option -g status-right "$status_right"
|
||||
tmux set-window-option -g window-status-separator "$window_status_separator"
|
||||
tmux set-option -g window-status-style "bg=${bg},fg=${fg}"
|
||||
tmux set-option -g window-status-format "$window_status_format"
|
||||
[ "$show_maximized_icon_for_all_tabs" = true ] && tmux set-option -g window-status-format "${window_status_format}#{?window_zoomed_flag,${maximized_pane_icon},}"
|
||||
|
||||
status_style="bg=${bg},fg=${fg}"
|
||||
[ "$bold_status" = true ] && status_style="$status_style,bold"
|
||||
tmux set-option -g status-style "$status_style"
|
||||
|
||||
tmux set-option -g window-status-bell-style "bg=${fg_prefix},fg=${bg},bold"
|
||||
tmux set-option -g window-status-activity-style "bg=${fg_current},fg=${bg}"
|
||||
|
||||
current_format="#[bg=${bg},fg=${fg_current}]${window_status_format}#[fg=${fg_zoomed},bg=${bg}]#{?window_zoomed_flag,${maximized_pane_icon},}#[fg=${bg},bg=default]"
|
||||
[ "$bold_current_window" = true ] && current_format="#[bg=${bg},fg=${fg_current},bold]${window_status_format}#[fg=#39BAE6,bg=${bg}]#{?window_zoomed_flag,${maximized_pane_icon},}#[fg=${bg},bg=default]"
|
||||
tmux set-option -g window-status-current-format "$current_format"
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
index 83548648..42ec378f 100644
|
||||
index 8354864..61462fd 100644
|
||||
--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
@@ -24,7 +24,7 @@ function _start_agent() {
|
||||
@@ -11,13 +11,3 @@ index 83548648..42ec378f 100644
|
||||
chmod 600 "$ssh_env_cache"
|
||||
. "$ssh_env_cache" > /dev/null
|
||||
}
|
||||
@@ -107,7 +107,8 @@ if zstyle -t :omz:plugins:ssh-agent agent-forwarding \
|
||||
fi
|
||||
fi
|
||||
else
|
||||
- _start_agent
|
||||
+ # Don't start new one, if ssh-agent is forwarded
|
||||
+ [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]] || [[ $SSH_AUTH_SOCK =~ "$HOME/.ssh/agent" ]] || _start_agent
|
||||
fi
|
||||
|
||||
# Don't add identities if lazy-loading is enabled
|
||||
Reference in New Issue
Block a user