commit 66f1491f4ed0e520c9bf18cac051907260b33472 Author: gpkvt Date: Fri Jul 14 22:39:37 2023 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39b67d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/private +.task/*.data diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f5939d --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +install: + ./install.zsh + +update: + ./install.zsh update diff --git a/README.md b/README.md new file mode 100644 index 0000000..9aec7ec --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Remarks + +## Symlinks + +`.config/*` should be copied or linked **into** `~/.config` + +`.ssh/config` should be linked to `~/.ssh/config` + +`.p10k.zsh` must be linked or copied to `~/.p10k.zsh` + +`.tmux.conf` must be linked or copied to `~/.tmux.conf` + +`.zshrc` must be linked or copied to `~/.zshrc` + +`neofetch.conf` must be linked or copied to `/etc/neofetch.conf` + +`.taskrc` should be linked or copied to `~/.taskrc` to work properly `.task` must be copied or linked to `~/.task` + +## Fonts for p10k + +`fonts` needs to be installed manually + +## tmux + +### Plugin and Theme Installation + +Start `tmux` and press `` (`ctrl+y`) followed by `I` (capital i) to install plugins and theme. + +### Sessions + +Sessionscripts in `tmux` might only work properly with `.ssh/config` + +## Fixes + +### Docker-Autocompletion + +`docker-autocompletion` might report `compinit:501: no such file or directory: /usr/share/zsh/vendor-completions/_docker`. The file is a symlink to `/mnt/wsl/docker-desktop/cli-tools/usr/share/zsh/vendor-completions/_docker` which doesn't exist if Docker-Desktop isn't running. A workaround is to replace the symlink with an copy of the real file: + +``` +sudo rm -rf /usr/share/zsh/vendor-completions/_docker +sudo cp /mnt/wsl/docker-desktop/cli-tools/usr/share/zsh/vendor-completions/_docker /usr/share/zsh/vendor-completions/ +sudo chattr +i /usr/share/zsh/vendor-completions/_docker +``` diff --git a/conky/conkyrc b/conky/conkyrc new file mode 100644 index 0000000..f76bd0e --- /dev/null +++ b/conky/conkyrc @@ -0,0 +1,87 @@ +-- Conky, a system monitor https://github.com/brndnmtthws/conky +-- +-- This configuration file is Lua code. You can write code in here, and it will +-- execute when Conky loads. You can use it to generate your own advanced +-- configurations. +-- +-- Try this (remove the `--`): +-- +-- print("Loading Conky config") +-- +-- For more on Lua, see: +-- https://www.lua.org/pil/contents.html + +conky.config = { + alignment = 'top_left', + background = false, + border_width = 1, + cpu_avg_samples = 2, + default_color = 'white', + default_outline_color = 'white', + default_shade_color = 'white', + double_buffer = true, + draw_borders = false, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + extra_newline = false, + font = 'DejaVu Sans Mono:size=12', + gap_x = 30, + gap_y = 60, + minimum_height = 5, + minimum_width = 5, + net_avg_samples = 2, + no_buffers = true, + out_to_console = false, + out_to_ncurses = false, + out_to_stderr = false, + out_to_x = true, + own_window = true, + own_window_class = 'Conky', + own_window_type = 'desktop', + show_graph_range = false, + show_graph_scale = false, + stippled_borders = 0, + update_interval = 1.0, + uppercase = false, + use_spacer = 'none', + use_xft = true, + own_window_transparent = true, + own_window_argb_visual = true +} + +conky.text = [[ +${color grey}Info:$color ${scroll 32 $sysname $nodename $machine} +$hr +${color grey}Uptime:$color $uptime +${color grey}Frequency (in GHz):$color $freq_g +${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}$color +$memgraph +${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4} +${color grey}CPU Usage:$color $cpu% ${cpubar 4} +$color${cpugraph} +${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes +${color grey}Load:$color $loadavg $color +$loadgraph +$hr +${color grey}Battery:$color ${acpiacadapter ACAD} ${battery_percent BAT1}% ${battery_bar BAT1} +$hr +${color grey}File systems: + / $color${fs_used /}/${fs_size /} ${fs_bar 6 /} +${color grey}Disk IO: +${color grey} Read:$color $diskio_read ${color grey}${goto 230}Write:$color $diskio_write +$diskiograph +$hr +${color grey}Networking: + WLAN Up:$color ${upspeed wlp57s0} ${color grey}${goto 230}Down:$color ${downspeed wlp57s0} + ${color grey}VPN Up:$color ${upspeed proton0} ${color grey}${goto 230}Down:$color ${downspeed proton0} + ${color grey}LAN Up:$color ${upspeed enx00e04cf03bf0} ${color grey}${goto 230}Down:$color ${downspeed enx00e04cf03bf0} +$hr +${color grey}Name PID CPU% MEM% +${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} +${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} +${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} +${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} +${color lightgrey} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5} +$hr +]] diff --git a/conky/deploy.zsh b/conky/deploy.zsh new file mode 100755 index 0000000..32184e9 --- /dev/null +++ b/conky/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.conkyrc +ln -s ${GIT_ROOT}/conky/conkyrc ~/.conkyrc diff --git a/fonts/Hack Bold Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/Hack Bold Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..eb80085 Binary files /dev/null and b/fonts/Hack Bold Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/Hack Bold Italic Nerd Font Complete Mono.ttf b/fonts/Hack Bold Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..9ce718b Binary files /dev/null and b/fonts/Hack Bold Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/Hack Bold Italic Nerd Font Complete Windows Compatible.ttf b/fonts/Hack Bold Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..ac573ca Binary files /dev/null and b/fonts/Hack Bold Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/Hack Bold Italic Nerd Font Complete.ttf b/fonts/Hack Bold Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..8dc2d8a Binary files /dev/null and b/fonts/Hack Bold Italic Nerd Font Complete.ttf differ diff --git a/fonts/Hack Bold Nerd Font Complete Mono Windows Compatible.ttf b/fonts/Hack Bold Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..76845af Binary files /dev/null and b/fonts/Hack Bold Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/Hack Bold Nerd Font Complete Mono.ttf b/fonts/Hack Bold Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..883937b Binary files /dev/null and b/fonts/Hack Bold Nerd Font Complete Mono.ttf differ diff --git a/fonts/Hack Bold Nerd Font Complete Windows Compatible.ttf b/fonts/Hack Bold Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..625c9c7 Binary files /dev/null and b/fonts/Hack Bold Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/Hack Bold Nerd Font Complete.ttf b/fonts/Hack Bold Nerd Font Complete.ttf new file mode 100644 index 0000000..290d487 Binary files /dev/null and b/fonts/Hack Bold Nerd Font Complete.ttf differ diff --git a/fonts/Hack Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/Hack Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..f4ebdfd Binary files /dev/null and b/fonts/Hack Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/Hack Italic Nerd Font Complete Mono.ttf b/fonts/Hack Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..ad9214e Binary files /dev/null and b/fonts/Hack Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/Hack Italic Nerd Font Complete Windows Compatible.ttf b/fonts/Hack Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..e9f0df7 Binary files /dev/null and b/fonts/Hack Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/Hack Italic Nerd Font Complete.ttf b/fonts/Hack Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..d1d7067 Binary files /dev/null and b/fonts/Hack Italic Nerd Font Complete.ttf differ diff --git a/fonts/Hack Regular Nerd Font Complete Mono Windows Compatible.ttf b/fonts/Hack Regular Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..6887250 Binary files /dev/null and b/fonts/Hack Regular Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/Hack Regular Nerd Font Complete Mono.ttf b/fonts/Hack Regular Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..57568a6 Binary files /dev/null and b/fonts/Hack Regular Nerd Font Complete Mono.ttf differ diff --git a/fonts/Hack Regular Nerd Font Complete Windows Compatible.ttf b/fonts/Hack Regular Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..275c9c7 Binary files /dev/null and b/fonts/Hack Regular Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/Hack Regular Nerd Font Complete.ttf b/fonts/Hack Regular Nerd Font Complete.ttf new file mode 100644 index 0000000..d770b83 Binary files /dev/null and b/fonts/Hack Regular Nerd Font Complete.ttf differ diff --git a/fonts/deploy.zsh b/fonts/deploy.zsh new file mode 100755 index 0000000..e69de29 diff --git a/git/deploy.zsh b/git/deploy.zsh new file mode 100755 index 0000000..9f22789 --- /dev/null +++ b/git/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.gitconfig +ln -s ${GIT_ROOT}/git/gitconfig ~/.gitconfig diff --git a/git/gitconfig b/git/gitconfig new file mode 100644 index 0000000..b132cc8 --- /dev/null +++ b/git/gitconfig @@ -0,0 +1,9 @@ +# This is Git's per-user configuration file. + +[user] + name = gpkvt + email = git@21x9.org +[pull] + ff = only +[credential] + helper = store diff --git a/install.zsh b/install.zsh new file mode 100755 index 0000000..2d0bb73 --- /dev/null +++ b/install.zsh @@ -0,0 +1,84 @@ +#! /bin/zsh + +tools=( + netcat-openbsd + aria2 + bat + btop + bind9-dnsutils + debian-goodies + gron + htop + hub + icdiff + ioping + iotop + keychain + lsof + mlocate + mtr + ncdu + net-tools + nload + nmon + oping + powerline + progress + pv + ranger + reptyr + taskwarrior + tig + tmux + tmux-plugin-manager + unp + jq + nethogs + duf +) + +GIT_ROOT=$(git rev-parse --show-toplevel) +cd ${GIT_ROOT} + +for file in $(ls -1 ./**/deploy.zsh); do + chmod +x ${file} + echo "Executing ${file}" + ${file} +done + +echo "Checking zplug installation" +if [ $(dpkg-query -W -f='${Status}' zplug 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo "Installing zplug" + sudo DEBIAN_FRONTEND=noninteractive apt install zplug -yq +fi + +echo "Executing zplug init script" +# zplug - manage plugins +source /usr/share/zplug/init.zsh +zplug "zsh-users/zsh-syntax-highlighting" +zplug "zsh-users/zsh-autosuggestions" +zplug "zsh-users/zsh-completions" +zplug "plugins/per-directory-history", from:oh-my-zsh +zplug "plugins/history-substring-search", from:oh-my-zsh +zplug "plugins/common-aliases", from:oh-my-zsh +zplug "plugins/nmap", from:oh-my-zsh +zplug "plugins/taskwarrior", from:oh-my-zsh +zplug "romkatv/powerlevel10k", use:powerlevel10k.zsh-theme + +echo "Installing zplug plugins" +# zplug - install/load new plugins when zsh is started or reloaded +if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi +fi + +echo "Installing tools" +# Install "standard" tools +for i in "${tools[@]}"; do + if [ $(dpkg-query -W -f='${Status}' ${i} 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo "Installing ${i}" + sudo DEBIAN_FRONTEND=noninteractive apt install ${i} -yq + fi +done diff --git a/mc/deploy.zsh b/mc/deploy.zsh new file mode 100755 index 0000000..b63f73f --- /dev/null +++ b/mc/deploy.zsh @@ -0,0 +1,8 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +# cp instead of ln -s because the files may get changed by mc when using it +cp ${GIT_ROOT}/mc/ini ~/.config/mc/ +cp ${GIT_ROOT}/mc/panels.ini ~/.config/mc/ +cp ${GIT_ROOT}/mc/solarized.ini ~/.config/mc/ diff --git a/mc/ini b/mc/ini new file mode 100644 index 0000000..5510a08 --- /dev/null +++ b/mc/ini @@ -0,0 +1,152 @@ +[Midnight-Commander] +verbose=true +shell_patterns=true +auto_save_setup=true +preallocate_space=false +auto_menu=false +use_internal_view=true +use_internal_edit=true +clear_before_exec=true +confirm_delete=true +confirm_overwrite=true +confirm_execute=false +confirm_history_cleanup=true +confirm_exit=false +confirm_directory_hotlist_delete=false +confirm_view_dir=false +safe_delete=false +safe_overwrite=false +use_8th_bit_as_meta=false +mouse_move_pages_viewer=true +mouse_close_dialog=false +fast_refresh=false +drop_menus=false +wrap_mode=true +old_esc_mode=true +cd_symlinks=true +show_all_if_ambiguous=false +use_file_to_guess_type=true +alternate_plus_minus=false +only_leading_plus_minus=true +show_output_starts_shell=false +xtree_mode=false +file_op_compute_totals=true +classic_progressbar=true +use_netrc=true +ftpfs_always_use_proxy=false +ftpfs_use_passive_connections=true +ftpfs_use_passive_connections_over_proxy=false +ftpfs_use_unix_list_options=true +ftpfs_first_cd_then_ls=true +ignore_ftp_chattr_errors=true +editor_fill_tabs_with_spaces=false +editor_return_does_auto_indent=false +editor_backspace_through_tabs=false +editor_fake_half_tabs=true +editor_option_save_position=true +editor_option_auto_para_formatting=false +editor_option_typewriter_wrap=false +editor_edit_confirm_save=true +editor_syntax_highlighting=true +editor_persistent_selections=true +editor_drop_selection_on_copy=true +editor_cursor_beyond_eol=false +editor_cursor_after_inserted_block=false +editor_visible_tabs=true +editor_visible_spaces=true +editor_line_state=false +editor_simple_statusbar=false +editor_check_new_line=false +editor_show_right_margin=false +editor_group_undo=true +editor_state_full_filename=true +editor_ask_filename_before_edit=false +nice_rotating_dash=true +shadows=true +mcview_remember_file_position=false +auto_fill_mkdir_name=true +copymove_persistent_attr=true +pause_after_run=1 +mouse_repeat_rate=100 +double_click_speed=250 +old_esc_mode_timeout=1000000 +max_dirt_limit=10 +num_history_items_recorded=60 +vfs_timeout=60 +ftpfs_directory_timeout=900 +ftpfs_retry_seconds=30 +fish_directory_timeout=900 +editor_tab_spacing=8 +editor_word_wrap_line_length=72 +editor_option_save_mode=0 +editor_backup_extension=~ +editor_filesize_threshold=64M +editor_stop_format_chars=-+*\\,.;:&> +mcview_eof= +skin=/home/gpkvt/.config/mc/solarized.ini + +filepos_max_saved_entries=1024 + +[Layout] +output_lines=0 +left_panel_size=140 +top_panel_size=0 +message_visible=true +keybar_visible=true +xterm_title=true +command_prompt=true +menubar_visible=true +free_space=true +horizontal_split=false +vertical_equal=true +horizontal_equal=false + +[Misc] +timeformat_recent=%b %e %H:%M +timeformat_old=%b %e %Y +ftp_proxy_host=gate +ftpfs_password=anonymous@ +display_codepage=UTF-8 +source_codepage=Other_8_bit +autodetect_codeset= +spell_language=en +clipboard_store= +clipboard_paste= + +[Colors] +base_color= +screen= +color_terminals= + +xterm-256color= + +linux= + +tmux-256color= + +[Panels] +show_mini_info=true +kilobyte_si=false +mix_all_files=false +show_backups=true +show_dot_files=true +fast_reload=false +fast_reload_msg_shown=false +mark_moves_down=true +reverse_files_only=true +auto_save_setup_panels=false +navigate_with_arrows=false +panel_scroll_pages=true +panel_scroll_center=false +mouse_move_pages=true +filetype_mode=true +permission_mode=false +torben_fj_mode=false +quick_search_mode=2 +select_flags=6 + +[Panelize] +Find *.orig after patching=find . -name \\*.orig -print +Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print +Find rejects after patching=find . -name \\*.rej -print +Modified git files=git ls-files --modified diff --git a/mc/panels.ini b/mc/panels.ini new file mode 100644 index 0000000..e69de29 diff --git a/mc/solarized.ini b/mc/solarized.ini new file mode 100644 index 0000000..747f83c --- /dev/null +++ b/mc/solarized.ini @@ -0,0 +1,152 @@ +[skin] + description = Solarized (mostly) dark skin for Midnight Commander. + +[Lines] + # TODO: Description. + horiz = ─ + vert = │ + lefttop = ┌ + righttop = ┐ + leftbottom = └ + rightbottom = ┘ + topmiddle = ─ + bottommiddle = ─ + leftmiddle = ├ + rightmiddle = ┤ + cross = ┼ + dhoriz = ═ + dvert = ║ + dlefttop = ╔ + drighttop = ╗ + dleftbottom = ╚ + drightbottom = ╝ + dtopmiddle = ╤ + dbottommiddle = ╧ + dleftmiddle = ╟ + drightmiddle = ╢ + +[core] +# Panes. + _default_ = lightgray;black ;; Default file colors/background. + selected = white;cyan ;; Color while hovering above a file/directory. + marked = white;brightmagenta ;; Marked line (using select - insert, ctrl-t, etc...) + markselect = red;cyan ;; Marked and selected. + header = white ;; Pane header (name,size,date titles). + reverse = white;brightmagenta ;; The direcotry PWD above the header, in focused pane. + +# Input fields. + inputunchanged = lightgray;black ;; Input fields colors. + input = white;black ;; Input fields, modified. + inputhistory = red;lightgray ;; Input history controller. + inputmark = black;brightred ;; Input field marked text, if any. + disabled = brightcyan;lightgray ;; Disabled input fields in dialog boxes. + gauge = magenta;blue ;; Progress bars (while copying etc). TODO: What the text stands for?! + +# Command line. + # TODO: Command prompt line colors. What are they?! + commandlinemark = black;brightred ;; Commandline marked text, if any. + commandhistory = red;brightblack ;; Command prompt history controller. + + # TODO: What these stand for? + errors = black;green + statusbar = black;green + +[popup] + # TODO: Probably user menu, screenlist, encoding, etc... + pmenunormal = black;green + pmenusel = black;green + pmenutitle = black;green + +[dialog] + _default_ = black;lightgray ;; Default colors of dialogs (e.g. copy dialog). + dfocus = black;green ;; Controller colors (checkboxes, actions) in focus. + dhotnormal = red ;; Controllers hotkey color. + dhotfocus = red;green ;; Controllers hotkey color in focus. + dtitle = white;brightmagenta ;; Dialog title. + +[error] + _default_ = black;lightgray ;; Default colors of error dialogs (e.g. overwrite permission). + errdfocus = black;green ;; Controller colors (checkboxes, actions) in focus. + errdhotnormal = red ;; Controllers hotkey color. + errdhotfocus = red;green ;; Controllers hotkey color in focus. + errdtitle = white;red ;; Error dialog title. + +[filehighlight] +# View filehighlight.ini as reference. + directory = cyan;black ;; Directories. + executable = brightred;black ;; Executable files. + symlink = magenta;black ;; Symbolic links. + stalelink = lightgray;black ;; Broken links. + device = red;blueblack ;; An interface for a device driver. + special = black;blueblack ;; Pipes (FIFOs), sockets, block files, character files etc... + core = brightcyan;black ;; Core dump files, etc?... + temp = brightgreen;black ;; Bak, Temp, ~, etc... + archive = brightmagenta;black ;; Archives. + source = green;black ;; Source files. + media = brown;black ;; Interactive media. + graph = blue;black ;; Images, in other words. + database = brightgreen;black ;; DataBases, duh. + doc = red;black ;; Documents, duh. + +[menu] + _default_ = black;lightgray ;; Default colors for menu while active. + menuinactive = black;lightgray ;; Colors for menu while inactive. + menuhot = red ;; Menu item hotkey. + menusel = black;green ;; Selected menu item. + menuhotsel = red;green ;; Selected menu item hotkey. + +[help] + _default_ = black;lightgray ;; Default help tooltip text color/background. + helpitalic = brightmagenta ;; Help when italic. + helpbold = red ;; Help when bold. + helplink = cyan ;; Links insde help tooltip. + helpslink = green ;; Links insde help tooltip focused. + helptitle = white;brightmagenta ;; Help title. + +[buttonbar] +#Bottom button bar (copy,move, etc...) + hotkey = red;brightblack ;; Hotkey colors (1-10). + button = white;brightblack ;; Button colors (text itself). + +[editor] + # TODO: These. + _default_ = lightgray;black + editbold = green;blue + editmarked = lightgray;green + editwhitespace = brightblue;blue + editlinestate = brightmagenta + bookmark = white;red + bookmarkfound = black;green + editbg = lightgray;black + editframe = lightgray;black + editframeactive = lightgray;black + editframedrag = lightgray;black + +[viewer] + # TODO: These. + viewunderline = brighmagenta;black + viewbold = brighmagenta;black + viewselected = brighmagenta;black + +[widget-common] + # TODO: These. + sort-sign-up = ↓ + sort-sign-down = ↑ + +[widget-panel] + # TODO: These. + hiddenfiles-sign-show = ⋅ + hiddenfiles-sign-hide = • + history-prev-item-sign = « + history-next-item-sign = » + history-show-list-sign = ^ + +[widget-scollbar] + # TODO: These. + first-vert-char = ↑ + last-vert-char = ↓ + first-horiz-char = « + last-horiz-char = » + current-char = ■ + background-char = ▒ + diff --git a/neofetch/deploy.zsh b/neofetch/deploy.zsh new file mode 100755 index 0000000..2b8fddf --- /dev/null +++ b/neofetch/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +sudo rm /etc/neofetch.conf +sudo ln -s ${GIT_ROOT}/neofetch/neofetch.conf /etc/neofetch.conf diff --git a/neofetch/neofetch.conf b/neofetch/neofetch.conf new file mode 100644 index 0000000..a3cf085 --- /dev/null +++ b/neofetch/neofetch.conf @@ -0,0 +1,52 @@ +print_info () { + + prin + prin "------------------------------------------------------------" + info title + #info underline + prin "------------------------------------------------------------" + + #info "Host" model + info "OS" distro + info "Kernel" kernel + info "Uptime" uptime + #info "Packages" packages + #prin "Updates" $(apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | wc -l) + info "Shell" shell + + #info "Resolution" resolution + #info "DE" de + #info "WM" wm + #info "WM Theme" wm_theme + #info "Theme" theme + #info "Icons" icons + #info "Terminal" term + #info "Terminal Font" term_font + prin "------------------------------------------------------------" + #prin + + info "CPU" cpu + #info "GPU" gpu + #info "CPUsage" cpu_usage + info "Memory" memory + info "Disk" disk + info "Battery" battery + + # The lines below with a '#' in front are additional info functions + # that are disabled by default. Removing the '#' enables them and adding + # a '#' to the start disables them again. You can add a '#' to any of the + # lines in this function to disable their output. + + #info "Font" font + #info "Song" song + info "LAN IP" local_ip + info "WAN IP" public_ip + #info "Users" users + #info "Birthday" birthday + + #prin + prin "------------------------------------------------------------" + #prin "Weather" "$(curl wttr.in/?0?q?T | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}')" + + #info cols +} diff --git a/powerline/deploy.zsh b/powerline/deploy.zsh new file mode 100755 index 0000000..514191d --- /dev/null +++ b/powerline/deploy.zsh @@ -0,0 +1,9 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.p10k.zsh +ln -s ${GIT_ROOT}/powerline/p10k.zsh ~/.p10k.zsh + +rm -rf ~/.config/powerline/themes/tmux +ln -s ${GIT_ROOT}/powerline/themes/tmux ~/.config/powerline/themes/tmux diff --git a/powerline/p10k.zsh b/powerline/p10k.zsh new file mode 100644 index 0000000..8fed01e --- /dev/null +++ b/powerline/p10k.zsh @@ -0,0 +1,1750 @@ +# Generated by Powerlevel10k configuration wizard on 2022-06-04 at 01:16 CEST. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 07629. +# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, +# 24h time, angled separators, sharp heads, flat tails, 2 lines, solid, no frame, +# lightest-ornaments, sparse, many icons, fluent, transient_prompt, +# instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + autoload -Uz is-at-least && is-at-least 5.1 || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + context # user@hostname + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + # direnv # direnv status (https://direnv.net/) + # asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + #anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + # nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + # nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + # nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + # rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + # rvm # ruby version from rvm (https://rvm.io) + # fvm # flutter version management (https://github.com/leoafarias/fvm) + # luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + # jenv # java version from jenv (https://github.com/jenv/jenv) + # plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + # perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) + # phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + # scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + # haskell_stack # haskell version from stack (https://haskellstack.org/) + # kubecontext # current kubernetes context (https://kubernetes.io/) + # terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + # aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + # aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + # azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + # gcloud # google cloud cli account and project (https://cloud.google.com/) + # google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + # toolbox # toolbox name (https://github.com/containers/toolbox) + # nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + # nnn # nnn shell (https://github.com/jarun/nnn) + # xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + # vi_mode # vi mode (you don't need this if you've enabled prompt_char) + vpn_ip # virtual private network indicator + load # CPU load + disk_usage # disk usage + ram # free RAM + swap # used swap + #todo # todo items (https://github.com/todotxt/todo.txt-cli) + #timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + time # current time + # =========================[ Line #2 ]========================= + newline + #perdir_history # should indicate if history is global or local (per directory), but does not update properly + ip # ip address and bandwidth usage for a specified network interface + public_ip # public IP address + proxy # system-wide http/https/ftp proxy + battery # internal battery + wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=none + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + 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=244 + # 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. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-version + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control system colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg repository. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=false + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=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=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # 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. + typeset -g POWERLEVEL9K_STATUS_ERROR=false + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ 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 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # 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 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_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 + + # 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='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ 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 + # 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. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show "perl-" at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ 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 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # 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 + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + function prompt_perdir_history() { + if [ $_per_directory_history_is_global ]; then + p10k segment -e -b 'blue' -f 'white' -i '🏺' -t 'global' + else + p10k segment -e -b 'white' -f 'blue' -i '🏺' -t 'local' + fi + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/powerline/themes/tmux/default.json b/powerline/themes/tmux/default.json new file mode 100644 index 0000000..18db4ce --- /dev/null +++ b/powerline/themes/tmux/default.json @@ -0,0 +1,29 @@ +{ + "segments": { + "right": [ + { + "function": "powerline.segments.common.net.external_ip" + }, + { + "function": "powerline.segments.common.net.network_load" + }, + { + "function": "powerline.segments.common.time.date" + }, + { + "function": "powerline.segments.common.time.date", + "name": "time", + "args": { + "format": "%H:%M", + "istime": true + } + }, + { + "function": "powerline.segments.common.net.hostname" + }, + { + "function": "powerline.segments.tmux.attached_clients" + } + ] + } +} diff --git a/scripts/startup.sh b/scripts/startup.sh new file mode 100755 index 0000000..7bd1623 --- /dev/null +++ b/scripts/startup.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# set scrolling speed +/usr/bin/xinput set-prop 13 "libinput Scrolling Pixel Distance" 25 + +# connect vpn +vpn=$(nmcli c | grep "Proton VPN" | awk -F" " '{print $1}') +echo ${vpn} + +if [ ! -z "${vpn}" ]; then + /usr/bin/nmcli c down "${vpn}" +fi + +/usr/bin/protonvpn-cli config --dns custom --ip 9.9.9.11 149.112.112.10 +/usr/bin/protonvpn-cli c -f + +if [ ! -z "${vpn}" ]; then + /usr/bin/nmcli c up "${vpn}" +fi + +#sudo wg-quick up wg0 + +/usr/bin/protonvpn diff --git a/task/deploy.zsh b/task/deploy.zsh new file mode 100755 index 0000000..863f40d --- /dev/null +++ b/task/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.taskrc +ln -s ${GIT_ROOT}/task/taskrc ~/.taskrc diff --git a/task/taskrc b/task/taskrc new file mode 100644 index 0000000..60c2a83 --- /dev/null +++ b/task/taskrc @@ -0,0 +1,35 @@ +# [Created by task 2.5.3 6/4/2022 22:30:58] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=~/.task + +# Color theme (uncomment one to use) +#include /usr/share/taskwarrior/light-16.theme +#include /usr/share/taskwarrior/light-256.theme +#include /usr/share/taskwarrior/dark-16.theme +#include /usr/share/taskwarrior/dark-256.theme +#include /usr/share/taskwarrior/dark-red-256.theme +#include /usr/share/taskwarrior/dark-green-256.theme +#include /usr/share/taskwarrior/dark-blue-256.theme +#include /usr/share/taskwarrior/dark-violets-256.theme +#include /usr/share/taskwarrior/dark-yellow-green.theme +include /usr/share/taskwarrior/dark-gray-256.theme +#include /usr/share/taskwarrior/dark-gray-blue-256.theme +#include /usr/share/taskwarrior/solarized-dark-256.theme +#include /usr/share/taskwarrior/solarized-light-256.theme +#include /usr/share/taskwarrior/no-color.theme + +taskd.trust=ignore hostname +news.version=2.6.0 + +include ~/.taskrc-credentials diff --git a/tmux/checkmail.sh b/tmux/checkmail.sh new file mode 100755 index 0000000..c27dc7d --- /dev/null +++ b/tmux/checkmail.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +session="checkmail" + +tmux new-session -d -s ${session} + +window=1 +tmux rename-window -t ${session}:${window} 'maillog' +tmux select-window -t ${session}:${window} + +tmux send-keys 'clear;ssh proxy1 "clear;tail /var/log/mail.log -f"' C-m +tmux select-pane -T 'mail.log 1' +tmux split-window -v +tmux select-pane -T 'mail.log 2' +tmux send-keys 'clear;ssh proxy2 "clear;tail /var/log/mail.log -f"' C-m + +window=2 +tmux new-window -t ${session}:${window} +tmux select-window -t ${session}:${window} +tmux rename-window -t ${session}:${window} 'mailq' + +tmux send-keys 'clear;ssh proxy1' C-m 'clear;mailq' C-m +tmux select-pane -T 'proxy1' +tmux split-window -v +tmux select-pane -T 'proxy2' +tmux send-keys 'clear;ssh proxy2' C-m 'clear;mailq' C-m + +window=3 +tmux new-window -t ${session}:${window} +tmux select-window -t ${session}:${window} +tmux rename-window -t ${session}:${window} 'salt' +tmux send-keys 'clear;ssh salt' C-m +tmux select-pane -T 'salt' + +tmux select-window -t ${session}:2 +tmux attach-session -t ${session} diff --git a/tmux/deploy.zsh b/tmux/deploy.zsh new file mode 100755 index 0000000..caa4bdc --- /dev/null +++ b/tmux/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.tmux.conf +ln -s ${GIT_ROOT}/tmux/tmux.conf ~/.tmux.conf diff --git a/tmux/shared.sh b/tmux/shared.sh new file mode 100755 index 0000000..631e09e --- /dev/null +++ b/tmux/shared.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "Use 'tmux -S /tmp/tmux_shared new-session -s shared' to start a new shared session." +echo "Change group ownership: 'chgrp tmuxshared /tmp/tmux_shared'" +echo "Execute 'tmux -S /tmp/shared attach -t shared' to join in, use '-r' for read-only mode." diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..8114d5a --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,43 @@ +# Install plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +# set -g @plugin 'tmux-plugins/tmux-resurrect' +# set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'tmux-plugins/tmux-mighty-scroll' +set -g @plugin 'tmux-plugins/tmux-logging' +set -g @plugin 'jaclu/tmux-menus' + +# Activate continuum restore +# set -g @continuum-restore 'on' + +# Activate menu plugin +set -g @menus_trigger 'F9' +set -g @menus_without_prefix 1 + +# Defaults +set -s default-terminal 'tmux-256color' +set -g mouse on + +# Show pane status +set -g pane-border-status top + +# Start index from 1 not 0 +set -g base-index 1 +setw -g pane-base-index 1 + +# remap prefix from 'C-b' to 'C-y' +unbind C-b +set-option -g prefix C-y +bind-key C-y send-prefix + +# 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 + +# exit session on C-x (use 'bind -n' to use it without prefix) +bind C-x confirm-before -p "kill-session #S? (y/n)" "kill-session" + +run '/usr/share/tmux-plugin-manager/tpm' +run-shell "powerline-config tmux setup" diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh new file mode 100644 index 0000000..3966595 --- /dev/null +++ b/zsh/aliases.zsh @@ -0,0 +1,9 @@ +# Aliases +alias ls='ls --color=never' +alias ll='ls -lah --color=never' +alias grep='grep --color=auto' +alias a='tmux attach' +alias bat='batcat' +alias rep='reptyr' +alias tools="echo \"${tools}\"" +unalias duf 2> /dev/null diff --git a/zsh/completions.zsh b/zsh/completions.zsh new file mode 100644 index 0000000..b0a2cfb --- /dev/null +++ b/zsh/completions.zsh @@ -0,0 +1,6 @@ +# Use modern completion system +autoload -Uz compinit +compinit +zstyle ':completion:*' menu select + +fpath=(~/dotfiles/zsh/zsh-completions $fpath) diff --git a/zsh/deploy.zsh b/zsh/deploy.zsh new file mode 100755 index 0000000..4fc0827 --- /dev/null +++ b/zsh/deploy.zsh @@ -0,0 +1,6 @@ +#! /bin/zsh + +GIT_ROOT=$(git rev-parse --show-toplevel) + +rm ~/.zshrc +ln -s ${GIT_ROOT}/zsh/zshrc ~/.zshrc diff --git a/zsh/exports.zsh b/zsh/exports.zsh new file mode 100644 index 0000000..4ecf874 --- /dev/null +++ b/zsh/exports.zsh @@ -0,0 +1,6 @@ +export LANGUAGE=en_US.UTF-8 +export LANG=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +export PATH=$PATH:/usr/local/sbin:~/dotfiles/tmux:~/dotfiles/bin +export EDITOR=mcedit +export TPM2_PKCS11_LOG_LEVEL=0 diff --git a/zsh/history.zsh b/zsh/history.zsh new file mode 100644 index 0000000..8290dfe --- /dev/null +++ b/zsh/history.zsh @@ -0,0 +1,5 @@ +# Keep 5000 lines of history within the shell and save it to ~/.zsh_history: +setopt histignorealldups sharehistory +HISTSIZE=5000 +SAVEHIST=5000 +HISTFILE=~/.zsh_history diff --git a/zsh/keybindings.zsh b/zsh/keybindings.zsh new file mode 100644 index 0000000..7d433b2 --- /dev/null +++ b/zsh/keybindings.zsh @@ -0,0 +1,63 @@ +# Use vi keybindings +bindkey -e + +function detect-clipboard() { + emulate -L zsh + + if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | pbcopy; } + function clippaste() { pbpaste; } + elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then + function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } + function clippaste() { cat /dev/clipboard; } + elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then + function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } + function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } + elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; } + function clippaste() { wl-paste; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | xsel --clipboard --input; } + function clippaste() { xsel --clipboard --output; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | xclip -selection clipboard -in &>/dev/null &|; } + function clippaste() { xclip -out -selection clipboard; } + elif (( ${+commands[lemonade]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | lemonade copy; } + function clippaste() { lemonade paste; } + elif (( ${+commands[doitclient]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | doitclient wclip; } + function clippaste() { doitclient wclip -r; } + elif (( ${+commands[win32yank]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | win32yank -i; } + function clippaste() { win32yank -o; } + elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then + function clipcopy() { cat "${1:-/dev/stdin}" | termux-clipboard-set; } + function clippaste() { termux-clipboard-get; } + elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then + function clipcopy() { tmux load-buffer "${1:--}"; } + function clippaste() { tmux save-buffer -; } + else + function _retry_clipboard_detection_or_fail() { + local clipcmd="${1}"; shift + if detect-clipboard; then + "${clipcmd}" "$@" + else + print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 + return 1 + fi + } + function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } + function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } + return 1 + fi +} + +detect-clipboard || true + +copybuffer () { + echo $BUFFER | clipcopy +} + +zle -N copybuffer +bindkey "^O" copybuffer diff --git a/zsh/neofetch.zsh b/zsh/neofetch.zsh new file mode 100644 index 0000000..f347091 --- /dev/null +++ b/zsh/neofetch.zsh @@ -0,0 +1 @@ +neofetch --config /etc/neofetch.conf diff --git a/zsh/powerlevel.zsh b/zsh/powerlevel.zsh new file mode 100644 index 0000000..3fc8ef6 --- /dev/null +++ b/zsh/powerlevel.zsh @@ -0,0 +1,10 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +typeset -g POWERLEVEL9K_INSTANT_PROMPT=on diff --git a/zsh/ssh.zsh b/zsh/ssh.zsh new file mode 100644 index 0000000..d9d318e --- /dev/null +++ b/zsh/ssh.zsh @@ -0,0 +1,5 @@ +if [ -z ${TMUX} ]; then + # Add SSH keys to keychain + find ~/.ssh -type f -regextype egrep -regex '.*/id_[^.]+$' | xargs /usr/bin/keychain --nogui + source ~/.keychain/$(hostname)-sh +fi diff --git a/zsh/tasks.zsh b/zsh/tasks.zsh new file mode 100644 index 0000000..51c7969 --- /dev/null +++ b/zsh/tasks.zsh @@ -0,0 +1,5 @@ +# Show tasks +if nc -zw1 192.168.42.100 53589; then + /usr/bin/task sync +fi +/usr/bin/task list diff --git a/zsh/tmux.zsh b/zsh/tmux.zsh new file mode 100644 index 0000000..a38f1e2 --- /dev/null +++ b/zsh/tmux.zsh @@ -0,0 +1,2 @@ +# Start tmux +# if [ -z ${TMUX} ]; then tmux; fi diff --git a/zsh/variables.zsh b/zsh/variables.zsh new file mode 100644 index 0000000..ebb695e --- /dev/null +++ b/zsh/variables.zsh @@ -0,0 +1,2 @@ +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#555555" +HISTORY_START_WITH_GLOBAL=true diff --git a/zsh/zplug.zsh b/zsh/zplug.zsh new file mode 100755 index 0000000..1c8996f --- /dev/null +++ b/zsh/zplug.zsh @@ -0,0 +1,23 @@ +# zplug - manage plugins +source /usr/share/zplug/init.zsh +zplug "zsh-users/zsh-syntax-highlighting" +zplug "zsh-users/zsh-autosuggestions" +zplug "zsh-users/zsh-completions" +zplug "plugins/per-directory-history", from:oh-my-zsh +zplug "plugins/history-substring-search", from:oh-my-zsh +zplug "plugins/common-aliases", from:oh-my-zsh +zplug "plugins/nmap", from:oh-my-zsh +zplug "plugins/taskwarrior", from:oh-my-zsh + +HISTORY_START_WITH_GLOBAL=true + +zplug "romkatv/powerlevel10k", use:powerlevel10k.zsh-theme + +# zplug - install/load new plugins when zsh is started or reloaded +if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi +fi +zplug load diff --git a/zsh/zsh-completions/_bw b/zsh/zsh-completions/_bw new file mode 100644 index 0000000..e436a14 --- /dev/null +++ b/zsh/zsh-completions/_bw @@ -0,0 +1,429 @@ +#compdef _bw bw + +function _bw { + local -a commands + + _arguments -C \ + '--pretty[Format output. JSON is tabbed with two spaces.]' \ + '--raw[Return raw output instead of a descriptive message.]' \ + '--response[Return a JSON formatted version of response output.]' \ + '--cleanexit[Exit with a success exit code (0) unless an error is thrown.]' \ + '--quiet[Don'"'"'t return anything to stdout.]' \ + '--nointeraction[Do not prompt for interactive user input.]' \ + '--session[Pass session key instead of reading from env.]' \ + '(-v --version)'{-v,--version}'[output the version number]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "1: :->cmnds" \ + "*::arg:->args" + + case $state in + cmnds) + commands=( + "login:Log into a user account." + "logout:Log out of the current user account." + "lock:Lock the vault and destroy active session keys." + "unlock:Unlock the vault and return a new session key." + "sync:Pull the latest vault data from server." + "generate:Generate a password/passphrase." + "encode:Base 64 encode stdin." + "config:Configure CLI settings." + "update:Check for updates." + "completion:Generate shell completions." + "status:Show server, last sync, user information, and vault status." + "serve:Start a RESTful API webserver." + "list:List an array of objects from the vault." + "get:Get an object from the vault." + "create:Create an object in the vault." + "edit:Edit an object from the vault." + "delete:Delete an object from the vault." + "restore:Restores an object from the trash." + "move:Move an item to an organization." + "confirm:Confirm an object to the organization." + "import:Import vault data from a file." + "export:Export vault data to a CSV or JSON file." + "share:--DEPRECATED-- Move an item to an organization." + "send:Work with Bitwarden sends. A Send can be quickly created using this command or subcommands can be used to fine-tune the Send" + "receive:Access a Bitwarden Send from a url" + ) + _describe "command" commands + ;; + esac + + case "$words[1]" in + login) + _bw_login + ;; + logout) + _bw_logout + ;; + lock) + _bw_lock + ;; + unlock) + _bw_unlock + ;; + sync) + _bw_sync + ;; + generate) + _bw_generate + ;; + encode) + _bw_encode + ;; + config) + _bw_config + ;; + update) + _bw_update + ;; + completion) + _bw_completion + ;; + status) + _bw_status + ;; + serve) + _bw_serve + ;; + list) + _bw_list + ;; + get) + _bw_get + ;; + create) + _bw_create + ;; + edit) + _bw_edit + ;; + delete) + _bw_delete + ;; + restore) + _bw_restore + ;; + move) + _bw_move + ;; + confirm) + _bw_confirm + ;; + import) + _bw_import + ;; + export) + _bw_export + ;; + share) + _bw_share + ;; + send) + _bw_send + ;; + receive) + _bw_receive + ;; + esac +} + +function _bw_login { + _arguments -C \ + '--method[Two-step login method.]' \ + '--code[Two-step login code.]' \ + '--sso[Log in with Single-Sign On.]' \ + '--apikey[Log in with an Api Key.]' \ + '--passwordenv[Environment variable storing your password]' \ + '--passwordfile[Path to a file containing your password as its first line]' \ + '--check[Check login status.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_logout { + +} + +function _bw_lock { + +} + +function _bw_unlock { + _arguments -C \ + '--check[Check lock status.]' \ + '--passwordenv[Environment variable storing your password]' \ + '--passwordfile[Path to a file containing your password as its first line]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_sync { + _arguments -C \ + '(-f --force)'{-f,--force}'[Force a full sync.]' \ + '--last[Get the last sync date.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_generate { + _arguments -C \ + '(-u --uppercase)'{-u,--uppercase}'[Include uppercase characters.]' \ + '(-l --lowercase)'{-l,--lowercase}'[Include lowercase characters.]' \ + '(-n --number)'{-n,--number}'[Include numeric characters.]' \ + '(-s --special)'{-s,--special}'[Include special characters.]' \ + '(-p --passphrase)'{-p,--passphrase}'[Generate a passphrase.]' \ + '--length[Length of the password.]' \ + '--words[Number of words.]' \ + '--separator[Word separator.]' \ + '(-c --capitalize)'{-c,--capitalize}'[Title case passphrase.]' \ + '--includeNumber[Passphrase includes number.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_encode { + +} + +function _bw_config { + _arguments -C \ + '--web-vault[Provides a custom web vault URL that differs from the base URL.]' \ + '--api[Provides a custom API URL that differs from the base URL.]' \ + '--identity[Provides a custom identity URL that differs from the base URL.]' \ + '--icons[Provides a custom icons service URL that differs from the base URL.]' \ + '--notifications[Provides a custom notifications URL that differs from the base URL.]' \ + '--events[Provides a custom events URL that differs from the base URL.]' \ + '--key-connector[Provides the URL for your Key Connector server.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_update { + +} + +function _bw_completion { + _arguments -C \ + '--shell[Shell to generate completions for.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_status { + +} + +function _bw_serve { + _arguments -C \ + '--hostname[The hostname to bind your API webserver to.]' \ + '--port[The port to run your API webserver on.]' \ + '--disable-origin-protection[If set, allows requests with origin header. Warning, this option exists for backwards compatibility reasons and exposes your environment to known CSRF attacks.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_list { + _arguments -C \ + '--search[Perform a search on the listed objects.]' \ + '--url[Filter items of type login with a url-match search.]' \ + '--folderid[Filter items by folder id.]' \ + '--collectionid[Filter items by collection id.]' \ + '--organizationid[Filter items or collections by organization id.]' \ + '--trash[Filter items that are deleted and in the trash.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_get { + _arguments -C \ + '--itemid[Attachment'"'"'s item id.]' \ + '--output[Output directory or filename for attachment.]' \ + '--organizationid[Organization id for an organization object.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_create { + _arguments -C \ + '--file[Path to file for attachment.]' \ + '--itemid[Attachment'"'"'s item id.]' \ + '--organizationid[Organization id for an organization object.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_edit { + _arguments -C \ + '--organizationid[Organization id for an organization object.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_delete { + _arguments -C \ + '--itemid[Attachment'"'"'s item id.]' \ + '--organizationid[Organization id for an organization object.]' \ + '(-p --permanent)'{-p,--permanent}'[Permanently deletes the item instead of soft-deleting it (item only).]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_restore { + +} + +function _bw_move { + +} + +function _bw_confirm { + _arguments -C \ + '--organizationid[Organization id for an organization object.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_import { + _arguments -C \ + '--formats[List formats]' \ + '--organizationid[ID of the organization to import to.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_export { + _arguments -C \ + '--output[Output directory or filename.]' \ + '--format[Export file format.]' \ + '--password[Use password to encrypt instead of your Bitwarden account encryption key. Only applies to the encrypted_json format.]' \ + '--organizationid[Organization id for an organization.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_share { + +} + +function _bw_send { + local -a commands + + _arguments -C \ + '(-f --file)'{-f,--file}'[Specifies that is a filepath]' \ + '(-d --deleteInDays)'{-d,--deleteInDays}'[The number of days in the future to set deletion date, defaults to 7]' \ + '(-a --maxAccessCount)'{-a,--maxAccessCount}'[The amount of max possible accesses.]' \ + '--hidden[Hide in web by default. Valid only if --file is not set.]' \ + '(-n --name)'{-n,--name}'[The name of the Send. Defaults to a guid for text Sends and the filename for files.]' \ + '--notes[Notes to add to the Send.]' \ + '--fullObject[Specifies that the full Send object should be returned rather than just the access url.]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "1: :->cmnds" \ + "*::arg:->args" + + case $state in + cmnds) + commands=( + "list:List all the Sends owned by you" + "template:Get json templates for send objects" + "get:Get Sends owned by you." + "receive:Access a Bitwarden Send from a url" + "create:create a Send" + "edit:edit a Send" + "remove-password:removes the saved password from a Send." + "delete:delete a Send" + ) + _describe "command" commands + ;; + esac + + case "$words[1]" in + list) + _bw_send_list + ;; + template) + _bw_send_template + ;; + get) + _bw_send_get + ;; + receive) + _bw_send_receive + ;; + create) + _bw_send_create + ;; + edit) + _bw_send_edit + ;; + remove-password) + _bw_send_remove-password + ;; + delete) + _bw_send_delete + ;; + esac +} + +function _bw_send_list { + +} + +function _bw_send_template { + +} + +function _bw_send_get { + _arguments -C \ + '--output[Output directory or filename for attachment.]' \ + '--text[Specifies to return the text content of a Send]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_send_receive { + _arguments -C \ + '--password[Password needed to access the Send.]' \ + '--passwordenv[Environment variable storing the Send'"'"'s password]' \ + '--passwordfile[Path to a file containing the Sends password as its first line]' \ + '--obj[Return the Send'"'"'s json object rather than the Send's content]' \ + '--output[Specify a file path to save a File-type Send to]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_send_create { + _arguments -C \ + '--file[file to Send. Can also be specified in parent'"'"'s JSON.]' \ + '--text[text to Send. Can also be specified in parent'"'"'s JSON.]' \ + '--hidden[text hidden flag. Valid only with the --text option.]' \ + '--password[optional password to access this Send. Can also be specified in JSON]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_send_edit { + _arguments -C \ + '--itemid[Overrides the itemId provided in [encodedJson]]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} + +function _bw_send_remove-password { + +} + +function _bw_send_delete { + +} + +function _bw_receive { + _arguments -C \ + '--password[Password needed to access the Send.]' \ + '--passwordenv[Environment variable storing the Send'"'"'s password]' \ + '--passwordfile[Path to a file containing the Sends password as its first line]' \ + '--obj[Return the Send'"'"'s json object rather than the Send's content]' \ + '--output[Specify a file path to save a File-type Send to]' \ + '(-h --help)'{-h,--help}'[output usage information]' \ + "*::arg:->args" +} \ No newline at end of file diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..0b89a1e --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,18 @@ +# Exit if mc is active +[[ -v MC_SID ]] && return + +# source settings +source ~/dotfiles/zsh/exports.zsh +source ~/dotfiles/zsh/variables.zsh +source ~/dotfiles/zsh/keybindings.zsh +source ~/dotfiles/zsh/history.zsh +source ~/dotfiles/zsh/aliases.zsh +source ~/dotfiles/zsh/completions.zsh +source ~/dotfiles/zsh/zplug.zsh +source ~/dotfiles/zsh/neofetch.zsh +source ~/dotfiles/zsh/ssh.zsh +source ~/dotfiles/zsh/tasks.zsh +source ~/dotfiles/zsh/tmux.zsh + +# always execute powerlevel last to avoid problems with instant prompt +source ~/dotfiles/zsh/powerlevel.zsh