alacritty setup

This commit is contained in:
Chris Titus 2024-07-15 14:00:04 -05:00
parent 1a05d87d94
commit fef89ef3fc
8 changed files with 159 additions and 7 deletions

View File

@ -0,0 +1,59 @@
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'
GREEN='\033[32m'
command_exists() {
which $1 >/dev/null 2>&1
}
checkEnv() {
## Check for requirements.
REQUIREMENTS='curl groups sudo'
for req in ${REQUIREMENTS}; do
if ! command_exists ${req}; then
echo "${RED}To run me, you need: ${REQUIREMENTS}${RC}"
exit 1
fi
done
## Check Package Handler
PACKAGEMANAGER='apt-get dnf pacman zypper'
for pgm in ${PACKAGEMANAGER}; do
if command_exists ${pgm}; then
PACKAGER=${pgm}
echo "Using ${pgm}"
break
fi
done
if [ -z "${PACKAGER}" ]; then
echo "${RED}Can't find a supported package manager${RC}"
exit 1
fi
## Check SuperUser Group
SUPERUSERGROUP='wheel sudo root'
for sug in ${SUPERUSERGROUP}; do
if groups | grep -q ${sug}; then
SUGROUP=${sug}
echo "Super user group ${SUGROUP}"
break
fi
done
## Check if member of the sudo group.
if ! groups | grep -q ${SUGROUP}; then
echo "${RED}You need to be a member of the sudo group to run me!${RC}"
exit 1
fi
DTYPE="unknown" # Default to unknown
# Use /etc/os-release for modern distro identification
if [ -f /etc/os-release ]; then
. /etc/os-release
DTYPE=$ID
fi
}

View File

@ -0,0 +1,85 @@
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'
GREEN='\033[32m'
command_exists() {
which $1 >/dev/null 2>&1
}
checkEnv() {
## Check for requirements.
REQUIREMENTS='curl groups sudo'
for req in ${REQUIREMENTS}; do
if ! command_exists ${req}; then
echo "${RED}To run me, you need: ${REQUIREMENTS}${RC}"
exit 1
fi
done
## Check Package Handler
PACKAGEMANAGER='apt-get dnf pacman zypper'
for pgm in ${PACKAGEMANAGER}; do
if command_exists ${pgm}; then
PACKAGER=${pgm}
echo "Using ${pgm}"
break
fi
done
if [ -z "${PACKAGER}" ]; then
echo "${RED}Can't find a supported package manager${RC}"
exit 1
fi
## Check SuperUser Group
SUPERUSERGROUP='wheel sudo root'
for sug in ${SUPERUSERGROUP}; do
if groups | grep -q ${sug}; then
SUGROUP=${sug}
echo "Super user group ${SUGROUP}"
break
fi
done
## Check if member of the sudo group.
if ! groups | grep -q ${SUGROUP}; then
echo "${RED}You need to be a member of the sudo group to run me!${RC}"
exit 1
fi
DTYPE="unknown" # Default to unknown
# Use /etc/os-release for modern distro identification
if [ -f /etc/os-release ]; then
. /etc/os-release
DTYPE=$ID
fi
}
setupAlacritty() {
echo "Install Alacritty if not already installed..."
if ! command_exists alacritty; then
case ${PACKAGER} in
pacman)
sudo ${PACKAGER} -S --noconfirm alacritty
;;
*)
sudo ${PACKAGER} install -y alacritty
;;
esac
else
echo "alacritty is already installed."
fi
echo "Copy alacritty config files"
if [ -d "${HOME}/.config/alacritty" ]; then
cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak"
fi
mkdir -p "${HOME}/.config/alacritty/"
wget -O "${HOME}/.config/alacritty/alacritty.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/alacritty.toml"
wget -O "${HOME}/.config/alacritty/nordic.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/nordic.toml"
}
checkEnv
setupAlacritty

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
RC='\e[0m'
RED='\e[31m'

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh -e
RC='\033[0m'
RED='\033[31m'
YELLOW='\033[33m'

View File

@ -72,13 +72,17 @@ impl CustomList {
name: "Titus Dotfiles",
command: ""
} => {
ListNode {
name: "Alacritty Setup",
command: include_str!("commands/dotfiles/alacritty-setup.sh"),
},
ListNode {
name: "Kitty Setup",
command: include_str!("commands/kitty-setup.sh"),
command: include_str!("commands/dotfiles/kitty-setup.sh"),
},
ListNode {
name: "Rofi Setup",
command: include_str!("commands/rofi-setup.sh"),
command: include_str!("commands/dotfiles/rofi-setup.sh"),
},
}
});