From fdf329b3df468c8be7ff8787d858e0baa1d3d62c Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sat, 10 Dec 2022 09:44:53 -0500 Subject: [PATCH] Prefer USER to USERNAME USERNAME seems to act weird on MacOS in scripts and nvim conifig --- bin/bin/toggle-color-mode | 4 ++-- install.sh | 2 +- nvim/.config/nvim/lua/config.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/bin/toggle-color-mode b/bin/bin/toggle-color-mode index 827ded1..1856118 100755 --- a/bin/bin/toggle-color-mode +++ b/bin/bin/toggle-color-mode @@ -1,8 +1,8 @@ #!/bin/bash -color_file=$HOME/.config/$USERNAME/color.yml +color_file=$HOME/.config/$USER/color.yml if ! test -f $color_file; then - mkdir -p $HOME/.config/$USERNAME + mkdir -p $HOME/.config/$USER echo light > $color_file fi old_color=$(cat $color_file) diff --git a/install.sh b/install.sh index 53f26c4..956f6d9 100755 --- a/install.sh +++ b/install.sh @@ -42,7 +42,7 @@ install_alacritty() { sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg sudo desktop-file-install /tmp/Alacritty.desktop sudo update-desktop-database - sudo ln -s /home/$USERNAME/.cargo/bin/alacritty /usr/local/bin/alacritty + sudo ln -s /home/$USER/.cargo/bin/alacritty /usr/local/bin/alacritty fi } diff --git a/nvim/.config/nvim/lua/config.lua b/nvim/.config/nvim/lua/config.lua index 1773456..b46dde8 100644 --- a/nvim/.config/nvim/lua/config.lua +++ b/nvim/.config/nvim/lua/config.lua @@ -36,7 +36,7 @@ vim.api.nvim_create_autocmd({"WinLeave"}, { --- background matching terminal function ChangeBackground() local home = os.getenv("HOME") - local user = os.getenv("USERNAME") + local user = os.getenv("USER") local file = io.open(home.."/.config/"..user.."/color.yml", "rb") local background = file:read() file:close()