Merge pull request #1 from gaurav210233/dev

Guided nstallation Script
This commit is contained in:
Gaurav Bankar
2024-08-08 23:23:23 +05:30
committed by GitHub
10 changed files with 419 additions and 14 deletions

View File

@@ -32,6 +32,78 @@ If you're new to this guide, you can start from the [Prerequisites section](docs
## Compatibility ⚙️
While this guide is created with [Arch Linux](https://archlinux.org/) in mind, it can also be helpful for users of other distributions who are familiar with their package management and system tweaking.
## Quick Installation Script 🚀
1. Clone the repository to your home folder:
```
git clone https://github.com/gaurav210233/simple-hyprland.git ~/simple-hyprland
```
2. Navigate to the installer directory:
```
cd ~/simple-hyprland/scripts/installer
```
3. Run the installation script with sudo:
```
sudo sh install.sh
```
#### Important Notes:
- This script is user-centric and allows you to choose which components to install (Everything is asked, even for the core e`).
- While the script offers flexibility, it is recommend to installing all components for the best experience, as this is already a minimal setup.
- The installation process follows the same flow as the documentation, ensuring a structured and educational approach.
- Although designed for Arch Linux, users of Arch-based distributions may also find this script helpful.
> **Note for Newcomers**: Although this script enables rapid setup, it's highly recommended to read through the documentation for those new to Hyprland. Understanding each step will greatly enhance your ability to customize and troubleshoot your environment.
### Key Bindings 🎹
After installation, you'll want to familiarize yourself with the default key bindings. Here are some essential shortcuts to get you started:
#### General
- `Super + T`: Open the terminal (`$terminal`).
- `Super + B`: Open the browser (`$browser`).
- `Super + O`: Open notes application (`$notes`).
- `Super + C`: Open the primary editor (`$editor`).
- `Super + S`: Open the alternative editor (`$editor-alt`).
- `Super + F`: Open the file manager (`$fileManager`).
- `Super + A`: Open the application menu (`$menu`).
- `Super + M`: Exit Hyprland.
#### Window Management & Workspace Navigation
- `Super + Q`: Close the active window.
- `Super + W`: Toggle floating mode for the active window.
- `Super + J`: Toggle split mode in the Dwindle layout.
- `SUPER + [Arrow Keys]`: Move focus between windows
- `SUPER + SHIFT + [Arrow Keys]`: Move active window
- `SUPER + CTRL + [Arrow Keys]`: Resize active window
- `SUPER + [1-9]`: Switch to workspace 1-9
- `SUPER + SHIFT + [1-9]`: Move active window to workspace 1-9
#### Screen Brightness, Volume and Media Control
- `Brightness Up`: Increase the screen brightness by 5%.
- `Brightness Down`: Decrease the screen brightness by 5%.
- `Volume Up`: Increase the volume by 5%.
- `Volume Down`: Decrease the volume by 5%.
- `Mic Mute`: Mute the microphone.
- `Audio Mute`: Mute the audio.
- `Play/Pause`: Toggle play/pause for media.
- `Next Track`: Skip to the next track.
- `Previous Track`: Go back to the previous track.
#### Miscellaneous
- `SUPER + L`: Lock screen
- `Super + V`: Open the clipboard history and paste the selected item.
- `Super + P`: Open the color picker and copy the selected color to the clipboard.
- `Super + L`: Lock the screen.
- `Super + Escape`: Open the logout menu.
- `Ctrl + Escape`: Toggle the Waybar (kill if running, start if not).
- `Print Screen`: Take a screenshot of the entire screen and copy it to the clipboard.
- `Super + Print Screen`: Take a screenshot of the active window and copy it to the clipboard.
- `Super + Alt + Print Screen`: Select an area to take a screenshot and copy it to the clipboard.
Make sure to have applications installed corresponding to the binds. Feel free to customize these keybindings to better suit your needs. You can customize these and add more in your Hyprland configuration file (`~/.config/hypr/hyprland.conf`).
## Credits 🙏
Many configuration parts, themes, and scripts in this guide are sourced from the community. I extend my thanks to all contributors, especially the [Hyprland project](https://github.com/hyprwm/Hyprland) and other cool repositories like [hyprdots](https://github.com/prasanthrangan/hyprdots). If you find that credit has not been given where due, please feel free to open a Pull Request (PR).

View File

@@ -65,7 +65,6 @@ exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRE
# exec-once = nm-applet &
# exec-once = waybar & hyprpaper & firefox
#############################
### ENVIRONMENT VARIABLES ###
#############################
@@ -202,7 +201,6 @@ misc {
vrr = 0
}
#############
### INPUT ###
#############
@@ -238,7 +236,6 @@ device {
sensitivity = -0.5
}
####################
### KEYBINDINGSS ###
####################
@@ -363,7 +360,6 @@ bind = , XF86MonBrightnessDown, exec, brightnessctl s 5%-
# windowrule = float, ^(kitty)$
windowrule = float, ^(jome)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
windowrulev2 = opacity 0.90 0.90,class:^(Thorium-browser)$
@@ -402,17 +398,9 @@ windowrulev2 = float,class:^(nm-applet)$
windowrulev2 = float,class:^(nm-connection-editor)$
windowrulev2 = float,class:^(org.kde.polkit-kde-authentication-agent-1)$
# windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
# layerrule = blur,waybar
layerrule = ignorezero,tofi
layerrule = ignorezero, dunst
layerrule = blur,dunst
windowrule=float, com-group_finity-mascot-Main
windowrule=noblur, com-group_finity-mascot-Main
windowrule=nofocus, com-group_finity-mascot-Main
windowrule=noshadow, com-group_finity-mascot-Main
windowrule=noborder, com-group_finity-mascot-Main
layerrule = blur,dunst

View File

@@ -39,7 +39,7 @@ label {
color = rgba(a6adc8)
font_size = 55
font_family = Fira Semibold
position = -100, -40
position = -100, 40
halign = right
valign = bottom
shadow_passes = 5

View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
log_message "Final setup script started"
print_bold_blue "\nCongratulations! Your Simple Hyprland setup is complete!"
print_bold_blue "\nRepository Information:"
echo " - GitHub Repository: https://github.com/gaurav210233/simple-hyprland"
echo " - If you found this repo helpful, please consider giving it a star on GitHub!"
print_bold_blue "\nContribute:"
echo " - Feel free to open issues, submit pull requests, or provide feedback."
echo " - Every contribution, big or small, is valuable to the community."
print_bold_blue "\nTroubleshooting:"
echo " - If you encounter any issues, please check the GitHub issues section."
echo " - Don't hesitate to open a new issue if you can't find a solution to your problem."
print_success "\nEnjoy your new Hyprland environment!"
echo "------------------------------------------------------------------------"

164
scripts/installer/helper.sh Executable file
View File

@@ -0,0 +1,164 @@
#!/bin/bash
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Log file
LOG_FILE="$SCRIPT_DIR/simple_hyprland_install.log"
function trap_message {
print_error "\n\nScript interrupted. Exiting.....\n"
# Add any cleanup code here
log_message "Script interrupted and exited"
exit 1
}
# Function to log messages
function log_message {
echo "$(date): $1" >> "$LOG_FILE"
}
# Functions for colored/bold output
function print_error {
echo -e "${RED}$1${NC}"
}
function print_success {
echo -e "${GREEN}$1${NC}"
}
function print_warning {
echo -e "${YELLOW}$1${NC}"
}
function print_info {
echo -e "${BLUE}$1${NC}"
}
function print_bold_blue {
echo -e "${BLUE}${BOLD}$1${NC}"
}
# Function to ask for confirmation
function ask_confirmation {
while true; do
read -p "$(print_warning "$1 (y/n): ")" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
log_message "Operation accepted by user."
return 0 # User confirmed
elif [[ $REPLY =~ ^[Nn]$ ]]; then
log_message "Operation cancelled by user."
print_error "Operation cancelled."
return 1 # User cancelled
else
print_error "Invalid input. Please answer y or n."
fi
done
}
# Function to run a command with optional confirmation and retry
function run_command {
local cmd="$1"
local description="$2"
local ask_confirm="${3:-yes}" # Default to asking for confirmation
local use_sudo="${4:-yes}" # Default to using sudo
local full_cmd=""
if [[ "$use_sudo" == "no" ]]; then
full_cmd="sudo -u $SUDO_USER $cmd"
else
full_cmd="$cmd"
fi
log_message "Attempting to run: $description"
print_info "\nCommand: $full_cmd"
if [[ "$ask_confirm" == "yes" ]]; then
if ! ask_confirmation "$description"; then
# print_info "$description was skipped."
log_message "$description was skipped by user choice."
return 1
fi
else
print_info "\n$description" # Echo what it's doing without confirmation
fi
while ! eval "$full_cmd"; do
print_error "Command failed."
log_message "Command failed: $cmd"
if [[ "$ask_confirm" == "yes" ]]; then
if ! ask_confirmation "Retry $description?"; then
print_warning "$description was not completed."
log_message "$description was not completed due to failure and user chose not to retry."
return 1
fi
else
print_warning "$description failed and will not be retried."
log_message "$description failed and was not retried (auto mode)."
return 1
fi
done
print_success "$description completed successfully."
log_message "$description completed successfully."
return 0
}
# Function to run a script with retry and confirmation
function run_script {
local script="$SCRIPT_DIR/$1"
local description="$2"
if ask_confirmation "\nExecute '$description' script"; then
while ! bash "$script"; do
print_error "$description script failed."
if ! ask_confirmation "Retry $description"; then
return 1 # User chose not to retry
fi
done
print_success "\n$description completed successfully."
else
return 1 # User chose not to run the script
fi
}
function check_root {
if [ "$EUID" -ne 0 ]; then
print_error "Please run as root"
log_message "Script not run as root. Exiting."
exit 1
fi
# Store the original user for later use
SUDO_USER=$(logname)
log_message "Original user is $SUDO_USER"
}
function check_os {
if [ -f /etc/os-release ]; then
. /etc/os-release
if [[ "$ID" != "arch" ]]; then
print_warning "This script is designed for Arch Linux. Your system: $PRETTY_NAME"
if ! ask_confirmation "Continue anyway?"; then
log_message "Installation cancelled due to unsupported OS"
exit 1
fi
else
print_success "Arch Linux detected. Proceeding with installation."
log_message "Arch Linux detected. Installation proceeding."
fi
else
print_error "Unable to determine OS. /etc/os-release not found."
if ! ask_confirmation "Continue anyway?"; then
log_message "Installation cancelled due to unknown OS"
exit 1
fi
fi
}

25
scripts/installer/hypr.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
log_message "Installation started for hypr section"
print_info "\nStarting hypr setup..."
print_info "\nEverything is recommended to INSTALL"
run_command "pacman -S --noconfirm hyprland" "Install Hyprland (Must)" "yes"
run_command "mkdir -p /home/$SUDO_USER/.config/hypr/ && cp -r /home/$SUDO_USER/simple-hyprland/configs/hypr/hyprland.conf /home/$SUDO_USER/.config/hypr/" "Copy hyprland config (Must)" "yes" "no"
run_command "pacman -S --noconfirm xdg-desktop-portal-hyprland" "Install XDG desktop portal for Hyprland" "yes"
run_command "pacman -S --noconfirm polkit-kde-agent" "Install KDE Polkit agent for authentication dialogs" "yes"
run_command "pacman -S --noconfirm dunst" "Install Dunst notification daemon" "yes"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/dunst /home/$SUDO_USER/.config/" "Copy dunst config" "yes" "no"
run_command "pacman -S --noconfirm qt5-wayland qt6-wayland" "Install QT support on wayland" "yes"
echo "------------------------------------------------------------------------"

31
scripts/installer/install.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
# Trap for unexpected exits
trap 'trap_message' INT TERM
# Script start
log_message "Installation started"
print_bold_blue "\nSimple Hyprland"
echo "---------------"
# Check if running as root
check_root
# Check if OS is Arch Linux
check_os
# Run child scripts
run_script "prerequisites.sh" "Prerequisites Setup"
run_script "hypr.sh" "Hyprland & Critical Softwares Setup"
run_script "utilities.sh" "Basic Utilities & Configs Setup"
run_script "theming.sh" "Themes and Tools Setup"
run_script "final.sh" "Final Setup"
print_bold_blue "\n🌟 Setup Complete\n"
log_message "Installation completed successfully"

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
log_message "Installation started for prerequisites section"
print_info "\nStarting prerequisites setup..."
run_command "pacman -Syyu --noconfirm" "Update package database and upgrade packages (Recommended)" "yes" # no
if run_command "pacman -S --noconfirm --needed git base-devel" "Install YAY (Must)/Breaks the script" "yes"; then #
run_command "git clone https://aur.archlinux.org/yay.git && cd yay" "Clone YAY (Must)/Breaks the script" "no" "no"
run_command "makepkg --noconfirm -si && cd .. # builds with makepkg" "Build YAY (Must)/Breaks the script" "no" "no"
fi
run_command "pacman -S --noconfirm pipewire wireplumber" "Configuring audio (Recommended)" "yes"
run_command "pacman -S --noconfirm ttf-cascadia-code-nerd ttf-cascadia-mono-nerd ttf-fira-code ttf-fira-mono ttf-fira-sans ttf-firacode-nerd ttf-iosevka-nerd ttf-iosevkaterm-nerd ttf-jetbrains-mono-nerd ttf-jetbrains-mono ttf-nerd-fonts-symbols ttf-nerd-fonts-symbols ttf-nerd-fonts-symbols-mono" "Installing Nerd Fonts and Symbols (Recommended)" "yes"
run_command "pacman -S --noconfirm sddm && systemctl enable sddm.service" "Install and enable SDDM (Recommended)" "yes"
run_command "yay -S --sudoloop --noconfirm brave-bin" "Install Brave Browser" "yes" "no"
run_command "pacman -S --noconfirm kitty" "Install Kitty (Recommended)" "yes"
run_command "pacman -S --noconfirm nano" "Install nano" "yes"
run_command "pacman -S --noconfirm tar" "Install tar for extracting files (Must)/needed for copying themes" "yes"
echo "------------------------------------------------------------------------"

View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
log_message "Installation started for theming section"
print_info "\nStarting theming setup..."
run_command "pacman -S --noconfirm nwg-look" "Install nwg-look for GTK theme management" "yes"
run_command "pacman -S --noconfirm qt5ct qt6ct kvantum" "Install Qt5, Qt6 Settings, and Kvantum theme engines" "yes"
run_command "tar -xvf /home/$SUDO_USER/simple-hyprland/assets/themes/Catppuccin-Mocha.tar.xz -C /usr/share/themes/" "Install Catppuccin Mocha GTK theme" "yes"
run_command "tar -xvf /home/$SUDO_USER/simple-hyprland/assets/icons/Tela-circle-dracula.tar.xz -C /usr/share/icons/" "Install Tela Circle Dracula icon theme" "yes"
run_command "yay -S --sudoloop --noconfirm kvantum-theme-catppuccin-git" "Install Catppuccin theme for Kvantum" "yes" "no"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/kitty /home/$SUDO_USER/.config/" "Copy Catppuccin theme configuration for Kitty terminal" "yes" "no"
# Add instructions to configure theming
print_info "\nPost-installation instructions:"
print_bold_blue "Set themes and icons:"
echo " - Run 'nwg-look' and set the global GTK and icon theme"
echo " - Open 'kvantummanager' (run with sudo for system-wide changes) to select and apply the Catppuccin theme"
echo " - Open 'qt6ct' to set the icon theme"
echo "------------------------------------------------------------------------"

View File

@@ -0,0 +1,36 @@
#!/bin/bash
# Get the directory of the current script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Source helper file
source $SCRIPT_DIR/helper.sh
log_message "Installation started for utilities section"
print_info "\nStarting utilities setup..."
run_command "pacman -S --noconfirm waybar" "Install Waybar - Status Bar" "yes"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/waybar /home/$SUDO_USER/.config/" "Copy Waybar config" "yes" "no"
run_command "yay -S --sudoloop --noconfirm tofi" "Install Tofi - Application Launcher" "yes" "no"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/tofi /home/$SUDO_USER/.config/" "Copy Tofi config(s)" "yes" "no"
run_command "pacman -S --noconfirm cliphist" "Install Cliphist - Clipboard Manager" "yes"
run_command "yay -S --sudoloop --noconfirm swww" "Install SWWW for wallpaper management" "yes" "no"
run_command "mkdir -p /home/$SUDO_USER/.config/assets/backgrounds && cp -r /home/$SUDO_USER/simple-hyprland/assets/backgrounds /home/$SUDO_USER/.config/assets/" "Copy sample wallpapers to assets directory (Recommended)" "yes" "no"
run_command "yay -S --sudoloop --noconfirm hyprpicker" "Install Hyprpicker - Color Picker" "yes" "no"
run_command "yay -S --sudoloop --noconfirm hyprlock" "Install Hyprlock - Screen Locker (Must)" "yes" "no"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/hypr/hyprlock.conf /home/$SUDO_USER/.config/hypr/" "Copy Hyprlock config" "yes" "no"
run_command "yay -S --sudoloop --noconfirm wlogout" "Install Wlogout - Session Manager" "yes" "no"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/wlogout /home/$SUDO_USER/.config/ && cp -r /home/$SUDO_USER/simple-hyprland/assets/wlogout /home/$SUDO_USER/.config/assets/" "Copy Wlogout config and assets" "yes" "no"
run_command "yay -S --sudoloop --noconfirm grimblast" "Install Grimblast - Screenshot tool" "yes" "no"
run_command "yay -S --sudoloop --noconfirm hypridle" "Install Hypridle for idle management (Must)" "yes" "no"
run_command "cp -r /home/$SUDO_USER/simple-hyprland/configs/hypr/hypridle.conf /home/$SUDO_USER/.config/hypr/" "Copy Hypridle config" "yes" "no"
echo "------------------------------------------------------------------------"