mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
kitty dotfile'
This commit is contained in:
parent
a4dbc92714
commit
9dd59f77a1
82
src/commands/kitty-setup.sh
Executable file
82
src/commands/kitty-setup.sh
Executable file
|
@ -0,0 +1,82 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
RC='\e[0m'
|
||||||
|
RED='\e[31m'
|
||||||
|
YELLOW='\e[33m'
|
||||||
|
GREEN='\e[32m'
|
||||||
|
|
||||||
|
command_exists() {
|
||||||
|
command -v $1 >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEnv() {
|
||||||
|
## Check for requirements.
|
||||||
|
REQUIREMENTS='curl groups sudo'
|
||||||
|
if ! command_exists ${REQUIREMENTS}; then
|
||||||
|
echo -e "${RED}To run me, you need: ${REQUIREMENTS}${RC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Check Package Handeler
|
||||||
|
PACKAGEMANAGER='apt-get dnf pacman zypper'
|
||||||
|
for pgm in ${PACKAGEMANAGER}; do
|
||||||
|
if command_exists ${pgm}; then
|
||||||
|
PACKAGER=${pgm}
|
||||||
|
echo -e "Using ${pgm}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "${PACKAGER}" ]; then
|
||||||
|
echo -e "${RED}Can't find a supported package manager"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Check SuperUser Group
|
||||||
|
SUPERUSERGROUP='wheel sudo root'
|
||||||
|
for sug in ${SUPERUSERGROUP}; do
|
||||||
|
if groups | grep ${sug}; then
|
||||||
|
SUGROUP=${sug}
|
||||||
|
echo -e "Super user group ${SUGROUP}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
## Check if member of the sudo group.
|
||||||
|
if ! groups | grep ${SUGROUP} >/dev/null; then
|
||||||
|
echo -e "${RED}You need to be a member of the sudo group to run me!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
DTYPE="unknown" # Default to unknown
|
||||||
|
# Use /etc/os-release for modern distro identification
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
source /etc/os-release
|
||||||
|
DTYPE=$ID
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setupKitty() {
|
||||||
|
echo "Install Kitty if not already installed..."
|
||||||
|
if ! command_exists kitty; then
|
||||||
|
case ${PACKAGER} in
|
||||||
|
pacman)
|
||||||
|
sudo ${PACKAGER} -S --noconfirm kitty
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
sudo ${PACKAGER} install -y kitty
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "Kitty is already installed."
|
||||||
|
fi
|
||||||
|
echo "Copy Kitty config files"
|
||||||
|
if [ -d "${HOME}/.config/kitty" ]; then
|
||||||
|
cp -r ${HOME}/.config/kitty {HOME}/.config/kitty-bak
|
||||||
|
fi
|
||||||
|
mkdir -p ${HOME}/.config/kitty/
|
||||||
|
wget -O ${HOME}/.config/kitty/kitty.conf https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/kitty/kitty.conf
|
||||||
|
wget -O ${HOME}/.config/kitty/nord.conf https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/kitty/nord.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEnv
|
||||||
|
setupKitty
|
0
src/commands/rofi-setup.sh
Normal file → Executable file
0
src/commands/rofi-setup.sh
Normal file → Executable file
0
src/commands/system-update.sh
Normal file → Executable file
0
src/commands/system-update.sh
Normal file → Executable file
|
@ -76,11 +76,14 @@ impl CustomList {
|
||||||
name: "Titus Dotfiles",
|
name: "Titus Dotfiles",
|
||||||
command: ""
|
command: ""
|
||||||
} => {
|
} => {
|
||||||
|
ListNode {
|
||||||
|
name: "Kitty Setup",
|
||||||
|
command: include_str!("commands/kitty-setup.sh"),
|
||||||
|
},
|
||||||
ListNode {
|
ListNode {
|
||||||
name: "Rofi Setup",
|
name: "Rofi Setup",
|
||||||
command: include_str!("commands/rofi-setup.sh"),
|
command: include_str!("commands/rofi-setup.sh"),
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// We don't get a reference, but rather an id, because references are siginficantly more
|
// We don't get a reference, but rather an id, because references are siginficantly more
|
||||||
|
|
Loading…
Reference in New Issue
Block a user