diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..aa9afb2 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,5 @@ +[[ $- != *i* ]] && return + +alias ls='lsd' +alias grep='grep --color=auto' +PS1='[\u@\h \W]\$ ' diff --git a/btop/.config/btop/btop.conf b/btop/.config/btop/btop.conf new file mode 100644 index 0000000..e88d8fa --- /dev/null +++ b/btop/.config/btop/btop.conf @@ -0,0 +1,272 @@ +#? Config file for btop v.1.4.6 + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "/home/arch/.config/btop/themes/tokyonight_storm.theme" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = true + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = true + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = false + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = false + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = true + +#* Use terminal synchronized output sequences to reduce flickering on supported terminals. +terminal_sync = true + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty". +graph_symbol_gpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "cpu mem net proc" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 2000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "cpu lazy" + +#* Reverse sorting order, True or False. +proc_reversed = false + +#* Show processes as a tree. +proc_tree = false + +#* Use the cpu graph colors in the process list. +proc_colors = true + +#* Use a darkening gradient in the process list. +proc_gradient = true + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = false + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = true + +#* Show cpu graph for each process. +proc_cpu_graphs = true + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = false + +#* Show proc box on left side of screen instead of right. +proc_left = false + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = false + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = false + +#* Should cpu and memory usage display be preserved for dead processes when paused. +keep_dead_proc_usage = false + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off". +show_gpu_info = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = true + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = false + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = false + +#* Shows the system uptime in the CPU box. +show_uptime = true + +#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo. +show_cpu_watts = true + +#* Show cpu temperature. +check_temp = true + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = true + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = false + +#* Show CPU frequency. +show_cpu_freq = true + +#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average". +freq_mode = "first" + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = true + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user" +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = true + +#* Show mem box below net box instead of above. +mem_below_net = false + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = true + +#* If swap memory should be shown in memory box. +show_swap = true + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = true + +#* If mem box should be split to also show disks info. +show_disks = true + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = true + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = true + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = false + +#* Set to true to show available disk space for privileged users. +disk_free_priv = false + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = true + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = false + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = false + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = true + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = true + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes. +base_10_bitrate = "Auto" + +#* Show battery stats in top right if battery is present. +show_battery = true + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Show power stats of battery next to charge indicator. +show_battery_watts = true + +#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" + +#* Automatically save current settings to config file on exit. +save_config_on_exit = true + +#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. +nvml_measure_pcie_speeds = true + +#* Measure PCIe throughput on AMD cards, may impact performance on certain cards. +rsmi_measure_pcie_speeds = true + +#* Horizontally mirror the GPU graph. +gpu_mirror_graph = true + +#* Set which GPU vendors to show. Available values are "nvidia amd intel" +shown_gpus = "nvidia amd intel" + +#* Custom gpu0 model name, empty string to disable. +custom_gpu_name0 = "" + +#* Custom gpu1 model name, empty string to disable. +custom_gpu_name1 = "" + +#* Custom gpu2 model name, empty string to disable. +custom_gpu_name2 = "" + +#* Custom gpu3 model name, empty string to disable. +custom_gpu_name3 = "" + +#* Custom gpu4 model name, empty string to disable. +custom_gpu_name4 = "" + +#* Custom gpu5 model name, empty string to disable. +custom_gpu_name5 = "" diff --git a/btop/.config/btop/themes/tokyonight_storm.theme b/btop/.config/btop/themes/tokyonight_storm.theme new file mode 100644 index 0000000..2fd2f6b --- /dev/null +++ b/btop/.config/btop/themes/tokyonight_storm.theme @@ -0,0 +1,73 @@ +# Theme: tokyonight_storm +# By: Folke Lemaitre + +theme[main_bg]="#24283b" +theme[main_fg]="#c0caf5" + +# Title color for boxes +theme[title]="#c0caf5" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#ff9e64" + +# Selected item in processes box +theme[selected_bg]="#292e42" +theme[selected_fg]="#7dcfff" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#7dcfff" + +# Cpu box outline color +theme[cpu_box]="#29a4bd" + +# Memory/disks box outline color +theme[mem_box]="#29a4bd" + +# Net up/down box outline color +theme[net_box]="#29a4bd" + +# Processes box outline color +theme[proc_box]="#29a4bd" + +# Box divider line and small boxes line color +theme[div_line]="#29a4bd" + +# Temperature graph colors +theme[temp_start]="#9ece6a" +theme[temp_mid]="#e0af68" +theme[temp_end]="#f7768e" + +# CPU graph colors +theme[cpu_start]="#9ece6a" +theme[cpu_mid]="#e0af68" +theme[cpu_end]="#f7768e" + +# Mem/Disk free meter +theme[free_start]="#9ece6a" +theme[free_mid]="#e0af68" +theme[free_end]="#f7768e" + +# Mem/Disk cached meter +theme[cached_start]="#9ece6a" +theme[cached_mid]="#e0af68" +theme[cached_end]="#f7768e" + +# Mem/Disk available meter +theme[available_start]="#9ece6a" +theme[available_mid]="#e0af68" +theme[available_end]="#f7768e" + +# Mem/Disk used meter +theme[used_start]="#9ece6a" +theme[used_mid]="#e0af68" +theme[used_end]="#f7768e" + +# Download graph colors +theme[download_start]="#9ece6a" +theme[download_mid]="#e0af68" +theme[download_end]="#f7768e" + +# Upload graph colors +theme[upload_start]="#9ece6a" +theme[upload_mid]="#e0af68" +theme[upload_end]="#f7768e" \ No newline at end of file diff --git a/environments/.config/uwsm/env b/environments/.config/uwsm/env new file mode 100644 index 0000000..e5483f9 --- /dev/null +++ b/environments/.config/uwsm/env @@ -0,0 +1,3 @@ +export EDITOR=nvim +export XCURSOR_SIZE=24 +export SWWW_TRANSITION=any diff --git a/environments/.config/uwsm/env-hyprland b/environments/.config/uwsm/env-hyprland new file mode 100644 index 0000000..93f41ef --- /dev/null +++ b/environments/.config/uwsm/env-hyprland @@ -0,0 +1 @@ +export HYPRCURSOR_SIZE=24 diff --git a/fastfetch/.config/fastfetch/config.jsonc b/fastfetch/.config/fastfetch/config.jsonc new file mode 100644 index 0000000..b821b75 --- /dev/null +++ b/fastfetch/.config/fastfetch/config.jsonc @@ -0,0 +1,135 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/master/doc/json_schema.json", + "logo": { + "type": "auto", + "source": "", + "height": 19, + "padding": { + "top": 2, + "left": 2, + "right": 4 + } + }, + "modules": [ + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m┌──────────────────────HARDWARE──────────────────────┐" + }, + { + "type": "host", + "key": " PC", + "keyColor": "green" + }, + { + "type": "battery", + "key": "│ ├󱊣", + "keyColor": "green" + }, + { + "type": "cpu", + "key": "│ ├", + "showPeCoreCount": true, + "keyColor": "green" + }, + { + "type": "gpu", + "key": "│ ├", + "detectionMethod": "pci", + "keyColor": "green" + }, + { + "type": "display", + "key": "│ ├󱄄", + "keyColor": "green" + }, + { + "type": "disk", + "key": "│ ├󰋊", + "keyColor": "green" + }, + { + "type": "memory", + "key": "│ ├", + "keyColor": "green" + }, + { + "type": "swap", + "key": "└ └󰓡 ", + "keyColor": "green" + }, + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m└────────────────────────────────────────────────────┘" + }, + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m┌──────────────────────SOFTWARE──────────────────────┐" + }, + { + "type": "os", + "key": " OS", + "keyColor": "blue", + "text": "{name}" + }, + { + "type": "kernel", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "wm", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "de", + "key": " DE", + "keyColor": "blue" + }, + { + "type": "terminal", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "packages", + "key": "│ ├󰏖", + "keyColor": "blue" + }, + { + "type": "wmtheme", + "key": "│ ├󰉼", + "keyColor": "blue" + }, + { + "type": "command", + "key": "└ └󰸌", + "keyColor": "blue", + "text": "echo -e \"\\e[38m●\\e[37m●\\e[36m●\\e[35m●\\e[34m●\\e[33m●\\e[32m●\\e[31m●\"" + }, + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m└────────────────────────────────────────────────────┘" + }, + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m┌────────────────────────TIME────────────────────────┐" + }, + { + "type": "command", + "key": "󱦟 OS Age", + "keyColor": "magenta", + "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days" + }, + { + "type": "uptime", + "key": "󱫐 Uptime", + "keyColor": "magenta" + }, + { + "type": "custom", + "format": "\u001b[38;2;192;202;245m└────────────────────────────────────────────────────┘" + }, + "break" + ] +} diff --git a/fastfetch/.config/fastfetch/logo.png b/fastfetch/.config/fastfetch/logo.png new file mode 100644 index 0000000..6e1c896 Binary files /dev/null and b/fastfetch/.config/fastfetch/logo.png differ diff --git a/fish/.config/fish/conf.d/bobthefish.fish b/fish/.config/fish/conf.d/bobthefish.fish new file mode 100644 index 0000000..8e1d7b7 --- /dev/null +++ b/fish/.config/fish/conf.d/bobthefish.fish @@ -0,0 +1,13 @@ +set -g theme_powerline_fonts no +set -g theme_nerd_fonts yes +set -g theme_show_exit_status yes +set -g theme_display_jobs_verbose yes +set -g theme_display_user ssh +set -g theme_display_hostname ssh +set -g fish_prompt_pwd_dir_length 1 +set -g theme_color_scheme user +set -g theme_display_git_dirty_verbose yes +set -g theme_display_git_ahead_verbose yes +set -g theme_display_git_stashed_verbose yes +set -g theme_display_git_default_branch yes +set -g theme_use_abbreviated_branch_name yes diff --git a/fish/.config/fish/conf.d/tokyonight_storm.fish b/fish/.config/fish/conf.d/tokyonight_storm.fish new file mode 100644 index 0000000..2ea19e4 --- /dev/null +++ b/fish/.config/fish/conf.d/tokyonight_storm.fish @@ -0,0 +1,35 @@ +# TokyoNight Color Palette +set -l foreground c0caf5 +set -l selection 2e3c64 +set -l comment 565f89 +set -l red f7768e +set -l orange ff9e64 +set -l yellow e0af68 +set -l green 9ece6a +set -l purple 9d7cd8 +set -l cyan 7dcfff +set -l pink bb9af7 + +# Syntax Highlighting Colors +set -g fish_color_normal $foreground +set -g fish_color_command $cyan +set -g fish_color_keyword $pink +set -g fish_color_quote $yellow +set -g fish_color_redirection $foreground +set -g fish_color_end $orange +set -g fish_color_option $pink +set -g fish_color_error $red +set -g fish_color_param $purple +set -g fish_color_comment $comment +set -g fish_color_selection --background=$selection +set -g fish_color_search_match --background=$selection +set -g fish_color_operator $green +set -g fish_color_escape $pink +set -g fish_color_autosuggestion $comment + +# Completion Pager Colors +set -g fish_pager_color_progress $comment +set -g fish_pager_color_prefix $cyan +set -g fish_pager_color_completion $foreground +set -g fish_pager_color_description $cyan +set -g fish_pager_color_selected_background --background=$selection diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish new file mode 100644 index 0000000..ea1e4ed --- /dev/null +++ b/fish/.config/fish/config.fish @@ -0,0 +1,3 @@ +if not status is-interactive + exit +end diff --git a/fish/.config/fish/fish_plugins b/fish/.config/fish/fish_plugins new file mode 100644 index 0000000..a912a84 --- /dev/null +++ b/fish/.config/fish/fish_plugins @@ -0,0 +1 @@ +oh-my-fish/theme-bobthefish diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables new file mode 100644 index 0000000..18db892 --- /dev/null +++ b/fish/.config/fish/fish_variables @@ -0,0 +1,7 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:4300 +SETUVAR __fish_webconfig_theme_notification:set\x2dtheme\x2dv1\x2d\x233 +SETUVAR _fisher_oh_2D_my_2D_fish_2F_theme_2D_bobthefish_files:\x7e/\x2econfig/fish/functions/__bobthefish_colors\x2efish\x1e\x7e/\x2econfig/fish/functions/__bobthefish_display_colors\x2efish\x1e\x7e/\x2econfig/fish/functions/__bobthefish_glyphs\x2efish\x1e\x7e/\x2econfig/fish/functions/bobthefish_display_colors\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_greeting\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_mode_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_right_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_title\x2efish +SETUVAR _fisher_plugins:oh\x2dmy\x2dfish/theme\x2dbobthefish +SETUVAR _fisher_upgraded_to_4_4:\x1d diff --git a/fish/.config/fish/functions/__bobthefish_colors.fish b/fish/.config/fish/functions/__bobthefish_colors.fish new file mode 100644 index 0000000..dfe8f30 --- /dev/null +++ b/fish/.config/fish/functions/__bobthefish_colors.fish @@ -0,0 +1,1133 @@ +function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthefish' + switch "$color_scheme" + case 'user' + set -l colorfg 3b4261 + set -x color_initial_segment_exit white red --bold + set -x color_initial_segment_private white 3b4261 + set -x color_initial_segment_su white green --bold + set -x color_initial_segment_jobs white blue --bold + + set -x color_path 3b4261 white + set -x color_path_basename 3b4261 white --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree 3b4261 $colorfg --bold + set -x color_repo_dirty red $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username white 3b4261 --bold + set -x color_hostname white 3b4261 + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal' 'terminal-dark*' + set -l colorfg black + [ "$color_scheme" = 'terminal-dark-white' ]; and set colorfg white + set -x color_initial_segment_exit white red --bold + set -x color_initial_segment_private white black + set -x color_initial_segment_su white green --bold + set -x color_initial_segment_jobs white blue --bold + + set -x color_path black white + set -x color_path_basename black white --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree black $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username white black --bold + set -x color_hostname white black + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal-light*' + set -l colorfg white + [ "$color_scheme" = 'terminal-light-black' ]; and set colorfg black + set -x color_initial_segment_exit black red --bold + set -x color_initial_segment_private black white + set -x color_initial_segment_su black green --bold + set -x color_initial_segment_jobs black blue --bold + + set -x color_path white black + set -x color_path_basename white black --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree white $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username black white --bold + set -x color_hostname black white + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal2' 'terminal2-dark*' + set -l colorfg black + [ "$color_scheme" = 'terminal2-dark-white' ]; and set colorfg white + set -x color_initial_segment_exit grey red --bold + set -x color_initial_segment_private grey black + set -x color_initial_segment_su grey green --bold + set -x color_initial_segment_jobs grey blue --bold + + set -x color_path brgrey white + set -x color_path_basename brgrey white --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree brgrey $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username brgrey white --bold + set -x color_hostname brgrey white + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal2-light*' + set -l colorfg white + [ "$color_scheme" = 'terminal2-light-black' ]; and set colorfg black + set -x color_initial_segment_exit brgrey red --bold + set -x color_initial_segment_private brgrey black + set -x color_initial_segment_su brgrey green --bold + set -x color_initial_segment_jobs brgrey blue --bold + + set -x color_path grey black + set -x color_path_basename grey black --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree grey $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username grey black --bold + set -x color_hostname grey black + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'zenburn' + set -l grey 333333 # a bit darker than normal zenburn grey + set -l red CC9393 + set -l green 7F9F7F + set -l yellow E3CEAB + set -l orange DFAF8F + set -l blue 8CD0D3 + set -l white DCDCCC + + set -x color_initial_segment_exit $white $red --bold + set -x color_initial_segment_private $white $grey + set -x color_initial_segment_su $white $green --bold + set -x color_initial_segment_jobs $white $blue --bold + + set -x color_path $grey $white + set -x color_path_basename $grey $white --bold + set -x color_path_nowrite $grey $red + set -x color_path_nowrite_basename $grey $red --bold + + set -x color_repo $green $grey + set -x color_repo_work_tree $grey $grey --bold + set -x color_repo_dirty $red $grey + set -x color_repo_staged $yellow $grey + + set -x color_vi_mode_default $grey $yellow --bold + set -x color_vi_mode_insert $green $white --bold + set -x color_vi_mode_visual $yellow $grey --bold + + set -x color_vagrant $blue $green --bold + set -x color_k8s $green $white --bold + set -x color_aws_vault $blue $grey --bold + set -x color_aws_vault_expired $blue $red --bold + set -x color_username $grey $blue --bold + set -x color_hostname $grey $blue + set -x color_screen $green $grey --bold + set -x color_rvm $red $grey --bold + set -x color_node $green $white --bold + set -x color_virtualfish $blue $grey --bold + set -x color_virtualgo $blue $grey --bold + set -x color_desk $blue $grey --bold + set -x color_nix $blue $grey --bold + + case 'base16-light' + set -l base00 181818 + set -l base01 282828 + set -l base02 383838 + set -l base03 585858 + set -l base04 b8b8b8 + set -l base05 d8d8d8 + set -l base06 e8e8e8 + set -l base07 f8f8f8 + set -l base08 ab4642 # red + set -l base09 dc9656 # orange + set -l base0A f7ca88 # yellow + set -l base0B a1b56c # green + set -l base0C 86c1b9 # cyan + set -l base0D 7cafc2 # blue + set -l base0E ba8baf # violet + set -l base0F a16946 # brown + + set -l colorfg $base00 + + set -x color_initial_segment_exit $base02 $base08 --bold + set -x color_initial_segment_private $base02 $base06 + set -x color_initial_segment_su $base02 $base0B --bold + set -x color_initial_segment_jobs $base02 $base0D --bold + + set -x color_path $base06 $base02 + set -x color_path_basename $base06 $base01 --bold + set -x color_path_nowrite $base06 $base08 + set -x color_path_nowrite_basename $base06 $base08 --bold + + set -x color_repo $base0B $colorfg + set -x color_repo_work_tree $base06 $colorfg --bold + set -x color_repo_dirty $base08 $colorfg + set -x color_repo_staged $base09 $colorfg + + set -x color_vi_mode_default $base04 $colorfg --bold + set -x color_vi_mode_insert $base0B $colorfg --bold + set -x color_vi_mode_visual $base09 $colorfg --bold + + set -x color_vagrant $base0C $colorfg --bold + set -x color_k8s $base06 $colorfg --bold + set -x color_aws_vault $base0D $colorfg --bold + set -x color_aws_vault_expired $base0D $base08 --bold + set -x color_username $base02 $base0D --bold + set -x color_hostname $base02 $base0D + set -x color_screen $base06 $colorfg --bold + set -x color_rvm $base08 $colorfg --bold + set -x color_node $base0B $colorfg --bold + set -x color_virtualfish $base0D $colorfg --bold + set -x color_virtualgo $base0D $colorfg --bold + set -x color_desk $base0D $colorfg --bold + set -x color_nix $base0D $colorfg --bold + + case 'base16' 'base16-dark' + set -l base00 181818 + set -l base01 282828 + set -l base02 383838 + set -l base03 585858 + set -l base04 b8b8b8 + set -l base05 d8d8d8 + set -l base06 e8e8e8 + set -l base07 f8f8f8 + set -l base08 ab4642 # red + set -l base09 dc9656 # orange + set -l base0A f7ca88 # yellow + set -l base0B a1b56c # green + set -l base0C 86c1b9 # cyan + set -l base0D 7cafc2 # blue + set -l base0E ba8baf # violet + set -l base0F a16946 # brown + + set -l colorfg $base07 + + set -x color_initial_segment_exit $base05 $base08 --bold + set -x color_initial_segment_private $base05 $base02 + set -x color_initial_segment_su $base05 $base0B --bold + set -x color_initial_segment_jobs $base05 $base0D --bold + + set -x color_path $base02 $base05 + set -x color_path_basename $base02 $base06 --bold + set -x color_path_nowrite $base02 $base08 + set -x color_path_nowrite_basename $base02 $base08 --bold + + set -x color_repo $base0B $colorfg + set -x color_repo_work_tree $base02 $colorfg --bold + set -x color_repo_dirty $base08 $colorfg + set -x color_repo_staged $base09 $colorfg + + set -x color_vi_mode_default $base03 $colorfg --bold + set -x color_vi_mode_insert $base0B $colorfg --bold + set -x color_vi_mode_visual $base09 $colorfg --bold + + set -x color_vagrant $base0C $colorfg --bold + set -x color_k8s $base0B $colorfg --bold + set -x color_aws_vault $base0D $base0A --bold + set -x color_aws_vault_expired $base0D $base08 --bold + set -x color_username $base02 $base0D --bold + set -x color_hostname $base02 $base0D + set -x color_screen $base0B $colorfg --bold + set -x color_rvm $base08 $colorfg --bold + set -x color_node $base0B $colorfg --bold + set -x color_virtualfish $base0D $colorfg --bold + set -x color_virtualgo $base0D $colorfg --bold + set -x color_desk $base0D $colorfg --bold + set -x color_nix $base0D $colorfg --bold + + case 'solarized-light' + set -l base03 002b36 + set -l base02 073642 + set -l base01 586e75 + set -l base00 657b83 + set -l base0 839496 + set -l base1 93a1a1 + set -l base2 eee8d5 + set -l base3 fdf6e3 + set -l yellow b58900 + set -l orange cb4b16 + set -l red dc322f + set -l magenta d33682 + set -l violet 6c71c4 + set -l blue 268bd2 + set -l cyan 2aa198 + set -l green 859900 + + set colorfg $base03 + + set -x color_initial_segment_exit $base02 $red --bold + set -x color_initial_segment_private $base02 $base2 + set -x color_initial_segment_su $base02 $green --bold + set -x color_initial_segment_jobs $base02 $blue --bold + + set -x color_path $base2 $base00 + set -x color_path_basename $base2 $base01 --bold + set -x color_path_nowrite $base2 $orange + set -x color_path_nowrite_basename $base2 $orange --bold + + set -x color_repo $green $colorfg + set -x color_repo_work_tree $base2 $colorfg --bold + set -x color_repo_dirty $red $colorfg + set -x color_repo_staged $yellow $colorfg + + set -x color_vi_mode_default $blue $colorfg --bold + set -x color_vi_mode_insert $green $colorfg --bold + set -x color_vi_mode_visual $yellow $colorfg --bold + + set -x color_vagrant $violet $colorfg --bold + set -x color_k8s $green $colorfg --bold + set -x color_aws_vault $violet $base3 --bold + set -x color_aws_vault_expired $violet $orange --bold + set -x color_username $base2 $blue --bold + set -x color_hostname $base2 $blue + set -x color_screen $green $colorfg --bold + set -x color_rvm $red $colorfg --bold + set -x color_node $green $colorfg --bold + set -x color_virtualfish $cyan $colorfg --bold + set -x color_virtualgo $cyan $colorfg --bold + set -x color_desk $cyan $colorfg --bold + set -x color_nix $cyan $colorfg --bold + + case 'solarized' 'solarized-dark' + set -l base03 002b36 + set -l base02 073642 + set -l base01 586e75 + set -l base00 657b83 + set -l base0 839496 + set -l base1 93a1a1 + set -l base2 eee8d5 + set -l base3 fdf6e3 + set -l yellow b58900 + set -l orange cb4b16 + set -l red dc322f + set -l magenta d33682 + set -l violet 6c71c4 + set -l blue 268bd2 + set -l cyan 2aa198 + set -l green 859900 + + set colorfg $base3 + + set -x color_initial_segment_exit $base2 $red --bold + set -x color_initial_segment_private $base2 $base02 + set -x color_initial_segment_su $base2 $green --bold + set -x color_initial_segment_jobs $base2 $blue --bold + + set -x color_path $base02 $base0 + set -x color_path_basename $base02 $base1 --bold + set -x color_path_nowrite $base02 $orange + set -x color_path_nowrite_basename $base02 $orange --bold + + set -x color_repo $green $colorfg + set -x color_repo_work_tree $base02 $colorfg --bold + set -x color_repo_dirty $red $colorfg + set -x color_repo_staged $yellow $colorfg + + set -x color_vi_mode_default $blue $colorfg --bold + set -x color_vi_mode_insert $green $colorfg --bold + set -x color_vi_mode_visual $yellow $colorfg --bold + + set -x color_vagrant $violet $colorfg --bold + set -x color_k8s $green $colorfg --bold + set -x color_aws_vault $violet $base3 --bold + set -x color_aws_vault_expired $violet $orange --bold + set -x color_username $base02 $blue --bold + set -x color_hostname $base02 $blue + set -x color_screen $green $colorfg --bold + set -x color_rvm $red $colorfg --bold + set -x color_node $green $colorfg --bold + set -x color_virtualfish $cyan $colorfg --bold + set -x color_virtualgo $cyan $colorfg --bold + set -x color_desk $cyan $colorfg --bold + set -x color_nix $cyan $colorfg --bold + + case 'light' + # light medium dark + # ------ ------ ------ + set -l red cc9999 ce000f 660000 + set -l green addc10 189303 0c4801 + set -l blue 48b4fb 005faf 255e87 + set -l orange f6b117 unused 3a2a03 + set -l brown bf5e00 803f00 4d2600 + set -l grey cccccc 999999 333333 + set -l white ffffff + set -l black 000000 + set -l ruby_red af0000 + + set -x color_initial_segment_exit $grey[3] $red[2] --bold + set -x color_initial_segment_private $grey[3] $grey[1] + set -x color_initial_segment_su $grey[3] $green[2] --bold + set -x color_initial_segment_jobs $grey[3] $blue[3] --bold + + set -x color_path $grey[1] $grey[2] + set -x color_path_basename $grey[1] $grey[3] --bold + set -x color_path_nowrite $red[1] $red[3] + set -x color_path_nowrite_basename $red[1] $red[3] --bold + + set -x color_repo $green[1] $green[3] + set -x color_repo_work_tree $grey[1] $white --bold + set -x color_repo_dirty $red[2] $white + set -x color_repo_staged $orange[1] $orange[3] + + set -x color_vi_mode_default $grey[2] $grey[3] --bold + set -x color_vi_mode_insert $green[2] $grey[3] --bold + set -x color_vi_mode_visual $orange[1] $orange[3] --bold + + set -x color_vagrant $blue[1] $white --bold + set -x color_k8s $green[1] $colorfg --bold + set -x color_aws_vault $blue[3] $orange[1] --bold + set -x color_aws_vault_expired $blue[3] $red[3] --bold + set -x color_username $grey[1] $blue[3] --bold + set -x color_hostname $grey[1] $blue[3] + set -x color_screen $green[1] $colorfg --bold + set -x color_rvm $ruby_red $grey[1] --bold + set -x color_node $green $grey[1] --bold + set -x color_virtualfish $blue[2] $grey[1] --bold + set -x color_virtualgo $blue[2] $grey[1] --bold + set -x color_desk $blue[2] $grey[1] --bold + set -x color_nix $blue[2] $grey[1] --bold + + case 'gruvbox' + # light medium dark darkest + # ------ ------ ------ ------- + set -l red fb4934 cc241d + set -l green b8bb26 98971a + set -l yellow fabd2f d79921 + set -l aqua 8ec07c 689d6a + set -l blue 83a598 458588 + set -l grey cccccc 999999 333333 + set -l fg fbf1c7 ebdbb2 d5c4a1 a89984 + set -l bg 504945 282828 + + set -x color_initial_segment_exit $fg[1] $red[2] --bold + set -x color_initial_segment_private $fg[1] $bg[1] + set -x color_initial_segment_su $fg[1] $green[2] --bold + set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold + + set -x color_path $bg[1] $fg[2] + set -x color_path_basename $bg[1] $fg[2] --bold + set -x color_path_nowrite $red[1] $fg[2] + set -x color_path_nowrite_basename $red[1] $fg[2] --bold + + set -x color_repo $green[2] $bg[1] + set -x color_repo_work_tree $bg[1] $fg[2] --bold + set -x color_repo_dirty $red[2] $fg[2] + set -x color_repo_staged $yellow[1] $bg[1] + + set -x color_vi_mode_default $fg[4] $bg[2] --bold + set -x color_vi_mode_insert $blue[1] $bg[2] --bold + set -x color_vi_mode_visual $yellow[1] $bg[2] --bold + + set -x color_vagrant $blue[2] $fg[2] --bold + set -x color_k8s $green[2] $fg[2] --bold + set -x color_aws_vault $blue[2] $yellow[1] --bold + set -x color_aws_vault_expired $blue[2] $red[1] --bold + set -x color_username $fg[3] $blue[2] --bold + set -x color_hostname $fg[3] $blue[2] + set -x color_screen $green[1] $fg[2] --bold + set -x color_rvm $red[2] $fg[2] --bold + set -x color_node $green[1] $fg[2] --bold + set -x color_virtualfish $blue[2] $fg[2] --bold + set -x color_virtualgo $blue[2] $fg[2] --bold + set -x color_desk $blue[2] $fg[2] --bold + set -x color_nix $blue[2] $fg[2] --bold + + case 'gruvbox-light' + # light medium dark darkest + # ------ ------ ------ ------- + set -l red 9d0006 cc241d + set -l green 79740e 98971a + set -l yellow b57614 d79921 + set -l aqua 427b58 689d6a + set -l blue 076678 458588 + set -l grey a89984 928374 + set -l orange af3a03 d65d0e + set -l fg 282828 3c3836 504945 7c6f64 + set -l bg d5c4a1 fbf1c7 + + set -x color_initial_segment_exit $red[1] $bg[2] --bold + set -x color_initial_segment_su $fg[1] $green[2] --bold + set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold + + set -x color_path $bg[1] $fg[2] + set -x color_path_basename $bg[1] $fg[2] --bold + set -x color_path_nowrite $red[1] $bg[2] + set -x color_path_nowrite_basename $red[1] $bg[2] --bold + + set -x color_repo $green[2] $fg[1] + set -x color_repo_work_tree $bg[1] $fg[2] --bold + set -x color_repo_dirty $orange[2] $bg[2] + set -x color_repo_staged $yellow[1] $bg[1] + + set -x color_vi_mode_default $fg[4] $bg[2] --bold + set -x color_vi_mode_insert $blue[1] $bg[2] --bold + set -x color_vi_mode_visual $yellow[1] $bg[2] --bold + + set -x color_vagrant $blue[2] $fg[2] --bold + set -x color_k8s $green[2] $fg[2] --bold + set -x color_username $fg[3] $blue[2] --bold + set -x color_hostname $fg[3] $blue[2] + set -x color_screen $green[2] $fg[2] --bold + set -x color_rvm $red[2] $bg[2] --bold + set -x color_nvm $green[1] $fg[2] --bold + set -x color_virtualfish $blue[2] $fg[2] --bold + set -x color_virtualgo $blue[2] $fg[2] --bold + set -x color_desk $blue[2] $fg[2] --bold + set -x color_nix $blue[2] $fg[2] --bold + + case 'dracula' # https://draculatheme.com + set -l bg 282a36 + set -l current_line 44475a + set -l selection 44475a + set -l fg f8f8f2 + set -l comment 6272a4 + set -l cyan 8be9fd + set -l green 50fa7b + set -l orange ffb86c + set -l pink ff79c6 + set -l purple bd93f9 + set -l red ff5555 + set -l yellow f1fa8c + + set -x color_initial_segment_exit $fg $red --bold + set -x color_initial_segment_private $fg $selection + set -x color_initial_segment_su $fg $purple --bold + set -x color_initial_segment_jobs $fg $comment --bold + + set -x color_path $selection $fg + set -x color_path_basename $selection $fg --bold + set -x color_path_nowrite $selection $red + set -x color_path_nowrite_basename $selection $red --bold + + set -x color_repo $green $bg + set -x color_repo_work_tree $selection $fg --bold + set -x color_repo_dirty $red $bg + set -x color_repo_staged $yellow $bg + + set -x color_vi_mode_default $bg $yellow --bold + set -x color_vi_mode_insert $green $bg --bold + set -x color_vi_mode_visual $orange $bg --bold + + set -x color_vagrant $pink $bg --bold + set -x color_k8s $purple $bg --bold + set -x color_aws_vault $comment $yellow --bold + set -x color_aws_vault_expired $comment $red --bold + set -x color_username $selection $cyan --bold + set -x color_hostname $selection $cyan + set -x color_screen $green $bg --bold + set -x color_rvm $red $bg --bold + set -x color_node $green $bg --bold + set -x color_virtualfish $comment $bg --bold + set -x color_virtualgo $cyan $bg --bold + set -x color_desk $comment $bg --bold + set -x color_nix $cyan $bg --bold + + case 'nord' + set -l base00 2E3440 + set -l base01 3B4252 + set -l base02 434C5E + set -l base03 4C566A + set -l base04 D8DEE9 + set -l base05 E5E9F0 + set -l base06 ECEFF4 + set -l base07 8FBCBB + set -l base08 88C0D0 + set -l base09 81A1C1 + set -l base0A 5E81AC + set -l base0B BF616A + set -l base0C D08770 + set -l base0D EBCB8B + set -l base0E A3BE8C + set -l base0F B48EAD + + set -l colorfg $base00 + + set -x color_initial_segment_exit $base05 $base0B --bold + set -x color_initial_segment_private $base05 $base02 + set -x color_initial_segment_su $base05 $base0E --bold + set -x color_initial_segment_jobs $base05 $base0C --bold + + set -x color_path $base02 $base05 + set -x color_path_basename $base02 $base06 --bold + set -x color_path_nowrite $base02 $base08 + set -x color_path_nowrite_basename $base02 $base08 --bold + + set -x color_repo $base0E $colorfg + set -x color_repo_work_tree $base02 $colorfg --bold + set -x color_repo_dirty $base0B $colorfg + set -x color_repo_staged $base0D $colorfg + + set -x color_vi_mode_default $base08 $colorfg --bold + set -x color_vi_mode_insert $base06 $colorfg --bold + set -x color_vi_mode_visual $base07 $colorfg --bold + + set -x color_vagrant $base02 $colorfg --bold + set -x color_k8s $base02 $colorfg --bold + set -x color_aws_vault $base0A $base0D --bold + set -x color_aws_vault_expired $base0A $base0B --bold + set -x color_username $base02 $base0D --bold + set -x color_hostname $base02 $base0D + set -x color_screen $base02 $colorfg --bold + set -x color_rvm $base09 $colorfg --bold + set -x color_node $base09 $colorfg --bold + set -x color_virtualfish $base09 $colorfg --bold + set -x color_virtualgo $base09 $colorfg --bold + set -x color_desk $base09 $colorfg --bold + + case 'catppuccin-latte' + set -l rosewater dc8a78 + set -l flamingo dd7878 + set -l pink ea76cb + set -l mauve 8839ef + set -l red d20f39 + set -l maroon e64553 + set -l peach fe640b + set -l yellow df8e1d + set -l green 40a02b + set -l teal 179299 + set -l sky 04a5e5 + set -l sapphire 209fb5 + set -l blue 1e66f5 + set -l lavender 7287fd + set -l text 4c4f69 + set -l subtext1 5c5f77 + set -l subtext0 6c6f85 + set -l overlay2 7c7f93 + set -l overlay1 8c8fa1 + set -l overlay0 9ca0b0 + set -l surface2 acb0be + set -l surface1 bcc0cc + set -l surface0 ccd0da + set -l base eff1f5 + set -l mantle e6e9ef + set -l crust dce0e8 + + set -x color_initial_segment_exit $surface2 $red --bold + set -x color_initial_segment_private $surface2 $flamingo + set -x color_initial_segment_su $surface2 $green --bold + set -x color_initial_segment_jobs $surface2 $peach --bold + + set -x color_path $surface0 $text + set -x color_path_basename $surface0 $text --bold + set -x color_path_nowrite $surface0 $mauve + set -x color_path_nowrite_basename $surface0 $mauve --bold + + set -x color_repo $green $mantle + set -x color_repo_work_tree $surface2 $mantle --bold + set -x color_repo_dirty $red $mantle + set -x color_repo_staged $yellow $mantle + + set -x color_vi_mode_default $sky $mantle --bold + set -x color_vi_mode_insert $green $mantle --bold + set -x color_vi_mode_visual $mauve $mantle --bold + + set -x color_vagrant $surface2 $text --bold + set -x color_k8s $surface2 $text --bold + set -x color_aws_vault $yellow $mantle --bold + set -x color_aws_vault_expired $red $mantle --bold + set -x color_username $surface2 $yellow --bold + set -x color_hostname $surface2 $yellow + set -x color_screen $green $mantle --bold + set -x color_rvm $red $mantle --bold + set -x color_node $green $mantle --bold + set -x color_virtualfish $peach $mantle --bold + set -x color_virtualgo $sky $mantle --bold + set -x color_desk $peach $mantle --bold + set -x color_nix $sky $mantle --bold + + case 'catppuccin-frappe' + set -l rosewater f2d5cf + set -l flamingo eebebe + set -l pink f4b8e4 + set -l mauve ca9ee6 + set -l red e78284 + set -l maroon ea999c + set -l peach ef9f76 + set -l yellow e5c890 + set -l green a6d189 + set -l teal 81c8be + set -l sky 99d1db + set -l sapphire 85c1dc + set -l blue 8caaee + set -l lavender babbf1 + set -l text c6d0f5 + set -l subtext1 b5bfe2 + set -l subtext0 a5adce + set -l overlay2 949cbb + set -l overlay1 838ba7 + set -l overlay0 737994 + set -l surface2 626880 + set -l surface1 51576d + set -l surface0 414559 + set -l base 303446 + set -l mantle 292c3c + set -l crust 232634 + + set -x color_initial_segment_exit $surface2 $red --bold + set -x color_initial_segment_private $surface2 $flamingo + set -x color_initial_segment_su $surface2 $green --bold + set -x color_initial_segment_jobs $surface2 $peach --bold + + set -x color_path $surface0 $text + set -x color_path_basename $surface0 $text --bold + set -x color_path_nowrite $surface0 $mauve + set -x color_path_nowrite_basename $surface0 $mauve --bold + + set -x color_repo $green $mantle + set -x color_repo_work_tree $surface2 $mantle --bold + set -x color_repo_dirty $red $mantle + set -x color_repo_staged $yellow $mantle + + set -x color_vi_mode_default $sky $mantle --bold + set -x color_vi_mode_insert $green $mantle --bold + set -x color_vi_mode_visual $mauve $mantle --bold + + set -x color_vagrant $surface2 $text --bold + set -x color_k8s $surface2 $text --bold + set -x color_aws_vault $yellow $mantle --bold + set -x color_aws_vault_expired $red $mantle --bold + set -x color_username $surface2 $yellow --bold + set -x color_hostname $surface2 $yellow + set -x color_screen $green $mantle --bold + set -x color_rvm $red $mantle --bold + set -x color_node $green $mantle --bold + set -x color_virtualfish $peach $mantle --bold + set -x color_virtualgo $sky $mantle --bold + set -x color_desk $peach $mantle --bold + set -x color_nix $sky $mantle --bold + + case 'catppuccin-macchiato' + set -l rosewater f4dbd6 + set -l flamingo f0c6c6 + set -l pink f5bde6 + set -l mauve c6a0f6 + set -l red ed8796 + set -l maroon ee99a0 + set -l peach f5a97f + set -l yellow eed49f + set -l green a6da95 + set -l teal 8bd5ca + set -l sky 91d7e3 + set -l sapphire 7dc4e4 + set -l blue 8aadf4 + set -l lavender b7bdf8 + set -l text cad3f5 + set -l subtext1 b8c0e0 + set -l subtext0 a5adcb + set -l overlay2 939ab7 + set -l overlay1 8087a2 + set -l overlay0 6e738d + set -l surface2 5b6078 + set -l surface1 494d64 + set -l surface0 363a4f + set -l base 24273a + set -l mantle 1e2030 + set -l crust 181926 + + set -x color_initial_segment_exit $surface2 $red --bold + set -x color_initial_segment_private $surface2 $flamingo + set -x color_initial_segment_su $surface2 $green --bold + set -x color_initial_segment_jobs $surface2 $peach --bold + + set -x color_path $surface0 $text + set -x color_path_basename $surface0 $text --bold + set -x color_path_nowrite $surface0 $mauve + set -x color_path_nowrite_basename $surface0 $mauve --bold + + set -x color_repo $green $mantle + set -x color_repo_work_tree $surface2 $mantle --bold + set -x color_repo_dirty $red $mantle + set -x color_repo_staged $yellow $mantle + + set -x color_vi_mode_default $sky $mantle --bold + set -x color_vi_mode_insert $green $mantle --bold + set -x color_vi_mode_visual $mauve $mantle --bold + + set -x color_vagrant $surface2 $text --bold + set -x color_k8s $surface2 $text --bold + set -x color_aws_vault $yellow $mantle --bold + set -x color_aws_vault_expired $red $mantle --bold + set -x color_username $surface2 $yellow --bold + set -x color_hostname $surface2 $yellow + set -x color_screen $green $mantle --bold + set -x color_rvm $red $mantle --bold + set -x color_node $green $mantle --bold + set -x color_virtualfish $peach $mantle --bold + set -x color_virtualgo $sky $mantle --bold + set -x color_desk $peach $mantle --bold + set -x color_nix $sky $mantle --bold + + case 'catppuccin-mocha' + set -l rosewater f5e0dc + set -l flamingo f2cdcd + set -l pink f5c2e7 + set -l mauve cba6f7 + set -l red f38ba8 + set -l maroon eba0ac + set -l peach fab387 + set -l yellow f9e2af + set -l green a6e3a1 + set -l teal 94e2d5 + set -l sky 89dceb + set -l sapphire 74c7ec + set -l blue 89b4fa + set -l lavender b4befe + set -l text cdd6f4 + set -l subtext1 bac2de + set -l subtext0 a6adc8 + set -l overlay2 9399b2 + set -l overlay1 7f849c + set -l overlay0 6c7086 + set -l surface2 585b70 + set -l surface1 45475a + set -l surface0 313244 + set -l base 1e1e2e + set -l mantle 181825 + set -l crust 11111b + + set -x color_initial_segment_exit $surface2 $red --bold + set -x color_initial_segment_private $surface2 $flamingo + set -x color_initial_segment_su $surface2 $green --bold + set -x color_initial_segment_jobs $surface2 $peach --bold + + set -x color_path $surface0 $text + set -x color_path_basename $surface0 $text --bold + set -x color_path_nowrite $surface0 $mauve + set -x color_path_nowrite_basename $surface0 $mauve --bold + + set -x color_repo $green $mantle + set -x color_repo_work_tree $surface2 $mantle --bold + set -x color_repo_dirty $red $mantle + set -x color_repo_staged $yellow $mantle + + set -x color_vi_mode_default $sky $mantle --bold + set -x color_vi_mode_insert $green $mantle --bold + set -x color_vi_mode_visual $mauve $mantle --bold + + set -x color_vagrant $surface2 $text --bold + set -x color_k8s $surface2 $text --bold + set -x color_aws_vault $yellow $mantle --bold + set -x color_aws_vault_expired $red $mantle --bold + set -x color_username $surface2 $yellow --bold + set -x color_hostname $surface2 $yellow + set -x color_screen $green $mantle --bold + set -x color_rvm $red $mantle --bold + set -x color_node $green $mantle --bold + set -x color_virtualfish $peach $mantle --bold + set -x color_virtualgo $sky $mantle --bold + set -x color_desk $peach $mantle --bold + set -x color_nix $sky $mantle --bold + + case 'jellybeans' # https://github.com/nanotech/jellybeans.vim + set -l bg 151515 + set -l darker_grey 1c1c1c + set -l dark_grey 262626 + set -l grey 888888 + set -l blue_grey a0a8b0 + set -l light_grey d8dee9 + set -l white ffffff + set -l dark_red 902020 + set -l red cf6a4c + set -l red_orange ffb964 + set -l bright_orange fad07a + set -l pale_gold dad085 + set -l pink f0a0c0 + set -l lilac c6b6ee + set -l dark_blue 2b5b77 + set -l deep_blue 0d61ac + set -l blue 8197bf + set -l bright_blue 7697d6 + set -l cyan 8fbfdc + set -l blue_green 668799 + set -l green 799d6a + set -l bright_green 70b950 + set -l brighter_green 65c254 + set -l light_green 99ad6a + set -l dark_green 556633 + + set -x color_initial_segment_exit $dark_red $white --bold + set -x color_initial_segment_private $light_grey $dark_grey --bold + set -x color_initial_segment_su $red_orange $darker_grey --bold + set -x color_initial_segment_jobs $lilac $darker_grey --bold + + set -x color_path $dark_grey $light_grey + set -x color_path_basename $dark_grey $light_grey --bold + set -x color_path_nowrite $dark_grey $red_orange + set -x color_path_nowrite_basename $dark_grey $red_orange --bold + + set -x color_repo $light_green $darker_grey + set -x color_repo_work_tree $dark_grey $light_grey --bold + set -x color_repo_dirty $red $darker_grey + set -x color_repo_staged $pale_gold $darker_grey + + set -x color_vi_mode_default $bright_blue $darker_grey --bold + set -x color_vi_mode_insert $lilac $darker_grey --bold + set -x color_vi_mode_visual $cyan $darker_grey --bold + + set -x color_username $dark_grey $blue_grey --bold + set -x color_hostname $dark_grey $blue_grey + set -x color_screen $bright_green $darker_grey --bold + + set -x color_vagrant $lilac $darker_grey --bold + set -x color_k8s $pale_gold $darker_grey --bold + set -x color_aws_vault $deep_blue $pale_gold --bold + set -x color_aws_vault_expired $deep_blue $red --bold + set -x color_rvm $pink $darker_grey --bold + set -x color_nvm $bright_green $darker_grey --bold + set -x color_virtualfish $cyan $darker_grey --bold + set -x color_virtualgo $light_green $darker_grey --bold + set -x color_desk $light_grey $darker_grey --bold + set -x color_nix $bright_blue $darker_grey --bold + + case 'darcula' + # light medium dark darkest + # ------ ------ ------ ------ + set -l grey 808080 616161 595959 424242 + set -l red FF4050 F0524F B82421 772E2C + set -l green 4FC414 5C962C 458500 39511F + set -l yellow E5BF00 A68A0D A87B00 5C4F17 + set -l blue 1FB0FF 3993D4 1778BD 245980 + set -l white F9F9F4 B7C3D0 + + set -x color_initial_segment_exit $white[2] $red[3] --bold + set -x color_initial_segment_private $white[2] $grey[4] + set -x color_initial_segment_su $white[2] $green[3] --bold + set -x color_initial_segment_jobs $white[2] $blue[3] --bold + + set -x color_path $grey[4] $white[2] + set -x color_path_basename $grey[4] $white[1] --bold + set -x color_path_nowrite $grey[4] $red[2] + set -x color_path_nowrite_basename $grey[4] $red[1] --bold + + set -x color_repo $green[3] $white[4] + set -x color_repo_work_tree $grey[4] $grey[4] --bold + set -x color_repo_dirty $red[3] $grey[4] + set -x color_repo_staged $yellow[3] $grey[4] + + set -x color_vi_mode_default $grey[4] $yellow[2] --bold + set -x color_vi_mode_insert $green[2] $grey[4] --bold + set -x color_vi_mode_visual $yellow[2] $grey[4] --bold + + set -x color_vagrant $blue[2] $green[1] --bold + set -x color_k8s $green[2] $grey[4] --bold + set -x color_aws_vault $blue[2] $grey[4] --bold + set -x color_aws_vault_expired $blue[2] $red[1] --bold + set -x color_username $grey[4] $blue[2] --bold + set -x color_hostname $grey[4] $blue[1] + set -x color_screen $green[3] $white[2] --bold + set -x color_rvm $red[2] $grey[4] --bold + set -x color_node $green[3] $white[2] --bold + set -x color_virtualfish $blue[2] $grey[4] --bold + set -x color_virtualgo $blue[2] $grey[4] --bold + set -x color_desk $blue[2] $grey[4] --bold + set -x color_nix $blue[2] $grey[4] --bold + + case '*' # default dark theme + # light medium dark + # ------ ------ ------ + set -l red cc9999 ce000f 660000 + set -l green addc10 189303 0c4801 + set -l blue 48b4fb 005faf 255e87 + set -l orange f6b117 unused 3a2a03 + set -l brown bf5e00 803f00 4d2600 + set -l grey cccccc 999999 333333 + set -l white ffffff + set -l black 000000 + set -l ruby_red af0000 + set -l go_blue 00d7d7 + + set -x color_initial_segment_exit $white $red[2] --bold + set -x color_initial_segment_private $white $grey[3] + set -x color_initial_segment_su $white $green[2] --bold + set -x color_initial_segment_jobs $white $blue[3] --bold + + set -x color_path $grey[3] $grey[2] + set -x color_path_basename $grey[3] $white --bold + set -x color_path_nowrite $red[3] $red[1] + set -x color_path_nowrite_basename $red[3] $red[1] --bold + + set -x color_repo $green[1] $green[3] + set -x color_repo_work_tree $grey[3] $white --bold + set -x color_repo_dirty $red[2] $white + set -x color_repo_staged $orange[1] $orange[3] + + set -x color_vi_mode_default $grey[2] $grey[3] --bold + set -x color_vi_mode_insert $green[2] $grey[3] --bold + set -x color_vi_mode_visual $orange[1] $orange[3] --bold + + set -x color_vagrant $blue[1] $white --bold + set -x color_k8s $green[2] $white --bold + set -x color_aws_vault $blue[3] $orange[1] --bold + set -x color_aws_vault_expired $blue[3] $red[3] --bold + set -x color_username $grey[1] $blue[3] --bold + set -x color_hostname $grey[1] $blue[3] + set -x color_screen $green[1] $white --bold + set -x color_rvm $ruby_red $grey[1] --bold + set -x color_node $green[1] $white --bold + set -x color_virtualfish $blue[2] $grey[1] --bold + set -x color_virtualgo $go_blue $black --bold + set -x color_desk $blue[2] $grey[1] --bold + set -x color_nix $blue[2] $grey[1] --bold + end +end + +function __bobthefish_user_color_scheme_deprecated + set -q __color_initial_segment_exit; or set -l __color_initial_segment_exit ffffff ce000f --bold + set -q __color_initial_segment_private; or set -l __color_initial_segment_private ffffff 255e87 + set -q __color_initial_segment_su; or set -l __color_initial_segment_su ffffff 189303 --bold + set -q __color_initial_segment_jobs; or set -l __color_initial_segment_jobs ffffff 255e87 --bold + set -q __color_path; or set -l __color_path 333333 999999 + set -q __color_path_basename; or set -l __color_path_basename 333333 ffffff --bold + set -q __color_path_nowrite; or set -l __color_path_nowrite 660000 cc9999 + set -q __color_path_nowrite_basename; or set -l __color_path_nowrite_basename 660000 cc9999 --bold + set -q __color_repo; or set -l __color_repo addc10 0c4801 + set -q __color_repo_work_tree; or set -l __color_repo_work_tree 333333 ffffff --bold + set -q __color_repo_dirty; or set -l __color_repo_dirty ce000f ffffff + set -q __color_repo_staged; or set -l __color_repo_staged f6b117 3a2a03 + set -q __color_vi_mode_default; or set -l __color_vi_mode_default 999999 333333 --bold + set -q __color_vi_mode_insert; or set -l __color_vi_mode_insert 189303 333333 --bold + set -q __color_vi_mode_visual; or set -l __color_vi_mode_visual f6b117 3a2a03 --bold + set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold + set -q __color_username; or set -l __color_username cccccc 255e87 --bold + set -q __color_hostname; or set -l __color_hostname cccccc 255e87 + set -q __color_rvm; or set -l __color_rvm af0000 cccccc --bold + set -q __color_virtualfish; or set -l __color_virtualfish 005faf cccccc --bold + set -q __color_virtualgo; or set -l __color_virtualgo 005faf cccccc --bold + set -q __color_desk; or set -l __color_desk 005faf cccccc --bold + set -q __color_nix; or set -l __color_nix 005faf cccccc --bold + + set_color black -b red --bold + echo "The 'user' color scheme is deprecated." + set_color normal + set_color black -b red + echo "To define a custom color scheme, create a 'bobthefish_colors' function:" + set_color normal + echo + + echo "function bobthefish_colors -S -d 'Define a custom bobthefish color scheme' + + # optionally include a base color scheme... + ___bobthefish_colors default + + # then override everything you want! note that these must be defined with `set -x` + set -x color_initial_segment_exit $__color_initial_segment_exit + set -x color_initial_segment_private $__color_initial_segment_private + set -x color_initial_segment_su $__color_initial_segment_su + set -x color_initial_segment_jobs $__color_initial_segment_jobs + set -x color_path $__color_path + set -x color_path_basename $__color_path_basename + set -x color_path_nowrite $__color_path_nowrite + set -x color_path_nowrite_basename $__color_path_nowrite_basename + set -x color_repo $__color_repo + set -x color_repo_work_tree $__color_repo_work_tree + set -x color_repo_dirty $__color_repo_dirty + set -x color_repo_staged $__color_repo_staged + set -x color_vi_mode_default $__color_vi_mode_default + set -x color_vi_mode_insert $__color_vi_mode_insert + set -x color_vi_mode_visual $__color_vi_mode_visual + set -x color_vagrant $__color_vagrant + set -x color_aws_vault $__color_aws_vault + set -x color_aws_vault_expired $__color_aws_vault_expired + set -x color_username $__color_username + set -x color_hostname $__color_hostname + set -x color_rvm $__color_rvm + set -x color_virtualfish $__color_virtualfish + set -x color_virtualgo $__color_virtualgo + set -x color_desk $__color_desk + set -x color_nix $__color_nix +end" + + echo +end diff --git a/fish/.config/fish/functions/__bobthefish_display_colors.fish b/fish/.config/fish/functions/__bobthefish_display_colors.fish new file mode 100644 index 0000000..210a803 --- /dev/null +++ b/fish/.config/fish/functions/__bobthefish_display_colors.fish @@ -0,0 +1,3 @@ +function __bobthefish_display_colors -d 'Print example prompts using the current color scheme' + bobthefish_display_colors +end diff --git a/fish/.config/fish/functions/__bobthefish_glyphs.fish b/fish/.config/fish/functions/__bobthefish_glyphs.fish new file mode 100644 index 0000000..1adb236 --- /dev/null +++ b/fish/.config/fish/functions/__bobthefish_glyphs.fish @@ -0,0 +1,104 @@ +function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish' + # Powerline glyphs + set -x branch_glyph \uE0A0 + set -x right_black_arrow_glyph \uE0B0 + set -x right_arrow_glyph \uE0B1 + set -x left_black_arrow_glyph \uE0B2 + set -x left_arrow_glyph \uE0B3 + + # Additional glyphs + set -x detached_glyph \u27A6 + set -x tag_glyph \u2302 + set -x nonzero_exit_glyph '! ' + set -x private_glyph \uE0A2 ' ' + set -x superuser_glyph '$ ' + set -x bg_job_glyph '% ' + set -x hg_glyph \u263F + + # Python glyphs + set -x superscript_glyph \u00B9 \u00B2 \u00B3 + set -x virtualenv_glyph \u25F0 + set -x pypy_glyph \u1D56 + + set -x ruby_glyph '' + set -x go_glyph '' + set -x nix_glyph '' + + # Desk glyphs + set -x desk_glyph \u25F2 + + # Kubernetes glyphs + set -x k8s_glyph \u2388 # '⎈' + + # Vagrant glyphs + set -x vagrant_running_glyph \u2191 # ↑ 'running' + set -x vagrant_poweroff_glyph \u2193 # ↓ 'poweroff' + set -x vagrant_aborted_glyph \u2715 # ✕ 'aborted' + set -x vagrant_saved_glyph \u21E1 # ⇡ 'saved' + set -x vagrant_stopping_glyph \u21E3 # ⇣ 'stopping' + set -x vagrant_unknown_glyph '!' # strange cases + + # Git glyphs + set -x git_dirty_glyph '*' + set -x git_staged_glyph '~' + set -x git_stashed_glyph '$' + set -x git_untracked_glyph '…' + set -x git_ahead_glyph \u2191 # '↑' + set -x git_behind_glyph \u2193 # '↓' + set -x git_plus_glyph '+' + set -x git_minus_glyph '-' + set -x git_plus_minus_glyph '±' + + # Fossil glyph (it reuses most of the git glyphs) + set -x fossil_glyph \U1F9B4 # Unicode bone emoji + + # Disable Powerline fonts (unless we're using nerd fonts instead) + if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ] + set private_glyph \u29B8 ' ' + set branch_glyph \u2387 + set right_black_arrow_glyph '' + set right_arrow_glyph '' + set left_black_arrow_glyph '' + set left_arrow_glyph '' + end + + # Use prettier Nerd Fonts glyphs + if [ "$theme_nerd_fonts" = "yes" ] + set private_glyph \uF023 ' ' # nf-fa-lock + + set branch_glyph \uF418 + set detached_glyph \uF417 + set tag_glyph \uF412 + + set nix_glyph \uF313 ' ' # nf-linux-nixos + set virtualenv_glyph \uE73C ' ' + set ruby_glyph \uE791 ' ' + set go_glyph \uE626 ' ' + set node_glyph \uE718 ' ' + + set vagrant_running_glyph \uF431 # ↑ 'running' + set vagrant_poweroff_glyph \uF433 # ↓ 'poweroff' + set vagrant_aborted_glyph \uF468 # ✕ 'aborted' + set vagrant_unknown_glyph \uF421 # strange cases + + set git_dirty_glyph \uF448 '' # nf-oct-pencil + set git_staged_glyph \uF0C7 '' # nf-fa-save + set git_stashed_glyph \uF0C6 '' # nf-fa-paperclip + set git_untracked_glyph \uF128 '' # nf-fa-question + # set git_untracked_glyph \uF141 '' # nf-fa-ellipsis_h + set fossil_glyph \UF00B9 # nf-md-bone + + set git_ahead_glyph \uF47B # nf-oct-chevron_up + set git_behind_glyph \uF47C # nf-oct-chevron_down + + set git_plus_glyph \uF0DE # fa-sort-asc + set git_minus_glyph \uF0DD # fa-sort-desc + set git_plus_minus_glyph \uF0DC # fa-sort + end + + # Avoid ambiguous glyphs + if [ "$theme_avoid_ambiguous_glyphs" = "yes" ] + set git_untracked_glyph '...' + set fossil_glyph '' # blank, for lack of a good fallback + end +end diff --git a/fish/.config/fish/functions/bobthefish_display_colors.fish b/fish/.config/fish/functions/bobthefish_display_colors.fish new file mode 100644 index 0000000..39c025f --- /dev/null +++ b/fish/.config/fish/functions/bobthefish_display_colors.fish @@ -0,0 +1,170 @@ +function bobthefish_display_colors -a color_scheme -d 'Print example prompt color schemes' + + set -l color_schemes default light \ + solarized solarized-light \ + base16 base16-light \ + gruvbox gruvbox-light zenburn \ + dracula nord \ + catppuccin-latte catppuccin-frappe \ + catppuccin-macchiato catppuccin-mocha \ + jellybeans \ + terminal terminal-dark-white \ + terminal-light terminal-light-black \ + terminal2 terminal2-dark-white \ + terminal2-light terminal2-light-black + + switch "$color_scheme" + case '--all' + for scheme in $color_schemes + echo + echo "$scheme:" + bobthefish_display_colors $scheme + end + return + + case $color_schemes + __bobthefish_colors $color_scheme + + case '' + if type -q bobthefish_colors + if [ -n "$theme_color_scheme" ] + echo "$theme_color_scheme (with bobthefish_colors overrides):" + else + echo 'custom (via bobthefish_colors):' + end + else if [ -n "$theme_color_scheme" ] + echo "$theme_color_scheme:" + end + + __bobthefish_colors $theme_color_scheme + type -q bobthefish_colors + and bobthefish_colors + + case '*' + echo 'usage: bobthefish_display_colors [--all] [color_scheme]' + return + end + + __bobthefish_glyphs + + echo + set_color normal + + __bobthefish_start_segment $color_initial_segment_exit + echo -n exit $nonzero_exit_glyph + set_color -b $color_initial_segment_private + echo -n private $private_glyph + set_color -b $color_initial_segment_su + echo -n su $superuser_glyph + set_color -b $color_initial_segment_jobs + echo -n jobs $bg_job_glyph + __bobthefish_finish_segments + set_color normal + echo -n "(<- initial_segment)" + echo + + __bobthefish_start_segment $color_path + echo -n /color/path/ + set_color -b $color_path_basename + echo -ns basename ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_path_nowrite + echo -n /color/path/nowrite/ + set_color -b $color_path_nowrite_basename + echo -ns basename ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_path + echo -n /color/path/ + set_color -b $color_path_basename + echo -ns basename ' ' + __bobthefish_start_segment $color_repo + echo -n "$branch_glyph repo $git_stashed_glyph " + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_path + echo -n /color/path/ + set_color -b $color_path_basename + echo -ns basename ' ' + __bobthefish_start_segment $color_repo_dirty + echo -n "$tag_glyph repo_dirty $git_dirty_glyph " + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_path + echo -n /color/path/ + set_color -b $color_path_basename + echo -ns basename ' ' + __bobthefish_start_segment $color_repo_staged + echo -n "$detached_glyph repo_staged $git_staged_glyph " + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_vi_mode_default + echo -ns vi_mode_default ' ' + __bobthefish_finish_segments + __bobthefish_start_segment $color_vi_mode_insert + echo -ns vi_mode_insert ' ' + __bobthefish_finish_segments + __bobthefish_start_segment $color_vi_mode_visual + echo -ns vi_mode_visual ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_vagrant + echo -ns $vagrant_running_glyph ' ' vagrant ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_username + echo -n username + set_color normal + set_color -b $color_hostname[1] $color_hostname[2..-1] + echo -ns @hostname ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_screen + echo -ns 'screen ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_rvm + echo -ns $ruby_glyph rvm ' ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_nvm + echo -ns $ruby_glyph nvm ' ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_virtualfish + echo -ns $virtualenv_glyph virtualfish ' ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_virtualgo + echo -ns $go_glyph virtualgo ' ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_desk + echo -ns $desk_glyph desk ' ' + __bobthefish_finish_segments + echo + + __bobthefish_start_segment $color_aws_vault + echo -ns aws-vault ' (' active ') ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_aws_vault_expired + echo -ns aws-vault ' (' expired ') ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_k8s + echo -ns $k8s_glyph ' k8s-context' + __bobthefish_finish_segments + + echo -e "\n" +end diff --git a/fish/.config/fish/functions/fish_greeting.fish b/fish/.config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..b17c915 --- /dev/null +++ b/fish/.config/fish/functions/fish_greeting.fish @@ -0,0 +1,10 @@ +function fish_greeting + if test $TERM = 'xterm-kitty' + fastfetch --logo-type kitty -l ~/.config/fastfetch/logo.png + if test $HYPRLAND_INSTANCE_SIGNATURE; echo -e "\e[34m \e[39m""$(hyprctl splash)"; end + else if test $TERM = 'linux' + fastfetch -c none + else + fastfetch + end +end diff --git a/fish/.config/fish/functions/fish_mode_prompt.fish b/fish/.config/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..e4b38e5 --- /dev/null +++ b/fish/.config/fish/functions/fish_mode_prompt.fish @@ -0,0 +1,42 @@ +# Display the current binding mode... if it's vi or vi-like. +# +# To always show the binding mode (regardless of current bindings): +# set -g theme_display_vi yes +# +# To never show: +# set -g theme_display_vi no + +function fish_mode_prompt -d 'bobthefish-optimized fish mode indicator' + [ "$theme_display_vi" != 'no' ] + or return + + [ "$fish_key_bindings" = 'fish_vi_key_bindings' \ + -o "$fish_key_bindings" = 'hybrid_bindings' \ + -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \ + -o "$theme_display_vi" = 'yes' ] + or return + + __bobthefish_colors $theme_color_scheme + + type -q bobthefish_colors + and bobthefish_colors + + set_color normal # clear out anything bold or underline... + + switch $fish_bind_mode + case default + set_color -b $color_vi_mode_default + echo -n ' N ' + case insert + set_color -b $color_vi_mode_insert + echo -n ' I ' + case replace replace_one replace-one + set_color -b $color_vi_mode_insert + echo -n ' R ' + case visual + set_color -b $color_vi_mode_visual + echo -n ' V ' + end + + set_color normal +end diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..8e67d21 --- /dev/null +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,1338 @@ +# name: bobthefish +# +# bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome. +# +# You will need a Powerline-patched font for this to work: +# +# https://powerline.readthedocs.org/en/master/installation.html#patched-fonts +# +# I recommend picking one of these: +# +# https://github.com/Lokaltog/powerline-fonts +# +# For more advanced awesome, install a nerd fonts patched font (and be sure to +# enable nerd fonts support with `set -g theme_nerd_fonts yes`): +# +# https://github.com/ryanoasis/nerd-fonts +# +# See README.md for setup and configuration options. +# +# ============================== +# Helper methods +# ============================== + +function __bobthefish_basename -d 'basically basename, but faster' + string replace -r '^.*/' '' -- $argv +end + +function __bobthefish_dirname -d 'basically dirname, but faster' + string replace -r '/[^/]+/?$' '' -- $argv +end + +function __bobthefish_pwd -d 'Get a normalized $PWD' + # The pwd builtin accepts `-P` on at least Fish 3.x, but fall back to $PWD if that doesn't work + builtin pwd -P 2>/dev/null + or echo $PWD +end + +# Note that for fish < 3.0 this falls back to unescaped, rather than trying to do something clever /shrug +# After we drop support for older fishies, we can inline this without the fallback. +function __bobthefish_escape_regex -a str -d 'A backwards-compatible `string escape --style=regex` implementation' + string escape --style=regex "$str" 2>/dev/null + or echo "$str" +end + +function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' + set -l tag (command git describe --tags --exact-match 2>/dev/null) + and echo "$tag_glyph $tag " + + set -l branch (command git symbolic-ref HEAD 2>/dev/null | string replace -r '^refs/heads/' '') + and begin + [ -n "$theme_git_default_branches" ] + or set -l theme_git_default_branches master main (git config init.defaultBranch) + + [ "$theme_display_git_master_branch" != 'yes' -a "$theme_display_git_default_branch" != 'yes' ] + and contains $branch $theme_git_default_branches + and echo $branch_glyph + and return + + # truncate the middle of the branch name, but only if it's 25+ characters + set -l truncname $branch + [ "$theme_use_abbreviated_branch_name" = 'yes' ] + and set truncname (string replace -r '^(.{17}).{3,}(.{5})$' "\$1…\$2" $branch) + + echo $branch_glyph $truncname + and return + end + + # If we've already shown a tag we don't need to show a detached branch + if [ -z "$tag" ] + set -l branch (command git show-ref --head -s --abbrev | head -n1 2>/dev/null) + echo "$detached_glyph $branch" + end +end + +function __bobthefish_fossil_branch -S -d 'Get the current fossil branch' + set -l branch (command fossil branch 2>/dev/null | string trim --left --chars=' *') + echo "$branch_glyph $branch" +end + +function __bobthefish_hg_branch -S -d 'Get the current hg branch' + set -l branch (command hg branch 2>/dev/null) + set -l book (command hg book | command grep \* | cut -d\ -f3) + echo "$branch_glyph $branch @ $book" +end + +function __bobthefish_pretty_parent -S -a child_dir -d 'Print a parent directory, shortened to fit the prompt' + set -q fish_prompt_pwd_dir_length + or set -l fish_prompt_pwd_dir_length 1 + + # Replace $HOME with ~ + set -l real_home ~ + set -l parent_dir (string replace -r '^'(__bobthefish_escape_regex "$real_home")'($|/)' '~$1' (__bobthefish_dirname $child_dir)) + + # Must check whether `$parent_dir = /` if using native dirname + if [ -z "$parent_dir" ] + echo -n / + return + end + + if [ $fish_prompt_pwd_dir_length -eq 0 ] + echo -n "$parent_dir/" + return + end + + string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' "$parent_dir/" +end + +function __bobthefish_ignore_vcs_dir -a real_pwd -d 'Check whether the current directory should be ignored as a VCS segment' + for p in $theme_vcs_ignore_paths + set ignore_path (realpath $p 2>/dev/null) + switch $real_pwd/ + case $ignore_path/\* + echo 1 + return + end + end +end + +function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git project base directory' + [ "$theme_display_git" = 'no' ] + and return + + command -q git + or return + + set -q theme_vcs_ignore_paths + and [ (__bobthefish_ignore_vcs_dir $real_pwd) ] + and return + + if [ "$theme_git_worktree_support" != 'yes' ] + set -l git_toplevel (command git rev-parse --show-toplevel 2>/dev/null) + + [ -z "$git_toplevel" ] + and return + + ## Support Git under WSL (see #336) + # command -q wslpath + # and set git_toplevel (command wslpath $git_toplevel) + + # If there are no symlinks, just use git toplevel + switch $real_pwd/ + case $git_toplevel/\* + echo $git_toplevel + return + end + + # Otherwise, we need to find the equivalent directory in the $PWD + set -l d $real_pwd + while not [ -z "$d" ] + if [ (realpath "$d") = "$git_toplevel" ] + echo $d + return + end + + [ "$d" = '/' ] + and return + + set d (__bobthefish_dirname $d) + end + return + end + + set -l git_dir (command git rev-parse --git-dir 2>/dev/null) + or return + + pushd $git_dir + set git_dir (__bobthefish_pwd) + popd + + switch $real_pwd/ + case $git_dir/\* + # Nothing works quite right if we're inside the git dir + # TODO: fix the underlying issues then re-enable the stuff below + + # # if we're inside the git dir, sweet. just return that. + # set -l toplevel (command git rev-parse --show-toplevel 2>/dev/null) + # if [ "$toplevel" ] + # switch $git_dir/ + # case $toplevel/\* + # echo $git_dir + # end + # end + return + end + + set -l project_dir (__bobthefish_dirname $git_dir) + + switch $real_pwd/ + case $project_dir/\* + echo $project_dir + return + end + + set project_dir (command git rev-parse --show-toplevel 2>/dev/null) + switch $real_pwd/ + case $project_dir/\* + echo $project_dir + end +end + +function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fossil project base directory' + [ "$theme_display_fossil" = 'yes' ] + and command -q fossil + and set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,') + or return + + set -q theme_vcs_ignore_paths + and [ (__bobthefish_ignore_vcs_dir $real_pwd) ] + and return + + echo "/$dir" +end + +function __bobthefish_hg_project_dir -S -a real_pwd -d 'Print the current hg project base directory' + [ "$theme_display_hg" = 'yes' ] + and command -q hg + or return + + set -q theme_vcs_ignore_paths + and [ (__bobthefish_ignore_vcs_dir $real_pwd) ] + and return + + set -l d $real_pwd + while not [ -z "$d" ] + if [ -e $d/.hg ] + command hg root --cwd "$d" 2>/dev/null + return + end + + [ "$d" = '/' ] + and return + + set d (__bobthefish_dirname $d) + end +end + +function __bobthefish_project_pwd -S -a project_root_dir -a real_pwd -d 'Print the working directory relative to project root' + set -q theme_project_dir_length + or set -l theme_project_dir_length 0 + + set -l project_dir (string replace -r '^'(__bobthefish_escape_regex "$project_root_dir")'($|/)' '' $real_pwd) + + if [ $theme_project_dir_length -eq 0 ] + echo -n $project_dir + return + end + + string replace -ar '(\.?[^/]{'"$theme_project_dir_length"'})[^/]*/' '$1/' $project_dir +end + +function __bobthefish_git_ahead -S -d 'Print the ahead/behind state for the current branch' + if [ "$theme_display_git_ahead_verbose" = 'yes' ] + __bobthefish_git_ahead_verbose + return + end + + set -l ahead 0 + set -l behind 0 + for line in (command git rev-list --left-right '@{upstream}...HEAD' 2>/dev/null) + switch "$line" + case '>*' + if [ $behind -eq 1 ] + echo '±' + return + end + set ahead 1 + case '<*' + if [ $ahead -eq 1 ] + echo "$git_plus_minus_glyph" + return + end + set behind 1 + end + end + + if [ $ahead -eq 1 ] + echo "$git_plus_glyph" + else if [ $behind -eq 1 ] + echo "$git_minus_glyph" + end +end + +function __bobthefish_git_ahead_verbose -S -d 'Print a more verbose ahead/behind state for the current branch' + set -l commits (command git rev-list --left-right '@{upstream}...HEAD' 2>/dev/null) + or return + + set -l behind (count (for arg in $commits; echo $arg; end | command grep '^<')) + set -l ahead (count (for arg in $commits; echo $arg; end | command grep -v '^<')) + + switch "$ahead $behind" + case '' # no upstream + case '0 0' # equal to upstream + return + case '* 0' # ahead of upstream + echo "$git_ahead_glyph$ahead" + case '0 *' # behind upstream + echo "$git_behind_glyph$behind" + case '*' # diverged from upstream + echo "$git_ahead_glyph$ahead$git_behind_glyph$behind" + end +end + +function __bobthefish_git_dirty_verbose -S -d 'Print a more verbose dirty state for the current working tree' + set -l changes (command git diff --numstat | awk '{ added += $1; removed += $2 } END { print "+" added "/-" removed }') + or return + + echo "$changes " | string replace -r '(\+0/(-0)?|/-0)' '' +end + +function __bobthefish_git_stashed -S -d 'Print the stashed state for the current branch' + if [ "$theme_display_git_stashed_verbose" = 'yes' ] + set -l stashed (command git rev-list --walk-reflogs --count refs/stash 2>/dev/null) + or return + + echo -n "$git_stashed_glyph$stashed" + else + command git rev-parse --verify --quiet refs/stash >/dev/null + and echo -n "$git_stashed_glyph" + end +end + + +# ============================== +# Segment functions +# ============================== + +function __bobthefish_start_segment -S -d 'Start a prompt segment' + set -l bg $argv[1] + set -e argv[1] + set -l fg $argv[1] + set -e argv[1] + + set_color normal # clear out anything bold or underline... + set_color -b $bg $fg $argv + + switch "$__bobthefish_current_bg" + case '' + # If there's no background, just start one + echo -n ' ' + case "$bg" + # If the background is already the same color, draw a separator + echo -ns $right_arrow_glyph ' ' + case '*' + # otherwise, draw the end of the previous segment and the start of the next + set_color $__bobthefish_current_bg + echo -ns $right_black_arrow_glyph ' ' + set_color $fg $argv + end + + set __bobthefish_current_bg $bg +end + +function __bobthefish_path_segment -S -a segment_dir -a path_type -d 'Display a shortened form of a directory' + set -l segment_color $color_path + set -l segment_basename_color $color_path_basename + + if not [ -w "$segment_dir" ] + set segment_color $color_path_nowrite + set segment_basename_color $color_path_nowrite_basename + end + + __bobthefish_start_segment $segment_color + + set -l directory + set -l parent + + switch "$segment_dir" + case / + set directory '/' + case "$HOME" + set directory '~' + case '*' + set parent (__bobthefish_pretty_parent "$segment_dir") + set directory (__bobthefish_basename "$segment_dir") + end + + [ "$theme_show_project_parent" != "no" -o "$path_type" != "project" ] + and echo -n $parent + + set_color -b $segment_basename_color + echo -ns $directory ' ' +end + +function __bobthefish_finish_segments -S -d 'Close open prompt segments' + if [ -n "$__bobthefish_current_bg" ] + set_color normal + set_color $__bobthefish_current_bg + echo -ns $right_black_arrow_glyph ' ' + end + + if [ "$theme_newline_cursor" = 'yes' ] + echo -ens "\n" + set_color $fish_color_autosuggestion + + if set -q theme_newline_prompt + echo -ens "$theme_newline_prompt" + else if [ "$theme_powerline_fonts" = 'no' -a "$theme_nerd_fonts" != 'yes' ] + echo -ns '> ' + else + echo -ns "$right_arrow_glyph " + end + else if [ "$theme_newline_cursor" = 'clean' ] + echo -ens "\n" + end + + set_color normal + set __bobthefish_current_bg +end + + +# ============================== +# Status segment +# ============================== + +function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a non-zero exit status, private mode, root user, and background jobs' + set -l nonzero + set -l superuser + set -l bg_jobs + + # Last exit was nonzero + [ $last_status -ne 0 ] + and set nonzero 1 + + # If superuser (uid == 0) + # + # Note that iff the current user is root and '/' is not writeable by root this + # will be wrong. But I can't think of a single reason that would happen, and + # it is literally 99.5% faster to check it this way, so that's a tradeoff I'm + # willing to make. + [ -w / -o -w /private/ ] + and [ (id -u) -eq 0 ] + and set superuser 1 + + # Jobs display + if set -q AUTOJUMP_SOURCED + # Autojump special case: check if there are jobs besides the `autojump` + # job, since that one is (briefly) backgrounded every time we `cd` + set bg_jobs (jobs -c | string match -v --regex '(Command|autojump)' | wc -l) + [ "$bg_jobs" -eq 0 ] + and set bg_jobs # clear it out so it doesn't show when `0` + else + if [ "$theme_display_jobs_verbose" = 'yes' ] + set bg_jobs (jobs -p | wc -l) + [ "$bg_jobs" -eq 0 ] + and set bg_jobs # clear it out so it doesn't show when `0` + else + # `jobs -p` is faster if we redirect to /dev/null, because it exits + # after the first match. We'll use that unless the user wants to + # display the actual job count + jobs -p >/dev/null + and set bg_jobs 1 + end + end + + if [ "$nonzero" -o "$fish_private_mode" -o "$superuser" -o "$bg_jobs" ] + __bobthefish_start_segment $color_initial_segment_exit + if [ "$nonzero" ] + set_color normal + set_color -b $color_initial_segment_exit + if [ "$theme_show_exit_status" = 'yes' ] + echo -ns $last_status ' ' + else + echo -n $nonzero_exit_glyph + end + end + + if [ "$fish_private_mode" ] + set_color normal + set_color -b $color_initial_segment_private + echo -n $private_glyph + end + + if [ "$superuser" ] + set_color normal + if [ -z "$FAKEROOTKEY" ] + set_color -b $color_initial_segment_su + else + set_color -b $color_initial_segment_exit + end + + echo -n $superuser_glyph + end + + if [ "$bg_jobs" ] + set_color normal + set_color -b $color_initial_segment_jobs + if [ "$theme_display_jobs_verbose" = 'yes' ] + echo -ns $bg_job_glyph $bg_jobs ' ' + else + echo -n $bg_job_glyph + end + end + end +end + + +# ============================== +# Container and VM segments +# ============================== + +function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status' + [ "$theme_display_vagrant" = 'yes' -a -f Vagrantfile ] + or return + + # .vagrant/machines/$machine/$provider/id + for file in .vagrant/machines/*/*/id + read -l id <"$file" + + if [ -n "$id" ] + switch "$file" + case '*/virtualbox/id' + __bobthefish_prompt_vagrant_vbox $id + case '*/vmware_fusion/id' + __bobthefish_prompt_vagrant_vmware $id + case '*/parallels/id' + __bobthefish_prompt_vagrant_parallels $id + end + end + end +end + +function __bobthefish_prompt_vagrant_vbox -S -a id -d 'Display VirtualBox Vagrant status' + set -l vagrant_status + set -l vm_status (VBoxManage showvminfo --machinereadable $id 2>/dev/null | command grep 'VMState=' | tr -d '"' | cut -d '=' -f 2) + + switch "$vm_status" + case 'running' + set vagrant_status "$vagrant_status$vagrant_running_glyph" + case 'poweroff' + set vagrant_status "$vagrant_status$vagrant_poweroff_glyph" + case 'aborted' + set vagrant_status "$vagrant_status$vagrant_aborted_glyph" + case 'saved' + set vagrant_status "$vagrant_status$vagrant_saved_glyph" + case 'stopping' + set vagrant_status "$vagrant_status$vagrant_stopping_glyph" + case '' + set vagrant_status "$vagrant_status$vagrant_unknown_glyph" + end + + [ -z "$vagrant_status" ] + and return + + __bobthefish_start_segment $color_vagrant + echo -ns $vagrant_status ' ' +end + +function __bobthefish_prompt_vagrant_vmware -S -a id -d 'Display VMWare Vagrant status' + set -l vagrant_status + if [ (pgrep -f "$id") ] + set vagrant_status "$vagrant_status$vagrant_running_glyph" + else + set vagrant_status "$vagrant_status$vagrant_poweroff_glyph" + end + + [ -z "$vagrant_status" ] + and return + + __bobthefish_start_segment $color_vagrant + echo -ns $vagrant_status ' ' +end + +function __bobthefish_prompt_vagrant_parallels -S -d 'Display Parallels Vagrant status' + set -l vagrant_status + set -l vm_status (prlctl list $id -o status 2>/dev/null | command tail -1) + + switch "$vm_status" + case 'running' + set vagrant_status "$vagrant_status$vagrant_running_glyph" + case 'stopped' + set vagrant_status "$vagrant_status$vagrant_poweroff_glyph" + case 'paused' + set vagrant_status "$vagrant_status$vagrant_saved_glyph" + case 'suspended' + set vagrant_status "$vagrant_status$vagrant_saved_glyph" + case 'stopping' + set vagrant_status "$vagrant_status$vagrant_stopping_glyph" + case '' + set vagrant_status "$vagrant_status$vagrant_unknown_glyph" + end + + [ -z "$vagrant_status" ] + and return + + __bobthefish_start_segment $color_vagrant + echo -ns $vagrant_status ' ' +end + +function __bobthefish_prompt_docker -S -d 'Display Docker machine name' + [ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ] + and return + + __bobthefish_start_segment $color_vagrant + echo -ns $DOCKER_MACHINE_NAME ' ' +end + +function __bobthefish_k8s_context -S -d 'Get the current k8s context' + set -l config_paths "$HOME/.kube/config" + [ -n "$KUBECONFIG" ] + and set config_paths (string split ':' "$KUBECONFIG") $config_paths + + for file in $config_paths + [ -f "$file" ] + or continue + + while read -l key val + if [ "$key" = 'current-context:' ] + set -l context (string trim -c '"\' ' -- $val) + [ -z "$context" ] + and return 1 + + echo $context + return + end + end <$file + end + + return 1 +end + +function __bobthefish_k8s_namespace -S -d 'Get the current k8s namespace' + kubectl config view --minify --output "jsonpath={..namespace}" +end + +function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' + [ "$theme_display_k8s_context" = 'yes' ] + or return + + set -l context (__bobthefish_k8s_context) + or return + + [ "$theme_display_k8s_namespace" = 'yes' ] + and set -l namespace (__bobthefish_k8s_namespace) + + [ -z "$context" -o "$context" = 'default' ] + and [ -z "$namespace" -o "$namespace" = 'default' ] + and return + + set -l segment $k8s_glyph ' ' + [ "$context" != 'default' ] + and set segment $segment $context + [ "$namespace" != 'default' ] + and set segment $segment ':' $namespace + + __bobthefish_start_segment $color_k8s + echo -ns $segment ' ' +end + + +# ============================== +# Cloud Tools +# ============================== + +function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' + [ "$theme_display_aws_vault_profile" = 'yes' ] + or return + + [ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" ] + or return + + set -l profile $AWS_VAULT + + set -l now (date --utc +%s) + set -l expiry (date -d "$AWS_CREDENTIAL_EXPIRATION" +%s) + set -l diff_mins (math "floor(( $expiry - $now ) / 60)") + + set -l diff_time $diff_mins"m" + [ $diff_mins -le 0 ] + and set -l diff_time '0m' + [ $diff_mins -ge 60 ] + and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m" + + set -l segment $profile ' (' $diff_time ')' + set -l status_color $color_aws_vault + [ $diff_mins -le 0 ] + and set -l status_color $color_aws_vault_expired + + __bobthefish_start_segment $status_color + echo -ns $segment ' ' +end + + +# ============================== +# User / hostname info segments +# ============================== + +# Polyfill for fish < 2.5.0 +if not type -q prompt_hostname + if not set -q __bobthefish_prompt_hostname + set -g __bobthefish_prompt_hostname (uname -n | string replace -r '\..*' '') + end + + function prompt_hostname + echo $__bobthefish_prompt_hostname + end +end + +function __bobthefish_prompt_user -S -d 'Display current user and hostname' + [ "$theme_display_user" = 'yes' -o \( "$theme_display_user" != 'no' -a -n "$SSH_CLIENT" \) -o \( -n "$default_user" -a "$USER" != "$default_user" \) ] + and set -l display_user + + [ "$theme_display_sudo_user" = 'yes' -a -n "$SUDO_USER" ] + and set -l display_sudo_user + + [ "$theme_display_hostname" = 'yes' -o \( "$theme_display_hostname" != 'no' -a -n "$SSH_CLIENT" \) ] + and set -l display_hostname + + if set -q display_user + __bobthefish_start_segment $color_username + echo -ns (whoami) + end + + if set -q display_sudo_user + if set -q display_user + echo -ns ' ' + else + __bobthefish_start_segment $color_username + end + echo -ns "($SUDO_USER)" + end + + if set -q display_hostname + if set -q display_user + or set -q display_sudo_user + # reset colors without starting a new segment... + # (so we can have a bold username and non-bold hostname) + set_color normal + set_color -b $color_hostname[1] $color_hostname[2..-1] + echo -ns '@' (prompt_hostname) + else + __bobthefish_start_segment $color_hostname + echo -ns (prompt_hostname) + end + end + + set -q display_user + or set -q display_sudo_user + or set -q display_hostname + and echo -ns ' ' +end + + +# ============================== +# Virtual environment segments +# ============================== + +function __bobthefish_rvm_parse_ruby -S -a ruby_string -a scope -d 'Parse RVM Ruby string' + # Function arguments: + # - 'ruby-2.2.3@rails', 'jruby-1.7.19'... + # - 'default' or 'current' + set -l IFS @ + echo "$ruby_string" | read __ruby __rvm_{$scope}_ruby_gemset __ + set IFS - + echo "$__ruby" | read __rvm_{$scope}_ruby_interpreter __rvm_{$scope}_ruby_version __ + set -e __ruby + set -e __ +end + +function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM' + # look for rvm install path + set -q rvm_path + or set -l rvm_path ~/.rvm /usr/local/rvm + + # More `sed`/`grep`/`cut` magic... + set -l __rvm_default_ruby (grep GEM_HOME $rvm_path/environments/default 2>/dev/null | sed -e"s/'//g" | sed -e's/.*\///') + set -l __rvm_current_ruby (rvm-prompt i v g) + + [ "$__rvm_default_ruby" = "$__rvm_current_ruby" ] + and return + + set -l __rvm_default_ruby_gemset + set -l __rvm_default_ruby_interpreter + set -l __rvm_default_ruby_version + set -l __rvm_current_ruby_gemset + set -l __rvm_current_ruby_interpreter + set -l __rvm_current_ruby_version + + # Parse default and current Rubies to global variables + __bobthefish_rvm_parse_ruby $__rvm_default_ruby default + __bobthefish_rvm_parse_ruby $__rvm_current_ruby current + # Show unobtrusive RVM prompt + + # If interpreter differs form default interpreter, show everything: + if [ "$__rvm_default_ruby_interpreter" != "$__rvm_current_ruby_interpreter" ] + if [ "$__rvm_current_ruby_gemset" = 'global' ] + rvm-prompt i v + else + rvm-prompt i v g + end + # If version differs form default version + else if [ "$__rvm_default_ruby_version" != "$__rvm_current_ruby_version" ] + if [ "$__rvm_current_ruby_gemset" = 'global' ] + rvm-prompt v + else + rvm-prompt v g + end + # If gemset differs form default or 'global' gemset, just show it + else if [ "$__rvm_default_ruby_gemset" != "$__rvm_current_ruby_gemset" ] + rvm-prompt g + end +end + +function __bobthefish_prompt_rubies -S -d 'Display current Ruby information' + [ "$theme_display_ruby" = 'no' ] + and return + + set -l ruby_version + if command -q rvm-prompt + set ruby_version (__bobthefish_rvm_info) + else if command -q rbenv + set ruby_version (rbenv version-name) + # Don't show global ruby version... + set -q RBENV_ROOT + or set -l RBENV_ROOT $HOME/.rbenv + + [ -e "$RBENV_ROOT/version" ] + and read -l global_ruby_version <"$RBENV_ROOT/version" + + [ "$global_ruby_version" ] + or set -l global_ruby_version system + + [ "$ruby_version" = "$global_ruby_version" ] + and return + else if type -q chruby # chruby is implemented as a function, so using type -q is intentional + set ruby_version $RUBY_VERSION + else if command -q asdf + set -l asdf_current_ruby (asdf current ruby 2>/dev/null) + or return + + echo "$asdf_current_ruby" | read -l _asdf_plugin asdf_ruby_version asdf_provenance + + # If asdf changes their ruby version provenance format, update this to match + [ (string trim -- "$asdf_provenance") = "$HOME/.tool-versions" ] + and return + + set ruby_version $asdf_ruby_version + end + + [ -z "$ruby_version" ] + and return + + __bobthefish_start_segment $color_rvm + echo -ns $ruby_glyph $ruby_version ' ' +end + +function __bobthefish_prompt_golang -S -a real_pwd -d 'Display current Go information' + # setting is 'no', don't display the prompt + [ "$theme_display_go" = 'no' ] + and return + + # find the closest go.mod + set -l gomod_version "0" + set -l d $real_pwd + while not [ -z "$d" ] + if [ -e $d/go.mod ] + grep "^go " "$d/go.mod" | read __ gomod_version + break + end + + [ "$d" = "/" ] + and return + + set d (__bobthefish_dirname $d) + end + + # no go.mod, not in a go project, don't display the prompt + if [ "$gomod_version" = "0" ] + return + end + + # check if there's a Go executable + set -l no_go_installed "0" + set -l actual_go_version "0" + set -l high_enough_version "0" + if command -q go + set actual_go_version (go version | string replace --filter -r 'go version go(\\d+\\.\\d+(?:\\.\\d+)?).*' '$1') + if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort + set high_enough_version "1" + end + else + set no_go_installed "1" + end + + if [ "$high_enough_version" = "1" ] + __bobthefish_start_segment $color_virtualgo + else + __bobthefish_start_segment $color_rvm + end + + echo -ns $go_glyph + echo -ns "$gomod_version " + + # showing the prompt -- but plain ( for 'yes' ) or verbose? + if [ "$theme_display_go" = "verbose" ] + if [ "$actual_go_version" != "0" ] + # show the prompt with the required version AND the currently available + # version; same color rules as above + echo -ns " ($actual_go_version)" + end + end +end + +function __bobthefish_virtualenv_python_version -S -d 'Get current Python version' + switch (python --version 2>&1 | tr '\n' ' ') + case 'Python 2*PyPy*' + echo $pypy_glyph + case 'Python 3*PyPy*' + echo -s $pypy_glyph $superscript_glyph[3] + case 'Python 2*' + echo $superscript_glyph[2] + case 'Python 3*' + echo $superscript_glyph[3] + end +end + +function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself) or conda environment." + command -q python + or return + + [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ] + and return + + set -l version_glyph (__bobthefish_virtualenv_python_version) + set -l prompt_style 'default' + + if [ "$version_glyph" ] + __bobthefish_start_segment $color_virtualfish + if string match -q "Python 2*" (python --version 2>&1 | string trim) + set prompt_style 'verbose' + else if [ "$theme_display_virtualenv" = 'verbose' ] + set prompt_style 'verbose' + end + + if [ "$prompt_style" = 'verbose' ] + echo -ns $virtualenv_glyph $version_glyph ' ' + else + echo -ns $virtualenv_glyph + end + + end + + if [ "$VIRTUAL_ENV" ] + echo -ns (basename "$VIRTUAL_ENV") ' ' + else if [ "$CONDA_DEFAULT_ENV" ] + echo -ns (basename "$CONDA_DEFAULT_ENV") ' ' + end +end + +function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment' + [ "$theme_display_virtualgo" = 'no' -o -z "$VIRTUALGO" ] + and return + + __bobthefish_start_segment $color_virtualgo + echo -ns $go_glyph ' ' (basename "$VIRTUALGO") ' ' + set_color normal +end + +function __bobthefish_prompt_desk -S -d 'Display current desk environment' + [ "$theme_display_desk" = 'no' -o -z "$DESK_ENV" ] + and return + + __bobthefish_start_segment $color_desk + echo -ns $desk_glyph ' ' (basename -a -s '.fish' "$DESK_ENV") ' ' + set_color normal +end + +function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the parent directories' + set -l dir "$argv[1]" + set -l files $argv[2..-1] + + if test -z "$dir" + or test -z "$files" + return 1 + end + + while [ "$dir" ] + for f in $files + if [ -e "$dir/$f" ] + return + end + end + + [ "$dir" = '/' ] + and return 1 + + set dir (__bobthefish_dirname "$dir") + end + return 1 +end + +function __bobthefish_prompt_node -S -d 'Display current node version' + set -l should_show + + if [ "$theme_display_node" = 'always' -o "$theme_display_nvm" = 'yes' ] + set should_show 1 + else if [ "$theme_display_node" = 'yes' ] + __bobthefish_prompt_find_file_up "$PWD" package.json .nvmrc .node-version + and set should_show 1 + end + + [ -z "$should_show" ] + and return + + set -l node_manager + set -l node_manager_dir + + if type -q nvm + set node_manager 'nvm' + set node_manager_dir $NVM_DIR + else if command -q fnm + set node_manager 'fnm' + set node_manager_dir $FNM_DIR + end + + [ -n "$node_manager_dir" ] + or return + + set -l node_version ("$node_manager" current 2> /dev/null) + + [ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ] + and return + + [ -n "$color_nvm" ] + and set -x color_node $color_nvm + + __bobthefish_start_segment $color_node + echo -ns $node_glyph $node_version ' ' + set_color normal +end + +function __bobthefish_prompt_nix -S -d 'Display current nix environment' + [ "$theme_display_nix" = 'no' -o -z "$IN_NIX_SHELL" ] + and return + + __bobthefish_start_segment $color_nix + echo -ns $nix_glyph $IN_NIX_SHELL ' ' + + set_color normal +end + +# ============================== +# VCS segments +# ============================== + +function __bobthefish_prompt_fossil -S -a fossil_root_dir -a real_pwd -d 'Display the actual fossil state' + set -f fossil_statuses (command fossil changes --differ 2>/dev/null | cut -d' ' -f1 | sort -u) + + # Fossil doesn't really stage changes; untracked files are ignored, tracked files are committed by default + # It also syncs by default when you commit, and monitors for conflicts (which will be reported here) + for line in $fossil_statuses + switch $line + case ADDED UPDATED EDITED DELETED RENAMED + # These can really just all be dirty, then + set -f dirty $git_dirty_glyph + case EXTRA + set -f new $git_untracked_glyph + case CONFLICT + set -f conflict '!' + end + end + + set -f flags "$dirty$new$conflict" + + [ "$flags" ] + and set flags " $flags" + + set -l flag_colors $color_repo + if [ "$dirty" ] + set flag_colors $color_repo_dirty + end + + __bobthefish_path_segment $fossil_root_dir project + + __bobthefish_start_segment $flag_colors + echo -ns $fossil_glyph ' ' + + echo -ns (__bobthefish_fossil_branch) $flags ' ' + set_color normal + + set -l project_pwd (__bobthefish_project_pwd $fossil_root_dir $real_pwd) + if [ "$project_pwd" ] + if [ -w "$real_pwd" ] + __bobthefish_start_segment $color_path + else + __bobthefish_start_segment $color_path_nowrite + end + + echo -ns $project_pwd ' ' + end +end + +function __bobthefish_prompt_hg -S -a hg_root_dir -a real_pwd -d 'Display the actual hg state' + set -l dirty (command hg stat; or echo -n '*') + + set -l flags "$dirty" + [ "$flags" ] + and set flags '' + + set -l flag_colors $color_repo + if [ "$dirty" ] + set flag_colors $color_repo_dirty + end + + __bobthefish_path_segment $hg_root_dir project + + __bobthefish_start_segment $flag_colors + echo -ns $hg_glyph ' ' + + __bobthefish_start_segment $flag_colors + echo -ns (__bobthefish_hg_branch) $flags ' ' + set_color normal + + set -l project_pwd (__bobthefish_project_pwd $hg_root_dir $real_pwd) + if [ "$project_pwd" ] + if [ -w "$real_pwd" ] + __bobthefish_start_segment $color_path + else + __bobthefish_start_segment $color_path_nowrite + end + + echo -ns $project_pwd ' ' + end +end + +function __bobthefish_prompt_screen -S -d 'Display the screen name' + [ "$theme_display_screen" = 'no' -o -z "$STY" ] + and return + + __bobthefish_start_segment $color_screen + echo -ns (string split "." -- $STY)[2] ' ' + set_color normal +end + +function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the actual git state' + set -l dirty '' + if [ "$theme_display_git_dirty" != 'no' ] + set -l show_dirty (command git config --bool bash.showDirtyState 2>/dev/null) + if [ "$show_dirty" != 'false' ] + set dirty (command git diff --no-ext-diff --quiet --exit-code 2>/dev/null; or echo -n "$git_dirty_glyph") + if [ "$dirty" -a "$theme_display_git_dirty_verbose" = 'yes' ] + set dirty "$dirty"(__bobthefish_git_dirty_verbose) + end + end + end + + set -l staged (command git diff --cached --no-ext-diff --quiet --exit-code 2>/dev/null; or echo -n "$git_staged_glyph") + set -l stashed (__bobthefish_git_stashed) + set -l ahead (__bobthefish_git_ahead) + + set -l new '' + if [ "$theme_display_git_untracked" != 'no' ] + set -l show_untracked (command git config --bool bash.showUntrackedFiles 2>/dev/null) + if [ "$show_untracked" != 'false' ] + set new (command git ls-files --other --exclude-standard --directory --no-empty-directory "$git_root_dir" 2>/dev/null) + if [ "$new" ] + set new "$git_untracked_glyph" + end + end + end + + set -l flags "$dirty$staged$stashed$ahead$new" + + [ "$flags" ] + and set flags " $flags" + + set -l flag_colors $color_repo + if [ "$dirty" ] + set flag_colors $color_repo_dirty + else if [ "$staged" ] + set flag_colors $color_repo_staged + end + + __bobthefish_path_segment $git_root_dir project + + __bobthefish_start_segment $flag_colors + echo -ns (__bobthefish_git_branch) $flags ' ' + set_color normal + + if [ "$theme_git_worktree_support" != 'yes' ] + set -l project_pwd (__bobthefish_project_pwd $git_root_dir $real_pwd) + if [ "$project_pwd" ] + if [ -w "$real_pwd" ] + __bobthefish_start_segment $color_path + else + __bobthefish_start_segment $color_path_nowrite + end + + echo -ns $project_pwd ' ' + end + return + end + + set -l project_pwd (command git rev-parse --show-prefix 2>/dev/null | string trim --right --chars=/) + set -l work_dir (command git rev-parse --show-toplevel 2>/dev/null) + + # only show work dir if it's a parent… + if [ "$work_dir" ] + switch $real_pwd/ + case $work_dir/\* + string match "$git_root_dir*" $work_dir >/dev/null + and set work_dir (string sub -s (math 1 + (string length $git_root_dir)) $work_dir) + case \* + set -e work_dir + end + end + + if [ "$project_pwd" -o "$work_dir" ] + set -l colors $color_path + if not [ -w "$real_pwd" ] + set colors $color_path_nowrite + end + + __bobthefish_start_segment $colors + + # handle work_dir != project dir + if [ "$work_dir" ] + set -l work_parent (__bobthefish_dirname $work_dir) + if [ "$work_parent" ] + echo -n "$work_parent/" + end + + set_color normal + set_color -b $color_repo_work_tree + echo -n (__bobthefish_basename $work_dir) + + set_color normal + set_color -b $colors + [ "$project_pwd" ] + and echo -n '/' + end + + echo -ns $project_pwd ' ' + else + set project_pwd $real_pwd + + string match "$git_root_dir*" $project_pwd >/dev/null + and set project_pwd (string sub -s (math 1 + (string length $git_root_dir)) $project_pwd) + + set project_pwd (string trim --left --chars=/ -- $project_pwd) + + if [ "$project_pwd" ] + set -l colors $color_path + if not [ -w "$real_pwd" ] + set colors $color_path_nowrite + end + + __bobthefish_start_segment $colors + + echo -ns $project_pwd ' ' + end + end +end + +function __bobthefish_prompt_dir -S -a real_pwd -d 'Display a shortened form of the current directory' + __bobthefish_path_segment "$real_pwd" pwd +end + +# Polyfill for fish < 3.5.0 +function __bobthefish_closest_parent -S + if builtin -q path + echo (path sort -r $argv)[1] + else + string join \n $argv | awk '{ print length, $0 }' | sort -nsr | head -1 | cut -d" " -f2- + end +end + + +# ============================== +# Apply theme +# ============================== + +function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' + # Save the last status for later (do this before anything else) + set -l last_status $status + + # Use a simple prompt on dumb terminals. + if [ "$TERM" = 'dumb' ] + echo '> ' + return + end + + __bobthefish_glyphs + __bobthefish_colors $theme_color_scheme + + type -q bobthefish_colors + and bobthefish_colors + + # Start each line with a blank slate + set -l __bobthefish_current_bg + + set -l real_pwd (__bobthefish_pwd) + + # Status flags and input mode + __bobthefish_prompt_status $last_status + + # User / hostname info + __bobthefish_prompt_user + + # Screen + __bobthefish_prompt_screen + + # Containers and VMs + __bobthefish_prompt_vagrant + __bobthefish_prompt_docker + __bobthefish_prompt_k8s_context + + # Cloud Tools + __bobthefish_prompt_aws_vault_profile + + # Virtual environments + __bobthefish_prompt_nix + __bobthefish_prompt_desk + __bobthefish_prompt_rubies + __bobthefish_prompt_golang $real_pwd + __bobthefish_prompt_virtualfish + __bobthefish_prompt_virtualgo + __bobthefish_prompt_node + + + # VCS + set -l git_root_dir (__bobthefish_git_project_dir $real_pwd) + set -l hg_root_dir (__bobthefish_hg_project_dir $real_pwd) + set -l fossil_root_dir (__bobthefish_fossil_project_dir $real_pwd) + + # only show the closest parent + switch (__bobthefish_closest_parent "$git_root_dir" "$hg_root_dir" "$fossil_root_dir") + case '' + __bobthefish_prompt_dir $real_pwd + case "$git_root_dir" + __bobthefish_prompt_git $git_root_dir $real_pwd + case "$hg_root_dir" + __bobthefish_prompt_hg $hg_root_dir $real_pwd + case "$fossil_root_dir" + __bobthefish_prompt_fossil $fossil_root_dir $real_pwd + end + + __bobthefish_finish_segments +end diff --git a/fish/.config/fish/functions/fish_right_prompt.fish b/fish/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..45e14d6 --- /dev/null +++ b/fish/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,80 @@ +# See "Right prompt options" in README.md for configuration options + +function __bobthefish_cmd_duration -S -d 'Show command duration' + [ "$theme_display_cmd_duration" = "no" ] + and return + + [ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ] + and return + + if [ "$CMD_DURATION" -lt 5000 ] + echo -ns $CMD_DURATION 'ms' + else if [ "$CMD_DURATION" -lt 60000 ] + __bobthefish_pretty_ms $CMD_DURATION s + else if [ "$CMD_DURATION" -lt 3600000 ] + set_color $fish_color_error + __bobthefish_pretty_ms $CMD_DURATION m + else + set_color $fish_color_error + __bobthefish_pretty_ms $CMD_DURATION h + end + + set_color $fish_color_normal + set_color $fish_color_autosuggestion + + [ "$theme_display_date" = "no" ] + or echo -ns ' ' $__bobthefish_left_arrow_glyph +end + +function __bobthefish_pretty_ms -S -a ms -a interval -d 'Millisecond formatting for humans' + set -l interval_ms + set -l scale 1 + + switch $interval + case s + set interval_ms 1000 + case m + set interval_ms 60000 + case h + set interval_ms 3600000 + set scale 2 + end + + switch $FISH_VERSION + case 2.0.\* 2.1.\* 2.2.\* 2.3.\* + # Fish 2.3 and lower doesn't know about the -s argument to math. + math "scale=$scale;$ms/$interval_ms" | string replace -r '\\.?0*$' $interval + case 2.\* + # Fish 2.x always returned a float when given the -s argument. + math -s$scale "$ms/$interval_ms" | string replace -r '\\.?0*$' $interval + case \* + math -s$scale "$ms/$interval_ms" + echo -ns $interval + end +end + +function __bobthefish_timestamp -S -d 'Show the current timestamp' + [ "$theme_display_date" = "no" ] + and return + + set -q theme_date_format + or set -l theme_date_format "+%c" + + echo -n ' ' + set -q theme_date_timezone + and env TZ="$theme_date_timezone" date $theme_date_format + or date $theme_date_format +end + +function fish_right_prompt -d 'bobthefish is all about the right prompt' + set -l __bobthefish_left_arrow_glyph \uE0B3 + if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ] + set __bobthefish_left_arrow_glyph '<' + end + + set_color $fish_color_autosuggestion + + __bobthefish_cmd_duration + __bobthefish_timestamp + set_color normal +end diff --git a/fish/.config/fish/functions/fish_title.fish b/fish/.config/fish/functions/fish_title.fish new file mode 100644 index 0000000..91793c2 --- /dev/null +++ b/fish/.config/fish/functions/fish_title.fish @@ -0,0 +1,30 @@ +# See "Title options" in README.md for configuration options + +function __bobthefish_title_user -S -d 'Display actual user if different from $default_user' + if [ "$theme_title_display_user" = 'yes' ] + if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] + set -l IFS . + uname -n | read -l host __ + echo -ns (whoami) '@' $host ' ' + end + end +end + +function fish_title + __bobthefish_title_user + + if [ "$theme_title_display_process" = 'yes' ] + status current-command + + [ "$theme_title_display_path" != 'no' ] + and echo ' ' + end + + if [ "$theme_title_display_path" != 'no' ] + if [ "$theme_title_use_abbreviated_path" = 'no' ] + echo $PWD + else + prompt_pwd + end + end +end diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..c8ff111 --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,5 @@ +[user] + email = dorozhenkov9@gmail.com + name = Rabbit +[core] + editor = nvim diff --git a/hypr/.config/hypr/animations.conf b/hypr/.config/hypr/animations.conf new file mode 100644 index 0000000..99cd01a --- /dev/null +++ b/hypr/.config/hypr/animations.conf @@ -0,0 +1,36 @@ +animations { + enabled = yes, please :) + + # Animations curves + bezier = linear, 0, 0, 1, 1 + bezier = md3_standard, 0.2, 0, 0, 1 + bezier = md3_decel, 0.05, 0.7, 0.1, 1 + bezier = md3_accel, 0.3, 0, 0.8, 0.15 + bezier = overshot, 0.05, 0.9, 0.1, 1.1 + bezier = crazyshot, 0.1, 1.5, 0.76, 0.92 + bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0 + bezier = menu_decel, 0.1, 1, 0, 1 + bezier = menu_accel, 0.38, 0.04, 1, 0.07 + bezier = easeInOutCirc, 0.85, 0, 0.15, 1 + bezier = easeOutCirc, 0, 0.55, 0.45, 1 + bezier = easeOutExpo, 0.16, 1, 0.3, 1 + bezier = softAcDecel, 0.26, 0.26, 0.15, 1 + bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration + + # Animation configs + animation = windows, 1, 3, md3_decel, popin 60% + animation = windowsIn, 1, 3, md3_decel, popin 60% + animation = windowsOut, 1, 3, md3_accel, popin 60% + animation = border, 1, 10, default + animation = fade, 1, 3, md3_decel + animation = layers, 1, 2, md3_decel, slide + animation = layersIn, 1, 3, menu_decel, slide + animation = layersOut, 1, 1.6, menu_accel + animation = fadeLayersIn, 1, 2, menu_decel + animation = fadeLayersOut, 1, 4.5, menu_accel + animation = workspaces, 1, 7, menu_decel, slide + animation = workspaces, 1, 2.5, softAcDecel, slide + animation = workspaces, 1, 7, menu_decel, slidefade 15% + animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15% + animation = specialWorkspace, 1, 3, md3_decel, slidevert +} diff --git a/hypr/.config/hypr/bindings.conf b/hypr/.config/hypr/bindings.conf new file mode 100644 index 0000000..68b50bf --- /dev/null +++ b/hypr/.config/hypr/bindings.conf @@ -0,0 +1,10 @@ +bind = SUPER, RETURN, exec, runapp xdg-terminal-exec +bind = SUPER, E, exec, runapp nautilus +bind = SUPER, B, exec, runapp zen +bind = SUPER SHIFT, O, exec, runapp obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-transparent-visuals +bind = SUPER, T, exec, runapp Telegram +bind = SUPER, F1, exec, pkexec awg-quick up awg0 +bind = SUPER, F2, exec, pkexec awg-quick down awg0 +bind = , PRINT, exec, hyprshot -m region + +windowrule = match:class obsidian, match:fullscreen false, opacity 0.95 diff --git a/hypr/.config/hypr/hardware-bindings.conf b/hypr/.config/hypr/hardware-bindings.conf new file mode 100644 index 0000000..9156d9a --- /dev/null +++ b/hypr/.config/hypr/hardware-bindings.conf @@ -0,0 +1,14 @@ +# Multimedia keys for volume and LCD brightness +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+ +bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%- + +# Playerctl +bindl = , XF86AudioNext, exec, playerctl next +bindl = , XF86AudioPause, exec, playerctl play-pause +bindl = , XF86AudioPlay, exec, playerctl play-pause +bindl = , XF86AudioPrev, exec, playerctl previous + diff --git a/hypr/.config/hypr/hypr.conf b/hypr/.config/hypr/hypr.conf new file mode 100644 index 0000000..3844166 --- /dev/null +++ b/hypr/.config/hypr/hypr.conf @@ -0,0 +1,113 @@ +gesture = 3, horizontal, workspace + +#animations { +# enabled = yes, please :) +# +# # Default curves, see https://wiki.hypr.land/Configuring/Animations/#curves +# # NAME, X0, Y0, X1, Y1 +# bezier = easeOutQuint, 0.23, 1, 0.32, 1 +# bezier = easeInOutCubic, 0.65, 0.05, 0.36, 1 +# bezier = linear, 0, 0, 1, 1 +# bezier = almostLinear, 0.5, 0.5, 0.75, 1 +# bezier = quick, 0.15, 0, 0.1, 1 +# +# # Default animations, see https://wiki.hypr.land/Configuring/Animations/ +# # NAME, ONOFF, SPEED, CURVE, [STYLE] +# animation = global, 1, 10, default +# animation = border, 1, 5.39, easeOutQuint +# animation = windows, 1, 4.79, easeOutQuint +# animation = windowsIn, 1, 4.1, easeOutQuint, popin 87% +# animation = windowsOut, 1, 1.49, linear, popin 87% +# animation = fadeIn, 1, 1.73, almostLinear +# animation = fadeOut, 1, 1.46, almostLinear +# animation = fade, 1, 3.03, quick +# animation = layers, 1, 3.81, easeOutQuint +# animation = layersIn, 1, 4, easeOutQuint, fade +# animation = layersOut, 1, 1.5, linear, fade +# animation = fadeLayersIn, 1, 1.79, almostLinear +# animation = fadeLayersOut, 1, 1.39, almostLinear +# animation = workspaces, 1, 1.94, almostLinear, fade +# animation = workspacesIn, 1, 1.21, almostLinear, fade +# animation = workspacesOut, 1, 1.94, almostLinear, fade +# animation = zoomFactor, 1, 7, quick +#} +# +# Ref https://wiki.hypr.land/Configuring/Workspace-Rules/ +# "Smart gaps" / "No gaps when only" +# uncomment all if you wish to use that. +# workspace = w[tv1], gapsout:0, gapsin:0 +# workspace = f[1], gapsout:0, gapsin:0 +# windowrule { +# name = no-gaps-wtv1 +# match:float = false +# match:workspace = w[tv1] +# +# border_size = 0 +# rounding = 0 +# } +# +# windowrule { +# name = no-gaps-f1 +# match:float = false +# match:workspace = f[1] +# +# border_size = 0 +# rounding = 0 +# } + +# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more +#dwindle { +# pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below +# preserve_split = true # You probably want this +#} +# +## See https://wiki.hypr.land/Configuring/Master-Layout/ for more +#master { +# new_status = master +#} +# +## https://wiki.hypr.land/Configuring/Variables/#misc +#misc { +# force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers +# disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( +#} + +############################## +### WINDOWS AND WORKSPACES ### +############################## + +# See https://wiki.hypr.land/Configuring/Window-Rules/ for more +# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules + +# Example windowrules that are useful + +windowrule { + # Ignore maximize requests from all apps. You'll probably like this. + name = suppress-maximize-events + match:class = .* + + suppress_event = maximize +} + +windowrule { + # Fix some dragging issues with XWayland + name = fix-xwayland-drags + match:class = ^$ + match:title = ^$ + match:xwayland = true + match:float = true + match:fullscreen = false + match:pin = false + + no_focus = true +} + +# Hyprland-run windowrule +windowrule { + name = move-hyprland-run + + match:class = hyprland-run + + move = 20 monitor_h-120 + float = yes +} diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf new file mode 100644 index 0000000..4a6e12f --- /dev/null +++ b/hypr/.config/hypr/hyprland.conf @@ -0,0 +1,12 @@ +monitor = eDP-1, 1920x1080@60, 0x0, 1 +watchdog_timeout = 0 +misc:vfr = true + +source = ~/.config/hypr/input.conf +source = ~/.config/hypr/hardware-bindings.conf +source = ~/.config/hypr/tiling.conf +source = ~/.config/hypr/bindings.conf +source = ~/.config/hypr/looknfeel.conf +source = ~/.config/hypr/animations.conf +source = ~/.config/hypr/rules.conf +#source = ~/.config/hypr/hypr.conf diff --git a/hypr/.config/hypr/input.conf b/hypr/.config/hypr/input.conf new file mode 100644 index 0000000..06ae895 --- /dev/null +++ b/hypr/.config/hypr/input.conf @@ -0,0 +1,12 @@ +input { + kb_layout = us,ru + kb_options = grp:alt_caps_toggle,compose:ralt + + sensitivity = 0.5 + follow_mouse = 1 + + touchpad { + natural_scroll = true + middle_button_emulation = true + } +} diff --git a/hypr/.config/hypr/looknfeel.conf b/hypr/.config/hypr/looknfeel.conf new file mode 100644 index 0000000..587257c --- /dev/null +++ b/hypr/.config/hypr/looknfeel.conf @@ -0,0 +1,69 @@ +general { + border_size = 3 + gaps_in = 6 + gaps_out = 3 + + resize_on_border = true + layout = dwindle + + col.active_border = rgba(7aa2f7ee) + col.inactive_border = rgba(292e42ee) + + snap { + enabled = true + monitor_gap = 20 + respect_gaps = true + } +} + +decoration { + rounding = 8 + border_part_of_window = false + blur { + enabled = true + size = 4 + passes = 2 + popups = true + special = true + brightness = 0.75 + } + + shadow { + enabled = true + range = 6 + render_power = 3 + color = rgba(595959aa) + } +} + +dwindle { + pseudotile = true + preserve_split = true +} + +exec-once = runapp swww-daemon +misc { + disable_hyprland_logo = true + background_color = 0 + + #enable_swallow = true + #swallow_regex = ^(kitty)$ + #swallow_exception_regex = kitty + focus_on_activate = true +} + +ecosystem:no_donation_nag = true + +cursor { + inactive_timeout = 30 + warp_on_change_workspace = 1 + hide_on_key_press = true +} + +render { + cm_sdr_eotf = 2 + new_render_scheduling = true +} +xwayland:force_zero_scaling = true + +#layout:single_window_aspect_ratio = 16 9 diff --git a/hypr/.config/hypr/rules.conf b/hypr/.config/hypr/rules.conf new file mode 100644 index 0000000..e69de29 diff --git a/hypr/.config/hypr/tiling.conf b/hypr/.config/hypr/tiling.conf new file mode 100644 index 0000000..d64c567 --- /dev/null +++ b/hypr/.config/hypr/tiling.conf @@ -0,0 +1,101 @@ +bind = SUPER, W, killactive, +bind = SUPER, P, pseudo, +bind = SUPER, J, togglesplit, +bind = SUPER, F, togglefloating, +bind = SUPER, H, resizewindowpixel,100 100, +bind = SUPER SHIFT, F, fullscreenstate, 3 3 +bind = SUPER ALT, F, fullscreenstate, 1 1 + +bind = SUPER, O, togglefloating, +bind = SUPER, O, pin, + +# Move focus +bind = SUPER, left, movefocus, l +bind = SUPER, right, movefocus, r +bind = SUPER, up, movefocus, u +bind = SUPER, down, movefocus, d + +# Cycle through applications on active workspace (ПЕРЕРАБОТАТЬ) +bind = ALT, TAB, cyclenext, +bind = ALT SHIFT, TAB, cyclenext, prev +bind = ALT, TAB, bringactivetotop, +bind = ALT SHIFT, TAB, bringactivetotop, + +# Switch workspaces +bind = SUPER, 1, workspace, 1 +bind = SUPER, 2, workspace, 2 +bind = SUPER, 3, workspace, 3 +bind = SUPER, 4, workspace, 4 +bind = SUPER, 5, workspace, 5 +bind = SUPER, 6, workspace, 6 +bind = SUPER, 7, workspace, 7 +bind = SUPER, 8, workspace, 8 +bind = SUPER, 9, workspace, 9 +bind = SUPER, 0, workspace, 10 + +# TAB between workspaces +bind = SUPER, TAB, workspace, e+1 +bind = SUPER SHIFT, TAB, workspace, e-1 +bind = SUPER ALT, TAB, workspace, previous + +# Scroll through existing workspaces +bind = SUPER, mouse_down, workspace, e+1 +bind = SUPER, mouse_up, workspace, e-1 + +# Swap active window +bind = SUPER SHIFT, left, swapwindow, l +bind = SUPER SHIFT, right, swapwindow, r +bind = SUPER SHIFT, up, swapwindow, u +bind = SUPER SHIFT, down, swapwindow, d + +#Move window with mouse +bindm = SUPER, mouse:272, movewindow + +# Move active window to a workspace +bind = SUPER SHIFT, 1, movetoworkspace, 1 +bind = SUPER SHIFT, 2, movetoworkspace, 2 +bind = SUPER SHIFT, 3, movetoworkspace, 3 +bind = SUPER SHIFT, 4, movetoworkspace, 4 +bind = SUPER SHIFT, 5, movetoworkspace, 5 +bind = SUPER SHIFT, 6, movetoworkspace, 6 +bind = SUPER SHIFT, 7, movetoworkspace, 7 +bind = SUPER SHIFT, 8, movetoworkspace, 8 +bind = SUPER SHIFT, 9, movetoworkspace, 9 +bind = SUPER SHIFT, 0, movetoworkspace, 10 + +# Move active window silently to a workspace +bind = SUPER SHIFT ALT, 1, movetoworkspacesilent, 1 +bind = SUPER SHIFT ALT, 2, movetoworkspacesilent, 2 +bind = SUPER SHIFT ALT, 3, movetoworkspacesilent, 3 +bind = SUPER SHIFT ALT, 4, movetoworkspacesilent, 4 +bind = SUPER SHIFT ALT, 5, movetoworkspacesilent, 5 +bind = SUPER SHIFT ALT, 6, movetoworkspacesilent, 6 +bind = SUPER SHIFT ALT, 7, movetoworkspacesilent, 7 +bind = SUPER SHIFT ALT, 8, movetoworkspacesilent, 8 +bind = SUPER SHIFT ALT, 9, movetoworkspacesilent, 9 +bind = SUPER SHIFT ALT, 0, movetoworkspacesilent, 10 + +# Special workspace (scratchpad) +bind = SUPER, S, togglespecialworkspace, scratchpad +bind = SUPER SHIFT, S, movetoworkspace, special:scratchpad + +# ДОБАВИТЬ КОНФИГУРАЦИЮ ДЛЯ НЕСКОЛЬКИХ МОНИТОРОВ +# ДОБАВИТЬ КОНФИГУРАЦИЮ ГРУПП + +# Resize +bind = ALT, R, submap, resize +submap = resize + +binde = , right, resizeactive, 10 0 +binde = , left, resizeactive, -10 0 +binde = , up, resizeactive, 0 -10 +binde = , down, resizeactive, 0 10 +binde = SHIFT, right, resizeactive, 100 0 +binde = SHIFT, left, resizeactive, -100 0 +binde = SHIFT, up, resizeactive, 0 -100 +binde = SHIFT, down, resizeactive, 0 100 + +bind = , escape, submap, reset +submap = reset + +bindm = SUPER, mouse:273, resizewindow diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..a2b3d36 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,11 @@ +vim.o.number = true +vim.o.relativenumber = true +vim.o.cursorline = true +vim.o.wrap = false +vim.o.tabstop = 2 +vim.o.softtabstop = 2 +vim.o.shiftwidth = 2 +vim.g.mapleader = " " + +-- Plugins bootstrap +require("config.lazy") diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..67617db --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,10 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..5e6c81b --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,29 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import plugins + { import = "plugins" }, + }, + -- Configure any other settings. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "tokyonight" } }, + -- automatically check for plugin updates + checker = { enabled = true, notify = true }, +}) diff --git a/nvim/.config/nvim/lua/plugins/line.lua b/nvim/.config/nvim/lua/plugins/line.lua new file mode 100644 index 0000000..b9b4d36 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/line.lua @@ -0,0 +1,62 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = function() + return { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, -- ~60fps + events = { + 'WinEnter', + 'BufEnter', + 'BufWritePost', + 'SessionLoadPost', + 'FileChangedShellPost', + 'VimResized', + 'Filetype', + 'CursorMoved', + 'CursorMovedI', + 'ModeChanged', + }, + }, + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end + } +} diff --git a/nvim/.config/nvim/lua/plugins/noice.lua b/nvim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..3f76046 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,15 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + } +} diff --git a/nvim/.config/nvim/lua/plugins/theme.lua b/nvim/.config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..1d8545a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/theme.lua @@ -0,0 +1,14 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + if os.getenv("TERM") ~= "linux" then + vim.cmd.colorscheme("tokyonight-storm") + end + end + } +} + diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..205da0a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,18 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)" + } + }, +} diff --git a/zellij/.config/zellij/config.kdl b/zellij/.config/zellij/config.kdl new file mode 100644 index 0000000..1b3fca2 --- /dev/null +++ b/zellij/.config/zellij/config.kdl @@ -0,0 +1,536 @@ +// +// THIS FILE WAS AUTOGENERATED BY ZELLIJ, THE PREVIOUS FILE AT THIS LOCATION WAS COPIED TO: /home/arch/.config/zellij/config.kdl.bak +// +theme "tokyonight_storm" +keybinds clear-defaults=true { + locked { + bind "Ctrl g" { SwitchToMode "normal"; } + } + pane { + bind "left" { MoveFocus "left"; } + bind "down" { MoveFocus "down"; } + bind "up" { MoveFocus "up"; } + bind "right" { MoveFocus "right"; } + bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } + bind "d" { NewPane "down"; SwitchToMode "normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; } + bind "k" { MoveFocus "up"; } + bind "l" { MoveFocus "right"; } + bind "n" { NewPane; SwitchToMode "normal"; } + bind "p" { SwitchFocus; } + bind "Ctrl p" { SwitchToMode "normal"; } + bind "r" { NewPane "right"; SwitchToMode "normal"; } + bind "s" { NewPane "stacked"; SwitchToMode "normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "normal"; } + } + tab { + bind "left" { GoToPreviousTab; } + bind "down" { GoToNextTab; } + bind "up" { GoToPreviousTab; } + bind "right" { GoToNextTab; } + bind "1" { GoToTab 1; SwitchToMode "normal"; } + bind "2" { GoToTab 2; SwitchToMode "normal"; } + bind "3" { GoToTab 3; SwitchToMode "normal"; } + bind "4" { GoToTab 4; SwitchToMode "normal"; } + bind "5" { GoToTab 5; SwitchToMode "normal"; } + bind "6" { GoToTab 6; SwitchToMode "normal"; } + bind "7" { GoToTab 7; SwitchToMode "normal"; } + bind "8" { GoToTab 8; SwitchToMode "normal"; } + bind "9" { GoToTab 9; SwitchToMode "normal"; } + bind "[" { BreakPaneLeft; SwitchToMode "normal"; } + bind "]" { BreakPaneRight; SwitchToMode "normal"; } + bind "b" { BreakPane; SwitchToMode "normal"; } + bind "h" { GoToPreviousTab; } + bind "j" { GoToNextTab; } + bind "k" { GoToPreviousTab; } + bind "l" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "normal"; } + bind "r" { SwitchToMode "renametab"; TabNameInput 0; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "normal"; } + bind "Ctrl t" { SwitchToMode "normal"; } + bind "x" { CloseTab; SwitchToMode "normal"; } + bind "tab" { ToggleTab; } + } + resize { + bind "left" { Resize "Increase left"; } + bind "down" { Resize "Increase down"; } + bind "up" { Resize "Increase up"; } + bind "right" { Resize "Increase right"; } + bind "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + bind "=" { Resize "Increase"; } + bind "H" { Resize "Decrease left"; } + bind "J" { Resize "Decrease down"; } + bind "K" { Resize "Decrease up"; } + bind "L" { Resize "Decrease right"; } + bind "h" { Resize "Increase left"; } + bind "j" { Resize "Increase down"; } + bind "k" { Resize "Increase up"; } + bind "l" { Resize "Increase right"; } + bind "Ctrl n" { SwitchToMode "normal"; } + } + move { + bind "left" { MovePane "left"; } + bind "down" { MovePane "down"; } + bind "up" { MovePane "up"; } + bind "right" { MovePane "right"; } + bind "h" { MovePane "left"; } + bind "Ctrl h" { SwitchToMode "normal"; } + bind "j" { MovePane "down"; } + bind "k" { MovePane "up"; } + bind "l" { MovePane "right"; } + bind "n" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "tab" { MovePane; } + } + scroll { + bind "e" { EditScrollback; SwitchToMode "normal"; } + bind "s" { SwitchToMode "entersearch"; SearchInput 0; } + } + search { + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "n" { Search "down"; } + bind "o" { SearchToggleOption "WholeWord"; } + bind "p" { Search "up"; } + bind "w" { SearchToggleOption "Wrap"; } + } + session { + bind "a" { + LaunchOrFocusPlugin "zellij:about" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "c" { + LaunchOrFocusPlugin "configuration" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "Ctrl o" { SwitchToMode "normal"; } + bind "p" { + LaunchOrFocusPlugin "plugin-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "s" { + LaunchOrFocusPlugin "zellij:share" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + } + shared_except "locked" { + bind "Alt left" { MoveFocusOrTab "left"; } + bind "Alt down" { MoveFocus "down"; } + bind "Alt up" { MoveFocus "up"; } + bind "Alt right" { MoveFocusOrTab "right"; } + bind "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt =" { Resize "Increase"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Ctrl g" { SwitchToMode "locked"; } + bind "Alt h" { MoveFocusOrTab "left"; } + bind "Alt i" { MoveTab "left"; } + bind "Alt j" { MoveFocus "down"; } + bind "Alt k" { MoveFocus "up"; } + bind "Alt l" { MoveFocusOrTab "right"; } + bind "Alt n" { NewPane; } + bind "Alt o" { MoveTab "right"; } + bind "Alt p" { TogglePaneInGroup; } + bind "Alt Shift p" { ToggleGroupMarking; } + bind "Ctrl q" { Quit; } + } + shared_except "locked" "move" { + bind "Ctrl h" { SwitchToMode "move"; } + } + shared_except "locked" "session" { + bind "Ctrl o" { SwitchToMode "session"; } + } + shared_except "locked" "scroll" "search" "tmux" { + bind "Ctrl b" { SwitchToMode "tmux"; } + } + shared_except "locked" "scroll" "search" { + bind "Ctrl s" { SwitchToMode "scroll"; } + } + shared_except "locked" "tab" { + bind "Ctrl t" { SwitchToMode "tab"; } + } + shared_except "locked" "pane" { + bind "Ctrl p" { SwitchToMode "pane"; } + } + shared_except "locked" "resize" { + bind "Ctrl n" { SwitchToMode "resize"; } + } + shared_except "normal" "locked" "entersearch" { + bind "enter" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "entersearch" "renametab" "renamepane" { + bind "esc" { SwitchToMode "normal"; } + } + shared_among "pane" "tmux" { + bind "x" { CloseFocus; SwitchToMode "normal"; } + } + shared_among "scroll" "search" { + bind "PageDown" { PageScrollDown; } + bind "PageUp" { PageScrollUp; } + bind "left" { PageScrollUp; } + bind "down" { ScrollDown; } + bind "up" { ScrollUp; } + bind "right" { PageScrollDown; } + bind "Ctrl b" { PageScrollUp; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "normal"; } + bind "d" { HalfPageScrollDown; } + bind "Ctrl f" { PageScrollDown; } + bind "h" { PageScrollUp; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "l" { PageScrollDown; } + bind "Ctrl s" { SwitchToMode "normal"; } + bind "u" { HalfPageScrollUp; } + } + entersearch { + bind "Ctrl c" { SwitchToMode "scroll"; } + bind "esc" { SwitchToMode "scroll"; } + bind "enter" { SwitchToMode "search"; } + } + renametab { + bind "esc" { UndoRenameTab; SwitchToMode "tab"; } + } + shared_among "renametab" "renamepane" { + bind "Ctrl c" { SwitchToMode "normal"; } + } + renamepane { + bind "esc" { UndoRenamePane; SwitchToMode "pane"; } + } + shared_among "session" "tmux" { + bind "d" { Detach; } + } + tmux { + bind "left" { MoveFocus "left"; SwitchToMode "normal"; } + bind "down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "right" { MoveFocus "right"; SwitchToMode "normal"; } + bind "space" { NextSwapLayout; } + bind "\"" { NewPane "down"; SwitchToMode "normal"; } + bind "%" { NewPane "right"; SwitchToMode "normal"; } + bind "," { SwitchToMode "renametab"; } + bind "[" { SwitchToMode "scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "normal"; } + bind "c" { NewTab; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "l" { MoveFocus "right"; SwitchToMode "normal"; } + bind "n" { GoToNextTab; SwitchToMode "normal"; } + bind "o" { FocusNextPane; } + bind "p" { GoToPreviousTab; SwitchToMode "normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } + } +} + +// Plugin aliases - can be used to change the implementation of Zellij +// changing these requires a restart to take effect +plugins { + about location="zellij:about" + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } +} + +// Plugins to load in the background when a new session starts +// eg. "file:/path/to/my-plugin.wasm" +// eg. "https://example.com/my-plugin.wasm" +load_plugins { +} +web_client { + font "monospace" +} + +// Use a simplified UI without special fonts (arrow glyphs) +// Options: +// - true +// - false (Default) +// +// simplified_ui true + +// Choose the theme that is specified in the themes section. +// Default: default +// +// theme "dracula" + +// Choose the base input mode of zellij. +// Default: normal +// +// default_mode "locked" + +// Choose the path to the default shell that zellij will use for opening new panes +// Default: $SHELL +// +// default_shell "fish" + +// Choose the path to override cwd that zellij will use for opening new panes +// +// default_cwd "/tmp" + +// The name of the default layout to load on startup +// Default: "default" +// +// default_layout "compact" + +// The folder in which Zellij will look for layouts +// (Requires restart) +// +// layout_dir "/tmp" + +// The folder in which Zellij will look for themes +// (Requires restart) +// +// theme_dir "/tmp" + +// Toggle enabling the mouse mode. +// On certain configurations, or terminals this could +// potentially interfere with copying text. +// Options: +// - true (default) +// - false +// +// mouse_mode false + +// Toggle having pane frames around the panes +// Options: +// - true (default, enabled) +// - false +// +// pane_frames false + +// When attaching to an existing session with other users, +// should the session be mirrored (true) +// or should each user have their own cursor (false) +// (Requires restart) +// Default: false +// +// mirror_session true + +// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP +// eg. when terminal window with an active zellij session is closed +// (Requires restart) +// Options: +// - detach (Default) +// - quit +// +// on_force_close "quit" + +// Configure the scroll back buffer size +// This is the number of lines zellij stores for each pane in the scroll back +// buffer. Excess number of lines are discarded in a FIFO fashion. +// (Requires restart) +// Valid values: positive integers +// Default value: 10000 +// +// scroll_buffer_size 10000 + +// Provide a command to execute when copying text. The text will be piped to +// the stdin of the program to perform the copy. This can be used with +// terminal emulators which do not support the OSC 52 ANSI control sequence +// that will be used by default if this option is not set. +// Examples: +// +// copy_command "xclip -selection clipboard" // x11 +// copy_command "wl-copy" // wayland +// copy_command "pbcopy" // osx +// +// copy_command "pbcopy" + +// Choose the destination for copied text +// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. +// Does not apply when using copy_command. +// Options: +// - system (default) +// - primary +// +// copy_clipboard "primary" + +// Enable automatic copying (and clearing) of selection when releasing mouse +// Default: true +// +// copy_on_select true + +// Path to the default editor to use to edit pane scrollbuffer +// Default: $EDITOR or $VISUAL +// scrollback_editor "/usr/bin/vim" + +// A fixed name to always give the Zellij session. +// Consider also setting `attach_to_session true,` +// otherwise this will error if such a session exists. +// Default: +// +// session_name "My singleton session" + +// When `session_name` is provided, attaches to that session +// if it is already running or creates it otherwise. +// Default: false +// +// attach_to_session true + +// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible +// Options: +// - true (default) +// - false +// +// auto_layout false + +// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected +// Options: +// - true (default) +// - false +// +// session_serialization false + +// Whether pane viewports are serialized along with the session, default is false +// Options: +// - true +// - false (default) +// +// serialize_pane_viewport false + +// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 +// defaults to the scrollback size. If this number is higher than the scrollback size, it will +// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. +// +// scrollback_lines_to_serialize 10000 + +// Enable or disable the rendering of styled and colored underlines (undercurl). +// May need to be disabled for certain unsupported terminals +// (Requires restart) +// Default: true +// +// styled_underlines false + +// How often in seconds sessions are serialized +// +// serialization_interval 10000 + +// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know +// metadata info on this session) +// (Requires restart) +// Default: false +// +// disable_session_metadata false + +// Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it) +// (Requires restart) +// Default: true (if the host terminal supports it) +// +// support_kitty_keyboard_protocol false +// Whether to make sure a local web server is running when a new Zellij session starts. +// This web server will allow creating new sessions and attaching to existing ones that have +// opted in to being shared in the browser. +// When enabled, navigate to http://127.0.0.1:8082 +// (Requires restart) +// +// Note: a local web server can still be manually started from within a Zellij session or from the CLI. +// If this is not desired, one can use a version of Zellij compiled without +// `web_server_capability` +// +// Possible values: +// - true +// - false +// Default: false +// +// web_server false +// Whether to allow sessions started in the terminal to be shared through a local web server, assuming one is +// running (see the `web_server` option for more details). +// (Requires restart) +// +// Note: This is an administrative separation and not intended as a security measure. +// +// Possible values: +// - "on" (allow web sharing through the local web server if it +// is online) +// - "off" (do not allow web sharing unless sessions explicitly opt-in to it) +// - "disabled" (do not allow web sharing and do not permit sessions started in the terminal to opt-in to it) +// Default: "off" +// +// web_sharing "off" +// A path to a certificate file to be used when setting up the web client to serve the +// connection over HTTPs +// +// web_server_cert "/path/to/cert.pem" +// A path to a key file to be used when setting up the web client to serve the +// connection over HTTPs +// +// web_server_key "/path/to/key.pem" +/// Whether to enforce https connections to the web server when it is bound to localhost +/// (127.0.0.0/8) +/// +/// Note: https is ALWAYS enforced when bound to non-local interfaces +/// +/// Default: false +// +// enforce_https_for_localhost false + +// Whether to stack panes when resizing beyond a certain size +// Default: true +// +// stacked_resize false + +// Whether to show tips on startup +// Default: true +// +show_startup_tips false + +// Whether to show release notes on first version run +// Default: true +// +// show_release_notes false + +// Whether to enable mouse hover effects and pane grouping functionality +// default is true +// advanced_mouse_actions false + +// The ip address the web server should listen on when it starts +// Default: "127.0.0.1" +// (Requires restart) +// web_server_ip "127.0.0.1" + +// The port the web server should listen on when it starts +// Default: 8082 +// (Requires restart) +// web_server_port 8082 + +// A command to run (will be wrapped with sh -c and provided the RESURRECT_COMMAND env variable) +// after Zellij attempts to discover a command inside a pane when resurrecting sessions, the STDOUT +// of this command will be used instead of the discovered RESURRECT_COMMAND +// can be useful for removing wrappers around commands +// Note: be sure to escape backslashes and similar characters properly +// post_command_discovery_hook "echo $RESURRECT_COMMAND | sed " diff --git a/zellij/.config/zellij/themes/tokyonight_storm.kdl b/zellij/.config/zellij/themes/tokyonight_storm.kdl new file mode 100644 index 0000000..9ebad86 --- /dev/null +++ b/zellij/.config/zellij/themes/tokyonight_storm.kdl @@ -0,0 +1,22 @@ +// Tokyonight Zellij Colors +// Add this file to your `CONFIG_DIR/themes` directory as described here: +// https://zellij.dev/documentation/themes#getting-zellij-to-pick-up-the-theme + +themes { + tokyonight_storm { + fg "#c0caf5" + bg "#292e42" + // Black should match the terminal background color + // This ensures the top and bottom bars are transparent + black "#24283b" + red "#f7768e" + green "#9ece6a" + yellow "#e0af68" + blue "#7aa2f7" + magenta "#bb9af7" + cyan "#7dcfff" + white "#a9b1d6" + orange "#ff9e64" + } +} +