[~] $NB_

[?] CODE / KEYBOARDS / TERMINAL / NIXOS


[M] [POSTS] [HOWTO] [WHOAMI] [PODCASTS] [KEYBOARDS]


~~ SPOOKY ~~

** A ZSH THEME **

[COD] | [20250910] | [0x17]




SPOOKY

I regularly dig through the configurations of the tools installed here on the servers and computers to see what could be improved. I noticed that I’ve been using a default Oh My ZSH theme for quite some time. It can’t stay this way and calls for a custom prompt. This is how SPOOKY came about.

SPOOKY

I have the terminal open 98% of the day to get various things done. For some time now, I’ve been using Dracula as a theme for all imaginable tools. It’s available for a wide range of tools and is available in almost all repositories. Of course, Dracula also offers its own theme (LINK), but that didn’t quite appeal to me. So, I’m building my own. The terminal prompt is not only prompt but should, of course, be as space-saving as possible while also being as informative as possible. SPOOKY should ideally display the following information: the git status, current directory, user, time, and the ssh session. For me, these are the most important information for navigating the terminal smoothly. This is what it looks like when it’s running:

SPOOKY Prompts

The prompt is divided into two parts: the left and right prompts. The left side displays the basics, such as the current directory, the git status, and the folder icon, which turns red when logged in as root. The right side displays the SSH session once logged in, the logged-in user, and the time.

REQUIREMENTS

Of course, the whole thing isn’t entirely without dependencies. However, I made sure to keep them as minimal as possible. It should be clear that you need ZSH as your shell. GIT also makes sense, because without Git, there’s no Git status. Another recommended option, even independent of this theme, is a monospace font. I personally use Berkeley Mono in a patched Nerd Font version so that the icons can be displayed without problems.

If you still experience display issues, you can easily adjust the icons in the .zsh-theme file. That’s the entire list of dependencies, and I don’t think you can keep it any more minimal given the requirements.

INSTALLATION

SPOOKY is freely available on Github. If you have any suggestions for improvements, please let us know!

MANUALLY

If you’re using ZSH without a framework (like OMZ), first create a folder named themes if it doesn’t already exist and copy the theme file into it:

1  mkdir -p ~/.zsh/themes
2  cp spooky.zsh-theme ~/.zsh/themes

Then we link the theme in the .zshrc:

1  source ~/.zsh/themes/spooky.zsh-theme 

If you prefer to work with frameworks like Oh My ZSH instead of Vanilla ZSH, you can simply copy SPOOKY into your config:

1  ZSH_THEME="spooky"

This is a bit easier on NixOS. If you’re using OMZ, simply build a derivative that pulls the theme directly from Github and sets it as the theme:

1  let
2    spookyTheme = pkgs.fetchFromGitHub {
3      owner = "nerdbude";
4      repo = "spooky";
5      rev = "main";
6      sha256 = "DF9eysodZyW0cdscvPXoakxNJrkUa/F0MT8b3X/O740="; #check the right hash here
7    };

The theme can then be defined as default for ZSH:

1  programs.zsh = {
2          enable = true;
3          ohMyZsh = {
4          enable = true;
5          custom = "${spookyTheme}";
6		  theme = "spooky";
7		  };
8	};

Then you are only one obligatory nixos-rebuild switch away from SPOOKY.

Happy Hacking!


[~] BACK