Improve install script and add support for Hyprland on Fedora
This commit is contained in:
@@ -31,7 +31,7 @@ $colorpicker = hyprpicker
|
|||||||
# exec-once = nm-applet &
|
# exec-once = nm-applet &
|
||||||
exec-once = dunst
|
exec-once = dunst
|
||||||
exec-once = hyprpaper
|
exec-once = hyprpaper
|
||||||
exec-once = hyprpolkitagent
|
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||||
exec-once = udiskie
|
exec-once = udiskie
|
||||||
exec-once = waybar
|
exec-once = waybar
|
||||||
|
|
||||||
|
|||||||
125
install.sh
125
install.sh
@@ -47,41 +47,33 @@ PURPLE='\033[0;35m'
|
|||||||
CYAN='\033[0;36m'
|
CYAN='\033[0;36m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# Clone Dotfiles if not already present
|
||||||
|
cd $HOME/dotfiles
|
||||||
|
if [ $(pwd) != "$HOME/dotfiles" ]; then
|
||||||
|
echo -e "${YELLOW}[+] Cloning dotfiles repository...${NC}"
|
||||||
|
git clone https://github.com/TrudeEH/dotfiles --depth 1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}[E] Error cloning dotfiles repository. Exiting...${NC}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
cd dotfiles
|
||||||
|
echo -e "${GREEN}[I] dotfiles repository cloned successfully.${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}[I] dotfiles repository already present.${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
source ./scripts/p.sh
|
||||||
|
packageManagers=($(pcheck))
|
||||||
|
|
||||||
echo -e "${CYAN}"
|
echo -e "${CYAN}"
|
||||||
echo "####################"
|
echo "####################"
|
||||||
echo -n "#"
|
echo -n "#"
|
||||||
echo -e "${PURPLE} Trude's Dotfiles${CYAN} #"
|
echo -e "${PURPLE} Trude's Dotfiles${CYAN} #"
|
||||||
echo "####################"
|
echo "####################"
|
||||||
echo -e "${CYAN}Running on: ${PURPLE}$OSTYPE${NC}"
|
echo -e "${CYAN}Running on: ${PURPLE}$OSTYPE${NC}"
|
||||||
|
echo -e "${CYAN}Package managers: ${PURPLE}${packageManagers[@]}${NC}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Detect package managers and update repositories
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
||||||
if ! command -v brew >/dev/null 2>&1; then
|
|
||||||
echo -e "${YELLOW}[+] Installing Homebrew...${NC}"
|
|
||||||
chsh -s /bin/bash # Switch to bash (optional)
|
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
||||||
fi
|
|
||||||
pkg_manager="brew"
|
|
||||||
echo -e "${YELLOW}[+] Updating Homebrew repositories...${NC}"
|
|
||||||
brew update
|
|
||||||
elif command -v apt >/dev/null 2>&1; then
|
|
||||||
pkg_manager="apt"
|
|
||||||
echo -e "${YELLOW}[+] Updating APT repositories...${NC}"
|
|
||||||
sudo apt update
|
|
||||||
elif command -v dnf >/dev/null 2>&1; then
|
|
||||||
pkg_manager="dnf"
|
|
||||||
echo -e "${YELLOW}[+] Updating DNF repositories...${NC}"
|
|
||||||
sudo dnf update
|
|
||||||
elif command -v pacman >/dev/null 2>&1; then
|
|
||||||
pkg_manager="pacman"
|
|
||||||
echo -e "${YELLOW}[+] Updating PACMAN repositories...${NC}"
|
|
||||||
sudo pacman -Sy
|
|
||||||
else
|
|
||||||
echo -e "${RED}[E] No supported package manager found. Exiting...${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install Programs
|
# Install Programs
|
||||||
programs=(neovim curl git tmux bmon fzf gcc make gpg)
|
programs=(neovim curl git tmux bmon fzf gcc make gpg)
|
||||||
|
|
||||||
@@ -99,67 +91,32 @@ if $desktop; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if $hyprland; then
|
if $hyprland; then
|
||||||
programs+=(
|
if [[ " ${packageManagers[@]} " =~ "dnf" || " ${packageManagers[@]} " =~ "pacman" ]]; then
|
||||||
dunst # Notifications
|
programs+=(
|
||||||
foot # Terminal
|
dunst # Notifications
|
||||||
hyprland # Window manager
|
foot # Terminal
|
||||||
hyprlock # Screen locker
|
hyprland # Window manager
|
||||||
hyprpaper # Wallpaper manager
|
hyprlock # Screen locker
|
||||||
hyprpicker # Color picker
|
hyprpaper # Wallpaper manager
|
||||||
hyprpolkitagent # Auth pop-up for sudo access
|
hyprpicker # Color picker
|
||||||
network-manager # Network manager
|
polkit-gnome # Auth pop-up for sudo access
|
||||||
pipewire # Audio server
|
nautilus # File manager
|
||||||
udiskie # Automount USB drives
|
network-manager # Network manager
|
||||||
waybar # Status bar
|
pipewire # Audio server
|
||||||
wireplumber # PipeWire session manager
|
udiskie # Automount USB drives
|
||||||
wofi # Launcher
|
waybar # Status bar
|
||||||
xdg-desktop-portal-hyprland # D-Bus support for Hyprland
|
wireplumber # PipeWire session manager
|
||||||
|
wofi # Launcher
|
||||||
nautilus # File manager
|
xdg-desktop-portal-hyprland # D-Bus support for Hyprland programs
|
||||||
|
)
|
||||||
qt5-wayland # Qt5 Wayland support
|
|
||||||
qt6-wayland # Qt6 Wayland support
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
for prog in "${programs[@]}"; do
|
|
||||||
echo -e "${YELLOW}[+] Installing ${prog}...${NC}"
|
|
||||||
case $pkg_manager in
|
|
||||||
brew)
|
|
||||||
brew install "$prog"
|
|
||||||
;;
|
|
||||||
apt)
|
|
||||||
sudo apt install -y "$prog"
|
|
||||||
;;
|
|
||||||
dnf)
|
|
||||||
sudo dnf install -y "$prog"
|
|
||||||
;;
|
|
||||||
pacman)
|
|
||||||
sudo pacman -S --needed --noconfirm "$prog"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo -e "${RED}[E] Error installing ${prog}.${NC}"
|
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}[I] ${prog} installed successfully.${NC}"
|
echo -e "${RED}[E] Hyprland not available in your distro's repositories.${NC}"
|
||||||
|
exit 3
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Clone Dotfiles if not already present
|
|
||||||
cd $HOME/dotfiles
|
|
||||||
if [ $(pwd) != "$HOME/dotfiles" ]; then
|
|
||||||
echo -e "${YELLOW}[+] Cloning dotfiles repository...${NC}"
|
|
||||||
git clone https://github.com/TrudeEH/dotfiles --depth 1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo -e "${RED}[E] Error cloning dotfiles repository. Exiting...${NC}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
cd dotfiles
|
|
||||||
echo -e "${GREEN}[I] dotfiles repository cloned successfully.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${GREEN}[I] dotfiles repository already present.${NC}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
p i ${programs[@]}
|
||||||
|
|
||||||
# Copy files
|
# Copy files
|
||||||
echo -e "${YELLOW}[+] Installing Dotfiles...${NC}"
|
echo -e "${YELLOW}[+] Installing Dotfiles...${NC}"
|
||||||
cp -r $HOME/dotfiles/home/. $HOME
|
cp -r $HOME/dotfiles/home/. $HOME
|
||||||
|
|||||||
39
scripts/p.sh
39
scripts/p.sh
@@ -16,24 +16,29 @@ UNDERLINE="\e[4m"
|
|||||||
|
|
||||||
ENDCOLOR="\e[0m"
|
ENDCOLOR="\e[0m"
|
||||||
|
|
||||||
|
pcheck() {
|
||||||
|
local pms=()
|
||||||
|
if command -v flatpak >/dev/null 2>&1; then
|
||||||
|
pms+=("flatpak")
|
||||||
|
fi
|
||||||
|
if command -v nix >/dev/null 2>&1; then
|
||||||
|
pms+=("nix")
|
||||||
|
fi
|
||||||
|
if command -v brew >/dev/null 2>&1; then
|
||||||
|
pms+=("brew")
|
||||||
|
fi
|
||||||
|
if command -v apt >/dev/null 2>&1; then
|
||||||
|
pms+=("apt")
|
||||||
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
|
pms+=("pacman")
|
||||||
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
|
pms+=("dnf")
|
||||||
|
fi
|
||||||
|
echo "${pms[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
p() (
|
p() (
|
||||||
packageManagers=()
|
packageManagers=($(pcheck))
|
||||||
if [ "$(command -v flatpak)" ]; then
|
|
||||||
packageManagers+=("flatpak")
|
|
||||||
fi
|
|
||||||
if [ "$(command -v nix)" ]; then
|
|
||||||
packageManagers+=("nix")
|
|
||||||
fi
|
|
||||||
if [ "$(command -v brew)" ]; then
|
|
||||||
packageManagers+=("brew")
|
|
||||||
fi
|
|
||||||
if [ "$(command -v apt)" ]; then
|
|
||||||
packageManagers+=("apt")
|
|
||||||
elif [ "$(command -v pacman)" ]; then
|
|
||||||
packageManagers+=("pacman")
|
|
||||||
elif [ "$(command -v dnf)" ]; then
|
|
||||||
packageManagers+=("dnf")
|
|
||||||
fi
|
|
||||||
|
|
||||||
updateP() {
|
updateP() {
|
||||||
if [[ ${packageManagers[@]} =~ "flatpak" ]]; then
|
if [[ ${packageManagers[@]} =~ "flatpak" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user