Prefer USER to USERNAME

USERNAME seems to act weird on MacOS in scripts and nvim conifig
This commit is contained in:
Andrew Tomaka 2022-12-10 09:44:53 -05:00
parent a567fe4f12
commit fdf329b3df
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
3 changed files with 4 additions and 4 deletions

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
color_file=$HOME/.config/$USERNAME/color.yml color_file=$HOME/.config/$USER/color.yml
if ! test -f $color_file; then if ! test -f $color_file; then
mkdir -p $HOME/.config/$USERNAME mkdir -p $HOME/.config/$USER
echo light > $color_file echo light > $color_file
fi fi
old_color=$(cat $color_file) old_color=$(cat $color_file)

View file

@ -42,7 +42,7 @@ install_alacritty() {
sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install /tmp/Alacritty.desktop sudo desktop-file-install /tmp/Alacritty.desktop
sudo update-desktop-database 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 fi
} }

View file

@ -36,7 +36,7 @@ vim.api.nvim_create_autocmd({"WinLeave"}, {
--- background matching terminal --- background matching terminal
function ChangeBackground() function ChangeBackground()
local home = os.getenv("HOME") 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 file = io.open(home.."/.config/"..user.."/color.yml", "rb")
local background = file:read() local background = file:read()
file:close() file:close()