From 8d2d53f9d6aed6ae3f27a36ff20a0c47c4e577d1 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Mon, 22 Sep 2025 14:55:31 +0200 Subject: [PATCH] Hypr (desktop): add hypridle and dependency hints --- .config/hypr/README.md | 8 ++ .../50-autostart.conf##hostname.cn-arch | 1 + .config/hypr/scripts/check-deps.sh | 89 +++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 .config/hypr/README.md create mode 100755 .config/hypr/scripts/check-deps.sh diff --git a/.config/hypr/README.md b/.config/hypr/README.md new file mode 100644 index 0000000..9bdcda9 --- /dev/null +++ b/.config/hypr/README.md @@ -0,0 +1,8 @@ +Hyprland setup helpers +====================== + +Dependency check +---------------- +Run `scripts/check-deps.sh` to list commands this configuration expects. +The script exits with status 1 if a required command is missing and prints +optional tools separately. diff --git a/.config/hypr/conf.d/50-autostart.conf##hostname.cn-arch b/.config/hypr/conf.d/50-autostart.conf##hostname.cn-arch index a3becf2..27f51a2 100644 --- a/.config/hypr/conf.d/50-autostart.conf##hostname.cn-arch +++ b/.config/hypr/conf.d/50-autostart.conf##hostname.cn-arch @@ -8,3 +8,4 @@ exec-once = ~/.config/waybar/scripts/hyprsunset_daemon.sh exec-once = hyprpaper -c $HOME/.config/hyprpaper.conf exec-once = swayosd-server +exec-once = hypridle diff --git a/.config/hypr/scripts/check-deps.sh b/.config/hypr/scripts/check-deps.sh new file mode 100755 index 0000000..00ff496 --- /dev/null +++ b/.config/hypr/scripts/check-deps.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# check-deps.sh — report missing commands used by this Hyprland setup +# Usage: ./scripts/check-deps.sh + +set -euo pipefail + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +repo_root="${script_dir%/scripts}" + +header() { + printf '\n== %s ==\n' "$1" +} + +info() { printf ' - %s\n' "$1"; } + +required=( + 'uwsm|launch wrapper used for apps' + 'swaync|notification daemon' + 'swaync-client|notification control client' + 'waybar|status bar' + 'xsettingsd|XSettings bridge for GTK apps' + 'hyprpaper|wallpaper daemon' + 'hypridle|idle manager' + 'hyprlock|lock screen' + 'hyprctl|Hyprland control tool' + 'hyprsunset|color temperature daemon' + 'swayosd-server|overlay indicators' + 'swayosd-client|volume/brightness OSD client' + 'playerctl|media key handler' + 'wpctl|PipeWire volume control' + 'grimblast|screenshot helper' + 'kitty|default terminal emulator' + 'nautilus|default file manager' +) + +optional=( + 'sunwait|enables real sunrise/sunset scheduling for hyprsunset' + 'brightnessctl|required on laptop for idle dimming' + 'nm-applet|NetworkManager tray (laptop)' + 'blueman-applet|Bluetooth tray (laptop)' + 'clipman|clipboard history for wl-paste hook' + 'wl-paste|clipboard watcher utility' + 'sherlock|launcher binding' + 'uuctl|uwsm controller binding' + 'emote|emoji picker binding' + 'satty|grimblast editor when building from source' +) + +missing_required=() +missing_optional=() + +check_list() { + local -n list=$1 + local -n missing=$2 + local entry cmd desc + for entry in "${list[@]}"; do + IFS='|' read -r cmd desc <<<"$entry" + if ! command -v "$cmd" >/dev/null 2>&1; then + missing+=("$cmd|$desc") + fi + done +} + +check_list required missing_required +check_list optional missing_optional + +header "Required commands" +if ((${#missing_required[@]}==0)); then + info "all required commands found" +else + for entry in "${missing_required[@]}"; do + IFS='|' read -r cmd desc <<<"$entry" + info "missing: $cmd ($desc)" + done +fi + +header "Optional commands" +if ((${#missing_optional[@]}==0)); then + info "all optional commands found" +else + for entry in "${missing_optional[@]}"; do + IFS='|' read -r cmd desc <<<"$entry" + info "missing: $cmd ($desc)" + done +fi + +if ((${#missing_required[@]})); then + exit 1 +fi