Prefer USER to USERNAME
USERNAME seems to act weird on MacOS in scripts and nvim conifig
This commit is contained in:
parent
a567fe4f12
commit
fdf329b3df
3 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue