Add machine specific lazygit config

This commit is contained in:
Evie Litherland-Smith 2023-01-10 10:30:42 +00:00
parent 7fe33de53d
commit 740574a5c5
2 changed files with 32 additions and 5 deletions

9
.gitignore vendored
View file

@ -2,6 +2,9 @@
*.swp
.python-version
.DS_Store
plugin/
venv
# For Packer plugins
plugin
# For lazygit state file
state.yml
# For pynvim environment
venv

View file

@ -1,14 +1,38 @@
#! /usr/bin/env sh
# Install various dotfiles into their proper places
# Get machine for specific config locations
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
echo "Machine: ${machine}"
# .config files
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
mkdir -p "$CONFIG_DIR"
for FILE in config/*; do
FILENAME="$(basename $FILE)"
if [ ! -e "$CONFIG_DIR/$FILENAME" ]; then
if [ ! -e "$CONFIG_DIR/$FILENAME" ]
then
ln -s $(readlink -f "$FILE") "$CONFIG_DIR/$FILENAME"
echo "$(readlink -f $FILE) -> $CONFIG_DIR/$FILENAME"
fi
echo "$(readlink -f $FILE) -> $CONFIG_DIR/$FILENAME"
done
# Mac specific lazygit setup (because of course)
if [ $machine == "Mac" ]
then
rm "$CONFIG_DIR/lazygit"
echo "Removed $CONFIG_DIR/lazygit"
if [ ! -e "$HOME/Library/Application Support/lazygit" ]
then
ln -s "$(readlink -f config/lazygit)" "$HOME/Library/Application Support/lazygit"
echo "$(readlink -f config/lazygit) -> $HOME/Library/Application Support/lazygit"
fi
fi