Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply iceberg color scheme on Linux console to avoid unreadable ANSI Blue #665

Merged
merged 9 commits into from
Jul 11, 2024
Merged
Prev Previous commit
Next Next commit
Enforece iceberg cheme on Linux console
kachick committed Jul 11, 2024
commit a336455d40136f99986aaa3c3fd954fbf3c6153c
2 changes: 2 additions & 0 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
@@ -127,6 +127,8 @@
${lib.getBin pkgs.coreutils}/bin/stty stop undef

source "${config.xdg.configHome}/posix_shells/shared_functions.sh"

apply_iceberg_scheme_on_linux_console
''
+ builtins.readFile ./initExtra.bash;

32 changes: 32 additions & 0 deletions home-manager/common.nix
Original file line number Diff line number Diff line change
@@ -152,6 +152,38 @@
gch() {
fc -nrl 1 | ${lib.getExe homemade-pkgs.fzf-bind-posix-shell-history-to-git-commit-message}
}

apply_iceberg_scheme_on_linux_console() {
if [ 'linux' = "$TERM" ]; then
# Blue. Mandatory to be changed from ANSI
echo -en "\e]P484a0c6"
echo -en "\e]PC91acd1"

# Black
echo -en "\e]P01e2132"
echo -en "\e]P86b7089"

# Red
echo -en "\e]P1e27878"
echo -en "\e]P9e98989"

# Green
echo -en "\e]P2b4be82"
echo -en "\e]PAc0ca8e"

# Yellow
echo -en "\e]P3e2a478"
echo -en "\e]PBe9b189"

# Magenta
echo -en "\e]P5a093c7"
echo -en "\e]PDada0d3"

# White
echo -en "\e]P7c6c8d1"
echo -en "\e]PFd2d4de"
fi
}
'';

xdg.configFile."wezterm" = {
2 changes: 2 additions & 0 deletions home-manager/zsh.nix
Original file line number Diff line number Diff line change
@@ -205,6 +205,8 @@

source_sh "${config.xdg.configHome}/posix_shells/shared_functions.sh"

apply_iceberg_scheme_on_linux_console

# https://superuser.com/a/902508/120469
# https://github.com/zsh-users/zsh-autosuggestions/issues/259
zshaddhistory() { whence ''${''${(z)1}[1]} >| /dev/null || return 1 }
3 changes: 0 additions & 3 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
@@ -373,9 +373,6 @@ in
boot.initrd.kernelModules = [ "amdgpu" ];
# https://wiki.archlinux.org/title/Linux_console
console = {
# TODO: Don't use ANSI blue. Similar as https://github.com/systemd/systemd/issues/14495
# echo -en "\e]P0403030" # Make blue bright blue

earlySetup = true;
# The font should have PSF formats. Do not specify TTF and OTF
# You can list current glyphs with `showconsolefont`