From bb73d4102e55eb5455e5248d44ebb24860afe9bb Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 7 Oct 2023 01:44:29 -0400 Subject: [PATCH] feat(bash): add starship prompt --- config/ags/TODO | 2 ++ config/bash/bashrc | 2 +- nixos/configuration.nix | 9 ++++-- nixos/home/bashdots.nix | 64 +++++++++++++++++++++++++++++++++++++++++ nixos/home/dotfiles.nix | 16 +++++++++++ 5 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 config/ags/TODO diff --git a/config/ags/TODO b/config/ags/TODO new file mode 100644 index 00000000..7ed31011 --- /dev/null +++ b/config/ags/TODO @@ -0,0 +1,2 @@ +On fullscreen, make bar disappear (opacity 0) +Click to reappear diff --git a/config/bash/bashrc b/config/bash/bashrc index 515c9fc5..30f778c6 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -26,7 +26,7 @@ set_prompt() { PS1="╭╴$USER_COLOR\u$HOST_COLOR@\h$BRANCH$WHITE:$PURPLE\w$WHITE $LEVEL $STATUS\n╰╴$ " } -PROMPT_COMMAND="set_prompt \$?; history -a" +PROMPT_COMMAND="history -a" #PATH manipulations diff --git a/nixos/configuration.nix b/nixos/configuration.nix index d734a2a2..e0cf74f7 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { imports = [ @@ -20,9 +20,12 @@ # Select internationalisation properties. i18n.defaultLocale = "en_CA.UTF-8"; console = { - #font = "Lat2-Terminus16"; keyMap = "ca"; - #useXkbConfig = true; # use xkbOptions in tty. + }; + services.kmscon = { + enable = true; + hwRender = true; + extraOptions = "--font-size 12.5 --font-dpi 170 --font-name 'JetBrainsMono Nerd Font'"; }; nixpkgs.config.allowUnfree = true; diff --git a/nixos/home/bashdots.nix b/nixos/home/bashdots.nix index aeb0b5d7..808089e8 100644 --- a/nixos/home/bashdots.nix +++ b/nixos/home/bashdots.nix @@ -1,6 +1,70 @@ { lib, ... }: { + programs.starship = { + enable = true; + enableBashIntegration = true; + settings = { + format = lib.concatStrings [ + "╭╴" + "[](fg:#bd93f9)" + "[  ](bg:#bd93f9 fg:#090c0c)" + "[](bg:#715895 fg:#bd93f9)" + "$username$hostname" + "[](fg:#715895 bg:#382c4a)" + "$directory" + "[](fg:#382c4a bg:#120e18)" + "$git_branch" + "[](fg:#120e18)" + "\n╰╴$shlvl$character" + ]; + + username = { + show_always = true; + style_user = "fg:#e3e5e5 bg:#715895"; + format = "[ $user]($style)"; + }; + + hostname = { + ssh_only = false; + style = "fg:#e3e5e5 bg:#715895"; + format = "[@$hostname ]($style)"; + }; + + shlvl = { + disabled = false; + repeat = true; + symbol = "󰔳 "; + format = "[$symbol]($style)"; + threshold = 1; + }; + + character = { + success_symbol = "[\\$](bold green)"; + error_symbol = "[\\$](bold red)"; + }; + + directory = { + style = "fg:#bd93f9 bg:#382c4a"; + format = "[ $path ]($style)"; + truncate_to_repo = false; + }; + + directory.substitutions = { + "Documents" = "󰈙 "; + "Downloads" = " "; + "Music" = " "; + "Pictures" = " "; + }; + + git_branch = { + style = "fg:#715895 bg:#120e18"; + symbol = ""; + format = "[ $symbol $branch ]($style)"; + }; + }; + }; + programs.bash = { # TODO: deal with root dotfiles enable = true; enableCompletion = true; diff --git a/nixos/home/dotfiles.nix b/nixos/home/dotfiles.nix index 86221141..5a28afd9 100644 --- a/nixos/home/dotfiles.nix +++ b/nixos/home/dotfiles.nix @@ -122,6 +122,22 @@ in opacity = 0.8; }; + font = { + normal = { + family = "JetBrainsMono Nerd Font"; + style = "Regular"; + }; + bold = { + family = "JetBrainsMono Nerd Font"; + style = "Bold"; + }; + italic = { + family = "JetBrainsMono Nerd Font"; + style = "Italic"; + }; + size = 12.5; + }; + # https://github.com/dracula/alacritty/blob/05faff15c0158712be87d200081633d9f4850a7d/dracula.yml colors = { primary = {