mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-24 14:11:55 +00:00
alacritty setup
This commit is contained in:
parent
1a05d87d94
commit
fef89ef3fc
59
src/commands/common-script.sh
Normal file
59
src/commands/common-script.sh
Normal 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
|
||||
}
|
85
src/commands/dotfiles/alacritty-setup.sh
Executable file
85
src/commands/dotfiles/alacritty-setup.sh
Executable 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
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
RC='\033[0m'
|
||||
RED='\033[31m'
|
||||
YELLOW='\033[33m'
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
RC='\033[0m'
|
||||
RED='\033[31m'
|
||||
YELLOW='\033[33m'
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
RC='\033[0m'
|
||||
RED='\033[31m'
|
||||
YELLOW='\033[33m'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
RC='\e[0m'
|
||||
RED='\e[31m'
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
RC='\033[0m'
|
||||
RED='\033[31m'
|
||||
YELLOW='\033[33m'
|
||||
|
|
|
@ -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"),
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user