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:
parent
a16fcb9f51
commit
f72b7e6ddb
7 changed files with 25 additions and 25 deletions
|
|
@ -88,7 +88,7 @@ The solution uses Nix's conditional configuration in `home.nix`:
|
||||||
```nix
|
```nix
|
||||||
colors = let
|
colors = let
|
||||||
isLightTheme = true; # Change this to switch themes
|
isLightTheme = true; # Change this to switch themes
|
||||||
|
|
||||||
lightColors = { /* Catppuccin Latte colors */ };
|
lightColors = { /* Catppuccin Latte colors */ };
|
||||||
darkColors = { /* Catppuccin Mocha colors */ };
|
darkColors = { /* Catppuccin Mocha colors */ };
|
||||||
in if isLightTheme then lightColors else darkColors;
|
in if isLightTheme then lightColors else darkColors;
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@
|
||||||
# author: Lily Ballard
|
# author: Lily Ballard
|
||||||
# edits: DannyDannyDanny
|
# edits: DannyDannyDanny
|
||||||
# ref: stackoverflow.com/a/61262358/5684214
|
# ref: stackoverflow.com/a/61262358/5684214
|
||||||
|
|
||||||
function fish_prompt --description 'Write out the prompt'
|
function fish_prompt --description 'Write out the prompt'
|
||||||
set -l last_pipestatus $pipestatus
|
set -l last_pipestatus $pipestatus
|
||||||
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
|
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
|
||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
set -q fish_color_status
|
set -q fish_color_status
|
||||||
or set -g fish_color_status red
|
or set -g fish_color_status red
|
||||||
|
|
||||||
# Color the prompt differently when we're root
|
# Color the prompt differently when we're root
|
||||||
set -l color_cwd $fish_color_cwd
|
set -l color_cwd $fish_color_cwd
|
||||||
set -l suffix '>'
|
set -l suffix '>'
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
end
|
end
|
||||||
set suffix '#'
|
set suffix '#'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write pipestatus
|
# Write pipestatus
|
||||||
# If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it.
|
# 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
|
set -l bold_flag --bold
|
||||||
|
|
@ -49,17 +49,17 @@
|
||||||
echo -n "🐚 "
|
echo -n "🐚 "
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $nix_shell_info $suffix " "
|
echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $nix_shell_info $suffix " "
|
||||||
end
|
end
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
if test -d /opt/homebrew/bin
|
if test -d /opt/homebrew/bin
|
||||||
fish_add_path -g /opt/homebrew/bin /opt/homebrew/sbin
|
fish_add_path -g /opt/homebrew/bin /opt/homebrew/sbin
|
||||||
end
|
end
|
||||||
|
|
||||||
# Set default editor
|
# Set default editor
|
||||||
set -gx EDITOR nvim
|
set -gx EDITOR nvim
|
||||||
set -gx VISUAL nvim
|
set -gx VISUAL nvim
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
# Set this to true for light theme, false for dark theme
|
# Set this to true for light theme, false for dark theme
|
||||||
# You can change this and run 'darwin-rebuild switch' to switch themes
|
# You can change this and run 'darwin-rebuild switch' to switch themes
|
||||||
isLightTheme = true;
|
isLightTheme = true;
|
||||||
|
|
||||||
# Catppuccin Latte (Light) colors
|
# Catppuccin Latte (Light) colors
|
||||||
lightColors = {
|
lightColors = {
|
||||||
primary = { background = "0xeff1f5"; foreground = "0x4c4f69"; };
|
primary = { background = "0xeff1f5"; foreground = "0x4c4f69"; };
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
blue = "0x1e40af"; magenta = "0xea76cb"; cyan = "0x179299"; white = "0xbcc0cc";
|
blue = "0x1e40af"; magenta = "0xea76cb"; cyan = "0x179299"; white = "0xbcc0cc";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Catppuccin Mocha (Dark) colors
|
# Catppuccin Mocha (Dark) colors
|
||||||
darkColors = {
|
darkColors = {
|
||||||
primary = { background = "0x1e1e2e"; foreground = "0xcdd6f4"; };
|
primary = { background = "0x1e1e2e"; foreground = "0xcdd6f4"; };
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
nix.enable = false; # Determinate manages Nix
|
nix.enable = false; # Determinate manages Nix
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
system.primaryUser = "danny";
|
system.primaryUser = "danny";
|
||||||
|
|
||||||
# Shells & dev ergonomics
|
# Shells & dev ergonomics
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
# make default.nix in python project folders instead of using a top-level python environment manager
|
# make default.nix in python project folders instead of using a top-level python environment manager
|
||||||
# pyenv
|
# pyenv
|
||||||
# poetry
|
# poetry
|
||||||
|
|
||||||
neofetch # system info
|
neofetch # system info
|
||||||
btop # resource monitor
|
btop # resource monitor
|
||||||
tldr # community alternative to man
|
tldr # community alternative to man
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
lua << EOF
|
lua << EOF
|
||||||
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
|
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
|
||||||
local f=io.open(config_file, "r")
|
local f=io.open(config_file, "r")
|
||||||
if f~=nil then
|
if f~=nil then
|
||||||
local system_theme = f:read()
|
local system_theme = f:read()
|
||||||
-- f:close()
|
-- f:close()
|
||||||
io.close(f)
|
io.close(f)
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
print(' got:', system_theme)
|
print(' got:', system_theme)
|
||||||
print(' expected path:', file)
|
print(' expected path:', file)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
print('warning: nvim color scheme not found')
|
print('warning: nvim color scheme not found')
|
||||||
print(' expected path:', file)
|
print(' expected path:', file)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ show_usage() {
|
||||||
show_status() {
|
show_status() {
|
||||||
echo "Current theme status:"
|
echo "Current theme status:"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check Neovim theme
|
# Check Neovim theme
|
||||||
nvim_color_theme_path=~/.local/share/nvim_color_scheme
|
nvim_color_theme_path=~/.local/share/nvim_color_scheme
|
||||||
if [ -f "$nvim_color_theme_path" ]; then
|
if [ -f "$nvim_color_theme_path" ]; then
|
||||||
|
|
@ -34,7 +34,7 @@ show_status() {
|
||||||
else
|
else
|
||||||
echo " Neovim: no theme file found"
|
echo " Neovim: no theme file found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check platform-specific themes
|
# Check platform-specific themes
|
||||||
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
||||||
echo " Platform: WSL"
|
echo " Platform: WSL"
|
||||||
|
|
@ -42,12 +42,12 @@ show_status() {
|
||||||
echo " Windows system theme: managed by theme command"
|
echo " Windows system theme: managed by theme command"
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
echo " Platform: macOS"
|
echo " Platform: macOS"
|
||||||
|
|
||||||
# Check Alacritty theme from Nix config
|
# Check Alacritty theme from Nix config
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
|
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
|
||||||
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
|
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
|
||||||
|
|
||||||
if [ -f "$HOME_NIX" ]; then
|
if [ -f "$HOME_NIX" ]; then
|
||||||
if grep -q "isLightTheme = true" "$HOME_NIX"; then
|
if grep -q "isLightTheme = true" "$HOME_NIX"; then
|
||||||
echo " Alacritty: light (Catppuccin Latte)"
|
echo " Alacritty: light (Catppuccin Latte)"
|
||||||
|
|
@ -65,13 +65,13 @@ show_status() {
|
||||||
toggle_theme() {
|
toggle_theme() {
|
||||||
# Get current theme - prefer platform-specific detection
|
# Get current theme - prefer platform-specific detection
|
||||||
current_theme=""
|
current_theme=""
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
# On macOS, check the Nix config for current theme
|
# On macOS, check the Nix config for current theme
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
|
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
|
||||||
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
|
HOME_NIX="$DOTFILES_DIR/nixos/home/danny/home.nix"
|
||||||
|
|
||||||
if [ -f "$HOME_NIX" ]; then
|
if [ -f "$HOME_NIX" ]; then
|
||||||
if grep -q "isLightTheme = true" "$HOME_NIX"; then
|
if grep -q "isLightTheme = true" "$HOME_NIX"; then
|
||||||
current_theme="light"
|
current_theme="light"
|
||||||
|
|
@ -80,7 +80,7 @@ toggle_theme() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fallback to Neovim file if platform-specific detection didn't work
|
# Fallback to Neovim file if platform-specific detection didn't work
|
||||||
if [ -z "$current_theme" ]; then
|
if [ -z "$current_theme" ]; then
|
||||||
nvim_color_theme_path=~/.local/share/nvim_color_scheme
|
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
|
current_theme="light" # Default to light if no theme file exists
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine new theme
|
# Determine new theme
|
||||||
if [ "$current_theme" = "light" ]; then
|
if [ "$current_theme" = "light" ]; then
|
||||||
new_theme="dark"
|
new_theme="dark"
|
||||||
else
|
else
|
||||||
new_theme="light"
|
new_theme="light"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Toggling theme from $current_theme to $new_theme"
|
echo "Toggling theme from $current_theme to $new_theme"
|
||||||
|
|
||||||
# Call the main script with the new theme
|
# Call the main script with the new theme
|
||||||
exec "$0" "$new_theme"
|
exec "$0" "$new_theme"
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +139,7 @@ echo "Updated Neovim theme: $color_scheme"
|
||||||
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
||||||
# WSL platform - handle Windows Terminal and system theme
|
# WSL platform - handle Windows Terminal and system theme
|
||||||
echo "Detected WSL platform"
|
echo "Detected WSL platform"
|
||||||
|
|
||||||
# Check that all relevant files exist
|
# Check that all relevant files exist
|
||||||
windows_username=$(powershell.exe '$env:UserName' | tr -d '\r\n')
|
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"
|
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
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
# macOS platform - handle Alacritty theme
|
# macOS platform - handle Alacritty theme
|
||||||
echo "Detected macOS platform"
|
echo "Detected macOS platform"
|
||||||
|
|
||||||
# Use the existing Alacritty theme switching script
|
# Use the existing Alacritty theme switching script
|
||||||
alacritty_script="$DOTFILES_DIR/scripts/switch-alacritty-theme.sh"
|
alacritty_script="$DOTFILES_DIR/scripts/switch-alacritty-theme.sh"
|
||||||
if [ -f "$alacritty_script" ]; then
|
if [ -f "$alacritty_script" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue