From 7441f2cb05b6916ff7cb08a8c0f14b7ff865a1b1 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 2 Nov 2025 17:23:53 -0500 Subject: feat: Add smart AGS/Quickshell fallback with OverviewToggle wrapper Implements a robust fallback mechanism for desktop overview functionality that handles both AGS and Quickshell installations gracefully. Changes: - Add OverviewToggle.sh wrapper script that tries Quickshell first, falls back to AGS if unavailable or broken - Update UserKeybinds.conf with new SUPER+A binding to OverviewToggle.sh - Preserve original AGS and Quickshell keybinds as commented references - Simplify copy.sh logic to enable both AGS and QS simultaneously - Remove conflicting keybind toggle logic from copy.sh Benefits: - Users can have both AGS and Quickshell installed simultaneously - Automatic fallback when one tool is broken or unavailable - Quickshell preferred (tried first) as it's more performant - Graceful degradation with user notification if neither available - Auto-starts AGS if installed but not running - Compatible with existing upgrade.sh and ComposeHyprConfigs.sh workflow Technical details: - OverviewToggle.sh checks for running processes before attempting toggle - Uses hyprctl dispatch for Quickshell's global dispatcher - Falls back to ags -t 'overview' with rofi cleanup for AGS - Shows desktop notification if neither tool is available - Script auto-made executable via existing chmod in copy.sh (line 1027) Addresses: Issue where AGS and Quickshell have had recent stability problems, requiring manual keybind switching between them --- copy.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index 762af601..b4e958a9 100755 --- a/copy.sh +++ b/copy.sh @@ -259,38 +259,31 @@ if command -v blueman-applet >/dev/null 2>&1; then grep -qx 'exec-once = blueman-applet' "$OVERLAY_SA" || echo 'exec-once = blueman-applet' >>"$OVERLAY_SA" fi -# Check if ags is installed edit ags behaviour on configs +# Check if ags is installed and enable it if command -v ags >/dev/null 2>&1; then + echo "${INFO} AGS detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$LOG" OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = ags' "$OVERLAY_SA" || echo 'exec-once = ags' >>"$OVERLAY_SA" sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh - - # Uncomment the ags overview keybind - sed -i '/^#bind = \$mainMod, A, exec, pkill rofi || true && ags -t '\''overview'\''/s/^#//' config/hypr/UserConfigs/UserKeybinds.conf - - # Comment the quickshell line if not already commented - sed -i '/^\s*bind\s*=\s*\$mainMod,\s*A,\s*global,\s*quickshell:overviewToggle/{s/^\s*/#/}' config/hypr/UserConfigs/UserKeybinds.conf fi -# Check if quickshell is installed; edit quickshell behaviour on configs +# Check if quickshell is installed and enable it if command -v qs >/dev/null 2>&1; then + echo "${INFO} Quickshell detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$LOG" OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = qs' "$OVERLAY_SA" || echo 'exec-once = qs' >>"$OVERLAY_SA" sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh - - # Uncomment the quickshell keybind line - sed -i "/^#bind = \$mainMod, A, global, quickshell:overviewToggle/s/^#//" config/hypr/UserConfigs/UserKeybinds.conf - - # Ensure the ags overview keybind is commented - sed -i "/^\s*bind\s*=\s*\\\$mainMod,\s*A,\s*exec,\s*pkill rofi\s*||\s*true\s*&&\s*ags\s*-t\s*'overview'/{s/^\s*/#/}" config/hypr/UserConfigs/UserKeybinds.conf fi +# Note: The SUPER+A keybind now uses OverviewToggle.sh which automatically +# tries quickshell first and falls back to AGS, so both can be installed + printf "\n%.0s" {1..1} # Checking if neovim or vim is installed and offer user if they want to make as default editor -- cgit v1.2.3 From 5fc91179274f7dceed62e24aad274a600d082f22 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 02:25:14 -0500 Subject: fix(copy): always add KeybindsLayoutInit.sh to UserConfigs/Startup_Apps overlay\n\n- Ensures the layout-aware J/K init survives composition and user updates\n- Prevents cases where generated/Startup_Apps.conf misses the init entry --- copy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index b4e958a9..1addda84 100755 --- a/copy.sh +++ b/copy.sh @@ -281,6 +281,14 @@ if command -v qs >/dev/null 2>&1; then sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh fi +# Ensure layout-aware keybinds init runs on startup (adds to user overlay so it survives composes) +OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" +mkdir -p "$(dirname "$OVERLAY_SA")" +if ! grep -qx 'exec-once = \$scriptsDir/KeybindsLayoutInit.sh' "$OVERLAY_SA"; then + echo 'exec-once = $scriptsDir/KeybindsLayoutInit.sh' >>"$OVERLAY_SA" + echo "${INFO} Added KeybindsLayoutInit.sh to user Startup_Apps overlay" 2>&1 | tee -a "$LOG" +fi + # Note: The SUPER+A keybind now uses OverviewToggle.sh which automatically # tries quickshell first and falls back to AGS, so both can be installed -- cgit v1.2.3 From a35eb612dda901c5d14d559e55e64c0b1e93eae4 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 02:32:31 -0500 Subject: fix(startup): preserve KeybindsLayoutInit in composed Startup_Apps; harden hyprlock 12h edits\n\n- ComposeHyprConfigs.sh: ignore disabling /KeybindsLayoutInit.sh\n- copy.sh migration: filter KeybindsLayoutInit from Startup_Apps.disable\n- copy.sh: target existing hyprlock template, avoid sed errors --- config/hypr/scripts/ComposeHyprConfigs.sh | 4 ++++ copy.sh | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'copy.sh') diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh index 55bc3c5c..f0928a24 100755 --- a/config/hypr/scripts/ComposeHyprConfigs.sh +++ b/config/hypr/scripts/ComposeHyprConfigs.sh @@ -58,6 +58,10 @@ compose_startup_apps() { while IFS= read -r d; do d="$(echo "$d" | trim)" [[ -z "$d" || "$d" =~ ^# ]] && continue + # Never disable our layout-aware keybind init unless user re-enables via explicit edit here + if [[ "$d" == "\$scriptsDir/KeybindsLayoutInit.sh" ]]; then + continue + fi unset 'cmds[$d]' done <"$disable_file" fi diff --git a/copy.sh b/copy.sh index 1addda84..cd5f5212 100755 --- a/copy.sh +++ b/copy.sh @@ -414,11 +414,19 @@ while true; do sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG" # for hyprlock - sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" - sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" + HYPRLOCK_FILE="config/hypr/hyprlock.conf" + if [ ! -f "$HYPRLOCK_FILE" ] && [ -f "config/hypr/hyprlock-1080p.conf" ]; then + HYPRLOCK_FILE="config/hypr/hyprlock-1080p.conf" + fi + if [ -f "$HYPRLOCK_FILE" ]; then + sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" - sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%S")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" - sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" + sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%S")"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + else + echo "${WARN} hyprlock template not found; skipping 12H lock format edits" 2>&1 | tee -a "$LOG" + fi echo "${OK} 12H format set on waybar clocks succesfully." 2>&1 | tee -a "$LOG" @@ -854,7 +862,11 @@ compose_overlay_from_backup() { grep -E '^\s*exec-once\s*=' "$base_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$base_file.tmp.exec" comm -23 "$old_user_file.tmp.exec" "$base_file.tmp.exec" >"$new_user_file" # treat commented exec-once in old user as disables - grep -E '^\s*#\s*exec-once\s*=' "$old_user_file" | sed -E 's/^\s*#\s*exec-once\s*=\s*//' | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$disable_file" + grep -E '^\s*#\s*exec-once\s*=' "$old_user_file" \ + | sed -E 's/^\s*#\s*exec-once\s*=\s*//' \ + | sed -E 's/^\s+//;s/\s+$//' \ + | grep -Ev '^\$scriptsDir/KeybindsLayoutInit\.sh$' \ + | sort -u >"$disable_file" rm -f "$old_user_file.tmp.exec" "$base_file.tmp.exec" elif [ "$type" = "windowrules" ]; then # additions -- cgit v1.2.3 From 74b5fe09f3a0b04093ff1442b1dfc683f40d3eca Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 21:59:55 -0500 Subject: Dropped duplicate startup_apps.sh script Removed the ComposeHyprConfitg.sh script Your branch is up to date with 'origin/development'. Changes to be committed: deleted: config/hypr/UserConfigs/Startup_Apps.conf modified: config/hypr/hyprland.conf deleted: config/hypr/scripts/ComposeHyprConfigs.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh modified: copy.sh modified: upgrade.sh --- config/hypr/UserConfigs/Startup_Apps.conf | 62 ---------------- config/hypr/hyprland.conf | 2 - config/hypr/scripts/ComposeHyprConfigs.sh | 113 ----------------------------- config/hypr/scripts/Kool_Quick_Settings.sh | 2 +- copy.sh | 4 - upgrade.sh | 4 - 6 files changed, 1 insertion(+), 186 deletions(-) delete mode 100644 config/hypr/UserConfigs/Startup_Apps.conf delete mode 100755 config/hypr/scripts/ComposeHyprConfigs.sh (limited to 'copy.sh') diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf deleted file mode 100644 index 4f4fbd22..00000000 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ /dev/null @@ -1,62 +0,0 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # -# Commands and Apps to be executed at launch - -$scriptsDir = $HOME/.config/hypr/scripts -$UserScripts = $HOME/.config/hypr/UserScripts - -$wallDIR=$HOME/Pictures/wallpapers -$lock = $scriptsDir/LockScreen.sh -$SwwwRandom = $UserScripts/WallpaperAutoChange.sh -$livewallpaper="" - -# wallpaper stuff -exec-once = swww-daemon --format argb # New flag for v0.11.2 -#exec-once = swww-daemon --format xrgb # old 0.9.5 option -#exec-once = mpvpaper '*' -o "load-scripts=no no-audio --loop" $livewallpaper - -# wallpaper random -#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes - -# Startup -exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP - -# Initialize Drop Down terminal - See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644 -exec-once = $HOME/.config/hypr/scripts/Dropterminal.sh kitty & - - -# Polkit (Polkit Gnome / KDE) -exec-once = $scriptsDir/Polkit.sh - -# starup apps -exec-once = nm-applet --indicator -exec-once = nm-tray # For ubuntu -exec-once = swaync -#exec-once = ags -#exec-once = blueman-applet -#exec-once = rog-control-center -exec-once = waybar -exec-once = qs # quickshell AGS Desktop Overview alternative - -#clipboard manager -exec-once = wl-paste --type text --watch cliphist store -exec-once = wl-paste --type image --watch cliphist store - -# Rainbow borders -exec-once = $UserScripts/RainbowBorders.sh - -# Starting hypridle to start hyprlock -exec-once = hypridle - -# Weather script to populate cache on startup -exec-once = $UserScripts/WeatherWrap.sh - - -# Here are list of features available but disabled by default -# exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png # persistent wallpaper - -#gnome polkit for nixos -#exec-once = $scriptsDir/Polkit-NixOS.sh - -# xdg-desktop-portal-hyprland (should be auto starting. However, you can force to start) -#exec-once = $scriptsDir/PortalHyprland.sh diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 8f0fc1e5..8eb91df7 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -17,7 +17,6 @@ $UserConfigs = $HOME/.config/hypr/UserConfigs # User Configs directory path # Load vendor defaults, then user additions/overrides source= $configs/Startup_Apps.conf -source= $UserConfigs/Startup_Apps.conf source= $UserConfigs/ENVariables.conf # Environment variables to load @@ -30,7 +29,6 @@ source= $UserConfigs/LaptopDisplay.conf # Laptop display related. You need to re # Load vendor defaults, then user additions source= $configs/WindowRules.conf # all about Hyprland Window Rules and Layer Rules (defaults) -source= $UserConfigs/WindowRules.conf # user rules and layer rules source= $UserConfigs/UserDecorations.conf # Decorations config file diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh deleted file mode 100755 index f0928a24..00000000 --- a/config/hypr/scripts/ComposeHyprConfigs.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash -# Compose merged Hyprland configs for Startup_Apps and WindowRules -set -euo pipefail - -BASE_DIR="$HOME/.config/hypr" -BASE_CFG_DIR="$BASE_DIR/configs" -USER_DIR="$BASE_DIR/UserConfigs" -GEN_DIR="$BASE_DIR/generated" - -mkdir -p "$GEN_DIR" - -log() { printf "[compose] %s\n" "$*"; } - -# Trim leading/trailing whitespace -trim() { sed -E 's/^\s+//;s/\s+$//'; } - -# Normalize spaces in a directive line -normalize() { awk '{$1=$1;print}'; } - -# Build merged Startup_Apps.conf -compose_startup_apps() { - local base_file="$BASE_CFG_DIR/Startup_Apps.conf" - local user_file="$USER_DIR/Startup_Apps.conf" - local disable_file="$USER_DIR/Startup_Apps.disable" - local out_file="$GEN_DIR/Startup_Apps.conf" - - : >"$out_file" - - # Header and variable lines come from base - if [[ -f "$base_file" ]]; then - # Copy all non exec-once lines (comments, blanks, variables, etc.) - grep -Ev '^\s*exec-once\s*=' "$base_file" || true >>"$out_file" - fi - - # Collect exec-once commands (the right side of '=') - declare -A cmds=() - - if [[ -f "$base_file" ]]; then - while IFS= read -r line; do - [[ "$line" =~ ^\s*exec-once\s*= ]] || continue - cmd="${line#*=}" - cmd="$(echo "$cmd" | trim)" - cmds["$cmd"]=1 - done <"$base_file" - fi - - if [[ -f "$user_file" ]]; then - while IFS= read -r line; do - [[ "$line" =~ ^\s*exec-once\s*= ]] || continue - cmd="${line#*=}" - cmd="$(echo "$cmd" | trim)" - cmds["$cmd"]=1 - done <"$user_file" - fi - - # Apply disables (exact match of command string) - if [[ -f "$disable_file" ]]; then - while IFS= read -r d; do - d="$(echo "$d" | trim)" - [[ -z "$d" || "$d" =~ ^# ]] && continue - # Never disable our layout-aware keybind init unless user re-enables via explicit edit here - if [[ "$d" == "\$scriptsDir/KeybindsLayoutInit.sh" ]]; then - continue - fi - unset 'cmds[$d]' - done <"$disable_file" - fi - - # Emit combined exec-once (stable sort) - for k in "${!cmds[@]}"; do echo "$k"; done | sort -u | while IFS= read -r cmd; do - [[ -z "$cmd" ]] && continue - printf "exec-once = %s\n" "$cmd" >>"$out_file" - done - - log "Wrote $out_file" -} - -# Build merged WindowRules.conf -compose_window_rules() { - local base_file="$BASE_CFG_DIR/WindowRules.conf" - local user_file="$USER_DIR/WindowRules.conf" - local disable_file="$USER_DIR/WindowRules.disable" - local out_file="$GEN_DIR/WindowRules.conf" - - : >"$out_file" - echo "# Generated merged WindowRules" >>"$out_file" - - declare -A rules=() - add_rules() { - local f="$1" - [[ -f "$f" ]] || return 0 - grep -E '^(windowrule|layerrule)\s*=' "$f" | trim | while IFS= read -r r; do - rules["$r"]=1 - done - } - - add_rules "$base_file" - add_rules "$user_file" - - if [[ -f "$disable_file" ]]; then - while IFS= read -r d; do - d="$(echo "$d" | trim)" - [[ -z "$d" || "$d" =~ ^# ]] && continue - unset 'rules[$d]' - done <"$disable_file" - fi - - for r in "${!rules[@]}"; do echo "$r"; done | sort -u >>"$out_file" - log "Wrote $out_file" -} - -compose_startup_apps -compose_window_rules \ No newline at end of file diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index d6e1b089..16742492 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -55,7 +55,7 @@ main() { case "$choice" in "view/edit User Defaults") file="$UserConfigs/01-UserDefaults.conf" ;; "view/edit ENV variables") file="$UserConfigs/ENVariables.conf" ;; - "view/edit Window Rules") file="$UserConfigs/WindowRules.conf" ;; + "view/edit Window Rules") file="$configs/WindowRules.conf" ;; "view/edit User Keybinds") file="$UserConfigs/UserKeybinds.conf" ;; "view/edit User Settings") file="$UserConfigs/UserSettings.conf" ;; "view/edit Startup Apps") file="$configs/Startup_Apps.conf" ;; diff --git a/copy.sh b/copy.sh index cd5f5212..b1cc6e1a 100755 --- a/copy.sh +++ b/copy.sh @@ -933,10 +933,6 @@ if [ -d "$BACKUP_DIR_PATH" ]; then done fi -# Compose merged configs (Startup_Apps and WindowRules) -if [ -x "$DIRPATH/scripts/ComposeHyprConfigs.sh" ]; then - "$DIRPATH/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true -fi printf "\n%.0s" {1..1} diff --git a/upgrade.sh b/upgrade.sh index 9aee3c2c..07ee1f8b 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -198,10 +198,6 @@ if version_gt "$latest_version" "$stored_version"; then # Set executable for initial-boot.sh chmod +x "$HOME/.config/hypr/initial-boot.sh" 2>&1 | tee -a "$LOG" - # Compose merged configs (Startup_Apps and WindowRules) - if [ -x "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" ]; then - "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true - fi else echo "$MAGENTA Upgrade declined. No files or directories changed" 2>&1 | tee -a "$LOG" fi -- cgit v1.2.3