-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a05d87
commit fef89ef
Showing
8 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
3 changes: 2 additions & 1 deletion
3
src/commands/kitty-setup.sh → src/commands/dotfiles/kitty-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
RC='\033[0m' | ||
RED='\033[31m' | ||
YELLOW='\033[33m' | ||
|
3 changes: 2 additions & 1 deletion
3
src/commands/rofi-setup.sh → src/commands/dotfiles/rofi-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
RC='\033[0m' | ||
RED='\033[31m' | ||
YELLOW='\033[33m' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
RC='\033[0m' | ||
RED='\033[31m' | ||
YELLOW='\033[33m' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
RC='\e[0m' | ||
RED='\e[31m' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
RC='\033[0m' | ||
RED='\033[31m' | ||
YELLOW='\033[33m' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters