From ab31c829e2a16a42cc6b97c7106a95a3c9074991 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:45:41 +0900 Subject: [PATCH 1/5] Update quickshell.sh --- install-scripts/quickshell.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install-scripts/quickshell.sh b/install-scripts/quickshell.sh index fb80751..a39a915 100755 --- a/install-scripts/quickshell.sh +++ b/install-scripts/quickshell.sh @@ -7,6 +7,7 @@ if [[ $USE_PRESET = [Yy] ]]; then fi quick=( + qt6-5compat quickshell ) From c2a30d5a083760f3952149160a2864585c5fba8a Mon Sep 17 00:00:00 2001 From: mio-dokuhaki Date: Sun, 5 Oct 2025 13:06:18 +0900 Subject: [PATCH 2/5] Manually added monitor script documentation from Fedora PR #234 --- README.md | 114 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 4f0e838..3bb6eb6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ ![GitHub Repo stars](https://img.shields.io/github/stars/JaKooLit/Arch-Hyprland?style=for-the-badge&color=cba6f7) ![GitHub last commit](https://img.shields.io/github/last-commit/JaKooLit/Arch-Hyprland?style=for-the-badge&color=b4befe) ![GitHub repo size](https://img.shields.io/github/repo-size/JaKooLit/Arch-Hyprland?style=for-the-badge&color=cba6f7) -
@@ -54,45 +53,52 @@ https://github.com/user-attachments/assets/49bc12b2-abaf-45de-a21c-67aacd9bb872 ### Gallery and Videos + #### 🎥 Feb 2025 Video explanation of installation with preset + - [YOUTUBE-LINK](https://youtu.be/wQ70lo7P6vA?si=_QcbrNKh_Bg0L3wC) - [YOUTUBE-Hyprland-Playlist](https://youtube.com/playlist?list=PLDtGd5Fw5_GjXCznR0BzCJJDIQSZJRbxx&si=iaNjLulFdsZ6AV-t) - ### 🪧🪧🪧 ANNOUNCEMENT 🪧🪧🪧 + - This Repo does not contain Hyprland Dots or configs! Dotfiles can be checked here [`Hyprland-Dots`](https://github.com/JaKooLit/Hyprland-Dots) . During installation, if you opt to copy pre-configured dots, it will be downloaded from that centralized repo. -- Hyprland-Dots use are constantly evolving / improving. you can check CHANGELOGS here [`Hyprland-Dots-Changelogs`](https://github.com/JaKooLit/Hyprland-Dots/wiki/Changelogs) +- Hyprland-Dots use are constantly evolving / improving. you can check CHANGELOGS here [`Hyprland-Dots-Changelogs`](https://github.com/JaKooLit/Hyprland-Dots/wiki/Changelogs) - Since the Hyprland-Dots are evolving, some of the screenshots maybe old - the wallpaper offered to be downloaded towards the end is from this [`REPO`](https://github.com/JaKooLit/Wallpaper-Bank) > [!IMPORTANT] > install a backup tool like `snapper` or `timeshift`. and Backup your system before installing hyprland using this script (HIGHLY RECOMMENDED) -> [!CAUTION] +> [!CAUTION] > Download this script on a directory where you have write permissions. ie. HOME. Or any directory within your home directory. Else script will fail -#### 🆕 Prerequisites +#### 🆕 Prerequisites + - This install script is intended for atleast Server type / Minimal Arch Linux installed. > [!NOTE] > 🔘 Pipewire and Pipewire audio -- This script will install pipewire and will also disable or will uninstall pulseaudio. If you dont want it, edit install.sh, about line 191 and comment the line `execute_script "pipewire.sh"` or you can simply just delete pipewire.sh in install-scripts directory before installing. + +- This script will install pipewire and will also disable or will uninstall pulseaudio. If you dont want it, edit install.sh, about line 191 and comment the line `execute_script "pipewire.sh"` or you can simply just delete pipewire.sh in install-scripts directory before installing. #### ✨ Customize the packages to be installed + - inside the install-scripts directory, you can edit 00-hypr-pkgs.sh. Care though as the Hyprland Dots may not work properly! #### 🚩 Switching to SDDM assuming you have GDM installed and running + - if you really want switch to SDDM from GDM, you need to disable the gdm first. - `sudo systemctl disable gdm.service` then reboot -- after reboot, need to ran the install script via tty. So suggest download the install script first. Then disable gdm. reboot and once logged in, cd into Distro-Hyprland then `./install.sh` and then choose SDDM and SDDM theme in the options. +- after reboot, need to ran the install script via tty. So suggest download the install script first. Then disable gdm. reboot and once logged in, cd into Distro-Hyprland then `./install.sh` and then choose SDDM and SDDM theme in the options. - NOTE: Distro-Hyprland is Arch-Hyprland, or Fedora-Hyprland .. depends on which install scripts you downloaded. - #### 💫 SDDM and GTK Themes offered + - If you opted to install SDDM theme, here's the [`LINK`](https://github.com/JaKooLit/simple-sddm-2) which is a modified fork of [`LINK`](https://github.com/Keyitdev/sddm-astronaut-theme) -- If you opted to install GTK Themes, Icons, here's the [`LINK`](https://github.com/JaKooLit/GTK-themes-icons). This also includes Bibata Modern Ice cursor. +- If you opted to install GTK Themes, Icons, here's the [`LINK`](https://github.com/JaKooLit/GTK-themes-icons). This also includes Bibata Modern Ice cursor. #### 👀 NVidia GPU Owners. + - By default, nvidia-dkms will be installed. and only supports GTX 900 and newer. If required to install older driver, edit the nvidia.sh in install-scripts directory > [!IMPORTANT] @@ -101,16 +107,19 @@ https://github.com/user-attachments/assets/49bc12b2-abaf-45de-a21c-67aacd9bb872 - After installation, check [`THIS`](https://github.com/JaKooLit/Hyprland-Dots/wiki/Notes_to_remember#--for-nvidia-gpu-users) ## ✨ Auto clone and install -> [!CAUTION] + +> [!CAUTION] > If you are using FISH SHELL, DO NOT use this function. Clone and ran install.sh instead - you can use this command to automatically clone the installer and ran the script for you - NOTE: `curl` package is required before running this command + ```bash sh <(curl -L https://raw.githubusercontent.com/JaKooLit/Arch-Hyprland/main/auto-install.sh) ``` ## ✨ to use this script + - clone this repo (latest commit only) to reduce file size download by using git. Change directory, make executable and run the script ```bash @@ -120,115 +129,151 @@ chmod +x install.sh ./install.sh ``` -### 💥 💥 UNINSTALL SCRIPT / Removal of Config Files +### 💥 💥 UNINSTALL SCRIPT / Removal of Config Files + - 11 March 2025, due to popular request, created a guided `uninstall.sh` script. USE this with caution as it may render your system unstable. - I will not be responsible if your system breaks - The best still to revert to previous state of your system is via `timeshift or snapper` #### ✨ for ZSH and OH-MY-ZSH installation + > installer should auto change your default shell to zsh. However, if it does not, do this + ```bash chsh -s $(which zsh) zsh source ~/.zshrc ``` + - reboot or logout - by default `agnosterzak` theme is installed. Which is from external oh-my-zsh theme. You can find more themes from this [`OH-MY-ZSH-THEMES`](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) -- to change the theme, `SUPER SHIFT O` , choose desired theme, and close and open terminal. +- to change the theme, `SUPER SHIFT O` , choose desired theme, and close and open terminal. - or manually edit `~/.zshrc` . Look for ZSH_THEME="desired theme" #### 🎞️ AGS Overview DEMO + - in case you wonder, here is a short demo of AGS overview [Youtube LINK](https://youtu.be/zY5SLNPBJTs) #### ✨ TO DO once installation done and dotfiles copied -- SUPER H for HINT or click on the waybar HINT! Button + +- SUPER H for HINT or click on the waybar HINT! Button - Head over to [KooL Hyprland WIKI](https://github.com/JaKooLit/Hyprland-Dots/wiki) #### 🙋 Got a questions regarding the Hyprland Dots or configurations? 🙋 + - Head over to wiki Link [`WIKI`](https://github.com/JaKooLit/Hyprland-Dots/wiki) #### ⌨ Keybinds + - Keybinds [`CLICK`](https://github.com/JaKooLit/Hyprland-Dots/wiki/Keybinds) > [!TIP] > KooL Hyprland has a searchable keybind function via rofi. (SUPER SHIFT K) or right click the `HINTS` waybar button - #### 🔄 switching between Hyprland-git and none Hyprland-git + - you can use my prepared script [`LINK`](https://github.com/JaKooLit/Arch-Hyprland/tree/main/assets/hyprland-install) - Readme is also there +#### 🙋 👋 Having issues or questions? -#### 🙋 👋 Having issues or questions? - for the install part, kindly open issue on this repo - for the Pre-configured Hyprland dots / configuration, submit issue [`here`](https://github.com/JaKooLit/Hyprland-Dots/issues) #### 🔧 Proper way to re-installing a particular script from install-scripts directory -- CD into Arch-Hyprland directory and then ran the below command. + +- CD into Arch-Hyprland directory and then ran the below command. - i.e. `./install-scripts/gtk-themes.sh` - For reinstall GTK Themes or - `./install-scripts/sddm.sh` - For reinstall sddm > [!IMPORTANT] > DO NOT cd into install-scripts directory as script will most likely to fail +> #### 🛠️ Optional system monitor scripts (cross-distro compatible) +> - These installer helpers will set up user-level services and install required packages automatically. +> - Works on Fedora, Arch, and other distributions using standard tools. +> - Re-run any time from the repo root (do not `cd` into `install-scripts`). + +- - `./install-scripts/battery-monitor.sh` +- - Installs: `acpi`, `libnotify` +- - Creates: `~/.config/hypr/scripts/battery-monitor.sh` and user service `battery-monitor.service` +- - Manage: `systemctl --user status|start|stop battery-monitor` +- - `./install-scripts/disk-monitor.sh` +- - Installs: `libnotify` +- - Creates: `~/.config/hypr/scripts/disk-monitor.sh` and user service `disk-monitor.service` +- - Manage: `systemctl --user status|start|stop disk-monitor` +- - `./install-scripts/temp-monitor.sh` +- - Installs: `lm_sensors`, `libnotify` +- - Detects sensors (runs `sudo sensors-detect --auto` once) +- - Creates: `~/.config/hypr/scripts/temp-monitor.sh` and user service `temp-monitor.service` +- - Manage: `systemctl --user status|start|stop temp-monitor` +- > Packages above are installed by the respective installer scripts; no manual action is required. If you prefer package pre-install via the main package list, ensure `acpi`, `lm_sensors`, and `libnotify` are present in your setup. +- #### 🛣️ Roadmap: + - [ ] show a progress bar in downloading and compiling part when installing outside AUR or official repo #### ❗ some known issues for nvidia -- reports from members of my discord, states that some users of nvidia are getting stuck on sddm login. credit to @Kenni Fix stated was -``` + +- reports from members of my discord, states that some users of nvidia are getting stuck on sddm login. credit to @Kenni Fix stated was + +``` while in sddm press ctrl+alt+F2 or F3 log into your account `lspci -nn`, find the id of your nvidia card `ls /dev/dri/by-path` find the matching id -`ls -l /dev/dri/by-path` to check where the symlink points to +`ls -l /dev/dri/by-path` to check where the symlink points to ) ``` -- add "env = WLR_DRM_DEVICES,/dev/dri/cardX" to the ENVvariables config `~/.config/hypr/UserConfigs/ENVariables.conf` ; X being where the symlink of the gpu points to + +- add "env = WLR_DRM_DEVICES,/dev/dri/cardX" to the ENVvariables config `~/.config/hypr/UserConfigs/ENVariables.conf` ; X being where the symlink of the gpu points to - more info from the hyprland wiki [`Hyprland Wiki Link`](https://wiki.hyprland.org/FAQ/#my-external-monitor-is-blank--doesnt-render--receives-no-signal-laptop) - - reports from a member of discord for Nvidia for additional env's -- remove # from the following env's on +- remove # from the following env's on + ``` env = GBM_BACKEND,nvidia-drm env = WLR_RENDERER_ALLOW_SOFTWARE,1 ``` #### ❗ other known issues + - [ ] If you are using this script on an Arch-Based distros like Arco linux, or cachy OS or EOS or Manjaro, make sure to install pipewire, pipewire-pulse & pipewire-audio first. Arco Linux, on some of their ISO's still shipped with pulseaudio as audio backend. You will experience getting "stuck" on installation. - [ ] To install pipewire and its services , `sudo pacman -S pipewire wireplumber pipewire-audio pipewire-pulse` . When prompted, remove / replace pulseaudio. After that, you can ran `./install.sh` -- [ ] installing of cava-git on a newly installed Arch makes the install keep hanging. Switched back to cava. After booting and logged in, if cava dont work, replace it cava-git `yay -S cava-git` or `paru -S cava-git` -> [!NOTE] -> Auto start of Hyprland after login (no SDDM or GDM or any login managers) -- [ ] This was disabled a few days ago. (19 May 2024). This was because some users, after they used the Distro-Hyprland scripts with other DE (gnome-wayland or plasma-wayland), if they choose to login into gnome-wayland for example, Hyprland is starting. +- [ ] installing of cava-git on a newly installed Arch makes the install keep hanging. Switched back to cava. After booting and logged in, if cava dont work, replace it cava-git `yay -S cava-git` or `paru -S cava-git` + > [!NOTE] + > Auto start of Hyprland after login (no SDDM or GDM or any login managers) +- [ ] This was disabled a few days ago. (19 May 2024). This was because some users, after they used the Distro-Hyprland scripts with other DE (gnome-wayland or plasma-wayland), if they choose to login into gnome-wayland for example, Hyprland is starting. - [ ] to avoid this, I disabled it. You can re-enable again by editing `~/.zprofile` . Remove all the # on the first lines - [ ] ROFI issues (scaling, unexplained scaling etc). This is most likely to experience if you are installing on a system where rofi is currently installed. To fix it uninstall rofi and install rofi-wayland . `sudo pacman -Rns rofi` . Install rofi-wayland with `sudo pacman -S rofi-wayland`. Rofi-wayland is compatible with x11 so no need to worry. - #### 🫥 Improving performance for Older Nvidia Cards using driver 470 - - [`SEE HERE`](https://github.com/JaKooLit/Hyprland-Dots/discussions/123#discussion-6035205) + +- [`SEE HERE`](https://github.com/JaKooLit/Hyprland-Dots/discussions/123#discussion-6035205) #### 📒 Final Notes + - join my discord channel [`Discord`](https://discord.com/invite/kool-tech-world) - Feel free to copy, re-distribute, and use this script however you want. Would appreciate if you give me some loves by crediting my work :) - - #### ✍️ Contributing + - As stated above, these script does not contain actual config files. These are only the installer of packages - If you want to contribute and/or test the Hyprland-Dotfiles (development branch), [`Hyprland-Dots-Development`](https://github.com/JaKooLit/Hyprland-Dots/tree/development) - Want to contribute on KooL-Hyprland-Dots Click [`HERE`](https://github.com/JaKooLit/Hyprland-Dots/blob/main/CONTRIBUTING.md) for a guide how to contribute - Want to contribute on This Installer? Click [`HERE`](https://github.com/JaKooLit/Arch-Hyprland/blob/main/CONTRIBUTING.md) for a guide how to contribute #### 👍👍👍 Thanks and Credits! + - [`Hyprland`](https://hyprland.org/) Of course to Hyprland and @vaxerski for this awesome Dynamic Tiling Manager. ## 💖 Support + - a Star on my Github repos would be nice 🌟 -- Subscribe to my Youtube Channel [YouTube](https://www.youtube.com/@Ja.KooLit) +- Subscribe to my Youtube Channel [YouTube](https://www.youtube.com/@Ja.KooLit) - you can also give support through coffee's or btc 😊 @@ -238,15 +283,16 @@ or [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/JaKooLit) -Or you can donate cryto on my btc wallet :) +Or you can donate cryto on my btc wallet :) + > 1N3MeV2dsX6gQB42HXU6MF2hAix1mqjo8i ![Bitcoin](https://github.com/user-attachments/assets/7ed32f8f-c499-46f0-a53c-3f6fbd343699) +#### 📹 Youtube videos (Click to view and watch the playlist) 📹 -#### 📹 Youtube videos (Click to view and watch the playlist) 📹 [![Youtube Playlist Thumbnail](https://raw.githubusercontent.com/JaKooLit/screenshots/main/Youtube.png)](https://youtube.com/playlist?list=PLDtGd5Fw5_GjXCznR0BzCJJDIQSZJRbxx&si=iaNjLulFdsZ6AV-t) - ## 🥰🥰 💖💖 👍👍👍 + [![Stargazers over time](https://starchart.cc/JaKooLit/Arch-Hyprland.svg?variant=adaptive)](https://starchart.cc/JaKooLit/Arch-Hyprland) From 729149b7cce756275f2cb9724ededaca2e790624 Mon Sep 17 00:00:00 2001 From: mio-dokuhaki Date: Sun, 5 Oct 2025 13:45:27 +0900 Subject: [PATCH 3/5] Add missing monitor scripts from Fedora-Hyprland PR #234 --- install-scripts/battery-monitor.sh | 116 +++++++++++++++++++++ install-scripts/disk-monitor.sh | 126 +++++++++++++++++++++++ install-scripts/temp-monitor.sh | 156 +++++++++++++++++++++++++++++ 3 files changed, 398 insertions(+) create mode 100644 install-scripts/battery-monitor.sh create mode 100644 install-scripts/disk-monitor.sh create mode 100644 install-scripts/temp-monitor.sh diff --git a/install-scripts/battery-monitor.sh b/install-scripts/battery-monitor.sh new file mode 100644 index 0000000..e98379b --- /dev/null +++ b/install-scripts/battery-monitor.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Battery Monitor and Low Battery Notification # + +battery=( + acpi + libnotify +) + + +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Change the working directory to the parent directory of the script +PARENT_DIR="$SCRIPT_DIR/.." +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } + +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi + +# Set the name of the log file to include the current date and time +LOG="Install-Logs/install-$(date +%d-%H%M%S)_battery-monitor.log" + +# Battery Monitor +printf "${NOTE} Installing ${SKY_BLUE}Battery Monitor${RESET} Packages...\n" +for BAT in "${battery[@]}"; do + install_package "$BAT" "$LOG" +done + +# Create battery monitoring script +printf "${NOTE} Creating ${YELLOW}battery monitoring${RESET} script...\n" + +BATTERY_SCRIPT="$HOME/.config/hypr/scripts/battery-monitor.sh" +mkdir -p "$HOME/.config/hypr/scripts" + +cat > "$BATTERY_SCRIPT" << 'EOF' +#!/bin/bash +# Low Battery Notification Script +# Monitors battery level and sends notifications + +# Configuration +LOW_BATTERY_THRESHOLD=20 +CRITICAL_BATTERY_THRESHOLD=10 +CHECK_INTERVAL=60 # Check every 60 seconds + +# Track notification state to avoid spam +NOTIFIED_LOW=false +NOTIFIED_CRITICAL=false + +while true; do + # Get battery percentage + BATTERY_LEVEL=$(acpi -b | grep -P -o '[0-9]+(?=%)') + BATTERY_STATUS=$(acpi -b | grep -o 'Discharging\|Charging\|Full') + + # Only send notifications when discharging + if [ "$BATTERY_STATUS" = "Discharging" ]; then + if [ "$BATTERY_LEVEL" -le "$CRITICAL_BATTERY_THRESHOLD" ] && [ "$NOTIFIED_CRITICAL" = false ]; then + notify-send -u critical -i battery-caution "Critical Battery" "Battery level is at ${BATTERY_LEVEL}%! Please plug in your charger immediately." + NOTIFIED_CRITICAL=true + NOTIFIED_LOW=true + elif [ "$BATTERY_LEVEL" -le "$LOW_BATTERY_THRESHOLD" ] && [ "$NOTIFIED_LOW" = false ]; then + notify-send -u normal -i battery-low "Low Battery" "Battery level is at ${BATTERY_LEVEL}%. Consider plugging in your charger." + NOTIFIED_LOW=true + fi + else + # Reset notification flags when charging or full + NOTIFIED_LOW=false + NOTIFIED_CRITICAL=false + fi + + sleep "$CHECK_INTERVAL" +done +EOF + +chmod +x "$BATTERY_SCRIPT" + +printf "${OK} Battery monitoring script created at ${YELLOW}$BATTERY_SCRIPT${RESET}\n" + +# Create systemd user service +printf "${NOTE} Creating ${YELLOW}systemd user service${RESET} for battery monitoring...\n" + +SYSTEMD_DIR="$HOME/.config/systemd/user" +mkdir -p "$SYSTEMD_DIR" + +cat > "$SYSTEMD_DIR/battery-monitor.service" << EOF +[Unit] +Description=Battery Level Monitor +After=graphical-session.target + +[Service] +Type=simple +ExecStart=$BATTERY_SCRIPT +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=default.target +EOF + +printf "${OK} Systemd service created\n" + +# Enable and start the service +printf "${NOTE} Enabling and starting ${YELLOW}battery-monitor${RESET} service...\n" +systemctl --user daemon-reload +systemctl --user enable battery-monitor.service 2>&1 | tee -a "$LOG" +systemctl --user start battery-monitor.service 2>&1 | tee -a "$LOG" + +printf "${OK} Battery monitor service is now running!\n" +printf "${INFO} You can check status with: ${YELLOW}systemctl --user status battery-monitor${RESET}\n" +printf "${INFO} To stop: ${YELLOW}systemctl --user stop battery-monitor${RESET}\n" +printf "${INFO} To disable: ${YELLOW}systemctl --user disable battery-monitor${RESET}\n" + +printf "\n%.0s" {1..2} diff --git a/install-scripts/disk-monitor.sh b/install-scripts/disk-monitor.sh new file mode 100644 index 0000000..cd8a91d --- /dev/null +++ b/install-scripts/disk-monitor.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Disk Space Monitor # + +disk=( + libnotify +) + + +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Change the working directory to the parent directory of the script +PARENT_DIR="$SCRIPT_DIR/.." +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } + +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi + +# Set the name of the log file to include the current date and time +LOG="Install-Logs/install-$(date +%d-%H%M%S)_disk-monitor.log" + +# Disk Monitor +printf "${NOTE} Installing ${SKY_BLUE}Disk Monitor${RESET} Packages...\n" +for DISK in "${disk[@]}"; do + install_package "$DISK" "$LOG" +done + +# Create disk monitoring script +printf "${NOTE} Creating ${YELLOW}disk space monitoring${RESET} script...\n" + +DISK_SCRIPT="$HOME/.config/hypr/scripts/disk-monitor.sh" +mkdir -p "$HOME/.config/hypr/scripts" + +cat > "$DISK_SCRIPT" << 'EOF' +#!/bin/bash +# Disk Space Monitoring Script +# Monitors disk usage and sends notifications + +# Configuration +DISK_WARNING_THRESHOLD=80 +DISK_CRITICAL_THRESHOLD=90 +CHECK_INTERVAL=300 # Check every 5 minutes + +# Track notification state +declare -A NOTIFIED_WARNING +declare -A NOTIFIED_CRITICAL + +while true; do + # Get disk usage for all mounted filesystems + df -h | grep '^/dev/' | while read -r line; do + DEVICE=$(echo "$line" | awk '{print $1}') + MOUNT=$(echo "$line" | awk '{print $6}') + USAGE=$(echo "$line" | awk '{print $5}' | sed 's/%//') + + # Skip if usage is not a number + if ! [[ "$USAGE" =~ ^[0-9]+$ ]]; then + continue + fi + + # Check disk usage + if [ "$USAGE" -ge "$DISK_CRITICAL_THRESHOLD" ]; then + if [ "${NOTIFIED_CRITICAL[$MOUNT]}" != "true" ]; then + notify-send -u critical -i drive-harddisk "Critical Disk Space" "Mount point $MOUNT is ${USAGE}% full!\nDevice: $DEVICE" + NOTIFIED_CRITICAL[$MOUNT]="true" + NOTIFIED_WARNING[$MOUNT]="true" + fi + elif [ "$USAGE" -ge "$DISK_WARNING_THRESHOLD" ]; then + if [ "${NOTIFIED_WARNING[$MOUNT]}" != "true" ]; then + notify-send -u normal -i drive-harddisk "Low Disk Space" "Mount point $MOUNT is ${USAGE}% full\nDevice: $DEVICE" + NOTIFIED_WARNING[$MOUNT]="true" + fi + else + # Reset notifications when usage drops + if [ "$USAGE" -lt $((DISK_WARNING_THRESHOLD - 5)) ]; then + NOTIFIED_WARNING[$MOUNT]="false" + NOTIFIED_CRITICAL[$MOUNT]="false" + fi + fi + done + + sleep "$CHECK_INTERVAL" +done +EOF + +chmod +x "$DISK_SCRIPT" + +printf "${OK} Disk monitoring script created at ${YELLOW}$DISK_SCRIPT${RESET}\n" + +# Create systemd user service +printf "${NOTE} Creating ${YELLOW}systemd user service${RESET} for disk monitoring...\n" + +SYSTEMD_DIR="$HOME/.config/systemd/user" +mkdir -p "$SYSTEMD_DIR" + +cat > "$SYSTEMD_DIR/disk-monitor.service" << EOF +[Unit] +Description=Disk Space Monitor +After=graphical-session.target + +[Service] +Type=simple +ExecStart=$DISK_SCRIPT +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=default.target +EOF + +printf "${OK} Systemd service created\n" + +# Enable and start the service +printf "${NOTE} Enabling and starting ${YELLOW}disk-monitor${RESET} service...\n" +systemctl --user daemon-reload +systemctl --user enable disk-monitor.service 2>&1 | tee -a "$LOG" +systemctl --user start disk-monitor.service 2>&1 | tee -a "$LOG" + +printf "${OK} Disk monitor service is now running!\n" +printf "${INFO} You can check status with: ${YELLOW}systemctl --user status disk-monitor${RESET}\n" +printf "${INFO} View disk usage: ${YELLOW}df -h${RESET}\n" + +printf "\n%.0s" {1..2} diff --git a/install-scripts/temp-monitor.sh b/install-scripts/temp-monitor.sh new file mode 100644 index 0000000..21b5281 --- /dev/null +++ b/install-scripts/temp-monitor.sh @@ -0,0 +1,156 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Temperature Monitor - CPU/GPU Temperature Alerts # + +temp=( + lm_sensors + libnotify +) + + +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Change the working directory to the parent directory of the script +PARENT_DIR="$SCRIPT_DIR/.." +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } + +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi + +# Set the name of the log file to include the current date and time +LOG="Install-Logs/install-$(date +%d-%H%M%S)_temp-monitor.log" + +# Temperature Monitor +printf "${NOTE} Installing ${SKY_BLUE}Temperature Monitor${RESET} Packages...\n" +for TEMP in "${temp[@]}"; do + install_package "$TEMP" "$LOG" +done + +# Detect sensors +printf "${NOTE} Detecting ${YELLOW}hardware sensors${RESET}...\n" +sudo sensors-detect --auto 2>&1 | tee -a "$LOG" + +# Create temperature monitoring script +printf "${NOTE} Creating ${YELLOW}temperature monitoring${RESET} script...\n" + +TEMP_SCRIPT="$HOME/.config/hypr/scripts/temp-monitor.sh" +mkdir -p "$HOME/.config/hypr/scripts" + +cat > "$TEMP_SCRIPT" << 'EOF' +#!/bin/bash +# Temperature Monitoring Script +# Monitors CPU and GPU temperatures and sends alerts + +# Configuration +CPU_TEMP_WARNING=75 +CPU_TEMP_CRITICAL=85 +GPU_TEMP_WARNING=75 +GPU_TEMP_CRITICAL=85 +CHECK_INTERVAL=30 # Check every 30 seconds + +# Track notification state +NOTIFIED_CPU_WARN=false +NOTIFIED_CPU_CRIT=false +NOTIFIED_GPU_WARN=false +NOTIFIED_GPU_CRIT=false + +while true; do + # Get CPU temperature (average of all cores) + CPU_TEMP=$(sensors | grep -i 'Package id 0:\|Tdie:' | awk '{print $4}' | sed 's/+//;s/°C//' | head -1) + + # If Package id not found, try other methods + if [ -z "$CPU_TEMP" ]; then + CPU_TEMP=$(sensors | grep -i 'Core 0:' | awk '{print $3}' | sed 's/+//;s/°C//' | head -1) + fi + + # Get GPU temperature (if available) + GPU_TEMP=$(sensors | grep -i 'edge:\|temp1:' | awk '{print $2}' | sed 's/+//;s/°C//' | head -1) + + # Check CPU temperature + if [ -n "$CPU_TEMP" ]; then + CPU_TEMP_INT=${CPU_TEMP%.*} + + if [ "$CPU_TEMP_INT" -ge "$CPU_TEMP_CRITICAL" ]; then + if [ "$NOTIFIED_CPU_CRIT" = false ]; then + notify-send -u critical -i temperature-high "Critical CPU Temperature" "CPU temperature is ${CPU_TEMP}°C! System may throttle or shutdown." + NOTIFIED_CPU_CRIT=true + NOTIFIED_CPU_WARN=true + fi + elif [ "$CPU_TEMP_INT" -ge "$CPU_TEMP_WARNING" ]; then + if [ "$NOTIFIED_CPU_WARN" = false ]; then + notify-send -u normal -i temperature-normal "High CPU Temperature" "CPU temperature is ${CPU_TEMP}°C" + NOTIFIED_CPU_WARN=true + fi + else + NOTIFIED_CPU_WARN=false + NOTIFIED_CPU_CRIT=false + fi + fi + + # Check GPU temperature + if [ -n "$GPU_TEMP" ]; then + GPU_TEMP_INT=${GPU_TEMP%.*} + + if [ "$GPU_TEMP_INT" -ge "$GPU_TEMP_CRITICAL" ]; then + if [ "$NOTIFIED_GPU_CRIT" = false ]; then + notify-send -u critical -i temperature-high "Critical GPU Temperature" "GPU temperature is ${GPU_TEMP}°C!" + NOTIFIED_GPU_CRIT=true + NOTIFIED_GPU_WARN=true + fi + elif [ "$GPU_TEMP_INT" -ge "$GPU_TEMP_WARNING" ]; then + if [ "$NOTIFIED_GPU_WARN" = false ]; then + notify-send -u normal -i temperature-normal "High GPU Temperature" "GPU temperature is ${GPU_TEMP}°C" + NOTIFIED_GPU_WARN=true + fi + else + NOTIFIED_GPU_WARN=false + NOTIFIED_GPU_CRIT=false + fi + fi + + sleep "$CHECK_INTERVAL" +done +EOF + +chmod +x "$TEMP_SCRIPT" + +printf "${OK} Temperature monitoring script created at ${YELLOW}$TEMP_SCRIPT${RESET}\n" + +# Create systemd user service +printf "${NOTE} Creating ${YELLOW}systemd user service${RESET} for temperature monitoring...\n" + +SYSTEMD_DIR="$HOME/.config/systemd/user" +mkdir -p "$SYSTEMD_DIR" + +cat > "$SYSTEMD_DIR/temp-monitor.service" << EOF +[Unit] +Description=Temperature Monitor +After=graphical-session.target + +[Service] +Type=simple +ExecStart=$TEMP_SCRIPT +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=default.target +EOF + +printf "${OK} Systemd service created\n" + +# Enable and start the service +printf "${NOTE} Enabling and starting ${YELLOW}temp-monitor${RESET} service...\n" +systemctl --user daemon-reload +systemctl --user enable temp-monitor.service 2>&1 | tee -a "$LOG" +systemctl --user start temp-monitor.service 2>&1 | tee -a "$LOG" + +printf "${OK} Temperature monitor service is now running!\n" +printf "${INFO} You can check status with: ${YELLOW}systemctl --user status temp-monitor${RESET}\n" +printf "${INFO} View temperatures: ${YELLOW}sensors${RESET}\n" + +printf "\n%.0s" {1..2} From c16b3bc2c06719bf14860d44fcca307560137f8e Mon Sep 17 00:00:00 2001 From: mio-dokuhaki Date: Sun, 5 Oct 2025 16:15:56 +0900 Subject: [PATCH 4/5] Fixed README.md for formatting --- README.md | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 3bb6eb6..a12718b 100644 --- a/README.md +++ b/README.md @@ -188,26 +188,25 @@ source ~/.zshrc > [!IMPORTANT] > DO NOT cd into install-scripts directory as script will most likely to fail -> #### 🛠️ Optional system monitor scripts (cross-distro compatible) -> - These installer helpers will set up user-level services and install required packages automatically. -> - Works on Fedora, Arch, and other distributions using standard tools. -> - Re-run any time from the repo root (do not `cd` into `install-scripts`). +#### 🛠️ Optional system monitor scripts (cross-distro compatible) +- These installer helpers will set up user-level services and install required packages automatically. +- Works on Fedora, Arch, and other distributions using standard tools. +- Re-run any time from the repo root (do not `cd` into `install-scripts`). -- - `./install-scripts/battery-monitor.sh` -- - Installs: `acpi`, `libnotify` -- - Creates: `~/.config/hypr/scripts/battery-monitor.sh` and user service `battery-monitor.service` -- - Manage: `systemctl --user status|start|stop battery-monitor` -- - `./install-scripts/disk-monitor.sh` -- - Installs: `libnotify` -- - Creates: `~/.config/hypr/scripts/disk-monitor.sh` and user service `disk-monitor.service` -- - Manage: `systemctl --user status|start|stop disk-monitor` -- - `./install-scripts/temp-monitor.sh` -- - Installs: `lm_sensors`, `libnotify` -- - Detects sensors (runs `sudo sensors-detect --auto` once) -- - Creates: `~/.config/hypr/scripts/temp-monitor.sh` and user service `temp-monitor.service` -- - Manage: `systemctl --user status|start|stop temp-monitor` -- > Packages above are installed by the respective installer scripts; no manual action is required. If you prefer package pre-install via the main package list, ensure `acpi`, `lm_sensors`, and `libnotify` are present in your setup. -- +- `./install-scripts/battery-monitor.sh` + - Installs: `acpi`, `libnotify` + - Creates: `~/.config/hypr/scripts/battery-monitor.sh` and user service `battery-monitor.service` + - Manage: `systemctl --user status|start|stop battery-monitor` +- `./install-scripts/disk-monitor.sh` + - Installs: `libnotify` + - Creates: `~/.config/hypr/scripts/disk-monitor.sh` and user service `disk-monitor.service` + - Manage: `systemctl --user status|start|stop disk-monitor` +- `./install-scripts/temp-monitor.sh` + - Installs: `lm_sensors`, `libnotify` + - Detects sensors (runs `sudo sensors-detect --auto` once) + - Creates: `~/.config/hypr/scripts/temp-monitor.sh` and user service `temp-monitor.service` + - Manage: `systemctl --user status|start|stop temp-monitor` +> Packages above are installed by the respective installer scripts; no manual action is required. If you prefer package pre-install via the main package list, ensure `acpi`, `lm_sensors`, and `libnotify` are present in your setup. #### 🛣️ Roadmap: From 516f2e609c8f4e4476a23eed3144800ce3636c28 Mon Sep 17 00:00:00 2001 From: Donald Williams <129223418+dwilliam62@users.noreply.github.com> Date: Sun, 5 Oct 2025 19:31:36 -0400 Subject: [PATCH 5/5] Update 01-hypr-pkgs.sh Rofi wayland now merged with rofi --- install-scripts/01-hypr-pkgs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-scripts/01-hypr-pkgs.sh b/install-scripts/01-hypr-pkgs.sh index a2f651e..b868d71 100755 --- a/install-scripts/01-hypr-pkgs.sh +++ b/install-scripts/01-hypr-pkgs.sh @@ -36,7 +36,7 @@ hypr_package=( qt5ct qt6ct qt6-svg - rofi-wayland + rofi slurp swappy swaync @@ -124,4 +124,4 @@ for PKG1 in "${hypr_package[@]}" "${hypr_package_2[@]}" "${Extra[@]}"; do install_package "$PKG1" "$LOG" done -printf "\n%.0s" {1..2} \ No newline at end of file +printf "\n%.0s" {1..2}