Dotfiles/setup/modules/Desktop-Enviroments/hyprland-new.sh

119 lines
5.0 KiB
Bash

#!/bin/bash
set -e
echo "=== Hyprland Environment Installer ==="
# 1. Update system and install Flatpak
echo "Updating system and installing Flatpak..."
sudo pacman -Syu --noconfirm flatpak
sudo systemctl enable --now flatpak-system-helper.service
# 2. Install required packages (from hyprland.sh)
echo "Installing required packages..."
sudo pacman -Syu --noconfirm hyprland hyprcursor wl-clipboard hyprpaper hyprlock wofi kitty dunst nwg-dock-hyprland nwg-drawer nwg-menu nwg-look python cmake meson cpio pkgconf ruby-pkg-config hyprsunset hypridle ksshaskpass nm-connection-editor network-manager-applet blueman bluez pipewire alsa-utils firefox greetd-tuigreet grim slurp gst-plugin-pipewire imagemagick nerd-fonts otf-font-awesome pipewire-alsa pipewire-jack pipewire-pulse qt5-wayland qt6-wayland swww ttf-jetbrains-mono wireplumber wofi qt6ct xdg-desktop-portal-hyprland xdg-utils xorg-server xorg-xinit papirus-icon-theme cool-retro-term units qalculate-gtk iwd dbus thunar tumbler thunar-archive-plugin thunar-shares-plugin thunar-volman hyprpicker pcmanfm-qt
# 3. Run core.sh steps (network, cron, greetd, fail2ban, udisks2)
echo "Enabling essential services..."
sudo systemctl enable NetworkManager.service
sudo systemctl enable cronie.service
sudo systemctl enable greetd.service
sudo systemctl enable fail2ban.service
sudo systemctl enable udisks2.service
# 4. Install AUR packages (from hyprland.sh)
echo "Installing AUR packages..."
yay -Syu --answerdiff None --answerclean All hyprland-workspaces bluetuith wvkbd kew wofi-calc walker-bin iwmenu bzmenu ulauncher pinta localsend
# 5. EWW bar selection and compilation (from hyprland.sh)
echo "Setting up EWW bar..."
rm -rf ~/.config/eww
read -n1 -p "Install eww bar for PC, Notebook or Tablet [P,N,T]: " doit
case $doit in
n|N) cp -rf ~/Dotfiles/desktopenvs/hyprland/eww/ ~/.config/ ;;
p|P) cp -rf ~/Dotfiles/desktopenvs/hyprland/eww-nobattery/ ~/.config/eww ;;
t|T) cp -rf ~/Dotfiles/desktopenvs/hyprland/eww-touch/ ~/.config/eww ;;
*) echo "enter a valid decision" ;;
esac
echo "Compiling EWW..."
cd ~/install-tmp
git clone https://github.com/elkowar/eww
cd eww
cargo build --release --no-default-features --features=wayland
cd target/release
chmod +x ./eww
sudo cp ./eww /usr/bin
# 6. Theme and icon setup
sudo cp -r ~/Dotfiles/gtk-themes/cyberqueer /usr/share/themes
sudo cp ~/Dotfiles/desktopenvs/hyprland/btop/themes/cyberqueer.theme /usr/share/btop/themes
sudo cp -f ~/Dotfiles/desktopenvs/hyprland/greetd-tuigreet/config.toml /etc/greetd/config.toml
sudo ln -s /usr/bin/kitty /usr/bin/xdg-terminal-exec
sudo ln /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass
# 7. Cursor setup
mkdir -p ~/.icons
wget https://github.com/guillaumeboehm/Nordzy-cursors/releases/download/v2.3.0/Nordzy-cursors-lefthand.tar.gz
tar -zxvf Nordzy-cursors-lefthand.tar.gz -C $HOME/.icons/
# 8. Enable Bluetooth and networking services
sudo systemctl enable bluez
sudo systemctl enable bluetooth.service
sudo systemctl enable iwd.service
# 9. Hyprland plugin setup
hyprpm update
hyprpm add https://github.com/hyprwm/hyprland-plugins
# 10. Copy configs (not symlink, except hypr-usr)
echo "Copying configs..."
CONFIGS=(kitty mimeapps.list walker hypr xfce4 wofi dunst alacritty nwg-dock-hyprland nwg-drawer nwg-panel ulauncher scripts btop gtk-3.0 eww eww-nobattery)
for cfg in "${CONFIGS[@]}"; do
rm -rf ~/.config/$cfg
cp -r ~/Dotfiles/desktopenvs/hyprland/$cfg ~/.config/
done
# Copy hypr-usr files as local configs
cp ~/Dotfiles/desktopenvs/hyprland/hypr-usr/* ~/.config/
# 11. Wallpaper and resources
cp ~/Dotfiles/resources/fflogo.svg ~/Pictures/fflogo.svg
wget https://cloud.abdelbaki.eu/apps/theming/image/background?v=15 -O ~/Pictures/background.jpg
# 12. Python venv setup
python -m venv ~/.config/python-script
~/.config/python-script/bin/pip install speedtest-cli requests pint simpleeval parsedatetime
# 13. Udiskie icon fix (from fix_udiskie_icons.sh)
echo "Applying Udiskie icon fix..."
PAPIRUS_DIR="/usr/share/icons/Papirus-Dark/status"
HICOLOR_DIR="/usr/share/icons/hicolor/scalable/status"
if [ ! -d "$PAPIRUS_DIR" ]; then
echo "Papirus-Dark icon directory not found. Please install Papirus icon theme."
exit 1
fi
sudo ln -sf "$PAPIRUS_DIR/checkbox-checked.svg" "$HICOLOR_DIR/udiskie-checkbox-checked.svg"
sudo ln -sf "$PAPIRUS_DIR/checkbox-unchecked.svg" "$HICOLOR_DIR/udiskie-checkbox-unchecked.svg"
sudo gtk-update-icon-cache -f -t /usr/share/icons/hicolor
echo "Udiskie icons overridden successfully with Papirus equivalents."
# 14. Enable and start udiskie
echo "Enabling and starting udiskie..."
sudo systemctl enable udiskie.service
sudo systemctl start udiskie.service
# 15. Create config update script in home directory
cat << 'EOF' > ~/update-hypr-configs.sh
#!/bin/bash
CONFIGS=(kitty mimeapps.list walker hypr xfce4 wofi dunst alacritty nwg-dock-hyprland nwg-drawer nwg-panel ulauncher scripts btop gtk-3.0 eww eww-nobattery)
for cfg in "${CONFIGS[@]}"; do
cp -r ~/Dotfiles/desktopenvs/hyprland/$cfg ~/.config/
done
echo "Configs updated!"
EOF
chmod +x ~/update-hypr-configs.sh
echo "=== Installation Complete! ==="