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

1
.config/bat/bat.rc Normal file
View File

@@ -0,0 +1 @@
alias cat='bat --paging=never'

34
.config/fzf/fzf.rc Normal file
View File

@@ -0,0 +1,34 @@
# switch group using `,` and `.`
zstyle ':fzf-tab:*' switch-group ',' '.'
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
zstyle ':fzf-tab:*' popup-min-size 90 20
zstyle ':fzf-tab:*' popup-pad 40 0
zstyle ':fzf-tab:*' fzf-min-height 20
export FZF_DEFAULT_OPTS=(
'--color=fg:-1,bg:-1,hl:#005faf,bg+:-1,fg+:#ffffff,hl+:#ffb67a' \
'--color=info:#b0b0b0,prompt:#5fff87,pointer:#0f63bd,marker:#ff0808,spinner:#ffb67a,header:#0ca8fb,border:#4697BD' \
'-i' \
'--ansi' \
'--prompt= ' \
'--pointer=' \
'--tabstop=4' \
'--layout=reverse' \
'--preview-window=right:65%'
)
zstyle ':fzf-tab:complete:*' fzf-flags $FZF_DEFAULT_OPTS
FZF_TAB_GROUP_COLORS=(
$'\033[94m' $'\033[32m' $'\033[33m' $'\033[35m' $'\033[31m' $'\033[38;5;27m' $'\033[36m' \
$'\033[38;5;100m' $'\033[38;5;98m' $'\033[91m' $'\033[38;5;80m' $'\033[92m' \
$'\033[38;5;214m' $'\033[38;5;165m' $'\033[38;5;124m' $'\033[38;5;120m'
)
zstyle ':fzf-tab:*' group-colors $FZF_TAB_GROUP_COLORS
#zstyle ':fzf-tab:*' default-color $'\e[38;5;250m'
#zstyle ':fzf-tab:*' prefix '\e[38;5;255m'
zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word'
zstyle ':fzf-tab:complete:service:*' fzf-preview 'SYSTEMD_COLORS=1 service $word status'
zstyle ':fzf-tab:complete:(cd|__zoxide_z):*' fzf-preview 'lsd -a --color=always --icon=always --tree --depth 2 --ignore-glob .git $realpath'
zstyle ':fzf-tab:complete:(lsd|ls|cat|bat|rm|cp|mv):*' fzf-preview 'bat $realpath 2> /dev/null || lsd -a --color=always --icon=always --tree --depth 2 --ignore-glob .git $realpath'

28
.config/lsd/config.yaml Normal file
View File

@@ -0,0 +1,28 @@
blocks:
- permission
- user
- group
- size
- date
- name
color:
# When to colorize the output.
# When "classic" is set, this is set to "never".
# Possible values: never, auto, always
when: auto
# How to colorize the output.
# When "classic" is set, this is set to "no-color".
# Possible values: default, <theme-file-name>
# when specifying <theme-file-name>, lsd will look up theme file
# XDG Base Directory if relative, e.g. ~/.config/lsd/themes/<theme-file-name>.yaml,
# The file path if absolute
theme: kamu
# == Sorting ==
sorting:
column: name
dir-grouping: first
no-symlink: false
symlink-arrow:

13
.config/lsd/lsd.rc Normal file
View File

@@ -0,0 +1,13 @@
alias ls='lsd --config-file $KHOME/.config/lsd/config.yaml'
# ---
alias l='ls -l'
alias la='ls -a'
alias ll='ls -lah'
alias lt='ls -a --tree --depth 2 --ignore-glob .git'
alias lt2='ls -a --tree --depth 3 --ignore-glob .git'
alias lt3='ls -a --tree --depth 4 --ignore-glob .git'
alias ltu='ls -a --tree --ignore-glob .git'
alias ltl='ls -lah --tree --depth 2 --ignore-glob .git'
alias ltl2='ls -lah --tree --depth 3 --ignore-glob .git'
alias ltl3='ls -lah --tree --depth 4 --ignore-glob .git'
alias ltlu='ls -lah --tree --ignore-glob .git'

View File

@@ -0,0 +1,27 @@
user: 253
group: 253
permission:
read: dark_green
write: dark_yellow
exec: dark_red
exec-sticky: 5
no-access: 245
octal: 6
acl: dark_cyan
context: cyan
date:
hour-old: [0x00, 0xAF, 0xFF]
day-old: [0x00,0x5f,0xaf]
older: 245
size:
none: 240
small: 245
medium: 250
large: white
inode:
valid: 13
invalid: 245
links:
valid: 13
invalid: 245
tree-edge: 245

129
.config/omp/omp.json Normal file
View File

@@ -0,0 +1,129 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "p:tertiary",
"background_templates": [
"{{ if .Root }}#FF0000{{ end }}"
],
"foreground": "p:tertiary_font",
"style": "plain",
"template": " {{ .UserName }}{{ if .SSHSession }}@{{.HostName }}{{ end }} {{ if .Root }}<#FF0000,p:secondary>{{ else }}<p:tertiary,p:secondary>{{ end }}</>",
"type": "session"
},
{
"foreground": "p:secondary_font",
"background": "p:secondary",
"style": "plain",
"powerline_symbol": "",
"properties": {
"style": "full"
},
"template": " {{ .Path }} <p:secondary,transparent></>",
"type": "path",
"min_width": 80
},
{
"foreground": "p:secondary_font",
"background": "p:secondary",
"style": "plain",
"powerline_symbol": "",
"properties": {
"style": "agnoster",
"folder_icon": "",
"mixed_threshold": 2
},
"template": " {{ .Path }} <p:secondary,transparent></>",
"type": "path",
"max_width": 79
},
{
"foreground": "p:tertiary_font",
"background": "p:tertiary",
"style": "powerline",
"powerline_symbol": "",
"template": "{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }} ",
"properties": {
"fetch_status": true,
"fetch_upstream_icon": true
},
"type": "git",
"min_width": 80
},
{
"type": "executiontime",
"style": "plain",
"foreground": "p:secondary_font",
"background": "transparent",
"template": " {{ .FormattedMs }} ",
"properties": {
"threshold": 1000,
"style": "roundrock"
}
},
{
"foreground": "p:accent",
"background": "transparent",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"properties": {
"always_enabled": true
},
"style": "plain",
"template": "",
"type": "exit"
}
],
"type": "prompt"
}
],
"tooltips": [
{
"type": "git",
"tips": [
"git",
"g"
],
"style": "powerline",
"foreground": "p:tertiary_front",
"background": "p:tertiary",
"powerline_symbol": "",
"template": " {{ .HEAD }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }} ",
"properties": {
"fetch_status": true,
"fetch_upstream_icon": true
},
"max_width": 79
}
],
"transient_prompt_backup": {
"background": "p:secondary",
"foreground_templates": [
"{{ if .Root }}#FF0000{{ end }}"
],
"foreground": "p:tertiary",
"template": "<p:secondary_font> {{ .PWD }} </><p:secondary,transparent></>"
},
"secondary_prompt": {
"background": "p:secondary",
"foreground_templates": [
"{{ if .Root }}#FF0000{{ end }}"
],
"foreground": "p:tertiary",
"template": "<p:secondary_font> </><p:secondary,transparent></><p:accent,transparent> </>"
},
"final_space": true,
"version": 2,
"palette": {
"accent": "#0ca8fb",
"secondary": "#011f2a",
"tertiary": "#0f63bd",
"accent_font": "#000000",
"secondary_font": "#FFFFFF",
"tertiary_font": "#FFFFFF"
}
}

1
.config/omp/omp.rc Normal file
View File

@@ -0,0 +1 @@
eval "$(oh-my-posh init zsh --config ${XDG_CONFIG_HOME}/omp/omp.json)"

52
.config/sh/_kfg.rc Normal file
View File

@@ -0,0 +1,52 @@
function _kfg {
local -a _options _commands _programs
_programs=(
'all:Install everything'
'zsh:Powerful Shell'
'tmux:Terminal Multiplexer'
'unp:Perl script to make file archive extraction easier'
'bat:cat replacement with syntax highlighting and git integration'
'lsd:ls replacement with colors, icons, tree-view and more'
'omp:Customisable shell prompt renderer'
'zoxide:A smarter cd command'
'fzf:A command-line fuzzy finder'
'fzf-tab:Replace zsh default completion selection menu with fzf'
)
_commands=(
'update:Update kfg'
'install:Install programs and configs'
'version:Print version number'
)
_options=(
{-h,--help}'[Show this help]'
{-y,--yes}'[Skip confirmation questions]'
#{-a,--arch}' STRING [Set the architecture string to be used when downloading files from repositories. Most common are "amd64", "arm64", "armhf", etc]'
{-d,--debug}'[Print debug output]'
)
function _kfg_install {
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t programs "kfg install programs" _programs
return
else
_arguments $_options
return
fi
}
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t commands "kfg command" _commands
return
fi
case "$words[1]" in
install) _kfg_install && return 0 ;;
*) return 0 ;;
esac
}
compdef _kfg kfg

View File

@@ -0,0 +1,2 @@
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word

7
.config/sh/util.rc Normal file
View File

@@ -0,0 +1,7 @@
if command -v bat &> /dev/null; then
alias myip="curl https://ipinfo.io/json 2> /dev/null | bat -l JSON --file-name=https://ipinfo.io/json -p --paging=never"
else
alias myip="curl https://ipinfo.io/json 2> /dev/null"
fi
alias ip='ip -c'

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}"

1
.config/zoxide/zoxide.rc Normal file
View File

@@ -0,0 +1 @@
eval "$(zoxide init zsh --hook pwd --cmd z)"