Clean up trailing whitespaces

- Remove trailing whitespaces from all .nix files
- Remove trailing whitespaces from shell scripts
- Remove trailing whitespaces from README files
- Improves code consistency and follows best practices
This commit is contained in:
DannyDannyDanny 2025-09-13 17:39:26 +02:00
parent a16fcb9f51
commit f72b7e6ddb
7 changed files with 25 additions and 25 deletions

View file

@ -88,7 +88,7 @@ The solution uses Nix's conditional configuration in `home.nix`:
```nix
colors = let
isLightTheme = true; # Change this to switch themes
lightColors = { /* Catppuccin Latte colors */ };
darkColors = { /* Catppuccin Mocha colors */ };
in if isLightTheme then lightColors else darkColors;

View file

@ -15,14 +15,14 @@
# author: Lily Ballard
# edits: DannyDannyDanny
# ref: stackoverflow.com/a/61262358/5684214
function fish_prompt --description 'Write out the prompt'
set -l last_pipestatus $pipestatus
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
set -l normal (set_color normal)
set -q fish_color_status
or set -g fish_color_status red
# Color the prompt differently when we're root
set -l color_cwd $fish_color_cwd
set -l suffix '>'
@ -32,7 +32,7 @@
end
set suffix '#'
end
# Write pipestatus
# If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it.
set -l bold_flag --bold
@ -49,17 +49,17 @@
echo -n "🐚 "
end
)
echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $nix_shell_info $suffix " "
end
'';
shellInit = ''
if test -d /opt/homebrew/bin
fish_add_path -g /opt/homebrew/bin /opt/homebrew/sbin
end
# Set default editor
set -gx EDITOR nvim
set -gx VISUAL nvim

View file

@ -158,7 +158,7 @@
# Set this to true for light theme, false for dark theme
# You can change this and run 'darwin-rebuild switch' to switch themes
isLightTheme = true;
# Catppuccin Latte (Light) colors
lightColors = {
primary = { background = "0xeff1f5"; foreground = "0x4c4f69"; };
@ -172,7 +172,7 @@
blue = "0x1e40af"; magenta = "0xea76cb"; cyan = "0x179299"; white = "0xbcc0cc";
};
};
# Catppuccin Mocha (Dark) colors
darkColors = {
primary = { background = "0x1e1e2e"; foreground = "0xcdd6f4"; };

View file

@ -6,7 +6,7 @@
nix.enable = false; # Determinate manages Nix
nixpkgs.config.allowUnfree = true;
system.primaryUser = "danny";
# Shells & dev ergonomics

View file

@ -70,7 +70,7 @@
# make default.nix in python project folders instead of using a top-level python environment manager
# pyenv
# poetry
neofetch # system info
btop # resource monitor
tldr # community alternative to man

View file

@ -16,7 +16,7 @@
lua << EOF
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
local f=io.open(config_file, "r")
if f~=nil then
if f~=nil then
local system_theme = f:read()
-- f:close()
io.close(f)
@ -29,7 +29,7 @@
print(' got:', system_theme)
print(' expected path:', file)
end
else
else
print('warning: nvim color scheme not found')
print(' expected path:', file)
end

View file

@ -25,7 +25,7 @@ show_usage() {
show_status() {
echo "Current theme status:"
echo ""
# Check Neovim theme
nvim_color_theme_path=~/.local/share/nvim_color_scheme
if [ -f "$nvim_color_theme_path" ]; then
@ -34,7 +34,7 @@ show_status() {
else
echo " Neovim: no theme file found"
fi
# Check platform-specific themes
if [[ -n "$WSL_DISTRO_NAME" ]]; then
echo " Platform: WSL"
@ -42,12 +42,12 @@ show_status() {
echo " Windows system theme: managed by theme command"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo " Platform: macOS"
# Check Alacritty theme from Nix config
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
if [ -f "$HOME_NIX" ]; then
if grep -q "isLightTheme = true" "$HOME_NIX"; then
echo " Alacritty: light (Catppuccin Latte)"
@ -65,13 +65,13 @@ show_status() {
toggle_theme() {
# Get current theme - prefer platform-specific detection
current_theme=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# On macOS, check the Nix config for current theme
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
if [ -f "$HOME_NIX" ]; then
if grep -q "isLightTheme = true" "$HOME_NIX"; then
current_theme="light"
@ -80,7 +80,7 @@ toggle_theme() {
fi
fi
fi
# Fallback to Neovim file if platform-specific detection didn't work
if [ -z "$current_theme" ]; then
nvim_color_theme_path=~/.local/share/nvim_color_scheme
@ -90,16 +90,16 @@ toggle_theme() {
current_theme="light" # Default to light if no theme file exists
fi
fi
# Determine new theme
if [ "$current_theme" = "light" ]; then
new_theme="dark"
else
new_theme="light"
fi
echo "Toggling theme from $current_theme to $new_theme"
# Call the main script with the new theme
exec "$0" "$new_theme"
}
@ -139,7 +139,7 @@ echo "Updated Neovim theme: $color_scheme"
if [[ -n "$WSL_DISTRO_NAME" ]]; then
# WSL platform - handle Windows Terminal and system theme
echo "Detected WSL platform"
# Check that all relevant files exist
windows_username=$(powershell.exe '$env:UserName' | tr -d '\r\n')
windows_terminal_settings_path="/mnt/c/Users/${windows_username}/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json"
@ -185,7 +185,7 @@ if [[ -n "$WSL_DISTRO_NAME" ]]; then
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS platform - handle Alacritty theme
echo "Detected macOS platform"
# Use the existing Alacritty theme switching script
alacritty_script="$DOTFILES_DIR/scripts/switch-alacritty-theme.sh"
if [ -f "$alacritty_script" ]; then