Update .config/btop/btop.conf

Update .config/fish/config.fish
Update .config/fish/functions/fish_prompt.fish
This commit is contained in:
2026-01-07 11:27:02 +01:00
parent 2e03217e90
commit 757b351010
3 changed files with 29 additions and 88 deletions

View File

@@ -60,7 +60,7 @@ update_ms = 2000
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "cpu lazy" proc_sorting = "threads"
#* Reverse sorting order, True or False. #* Reverse sorting order, True or False.
proc_reversed = false proc_reversed = false

View File

@@ -11,6 +11,8 @@ if status is-interactive
# add github ssh key # add github ssh key
eval (ssh-agent -c) eval (ssh-agent -c)
ssh-add ~/.ssh/github ssh-add ~/.ssh/github
# add github gpg key
set -gx GPG_TTY (tty)
# vi mode # vi mode
fish_vi_key_bindings fish_vi_key_bindings

View File

@@ -1,90 +1,29 @@
function fish_prompt function fish_prompt --description 'Write out the prompt'
set -l __last_command_exit_status $status set -l last_pipestatus $pipestatus
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
if not set -q -g __fish_arrow_functions_defined set -l normal (set_color normal)
set -g __fish_arrow_functions_defined
function _git_branch_name # Color the prompt differently when we're root
set -l branch (git symbolic-ref --quiet HEAD 2>/dev/null) set -l color_cwd $fish_color_cwd
if set -q branch[1] set -l suffix '>'
echo (string replace -r '^refs/heads/' '' $branch) if functions -q fish_is_root_user; and fish_is_root_user
else if set -q fish_color_cwd_root
echo (git rev-parse --short HEAD 2>/dev/null) set color_cwd $fish_color_cwd_root
end end
set suffix '#'
end end
function _is_git_dirty # Write pipestatus
not command git diff-index --cached --quiet HEAD -- &>/dev/null # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it.
or not command git diff --no-ext-diff --quiet --exit-code &>/dev/null set -l bold_flag --bold
set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation
if test $__fish_prompt_status_generation = $status_generation
set bold_flag
end end
set __fish_prompt_status_generation $status_generation
function _is_git_repo set -l status_color (set_color $fish_color_status)
type -q git set -l statusb_color (set_color $bold_flag $fish_color_status)
or return 1 set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus)
git rev-parse --git-dir >/dev/null 2>&1
end echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
function _hg_branch_name
echo (hg branch 2>/dev/null)
end
function _is_hg_dirty
set -l stat (hg status -mard 2>/dev/null)
test -n "$stat"
end
function _is_hg_repo
fish_print_hg_root >/dev/null
end
function _repo_branch_name
_$argv[1]_branch_name
end
function _is_repo_dirty
_is_$argv[1]_dirty
end
function _repo_type
if _is_hg_repo
echo hg
return 0
else if _is_git_repo
echo git
return 0
end
return 1
end
end
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
set -l red (set_color -o red)
set -l green (set_color -o green)
set -l blue (set_color -o blue)
set -l normal (set_color normal)
set -l arrow_color "$green"
if test $__last_command_exit_status != 0
set arrow_color "$red"
end
set -l arrow "$arrow_color"
if fish_is_root_user
set arrow "$arrow_color# "
end
set -l cwd $cyan(basename (prompt_pwd))
set -l repo_info
if set -l repo_type (_repo_type)
set -l repo_branch $red(_repo_branch_name $repo_type)
set repo_info "$blue $repo_type:($repo_branch$blue)"
if _is_repo_dirty $repo_type
set -l dirty "$yellow"
set repo_info "$repo_info$dirty"
end
end
echo -n -s $arrow ' '$cwd $repo_info $normal ' '
end end