Skip to content

Commit

Permalink
p10k updates
Browse files Browse the repository at this point in the history
  • Loading branch information
anna328p committed Jan 10, 2025
1 parent ab0a4a8 commit 30c34fe
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 33 deletions.
1 change: 1 addition & 0 deletions common/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

# Misc
p.strace
p.xxd

(p.nixos-rebuild.override { nix = config.nix.package.out; })
];
Expand Down
2 changes: 1 addition & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions home/base/files/zsh/p10k.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function base16 {
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
newline
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
command_execution_time # duration of the last command
direnv # direnv status (https://direnv.net/)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
haskell_stack # haskell version from stack (https://haskellstack.org/)
Expand All @@ -62,6 +62,9 @@ function base16 {
time # current time
)

local misc_bg=$(base16 01 8)
local misc_fg=$(base16 04 7)

typeset -g POWERLEVEL9K_MODE=nerdfont-complete
typeset -g POWERLEVEL9K_ICON_PADDING=none

Expand Down Expand Up @@ -91,7 +94,7 @@ function base16 {
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
# The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
# ornaments defined above.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=$(base16 02 242)
# Start filler from the edge of the screen if there are no left segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
# End filler on the edge of the screen if there are no right segments on the first line.
Expand Down Expand Up @@ -410,15 +413,15 @@ function base16 {
# it will signify success by turning green.
typeset -g POWERLEVEL9K_STATUS_OK=true
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=8
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=$(base16 04 2)
typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0

# Status when some part of a pipe command fails but the overall exit status is zero. It may look
# like this: 1|0.
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=8
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='~'
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=0
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=1

# Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
# it will signify error by turning red.
Expand All @@ -444,8 +447,8 @@ function base16 {

###################[ command_execution_time: duration of the last command ]###################
# Execution time color.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=$misc_bg
# Show duration of the last command if takes at least this many seconds.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=1
# Show this many fractional digits. Zero means round to seconds.
Expand All @@ -459,29 +462,26 @@ function base16 {

#######################[ background_jobs: presence of background jobs ]#######################
# Background jobs color.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=$(base16 00 0)
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=$(base16 03 8)
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=$misc_bg
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=true
# Custom icon.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION=''

#######################[ direnv: direnv status (https://direnv.net/) ]########################
# Direnv color.
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3
typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=$misc_bg
# Custom icon.
# typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

#[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]##
# Nix shell color.
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0
typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=$misc_bg

# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
# typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=

# Custom icon.
# typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
#typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=

###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
# Foreground color.
Expand All @@ -501,14 +501,14 @@ function base16 {
#
##################################[ context: user@hostname ]##################################
# Context color when running with privileges.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1
typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=0
typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=1
# Context color in SSH without privileges.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=$misc_bg
# Default context color (no privileges, no SSH).
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=$misc_bg

# Context format when running with privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m'
Expand All @@ -528,8 +528,8 @@ function base16 {

###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
# Python virtual environment color.
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0
typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=$misc_bg
# Don't show Python version next to the virtual environment name.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
# If set to "false", won't show virtualenv if pyenv is already shown.
Expand All @@ -542,8 +542,8 @@ function base16 {

##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
# Haskell color.
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0
typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=$misc_fg
typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=$misc_bg

# Hide haskell version if it doesn't come from one of these sources.
#
Expand All @@ -558,8 +558,8 @@ function base16 {
#
####################################[ time: current time ]####################################
# Current time color.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$(base16 00 0)
typeset -g POWERLEVEL9K_TIME_BACKGROUND=$(base16 04 7)
typeset -g POWERLEVEL9K_TIME_FOREGROUND=0
typeset -g POWERLEVEL9K_TIME_BACKGROUND=4
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past
Expand Down Expand Up @@ -588,8 +588,8 @@ function base16 {
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true


typeset -g POWERLEVEL9K_HISTORY_FOREGROUND=0
typeset -g POWERLEVEL9K_HISTORY_BACKGROUND=$(base16 03 grey50)
typeset -g POWERLEVEL9K_HISTORY_FOREGROUND=$(base16 05 0)
typeset -g POWERLEVEL9K_HISTORY_BACKGROUND=$(base16 02 grey50)

# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
Expand Down
11 changes: 11 additions & 0 deletions systems/hermes/home/gtk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@
"Documents/Docs"
"work"
];

global = [
{
name = "/ on theseus";
target = "sftp://theseus.zerotier.ap5.network/";
}
{
name = "/home/anna on theseus";
target = "sftp://theseus.zerotier.ap5.network/home/anna";
}
];
};
}

0 comments on commit 30c34fe

Please sign in to comment.