umstrukturiert

This commit is contained in:
Christopher Beckmann
2023-05-26 17:00:58 +02:00
parent 1b227a5892
commit 4f35a25c10
16 changed files with 10 additions and 23 deletions

17
.config/tmux/myip.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
function get_ip {
ip a show $1 | grep -m 1 inet | awk '{print $2}' | cut -d / -f 1
}
INTERFACES=$( ip a show | grep -E "^[0-9]{0,3}:" | cut -d ' ' -f 2 | cut -d : -f 1 )
for ni in $INTERFACES
do
if [[ $ni != "lo" ]] && [[ ! $ni =~ "veth" ]] && [[ ! $ni =~ "br-" ]] && [[ ! $ni =~ "docker_" ]]; then
IP="$(get_ip $ni)"
if [[ ! -z $IP ]]; then
echo -n " #[fg=#${COLOR_ACCENT}]$ni #[fg=white]$IP"
fi
fi
done

62
.config/tmux/tmux.conf Normal file
View File

@@ -0,0 +1,62 @@
# default shell
set-option -g default-shell /bin/zsh
set-option -g status-position bottom
# tmux theme
source-file "${XDG_CONFIG_HOME}/tmux/tmux.theme"
# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
unbind '"'
unbind %
bind | split-window -h -c "#{pane_current_path}" # -c openes it in the current directory
bind - split-window -v -c "#{pane_current_path}"
# History limit increase
set -g history-limit 50000
# reload config
bind C-r source-file ${XDG_CONFIG_HOME}/tmux/tmux.conf \; display "Config reloaded!"
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# vim style switch pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
# Timeout for display messages (in milliseconds)
set -g display-time 1000
# Plugins
set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
bind -T copy-mode C-c send -X copy-pipe-no-clear "xclip -sel clip"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xclip -sel clip"
# Fix numbering for easy switching
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
## init tpm
run ${XDG_CONFIG_HOME}/tmux/plugins/tpm/tpm

12
.config/tmux/tmux.rc Normal file
View File

@@ -0,0 +1,12 @@
export COLOR_ACCENT="#0ca8fb"
export COLOR_SECONDARY="#011f2a"
export COLOR_TERTIARY="#0f63bd"
if tmux list-sessions > /dev/null 2>&1; then
tmux set-environment -g COLOR_ACCENT "#0ca8fb"
tmux set-environment -g COLOR_SECONDARY "#011f2a"
tmux set-environment -g COLOR_TERTIARY "#0f63bd"
tmux set-environment -g XDG_CONFIG_HOME "${XDG_CONFIG_HOME}"
tmux source ${XDG_CONFIG_HOME}/tmux/tmux.conf
fi

33
.config/tmux/tmux.theme Normal file
View File

@@ -0,0 +1,33 @@
# tmux theme
set -g default-terminal "screen-256color"
if 'infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"'
#+--- tmux-prefix-highlight ---+
set -g @prefix_highlight_output_prefix "#[fg=#${COLOR_TERTIARY}]#[bg=default]#[nobold]#[noitalics]#[nounderscore]#[bg=#${COLOR_TERTIARY}]#[fg=white] "
set -g @prefix_highlight_output_suffix "#[bg=#${COLOR_TERTIARY}]#[fg=black] "
#set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold"-
#set -g @prefix_highlight_fg 'white'
#set -g @prefix_highlight_bg '#${COLOR_TERTIARY}'
#+--------- Panes
set -g pane-border-style "fg=${COLOR_SECONDARY},bg=default"
set -g pane-active-border-style "fg=${COLOR_TERTIARY},bg=default"
set -g window-style "fg=#848a86,bg=default"
set -g window-active-style 'fg=#EEEEEE,bg=default'
#+----- Bar Style
set -g status-style fg=white,bg=default
set -g status-left "#[fg=white,bg=#${COLOR_TERTIARY},bold,noitalics,nounderscore] #S #[fg=#${COLOR_TERTIARY},bg=default,nobold,noitalics,nounderscore]"
set -g status-right "#{prefix_highlight} #[fg=#${COLOR_SECONDARY},bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=#${COLOR_SECONDARY}]#(${XDG_CONFIG_HOME}/tmux/myip.sh) %Y-%m-%d  %H:%M #[fg=#${COLOR_TERTIARY},bg=#${COLOR_SECONDARY},nobold,noitalics,nounderscore]#[fg=white,bg=#${COLOR_TERTIARY},nobold] #H "
set -g status-right-length 120
#+----- Windows
set -g window-status-format "#[fg=black,bg=#${COLOR_SECONDARY},nobold,noitalics,nounderscore] #[fg=white,bg=#${COLOR_SECONDARY}]#I #[fg=white,bg=#${COLOR_SECONDARY},nobold,noitalics,nounderscore] #[fg=white,bg=#${COLOR_SECONDARY}]#W #F #[fg=#${COLOR_SECONDARY},bg=default,nobold,noitalics,nounderscore]"
set -g window-status-current-format "#[fg=black,bg=#${COLOR_ACCENT},nobold] #[fg=black,bg=#${COLOR_ACCENT}]#I #[fg=black,bg=#${COLOR_ACCENT},nobold,noitalics,nounderscore] #[fg=black,bg=#${COLOR_ACCENT}]#W #F #[fg=#${COLOR_ACCENT},bg=default,nobold,noitalics,nounderscore]"
set -g window-status-separator ""
#+----- Messages
set -g message-style "fg=black,bg=${COLOR_ACCENT}"