diff --git a/.config/hypr/.initial_startup_done b/.config/hypr/.initial_startup_done new file mode 100644 index 00000000..e69de29b diff --git a/.config/hypr/Monitor_Profiles/default.conf b/.config/hypr/Monitor_Profiles/default.conf index a96cac7d..7e198f7f 100644 --- a/.config/hypr/Monitor_Profiles/default.conf +++ b/.config/hypr/Monitor_Profiles/default.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # default Monitor config # Monitor Configuration diff --git a/.config/hypr/UserConfigs/00-Readme b/.config/hypr/UserConfigs/00-Readme index e989d2bb..275919bb 100644 --- a/.config/hypr/UserConfigs/00-Readme +++ b/.config/hypr/UserConfigs/00-Readme @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== KooL's Hyprland-Dots diff --git a/.config/hypr/UserConfigs/01-UserDefaults.conf b/.config/hypr/UserConfigs/01-UserDefaults.conf index 7078e4c3..dd5f299a 100644 --- a/.config/hypr/UserConfigs/01-UserDefaults.conf +++ b/.config/hypr/UserConfigs/01-UserDefaults.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This is a file where you put your own default apps, default search Engine etc @@ -11,8 +16,8 @@ $edit=${EDITOR:-nano} # These two are for UserKeybinds.conf & Waybar Modules -$term = foot # Terminal -$files = nemo # File Manager +$term = kitty # Terminal +$files = thunar # File Manager # Default Search Engine for ROFI Search (SUPER S) -$Search_Engine = "https://www.google.com/search?q={}" +$Search_Engine = "https://www.google.com/search?q={}" \ No newline at end of file diff --git a/.config/hypr/UserConfigs/ENVariables.conf b/.config/hypr/UserConfigs/ENVariables.conf index 41d9b2d4..e2b3498a 100644 --- a/.config/hypr/UserConfigs/ENVariables.conf +++ b/.config/hypr/UserConfigs/ENVariables.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Environment variables. See https://wiki.hyprland.org/Configuring/Environment-variables/ # Set your defaults editor through ENV in ~/.config/hypr/UserConfigs/01-UserDefaults.conf diff --git a/.config/hypr/UserConfigs/LaptopDisplay.conf b/.config/hypr/UserConfigs/LaptopDisplay.conf index 9f766582..a9129190 100644 --- a/.config/hypr/UserConfigs/LaptopDisplay.conf +++ b/.config/hypr/UserConfigs/LaptopDisplay.conf @@ -1,3 +1,9 @@ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # NOTE, THIS FILE IS BEING USED by disabling Laptop display monitor behaviour when closing lid. # See notes on Laptops.conf diff --git a/.config/hypr/UserConfigs/Laptops.conf b/.config/hypr/UserConfigs/Laptops.conf index af5cb583..b4e3cbdc 100644 --- a/.config/hypr/UserConfigs/Laptops.conf +++ b/.config/hypr/UserConfigs/Laptops.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # See https://wiki.hyprland.org/Configuring/Keywords/ for more variable settings # These configs are mostly for laptops. This is addemdum to Keybinds.conf diff --git a/.config/hypr/UserConfigs/Startup_Apps.conf b/.config/hypr/UserConfigs/Startup_Apps.conf index f00acf90..8a3de78a 100644 --- a/.config/hypr/UserConfigs/Startup_Apps.conf +++ b/.config/hypr/UserConfigs/Startup_Apps.conf @@ -1,3 +1,8 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Commands and Apps to be executed at launch diff --git a/.config/hypr/UserConfigs/UserAnimations.conf b/.config/hypr/UserConfigs/UserAnimations.conf index 0f40b5e6..aebff1be 100644 --- a/.config/hypr/UserConfigs/UserAnimations.conf +++ b/.config/hypr/UserConfigs/UserAnimations.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== animations { enabled = yes diff --git a/.config/hypr/UserConfigs/UserDecorations.conf b/.config/hypr/UserConfigs/UserDecorations.conf index 0b450904..d962092f 100644 --- a/.config/hypr/UserConfigs/UserDecorations.conf +++ b/.config/hypr/UserConfigs/UserDecorations.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Decoration Settings # Hyprland Wiki Links @@ -12,14 +17,14 @@ general { border_size = 2 gaps_in = 2 gaps_out = 4 - - col.active_border = $color12 + + col.active_border = $color12 col.inactive_border = $color10 } decoration { rounding = 10 - + active_opacity = 1.0 inactive_opacity = 0.9 fullscreen_opacity = 1.0 @@ -37,13 +42,13 @@ decoration { color_inactive = $color10 } - blur { - enabled = true + enabled = true size = 6 - passes = 2 - ignore_opacity = true + passes = 3 new_optimizations = true + xray = true + ignore_opacity = true special = true popups = true } diff --git a/.config/hypr/UserConfigs/UserKeybinds.conf b/.config/hypr/UserConfigs/UserKeybinds.conf index e140cfe4..cc19ff78 100644 --- a/.config/hypr/UserConfigs/UserKeybinds.conf +++ b/.config/hypr/UserConfigs/UserKeybinds.conf @@ -1,11 +1,15 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This is where you put your own keybinds. Be Mindful to check as well ~/.config/hypr/configs/Keybinds.conf to avoid conflict # if you think I should replace the Pre-defined Keybinds in ~/.config/hypr/configs/Keybinds.conf , submit an issue or let me know in DC and present me a valid reason as to why, such as conflicting with global shortcuts, etc etc # See https://wiki.hyprland.org/Configuring/Keywords/ for more settings and variables # See also Laptops.conf for laptops keybinds -# /* ---- ✴️ Variables ✴️ ---- */ # $mainMod = SUPER $scriptsDir = $HOME/.config/hypr/scripts $UserScripts = $HOME/.config/hypr/UserScripts diff --git a/.config/hypr/UserConfigs/UserSettings.conf b/.config/hypr/UserConfigs/UserSettings.conf index d1a39ffe..1573afda 100644 --- a/.config/hypr/UserConfigs/UserSettings.conf +++ b/.config/hypr/UserConfigs/UserSettings.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # User Settings # This is where you put your own settings as this will not be touched during update # if the upgrade.sh is used. diff --git a/.config/hypr/UserConfigs/WindowRules.conf b/.config/hypr/UserConfigs/WindowRules.conf index ee9eb317..b6d65135 100644 --- a/.config/hypr/UserConfigs/WindowRules.conf +++ b/.config/hypr/UserConfigs/WindowRules.conf @@ -1,6 +1,18 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For window rules and layerrules # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # This file is used to add or overwrite window rules # This file will not be modified during dotfiles updates + + +# Optional Layer rules +# To Resolve blurred corners in rofi Uncomment +# layerrule = blur on, ignore_alpha 0, match:namespace rofi + + diff --git a/.config/hypr/UserConfigs/WorkSpaceRules.conf b/.config/hypr/UserConfigs/WorkSpaceRules.conf index aa86b35c..7d45ec16 100644 --- a/.config/hypr/UserConfigs/WorkSpaceRules.conf +++ b/.config/hypr/UserConfigs/WorkSpaceRules.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # NOTE: THIS IS NOT BEING SOURCED by hyprland # It is only here as a guide if you want to do it manually diff --git a/.config/hypr/UserScripts/00-Readme b/.config/hypr/UserScripts/00-Readme index 091bac85..259fc9d9 100755 --- a/.config/hypr/UserScripts/00-Readme +++ b/.config/hypr/UserScripts/00-Readme @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Place your new scripts here. # If you need to edit a script from main script (~/.config/hypr/scripts), copy it on this directory, and edit. diff --git a/.config/hypr/UserScripts/RainbowBorders-low-cpu.sh b/.config/hypr/UserScripts/RainbowBorders-low-cpu.sh new file mode 100755 index 00000000..a8de4c89 --- /dev/null +++ b/.config/hypr/UserScripts/RainbowBorders-low-cpu.sh @@ -0,0 +1,237 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# RainbowBorders-low-cpu.sh — low-overhead animated rainbow border for Hyprland +# +# Goal +# Animate Hyprland's active border with a rotating rainbow gradient while +# minimizing CPU usage on older systems by: +# - Using a modest update rate (default 1.0s) and larger angle steps +# - Avoiding subshell-heavy work inside the loop +# - Using Hyprland's command socket via socat when available +# - Quoting/validating inputs and suppressing noisy output +# - Preventing multiple concurrent instances +# - Optionally restoring the previous border value on exit +# +# Credits +# Initial source/idea by: DemiGoD +# Adaptation and optimization for low-CPU usage by: Hyprland-Dots maintainers +# +# Usage +# You can customize behavior via environment variables when launching: +# RB_INTERVAL Float seconds between updates (default: 1.0) +# RB_STEP_DEG Integer degrees per tick (default: 10) +# RB_START_DEG Integer starting angle (default: 0) +# RB_TARGET Hypr option to update (default: general:col.active_border) +# RB_COLORS Space-separated color list (default: 10-color rainbow below) +# RB_RESTORE If "1", attempt to restore previous value on exit (loop mode; default: 1) +# RB_LOCKFILE Path to a PID lock file (loop mode; default: /tmp/hypr-rainbowborders.lock) +# RB_TRANSPORT auto|socat|hyprctl (default: auto) +# - socat: send each command via Hyprland's command socket +# using socat (one short-lived connection per tick) +# - hyprctl: spawn hyprctl each tick +# - auto: prefer socat if possible, otherwise hyprctl +# RB_ONCE 1 to apply once and exit (no animation; default: 0) +# +# Example (slower animation): +# RB_INTERVAL=1.5 RB_STEP_DEG=12 ~/.config/hypr/UserScripts/RainbowBorders-low-cpu.sh & +# +# Notes +# - This focuses on the active border only. Animating inactive borders too +# will increase updates and CPU usage. +# - Higher RB_INTERVAL (e.g., 1.0–2.0s) and larger RB_STEP_DEG (10–20) +# reduce per-second work substantially. + +set -u + +# Defaults (can be overridden by env vars) +RB_INTERVAL="${RB_INTERVAL:-1.0}" +RB_STEP_DEG="${RB_STEP_DEG:-10}" +RB_START_DEG="${RB_START_DEG:-0}" +RB_TARGET="${RB_TARGET:-general:col.active_border}" +RB_COLORS_DEFAULT="0xffff0000 0xffff8000 0xffffff00 0xff80ff00 0xff00ff00 0xff00ff80 0xff00ffff 0xff0080ff 0xff0000ff 0xff8000ff" +RB_COLORS="${RB_COLORS:-$RB_COLORS_DEFAULT}" +RB_RESTORE="${RB_RESTORE:-1}" +RB_LOCKFILE="${RB_LOCKFILE:-/tmp/hypr-rainbowborders.lock}" +RB_TRANSPORT="${RB_TRANSPORT:-auto}" +RB_ONCE="${RB_ONCE:-0}" + +# ---------- helpers ---------- +log() { printf '[RainbowBorders-low-cpu] %s\n' "$*" >&2; } + +die() { log "ERROR: $*"; exit 1; } + +usage() { + cat <<'EOF' +Usage: RainbowBorders-low-cpu.sh [options] + +Options: + -h, --help Show this help and exit + --once, --run-once, -1 + Apply the current gradient once and exit (no animation). + In this mode, RB_RESTORE is ignored (the color persists). + +Environment overrides: + RB_INTERVAL Seconds between updates (default: 1.0) + RB_STEP_DEG Degrees per tick (default: 10) + RB_START_DEG Starting angle (default: 0) + RB_TARGET Hypr option to update (default: general:col.active_border) + RB_COLORS Space-separated colors (default: 10-color rainbow) + RB_RESTORE 1 to restore previous value on exit (loop mode only; default: 1) + RB_LOCKFILE PID lock path (loop mode only; default: /tmp/hypr-rainbowborders.lock) + RB_TRANSPORT auto|socat|hyprctl (default: auto) + RB_ONCE 1 for one-shot mode (same as --once) + +Examples: + Animate (light CPU): + RB_INTERVAL=1.5 RB_STEP_DEG=12 ./RainbowBorders-low-cpu.sh & + + Set a static rainbow once (no animation): + ./RainbowBorders-low-cpu.sh --once +EOF +} + +is_float() { [[ "$1" =~ ^[0-9]+(\.[0-9]+)?$|^\.[0-9]+$ ]]; } + +is_int() { [[ "$1" =~ ^[0-9]+$ ]]; } + +# ---------- parse CLI flags ---------- +while (( $# )); do + case "$1" in + -h|--help) usage; exit 0 ;; + --once|--run-once|-1) RB_ONCE=1 ;; + *) log "Unknown option: $1"; usage; exit 2 ;; + esac + shift +done + +# ---------- validation ---------- +if ! is_float "$RB_INTERVAL"; then + log "WARN: RB_INTERVAL='$RB_INTERVAL' invalid; defaulting to 1.0" + RB_INTERVAL="1.0" +fi +if ! is_int "$RB_STEP_DEG"; then + log "WARN: RB_STEP_DEG='$RB_STEP_DEG' invalid; defaulting to 10" + RB_STEP_DEG="10" +fi +if ! is_int "$RB_START_DEG"; then + log "WARN: RB_START_DEG='$RB_START_DEG' invalid; defaulting to 0" + RB_START_DEG="0" +fi + +# ---------- single-instance lock (PID file) ---------- +cleanup_lock() { [[ -f "$RB_LOCKFILE" ]] && rm -f "$RB_LOCKFILE"; } + +if [[ "$RB_ONCE" != "1" ]]; then + if [[ -f "$RB_LOCKFILE" ]]; then + oldpid="$(cat "$RB_LOCKFILE" 2>/dev/null || true)" + if [[ -n "${oldpid:-}" ]] && kill -0 "$oldpid" 2>/dev/null; then + log "Another instance is running (pid=$oldpid). Exiting." + exit 0 + else + # Stale lock + rm -f "$RB_LOCKFILE" || true + fi + fi + printf '%d' "$$" >"$RB_LOCKFILE" 2>/dev/null || die "Cannot write lockfile $RB_LOCKFILE" +fi + +# ---------- transport (socat vs hyprctl) ---------- +RB_MODE="" +RB_SOCK="" + +open_transport() { + local want="$RB_TRANSPORT" + local uid; uid=$(id -u 2>/dev/null || echo 0) + local base="${XDG_RUNTIME_DIR:-/run/user/$uid}" + local sig="${HYPRLAND_INSTANCE_SIGNATURE:-}" + if [[ -n "$sig" ]]; then + RB_SOCK="$base/hypr/$sig/.socket.sock" + fi + + # Prefer socat if requested/allowed and socket is available + if [[ "$want" == "socat" || "$want" == "auto" ]]; then + if command -v socat >/dev/null 2>&1 && [[ -n "$RB_SOCK" && -S "$RB_SOCK" ]]; then + RB_MODE="socat" + return 0 + elif [[ "$want" == "socat" ]]; then + die "RB_TRANSPORT=socat requested but 'socat' or Hyprland socket is unavailable" + fi + fi + + # Fallback to hyprctl: require presence and connectivity + command -v hyprctl >/dev/null 2>&1 || die "hyprctl not found and socat transport unavailable" + if ! hyprctl monitors >/dev/null 2>&1; then + die "hyprctl cannot reach a running Hyprland instance" + fi + RB_MODE="hyprctl" + return 0 +} + +open_transport || exit 1 +log "Using transport: $RB_MODE" + +# ---------- optional restore of previous border value ---------- +PREV_VALUE="" +if [[ "$RB_RESTORE" == "1" && "$RB_ONCE" != "1" ]]; then + if command -v hyprctl >/dev/null 2>&1; then + # hyprctl getoption prints various formats; try common keys + PREV_VALUE="$(hyprctl getoption "$RB_TARGET" 2>/dev/null \ + | sed -n 's/^.*str:[[:space:]]\+//p; s/^.*string:[[:space:]]\+//p; s/^.*value:[[:space:]]\+//p' \ + | tail -n1)" + fi +fi + +restore_previous() { + if [[ "$RB_RESTORE" == "1" && -n "${PREV_VALUE:-}" ]]; then + if [[ "$RB_MODE" == "socat" ]]; then + printf 'keyword %s %s\n' "$RB_TARGET" "$PREV_VALUE" | socat - "UNIX-CONNECT:$RB_SOCK" >/dev/null 2>&1 || true + else + hyprctl keyword "$RB_TARGET" "$PREV_VALUE" >/dev/null 2>&1 || true + fi + fi +} + +on_exit() { + restore_previous + cleanup_lock +} + +# In loop mode, set traps for cleanup/restore +if [[ "$RB_ONCE" != "1" ]]; then + trap on_exit INT TERM EXIT +fi + +# ---------- main logic ---------- +angle=$(( RB_START_DEG % 360 )) +STEP=$(( RB_STEP_DEG % 360 )) +(( STEP == 0 )) && STEP=10 + +write_border() { + local a="$1" + if [[ "$RB_MODE" == "socat" ]]; then + printf 'keyword %s %s %sdeg\n' "$RB_TARGET" "$RB_COLORS" "$a" | socat - "UNIX-CONNECT:$RB_SOCK" >/dev/null 2>&1 || true + else + hyprctl keyword "$RB_TARGET" "$RB_COLORS ${a}deg" >/dev/null 2>&1 || true + fi +} + +if [[ "$RB_ONCE" == "1" ]]; then + # Single write and exit; do not restore previous (intended to persist) + write_border "$angle" || log "WARN: one-shot write failed" + exit 0 +fi + +# Prime first write (avoid waiting one interval) +write_border "$angle" || log "WARN: initial write failed" + +while :; do + # Advance angle and write; failures are non-fatal to keep CPU use minimal + angle=$(( (angle + STEP) % 360 )) + write_border "$angle" + sleep "$RB_INTERVAL" +done diff --git a/.config/hypr/UserScripts/RainbowBorders.bak.sh b/.config/hypr/UserScripts/RainbowBorders.bak.sh new file mode 100755 index 00000000..87f13c34 --- /dev/null +++ b/.config/hypr/UserScripts/RainbowBorders.bak.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Smooth border cycling effect using Wallust palette or full rainbow + +# Possible values: "wallust_random", "rainbow", "gradient_flow" +EFFECT_TYPE="gradient_flow" + +WALLUST_COLORS_SOURCE="$HOME/.config/hypr/wallust/wallust-hyprland.conf" + +WALLUST_COLORS=() + +# ---------- LOAD WALLUST COLORS ---------- +if [[ "$EFFECT_TYPE" == "wallust_random" || "$EFFECT_TYPE" == "gradient_flow" ]]; then + # Accept either hex (0xffRRGGBB) or rgb(r,g,b) and normalize to 0xffRRGGBB + mapfile -t WALLUST_COLORS < <( + grep -E '^\$color[0-9]+' "$WALLUST_COLORS_SOURCE" | awk ' + function hex2(s){ return (length(s)==6 ? "0xff"s : ""); } + function rgb2(r,g,b){ return sprintf("0xff%02x%02x%02x", r, g, b); } + { + if (match($0, /0x([0-9a-fA-F]{8})/, m)) { print "0x" m[1]; next } + if (match($0, /#([0-9a-fA-F]{6})/, m)) { print hex2(m[1]); next } + if (match($0, /rgb\(([0-9]+),[ ]*([0-9]+),[ ]*([0-9]+)\)/, m)) { + print rgb2(m[1], m[2], m[3]); next + } + }' + ) + + if (( ${#WALLUST_COLORS[@]} == 0 )); then + # If wallust colors can't be loaded, fall back to random_hex + EFFECT_TYPE="rainbow" + fi +fi + +# ---------- RANDOM WALLUST COLORS ---------- +function wallust_random() { + echo "${WALLUST_COLORS[RANDOM % ${#WALLUST_COLORS[@]}]}" +} + +# ---------- RAINBOW COLORS ---------- +function random_hex() { + echo "0xff$(openssl rand -hex 3)" +} + +# ---------- FLOW MODE ---------- +BASE_COLOR="${WALLUST_COLORS[10]}" +GRAD1_COLOR="${WALLUST_COLORS[14]}" +GRAD2_COLOR="${WALLUST_COLORS[13]}" +GLOW_COLOR="${WALLUST_COLORS[15]}" + +MAX_POS=10 +GLOW_POS=0 + +function gradient_flow_color() { + local pos=$1 + local d=$(( pos - GLOW_POS )) + + # wrap distance (-9..9) + if (( d > MAX_POS/2 )); then d=$((d - MAX_POS)); fi + if (( d < -MAX_POS/2 )); then d=$((d + MAX_POS)); fi + + case "${d#-}" in + 0) echo "$GLOW_COLOR" ;; + 1) echo "$GRAD1_COLOR" ;; + 2) echo "$GRAD2_COLOR" ;; + *) echo "$BASE_COLOR" ;; + esac + + if (( pos == MAX_POS - 1 )); then + GLOW_POS=$(( (GLOW_POS + 1) % MAX_POS )) + fi +} + +# ---------- Main function ---------- + +function get_color() { + if [[ "$EFFECT_TYPE" == "wallust_random" && ${#WALLUST_COLORS[@]} -gt 0 ]]; then + wallust_random + elif [[ "$EFFECT_TYPE" == "gradient_flow" && ${#WALLUST_COLORS[@]} -ge 16 ]]; then + gradient_flow_color "$1" + else + random_hex + fi +} + +# border effect for ACTIVE window +hyprctl keyword general:col.active_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg + +# border effect for INACTIVE windows +#hyprctl keyword general:col.inactive_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg \ No newline at end of file diff --git a/.config/hypr/UserScripts/RainbowBorders.sh b/.config/hypr/UserScripts/RainbowBorders.sh deleted file mode 100755 index 0a7fd721..00000000 --- a/.config/hypr/UserScripts/RainbowBorders.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# for rainbow borders animation - -function random_hex() { - random_hex=("0xff$(openssl rand -hex 3)") - echo $random_hex -} - -# rainbow colors only for active window -hyprctl keyword general:col.active_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg - -# rainbow colors for inactive window (uncomment to take effect) -#hyprctl keyword general:col.inactive_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg \ No newline at end of file diff --git a/.config/hypr/UserScripts/RofiBeats.sh b/.config/hypr/UserScripts/RofiBeats.sh index a002a518..057d53b9 100755 --- a/.config/hypr/UserScripts/RofiBeats.sh +++ b/.config/hypr/UserScripts/RofiBeats.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # RofiBeats - unified, dynamic UI (add, remove, manage, play) mDIR="$HOME/Music/" diff --git a/.config/hypr/UserScripts/RofiCalc.sh b/.config/hypr/UserScripts/RofiCalc.sh index b72d5f3e..40a7ca3f 100755 --- a/.config/hypr/UserScripts/RofiCalc.sh +++ b/.config/hypr/UserScripts/RofiCalc.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ diff --git a/.config/hypr/UserScripts/Tak0-Autodispatch.sh b/.config/hypr/UserScripts/Tak0-Autodispatch.sh index 114a3e8e..b0607e13 100755 --- a/.config/hypr/UserScripts/Tak0-Autodispatch.sh +++ b/.config/hypr/UserScripts/Tak0-Autodispatch.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash -# USAGE / ІНСТРУКЦІЯ: +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# USAGE: # 1) Run from terminal: # ./dispatch.sh # Example: @@ -14,77 +20,49 @@ # Notes: # - Script waits about ~9 seconds (30 iterations of 0.3 sec) for window to appear. # - Uses hyprctl and jq, so these tools must be installed. -# -# USAGE / ІНСТРУКЦІЯ: -# 1) Запуск з терміналу: -# ./dispatch.sh -# Наприклад: -# ./dispatch.sh discord 2 -# -# 2) Виклик з конфігурації Hyprland (у файлі hyprland.conf): -# exec-once = /path/to/dispatch.sh -# -# Логи зберігаються у файлі dispatch.log поруч зі скриптом. -# Якщо вікно не з'явилось або неправильно диспатчилось — інформація там. -# -# Примітки: -# - Скрипт чекає до ~9 секунд (30 ітерацій по 0.3 сек) поки вікно з'явиться. -# - Використовує hyprctl і jq, тому ці інструменти мають бути встановлені. LOGFILE="$(dirname "$0")/dispatch.log" # Log file path located next to the script. -# Файл логів розташований поруч зі скриптом. APP=$1 # The application command or window class to launch or match. -# Команда для запуску аплікації або клас вікна для пошуку. TARGET_WORKSPACE=$2 # The target workspace number where the window should be moved. -# Цільовий номер воркспейсу, куди потрібно перемістити вікно. # Check if required arguments are provided. -# Перевірка наявності необхідних параметрів. if [[ -z "$APP" || -z "$TARGET_WORKSPACE" ]]; then - echo "Usage: $0 " >> "$LOGFILE" 2>&1 - exit 1 + echo "Usage: $0 " >>"$LOGFILE" 2>&1 + exit 1 fi -echo "Starting dispatch of '$APP' to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE" +echo "Starting dispatch of '$APP' to workspace $TARGET_WORKSPACE at $(date)" >>"$LOGFILE" # Starting the dispatch process and logging the event. -# Початок процесу диспатчу, запис у лог. - # Avoid early workspace focus issues by switching workspace first. -# Уникаємо проблем з раннім фокусом, спочатку переключаємо воркспейс. -hyprctl dispatch workspace "$TARGET_WORKSPACE" >> "$LOGFILE" 2>&1 +hyprctl dispatch workspace "$TARGET_WORKSPACE" >>"$LOGFILE" 2>&1 sleep 0.4 # Launch the application in the background and disown it. -# Запускаємо аплікацію у фоновому режимі та відв’язуємо від терміналу. -$APP & disown +$APP & +disown pid=$! -echo "Launched '$APP' with PID $pid" >> "$LOGFILE" +echo "Launched '$APP' with PID $pid" >>"$LOGFILE" # Log the launched process ID. -# Лог процесу запуску з PID. - # Wait for the application window to appear (matching window class). -# Чекаємо появи вікна аплікації (за класом вікна). for i in {1..30}; do - win=$(hyprctl clients -j | jq -r --arg APP "$APP" ' + win=$(hyprctl clients -j | jq -r --arg APP "$APP" ' .[] | select(.class | test($APP;"i")) | .address' 2>>"$LOGFILE") - if [[ -n "$win" ]]; then - echo "Found window $win for app '$APP', moving to workspace $TARGET_WORKSPACE" >> "$LOGFILE" - # Move the window to the target workspace. - # Переміщаємо вікно на цільовий воркспейс. - hyprctl dispatch movetoworkspace "$TARGET_WORKSPACE,address:$win" >> "$LOGFILE" 2>&1 - exit 0 - fi - sleep 0.3 + if [[ -n "$win" ]]; then + echo "Found window $win for app '$APP', moving to workspace $TARGET_WORKSPACE" >>"$LOGFILE" + # Move the window to the target workspace. + hyprctl dispatch movetoworkspace "$TARGET_WORKSPACE,address:$win" >>"$LOGFILE" 2>&1 + exit 0 + fi + sleep 0.3 done -echo "ERROR: Window for '$APP' was NOT found or dispatched properly to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE" +echo "ERROR: Window for '$APP' was NOT found or dispatched properly to workspace $TARGET_WORKSPACE at $(date)" >>"$LOGFILE" # Log error if window was not found or dispatched correctly. -# Запис помилки, якщо вікно не знайдено або неправильно диспатчено. exit 1 diff --git a/.config/hypr/UserScripts/WallpaperAutoChange.sh b/.config/hypr/UserScripts/WallpaperAutoChange.sh index 6d8e8735..faec6335 100755 --- a/.config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/.config/hypr/UserScripts/WallpaperAutoChange.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes # This script will randomly go through the files of a directory, setting it @@ -10,6 +15,11 @@ wallust_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') +if command -v awww >/dev/null 2>&1; then + WWW="awww" +else + WWW="swww" +fi if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then echo "Usage: @@ -17,7 +27,7 @@ if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then exit 1 fi -# Edit below to control the images transition +# Edit below to control the images transition (swww/awww) export SWWW_TRANSITION_FPS=60 export SWWW_TRANSITION_TYPE=simple @@ -31,7 +41,7 @@ while true; do done \ | sort -n | cut -d':' -f2- \ | while read -r img; do - swww img -o $focused_monitor "$img" + $WWW img -o $focused_monitor "$img" # Regenerate colors from the exact image path to avoid cache races $HOME/.config/hypr/scripts/WallustSwww.sh "$img" # Refresh UI components that depend on wallust output diff --git a/.config/hypr/UserScripts/WallpaperEffects.sh b/.config/hypr/UserScripts/WallpaperEffects.sh index 89577efa..e1c8fe83 100755 --- a/.config/hypr/UserScripts/WallpaperEffects.sh +++ b/.config/hypr/UserScripts/WallpaperEffects.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Wallpaper Effects using ImageMagick (SUPER SHIFT W) # Variables @@ -9,17 +14,26 @@ wallpaper_output="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" SCRIPTSDIR="$HOME/.config/hypr/scripts" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') rofi_theme="$HOME/.config/rofi/config-wallpaper-effect.rasi" +if command -v awww >/dev/null 2>&1; then + WWW="awww" +else + WWW="swww" +fi # Directory for swaync iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" -# swww transition config +# swww/awww transition config FPS=60 TYPE="wipe" DURATION=2 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW" == "swww" || "$WWW" == "awww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi # Define ImageMagick effects declare -A effects=( @@ -45,7 +59,7 @@ declare -A effects=( # Function to apply no effects no-effects() { - swww img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && + $WWW img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && wait $! wallust run "$wallpaper_current" -s && wait $! @@ -83,7 +97,7 @@ main() { done sleep 1 - swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & + $WWW img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & sleep 2 @@ -106,43 +120,3 @@ fi main sleep 1 - -if [[ -n "$choice" ]]; then - # Resolve SDDM themes directory (standard and NixOS path) - sddm_themes_dir="" - if [ -d "/usr/share/sddm/themes" ]; then - sddm_themes_dir="/usr/share/sddm/themes" - elif [ -d "/run/current-system/sw/share/sddm/themes" ]; then - sddm_themes_dir="/run/current-system/sw/share/sddm/themes" - fi - - if [ -n "$sddm_themes_dir" ]; then - sddm_simple="$sddm_themes_dir/simple_sddm_2" - - # Only prompt if theme exists and its Backgrounds directory is writable - if [ -d "$sddm_simple" ] && [ -w "$sddm_simple/Backgrounds" ]; then - # Check if yad is running to avoid multiple yad notification - if pidof yad > /dev/null; then - killall yad - fi - - if yad --info --text="Set current wallpaper as SDDM background?\n\nNOTE: This only applies to SIMPLE SDDM v2 Theme" \ - --text-align=left \ - --title="SDDM Background" \ - --timeout=5 \ - --timeout-indicator=right \ - --button="yad-yes:0" \ - --button="yad-no:1" \ - ; then - - # Check if terminal exists - if ! command -v "$terminal" &>/dev/null; then - notify-send -i "$iDIR/ja.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" - exit 1 - fi - - exec "$SCRIPTSDIR/sddm_wallpaper.sh" --effects - fi - fi - fi -fi diff --git a/.config/hypr/UserScripts/WallpaperRandom.sh b/.config/hypr/UserScripts/WallpaperRandom.sh index 654d4bd3..70f051f7 100755 --- a/.config/hypr/UserScripts/WallpaperRandom.sh +++ b/.config/hypr/UserScripts/WallpaperRandom.sh @@ -1,28 +1,42 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for Random Wallpaper ( CTRL ALT W) -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') -PICS=($(find -L ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \))) +PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \))) RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} -# Transition config +# Transition config (swww/awww) FPS=30 TYPE="random" DURATION=1 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW_CMD" == "swww" || "$WWW_CMD" == "awww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi +if ! "$WWW_CMD" query >/dev/null 2>&1; then + "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & +fi - -swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS +"$WWW_CMD" img -o "$focused_monitor" "$RANDOMPICS" $SWWW_PARAMS wait $! -"$SCRIPTSDIR/WallustSwww.sh" && +"$SCRIPTSDIR/WallustSwww.sh" "$RANDOMPICS" && wait $! sleep 2 diff --git a/.config/hypr/UserScripts/WallpaperSelect.sh b/.config/hypr/UserScripts/WallpaperSelect.sh index 0029d3e5..31c7969a 100755 --- a/.config/hypr/UserScripts/WallpaperSelect.sh +++ b/.config/hypr/UserScripts/WallpaperSelect.sh @@ -1,23 +1,37 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This script for selecting wallpapers (SUPER W) # WALLPAPERS PATH terminal=kitty -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" +wallpaper_link="$HOME/.config/rofi/.current_wallpaper" # Directory for swaync iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" -# swww transition config +# swww/awww transition config FPS=60 TYPE="any" DURATION=2 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW_CMD" == "swww" || "$WWW_CMD" == "awww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi + # Check if package bc exists if ! command -v bc &>/dev/null; then @@ -29,6 +43,9 @@ fi rofi_theme="$HOME/.config/rofi/config-wallpaper.rasi" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') +per_monitor_wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current_${focused_monitor}" +per_monitor_wallpaper_link="$HOME/.config/rofi/.current_wallpaper_${focused_monitor}" + # Ensure focused_monitor is detected if [[ -z "$focused_monitor" ]]; then notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Could not detect focused monitor" @@ -45,7 +62,7 @@ rofi_override="element-icon{size:${adjusted_icon_size}%;}" # Kill existing wallpaper daemons for video kill_wallpaper_for_video() { - swww kill 2>/dev/null + "$WWW_CMD" kill 2>/dev/null pkill mpvpaper 2>/dev/null pkill swaybg 2>/dev/null pkill hyprpaper 2>/dev/null @@ -65,7 +82,19 @@ mapfile -d '' PICS < <(find -L "${wallDIR}" -type f \( \ -iname "*.mp4" -o -iname "*.mkv" -o -iname "*.mov" -o -iname "*.webm" \) -print0) RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}" -RANDOM_PIC_NAME=". random" +RANDOM_PIC_NAME="$(basename "$RANDOM_PIC")" + +CURRENT_MON_PIC_PATH=$("$WWW_CMD" query 2>/dev/null | grep "$focused_monitor" | awk '{print $NF}') +if [[ -z "$CURRENT_MON_PIC_PATH" ]]; then + if [[ -L "$wallpaper_link" ]]; then + CURRENT_MON_PIC_PATH="$(readlink -f "$wallpaper_link")" + elif [[ -f "$wallpaper_link" ]]; then + CURRENT_MON_PIC_PATH="$wallpaper_link" + elif [[ -f "$wallpaper_current" ]]; then + CURRENT_MON_PIC_PATH="$wallpaper_current" + fi +fi +CURRENT_MON_PIC_NAME=$(basename "$CURRENT_MON_PIC_PATH") # Rofi command rofi_command="rofi -i -show -dmenu -config $rofi_theme -theme-str $rofi_override" @@ -74,7 +103,10 @@ rofi_command="rofi -i -show -dmenu -config $rofi_theme -theme-str $rofi_override menu() { IFS=$'\n' sorted_options=($(sort <<<"${PICS[*]}")) - printf "%s\x00icon\x1f%s\n" "$RANDOM_PIC_NAME" "$RANDOM_PIC" + printf "%s\x00icon\x1f%s\n" "Random: $RANDOM_PIC_NAME" "$RANDOM_PIC" + if [[ -n "$CURRENT_MON_PIC_PATH" ]]; then + printf "%s\x00icon\x1f%s\n" "Current: $CURRENT_MON_PIC_NAME" "$CURRENT_MON_PIC_PATH" + fi for pic_path in "${sorted_options[@]}"; do pic_name=$(basename "$pic_path") @@ -98,49 +130,6 @@ menu() { done } -# Offer SDDM Simple Wallpaper Option (only for non-video wallpapers) -set_sddm_wallpaper() { - sleep 1 - - # Resolve SDDM themes directory (standard and NixOS path) - local sddm_themes_dir="" - if [ -d "/usr/share/sddm/themes" ]; then - sddm_themes_dir="/usr/share/sddm/themes" - elif [ -d "/run/current-system/sw/share/sddm/themes" ]; then - sddm_themes_dir="/run/current-system/sw/share/sddm/themes" - fi - - [ -z "$sddm_themes_dir" ] && return 0 - - local sddm_simple="$sddm_themes_dir/simple_sddm_2" - - # Only prompt if theme exists and its Backgrounds directory is writable - if [ -d "$sddm_simple" ] && [ -w "$sddm_simple/Backgrounds" ]; then - - # Check if yad is running to avoid multiple notifications - if pidof yad >/dev/null; then - killall yad - fi - - if yad --info --text="Set current wallpaper as SDDM background?\n\nNOTE: This only applies to SIMPLE SDDM v2 Theme" \ - --text-align=left \ - --title="SDDM Background" \ - --timeout=5 \ - --timeout-indicator=right \ - --button="yes:0" \ - --button="no:1"; then - - # Check if terminal exists - if ! command -v "$terminal" &>/dev/null; then - notify-send -i "$iDIR/error.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" - exit 1 - fi - - exec "$SCRIPTSDIR/sddm_wallpaper.sh" --normal - - fi - fi -} modify_startup_config() { local selected_file="$1" @@ -149,6 +138,7 @@ modify_startup_config() { # Check if it's a live wallpaper (video) if [[ "$selected_file" =~ \.(mp4|mkv|mov|webm)$ ]]; then # For video wallpapers: + sed -i '/^\s*exec-once\s*=\s*\$scriptsDir\/WallpaperDaemon\.sh\s*$/s/^/\#/' "$startup_config" sed -i '/^\s*exec-once\s*=\s*swww-daemon\s*--format\s*xrgb\s*$/s/^/\#/' "$startup_config" sed -i '/^\s*#\s*exec-once\s*=\s*mpvpaper\s*.*$/s/^#\s*//;' "$startup_config" @@ -159,6 +149,7 @@ modify_startup_config() { echo "Configured for live wallpaper (video)." else # For image wallpapers: + sed -i '/^\s*#\s*exec-once\s*=\s*\$scriptsDir\/WallpaperDaemon\.sh\s*$/s/^\s*#\s*//;' "$startup_config" sed -i '/^\s*#\s*exec-once\s*=\s*swww-daemon\s*--format\s*xrgb\s*$/s/^\s*#\s*//;' "$startup_config" sed -i '/^\s*exec-once\s*=\s*mpvpaper\s*.*$/s/^/\#/' "$startup_config" @@ -173,12 +164,25 @@ apply_image_wallpaper() { kill_wallpaper_for_image - if ! pgrep -x "swww-daemon" >/dev/null; then - echo "Starting swww-daemon..." - swww-daemon --format xrgb & + if ! pgrep -x "$WWW_DAEMON" >/dev/null; then + echo "Starting $WWW_DAEMON..." + "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & fi + # Wait for daemon to be ready before applying + for _ in {1..20}; do + "$WWW_CMD" query >/dev/null 2>&1 && break + sleep 0.1 + done + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS || { + sleep 0.2 + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + } + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS - swww img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + # Persist per-monitor wallpaper selection + mkdir -p "$(dirname "$per_monitor_wallpaper_current")" "$(dirname "$per_monitor_wallpaper_link")" + ln -sf "$image_path" "$per_monitor_wallpaper_link" || true + cp -f "$image_path" "$per_monitor_wallpaper_current" || true # Run additional scripts (pass the image path to avoid cache race conditions) "$SCRIPTSDIR/WallustSwww.sh" "$image_path" @@ -186,7 +190,6 @@ apply_image_wallpaper() { "$SCRIPTSDIR/Refresh.sh" sleep 1 - set_sddm_wallpaper } apply_video_wallpaper() { @@ -208,22 +211,33 @@ main() { choice=$(menu | $rofi_command) choice=$(echo "$choice" | xargs) RANDOM_PIC_NAME=$(echo "$RANDOM_PIC_NAME" | xargs) + raw_choice="$choice" + choice="${choice#Random: }" + choice="${choice#Current: }" if [[ -z "$choice" ]]; then echo "No choice selected. Exiting." exit 0 fi - # Handle random selection correctly - if [[ "$choice" == "$RANDOM_PIC_NAME" ]]; then - choice=$(basename "$RANDOM_PIC") + # Resolve selection directly when using Random/Current entries + if [[ "$raw_choice" == Random:\ * ]]; then + selected_file="$RANDOM_PIC" + elif [[ "$raw_choice" == Current:\ * && -n "$CURRENT_MON_PIC_PATH" ]]; then + selected_file="$CURRENT_MON_PIC_PATH" + elif [[ -f "$choice" ]]; then + selected_file="$choice" + else + # Handle random selection by name when needed + if [[ "$choice" == "$RANDOM_PIC_NAME" ]]; then + choice=$(basename "$RANDOM_PIC") + fi + choice_basename=$(basename "$choice" | sed 's/\(.*\)\.[^.]*$/\1/') + + # Search for the selected file in the wallpapers directory, including subdirectories + selected_file=$(find "$wallDIR" -iname "$choice_basename.*" -print -quit) fi - choice_basename=$(basename "$choice" | sed 's/\(.*\)\.[^.]*$/\1/') - - # Search for the selected file in the wallpapers directory, including subdirectories - selected_file=$(find "$wallDIR" -iname "$choice_basename.*" -print -quit) - if [[ -z "$selected_file" ]]; then echo "File not found. Selected choice: $choice" exit 1 diff --git a/.config/hypr/UserScripts/Weather.py b/.config/hypr/UserScripts/Weather.py index 6061f696..6905e0e1 100755 --- a/.config/hypr/UserScripts/Weather.py +++ b/.config/hypr/UserScripts/Weather.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Rewritten to use Open-Meteo APIs (worldwide, no API key) for robust weather data. # Outputs Waybar-compatible JSON and a simple text cache. diff --git a/.config/hypr/UserScripts/Weather.sh b/.config/hypr/UserScripts/Weather.sh index ac9abc13..c6683e07 100755 --- a/.config/hypr/UserScripts/Weather.sh +++ b/.config/hypr/UserScripts/Weather.sh @@ -1,17 +1,56 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # weather info from wttr. https://github.com/chubin/wttr.in # Remember to add city +# Function to get current city from IP address with fallback -city="" +# Get your current location with your IP adress +get_current_city() { + local city + + # First try: ipinfo.io + local location_data=$(curl -fsS "https://ipinfo.io/json" 2>/dev/null) + if [ $? -eq 0 ] && [ -n "$location_data" ]; then + city=$(echo "$location_data" | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + fi + + # Fallback: ipapi.co + city=$(curl -fsS "https://ipapi.co/json" 2>/dev/null | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + + # Last resort: ipwho.is + city=$(curl -fsS "https://ipwho.is/" 2>/dev/null | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + + # If all fail + echo "Unknown" >&2 + return 1 +} +city=$(get_current_city) -# if city is blank, use https://ipapi.co/json to get location from IP -if [ -z "$city" ]; then - city=$(curl -fsS https://ipapi.co/json | grep city | cut -f4 -d'"') +# If city is empty, that means the IP check failed, which means, we should use manual setting +if [ -z "$city" ] || [ "$city" = "Unknown" ]; then + # SET YOUR MANUAL CITY HERE + city=" " # ← Change this to your preferred city + echo "Using manual city: $city" >&2 fi - # URL-encode city for safe use in URLs encoded_city="$city" if command -v python3 >/dev/null 2>&1; then @@ -206,4 +245,4 @@ tooltip_json=$(json_escape "${weather[0]}: $temperature $cond_disp") printf '{"text":"%s", "alt":"%s", "tooltip":"%s"}\n' "$text_json" "$alt_json" "$tooltip_json" # Write a two-line cache with an actual newline between lines -printf ' %s \n%s %s\n' "$temperature" "$condition" "${weather[1]}" > "$HOME/.cache/.weather_cache" \ No newline at end of file +printf ' %s \n%s %s\n' "$temperature" "$condition" "${weather[1]}" > "$HOME/.cache/.weather_cache" diff --git a/.config/hypr/UserScripts/WeatherWrap.sh b/.config/hypr/UserScripts/WeatherWrap.sh index 10c125dc..a95bbd51 100755 --- a/.config/hypr/UserScripts/WeatherWrap.sh +++ b/.config/hypr/UserScripts/WeatherWrap.sh @@ -1,11 +1,40 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Weather entrypoint: prefer Python (Open‑Meteo), fallback to legacy Bash (wttr.in) SCRIPT_DIR="$(dirname "$0")" PY_SCRIPT="$SCRIPT_DIR/Weather.py" BASH_FALLBACK="$SCRIPT_DIR/Weather.sh" +# Function to check network connectivity +check_network() { + # Try multiple methods to check network + if ping -c1 -W1 8.8.8.8 >/dev/null 2>&1; then + return 0 + fi + + if ping -c1 -W1 1.1.1.1 >/dev/null 2>&1; then + return 0 + fi + + if curl -s --connect-timeout 2 "https://ipinfo.io" >/dev/null 2>&1; then + return 0 + fi + + return 1 +} + +# If no network, return offline status immediately +if ! check_network; then + echo '{"text":"󰖪", "alt":"Offline", "tooltip":"No network connection"}' + exit 0 +fi + run_fallback() { if [ -f "$BASH_FALLBACK" ]; then # Invoke via bash to avoid requiring +x and ensure consistent shell @@ -30,4 +59,4 @@ else echo "python3 not found in PATH — falling back to Weather.sh" >&2 run_fallback "$@" exit $? -fi \ No newline at end of file +fi diff --git a/.config/hypr/UserScripts/ZshChangeTheme.sh b/.config/hypr/UserScripts/ZshChangeTheme.sh index 690f0f13..94c1b448 100755 --- a/.config/hypr/UserScripts/ZshChangeTheme.sh +++ b/.config/hypr/UserScripts/ZshChangeTheme.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for Oh my ZSH theme ( CTRL SHIFT O) # preview of theme can be view here: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes diff --git a/.config/hypr/animations/00-default.conf b/.config/hypr/animations/00-default.conf index 0f40b5e6..f2d33d93 100644 --- a/.config/hypr/animations/00-default.conf +++ b/.config/hypr/animations/00-default.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # animations { enabled = yes diff --git a/.config/hypr/animations/01-default - v2.conf b/.config/hypr/animations/01-default - v2.conf index dfbbed7f..7ba66b79 100644 --- a/.config/hypr/animations/01-default - v2.conf +++ b/.config/hypr/animations/01-default - v2.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # old animations diff --git a/.config/hypr/animations/03- Disable Animation.conf b/.config/hypr/animations/03- Disable Animation.conf index f73a485b..a2013570 100644 --- a/.config/hypr/animations/03- Disable Animation.conf +++ b/.config/hypr/animations/03- Disable Animation.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # animations { enabled = no diff --git a/.config/hypr/animations/END-4.conf b/.config/hypr/animations/END-4.conf index 0ab8d1af..394a0a1a 100644 --- a/.config/hypr/animations/END-4.conf +++ b/.config/hypr/animations/END-4.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "End-4" # credit https://github.com/end-4/dots-hyprland diff --git a/.config/hypr/animations/HYDE - Vertical.conf b/.config/hypr/animations/HYDE - Vertical.conf index ccceccf4..6f0a0669 100644 --- a/.config/hypr/animations/HYDE - Vertical.conf +++ b/.config/hypr/animations/HYDE - Vertical.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Vertical" # credit https://github.com/prasanthrangan/hyprdots diff --git a/.config/hypr/animations/HYDE - default.conf b/.config/hypr/animations/HYDE - default.conf index 96c439d6..981414fd 100644 --- a/.config/hypr/animations/HYDE - default.conf +++ b/.config/hypr/animations/HYDE - default.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Default" # credit https://github.com/prasanthrangan/hyprdots diff --git a/.config/hypr/animations/HYDE - minimal-1.conf b/.config/hypr/animations/HYDE - minimal-1.conf index 6dbcf8ec..909f7140 100644 --- a/.config/hypr/animations/HYDE - minimal-1.conf +++ b/.config/hypr/animations/HYDE - minimal-1.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # # name "Minimal-1" # credit https://github.com/prasanthrangan/hyprdots- diff --git a/.config/hypr/animations/HYDE - minimal-2.conf b/.config/hypr/animations/HYDE - minimal-2.conf index 6ac56bc5..241bec05 100644 --- a/.config/hypr/animations/HYDE - minimal-2.conf +++ b/.config/hypr/animations/HYDE - minimal-2.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # # name "Minimal-2" # credit https://github.com/prasanthrangan/hyprdots diff --git a/.config/hypr/animations/HYDE - optimized.conf b/.config/hypr/animations/HYDE - optimized.conf index 7534c69d..e325b635 100644 --- a/.config/hypr/animations/HYDE - optimized.conf +++ b/.config/hypr/animations/HYDE - optimized.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Optimized" # credit https://github.com/prasanthrangan/hyprdots diff --git a/.config/hypr/animations/ML4W - classic.conf b/.config/hypr/animations/ML4W - classic.conf index af8c5e15..7f697afd 100644 --- a/.config/hypr/animations/ML4W - classic.conf +++ b/.config/hypr/animations/ML4W - classic.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Classic" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/ML4W - dynamic.conf b/.config/hypr/animations/ML4W - dynamic.conf index c5f1da0d..7c98675d 100644 --- a/.config/hypr/animations/ML4W - dynamic.conf +++ b/.config/hypr/animations/ML4W - dynamic.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Dynamic" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/ML4W - fast.conf b/.config/hypr/animations/ML4W - fast.conf index 9623c418..ce586478 100644 --- a/.config/hypr/animations/ML4W - fast.conf +++ b/.config/hypr/animations/ML4W - fast.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Fast" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/ML4W - high.conf b/.config/hypr/animations/ML4W - high.conf index e881d8be..bc38fc66 100644 --- a/.config/hypr/animations/ML4W - high.conf +++ b/.config/hypr/animations/ML4W - high.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "High" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/ML4W - moving.conf b/.config/hypr/animations/ML4W - moving.conf index 974a8f60..deb6ad32 100644 --- a/.config/hypr/animations/ML4W - moving.conf +++ b/.config/hypr/animations/ML4W - moving.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Moving" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/ML4W - standard.conf b/.config/hypr/animations/ML4W - standard.conf index aa312bb1..7a18c604 100644 --- a/.config/hypr/animations/ML4W - standard.conf +++ b/.config/hypr/animations/ML4W - standard.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Standard" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/.config/hypr/animations/Mahaveer - me-1.conf b/.config/hypr/animations/Mahaveer - me-1.conf index 7c93f3ef..8db554b0 100644 --- a/.config/hypr/animations/Mahaveer - me-1.conf +++ b/.config/hypr/animations/Mahaveer - me-1.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Me-1" # credit https://github.com/mahaveergurjar diff --git a/.config/hypr/animations/Mahaveer - me-2.conf b/.config/hypr/animations/Mahaveer - me-2.conf index 4cc2bfa0..3d9b35ae 100644 --- a/.config/hypr/animations/Mahaveer - me-2.conf +++ b/.config/hypr/animations/Mahaveer - me-2.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # # name "Me-2" # credit https://github.com/mahaveergurjar diff --git a/.config/hypr/application-style.conf b/.config/hypr/application-style.conf index 7e67f106..2e5fa4e8 100644 --- a/.config/hypr/application-style.conf +++ b/.config/hypr/application-style.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # as per Hyprland wiki: hyprland-qt-support provides a QML style for hypr* qt6 apps roundess = 2 diff --git a/.config/hypr/configs/ENVariables.conf b/.config/hypr/configs/ENVariables.conf index d38c2d36..0226d053 100644 --- a/.config/hypr/configs/ENVariables.conf +++ b/.config/hypr/configs/ENVariables.conf @@ -1,11 +1,16 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Environment variables. See https://wiki.hyprland.org/Configuring/Environment-variables/ # Set your defaults editor through ENV in ~/.config/hypr/UserConfigs/01-UserDefaults.conf # environment-variables -# Current Version of JakooLit Dotfiles: -env = DOTS_VERSION,2.3.18 +# Current Version of KoolDots: +env = DOTS_VERSION,2.3.23 ### Toolkit Backend Variables ### env = GDK_BACKEND,wayland,x11,* @@ -24,8 +29,8 @@ env = XDG_SESSION_TYPE,wayland ### QT Variables ### env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 -env = QT_QPA_PLATFORMTHEME,qt5ct env = QT_QPA_PLATFORMTHEME,qt6ct +env = QT_STYLE_OVERRIDE,kvantum ### hyprland-qt-support ### env = QT_QUICK_CONTROLS_STYLE,org.hyprland.style diff --git a/.config/hypr/configs/Keybinds.conf b/.config/hypr/configs/Keybinds.conf index b309b74b..bbc93b25 100644 --- a/.config/hypr/configs/Keybinds.conf +++ b/.config/hypr/configs/Keybinds.conf @@ -1,8 +1,12 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Default Keybinds # visit https://wiki.hyprland.org/Configuring/Binds/ for more info -# /* ---- ✴️ Variables ✴️ ---- */ # $mainMod = SUPER $scriptsDir = $HOME/.config/hypr/scripts $UserConfigs = $HOME/.config/hypr/UserConfigs @@ -11,7 +15,7 @@ $UserScripts = $HOME/.config/hypr/UserScripts # settings for User defaults apps - set your default terminal and file manager on this file source= $UserConfigs/01-UserDefaults.conf -#### STANDAR #### +#### STANDARD #### # Common shortcuts #bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window # Super Key to Launch rofi menu bindd = $mainMod, D, app launcher, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window @@ -21,8 +25,10 @@ bindd = $mainMod, A, desktop overview, exec, $scriptsDir/OverviewToggle.sh # tog #bindd = $mainMod, A, Quickshell overview, global, quickshell:overviewToggle # desktop overview (if installed) bindd = $mainMod, Return, Open terminal, exec, $term bindd = $mainMod, E, file manager, exec, $files +bindd = $mainMod, C, SSH session manager, exec, $scriptsDir/rofi-ssh-menu.sh # FEATURES / EXTRAS +bindd = $mainMod, T, Global theme switcher using Wallust, exec, $scriptsDir/ThemeChanger.sh #Global theme switcher bindd = $mainMod, H, help / cheat sheet, exec, $scriptsDir/KeyHints.sh bindd = $mainMod ALT, R, refresh bar and menus, exec, $scriptsDir/Refresh.sh bindd = $mainMod ALT, E, emoji menu, exec, $scriptsDir/RofiEmoji.sh @@ -30,20 +36,24 @@ bindd = $mainMod, S, web search, exec, $scriptsDir/RofiSearch.sh bindd = $mainMod CTRL, S, window switcher, exec, rofi -show window bindd = $mainMod ALT, O, toggle blur, exec, $scriptsDir/ChangeBlur.sh bindd = $mainMod SHIFT, G, toggle game mode, exec, $scriptsDir/GameMode.sh -bindd = $mainMod ALT, L, toggle master/dwindle layout, exec, $scriptsDir/ChangeLayout.sh +bindd = $mainMod ALT, L, toggle layouts, exec, $scriptsDir/ChangeLayout.sh toggle bindd = $mainMod ALT, V, clipboard manager, exec, $scriptsDir/ClipManager.sh bindd = $mainMod CTRL, R, rofi theme selector, exec, $scriptsDir/RofiThemeSelector.sh bindd = $mainMod CTRL SHIFT, R, rofi theme selector (modified), exec, pkill rofi || true && $scriptsDir/RofiThemeSelector-modified.sh +bindd = $mainMod CTRL, K, Kitty theme selector, exec, $scriptsDir/Kitty_themes.sh +bindd = $mainMod SHIFT, B, Set static Rainbow Border, exec, $UserScripts/RainbowBorders-low-cpu.sh --run-once +bindd = $mainMod SHIFT, H, Toggle Mute/Unmute for Active-Window, exec, $scriptsDir/Toggle-Active-Window-Audio.sh +bindd = ALT SHIFT, S, Hyprshot Screen Capture, exec, $scriptsDir/hyprshot.sh -m region -o $HOME/Pictures/Screenshots bindd = $mainMod SHIFT, F, fullscreen, fullscreen bindd = $mainMod CTRL, F, maximize window, fullscreen, 1 bindd = $mainMod, SPACE, Float current window, togglefloating, -bindd = $mainMod ALT, SPACE, Float all windows, exec, hyprctl dispatch workspaceopt allfloat +bindd = $mainMod ALT, SPACE, Float all windows, exec, $scriptsDir/Float-all-Windows.sh bindd = $mainMod SHIFT, Return, DropDown terminal, exec, $scriptsDir/Dropterminal.sh $term # Desktop zooming or magnifier bindd = $mainMod ALT, mouse_down, zoom in, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')" -bindd = $mainMod ALT, mouse_up, zoom out, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" +bindd = $mainMod ALT, mouse_up, zoom out, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" # Waybar / Bar related bindd = $mainMod CTRL ALT, B, toggle waybar on/off, exec, pkill -SIGUSR1 waybar @@ -58,7 +68,7 @@ bindd = $mainMod SHIFT, M, online music, exec, $UserScripts/RofiBeats.sh bindd = $mainMod, W, select wallpaper, exec, $UserScripts/WallpaperSelect.sh bindd = $mainMod SHIFT, W, wallpaper effects, exec, $UserScripts/WallpaperEffects.sh bindd = CTRL ALT, W, random wallpaper, exec, $UserScripts/WallpaperRandom.sh -bindd = $mainMod CTRL, O, toggle active window opacity, exec, hyprctl setprop active opaque toggle +bindd = $mainMod CTRL, O, toggle active window opacity, setprop, active opaque toggle bindd = $mainMod SHIFT, K, search keybinds, exec, $scriptsDir/KeyBinds.sh bindd = $mainMod SHIFT, A, animations menu, exec, $scriptsDir/Animations.sh bindd = $mainMod SHIFT, O, change oh-my-zsh theme, exec, $UserScripts/ZshChangeTheme.sh @@ -85,19 +95,38 @@ bindd = $mainMod SHIFT, E, Quick settings menu, exec, $scriptsDir/Kool_Quick_Set # Master Layout bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster bindd = $mainMod, I, add master, layoutmsg, addmaster -# NOTE: J/K bindings are set dynamically by scripts/KeybindsLayoutInit.sh and scripts/ChangeLayout.sh -# (we intentionally do not bind them statically here to avoid conflicts across layouts) -# bindd = $mainMod, J, cycle next, layoutmsg, cyclenext -# bindd = $mainMod, K, cycle previous, layoutmsg, cycleprev +# j/k cycle windows globally +bindd = $mainMod, j, cycle next, layoutmsg, cyclenext +bindd = $mainMod, k, cycle previous, layoutmsg, cycleprev bindd = $mainMod CTRL, Return, swap with master, layoutmsg, swapwithmaster # Dwindle Layout -bindd = $mainMod SHIFT, I, toggle split (dwindle), togglesplit +bindd = $mainMod SHIFT, I, toggle split (dwindle), layoutmsg, togglesplit bindd = $mainMod, P, toggle pseudo (dwindle), pseudo, # Works on either layout (Master or Dwindle) bindd = $mainMod, M, set split ratio 0.3, exec, hyprctl dispatch splitratio 0.3 +# layout aware keybinds +exec-once = $scriptsDir/ChangeLayout.sh init +# Direct layout binds +bindd = $mainMod ALT, 1, layout dwindle, exec, $scriptsDir/ChangeLayout.sh dwindle +bindd = $mainMod ALT, 2, layout master, exec, $scriptsDir/ChangeLayout.sh master +bindd = $mainMod ALT, 3, layout scrolling, exec, $scriptsDir/ChangeLayout.sh scrolling +bindd = $mainMod ALT, 4, layout monocle, exec, $scriptsDir/ChangeLayout.sh monocle + +# Scrolling Layout +bindd = $mainMod SHIFT, period, move to right column, layoutmsg, move +col +bindd = $mainMod SHIFT, comma, move to left column, layoutmsg, move -col +bindd = $mainMod ALT, comma, swap columns left, layoutmsg, swapcol l +bindd = $mainMod ALT, period, swap columns right, layoutmsg, swapcol r + +# Set layout to Horizontal (Standard "Tape" style) +bindd = $mainMod ALT, H, Horizonal scroll right,exec, hyprctl keyword scrolling:direction right +# Set layout to Vertical (Stacked "Column" style) +bindd = $mainMod ALT, V, Vertical Scroll down,exec, hyprctl keyword scrolling:direction down +# Create a toggle bind (e.g., Mod + Shift + S) +bindd = $mainMod ALT, S, toggle scrolling V/H, exec, bash -c '[[ $(hyprctl getoption scrolling:direction -j | jq -r ".str") == "right" ]] && hyprctl keyword scrolling:direction down || hyprctl keyword scrolling:direction right' # Cycle windows; if floating bring to top bindd = ALT, tab, cycle next window, cyclenext @@ -106,6 +135,8 @@ bindd = ALT, tab, bring active to top, bringactivetotop # Special Keys / Hot Keys bindeld = , xf86audioraisevolume, volume up, exec, $scriptsDir/Volume.sh --inc bindeld = , xf86audiolowervolume, volume down, exec, $scriptsDir/Volume.sh --dec +bindeld = ALT, xf86audioraisevolume, volume up precise, exec, $scriptsDir/Volume.sh --inc-precise +bindeld = ALT, xf86audiolowervolume, volume down precise, exec, $scriptsDir/Volume.sh --dec-precise bindld = , xf86AudioMicMute, toggle mic mute, exec, $scriptsDir/Volume.sh --toggle-mic bindld = , xf86audiomute, toggle mute, exec, $scriptsDir/Volume.sh --toggle bindld = , xf86Sleep, sleep, exec, systemctl suspend @@ -160,8 +191,8 @@ bindd = $mainMod CTRL, K, Move left into group, moveintogroup, l # Move active w bindd = $mainMod CTRL, L, Move Right into group, moveintogroup, r # Move active window right into a group bindd = $mainMod CTRL, H, Move active out of group, moveoutofgroup # Move active window out of group -# Try to dynamically move in grouped window and when ungrouped -# Not working for me DW 11/26/25 PR: https://github.com/JaKooLit/Hyprland-Dots/pull/872 +# Try to dynamically move in grouped window and when ungrouped +# Not working for me DW 11/26/25 PR: https://github.com/LinuxBeginnings/Hyprland-Dots/pull/872 #bindd = $mainMod, right, focus right, exec, bash -c 'if hyprctl activewindow -j | jq -e "((.grouped | type) == \"boolean\") or (.address == (.grouped[-1] // empty))" >/dev/null 2>&1; then hyprctl dispatch movefocus r; else hyprctl dispatch changegroupactive f; fi' #bindd = $mainMod, left, focus left, exec, bash -c 'if hyprctl activewindow -j | jq -e "((.grouped | type) == \"boolean\") or (.address == (.grouped[0] // empty))" >/dev/null 2>&1; then hyprctl dispatch movefocus l; else hyprctl dispatch changegroupactive b; fi' @@ -181,7 +212,7 @@ bindd = $mainMod, U, toggle special workspace, togglespecialworkspace, # The following mappings use the key codes to better support various keyboard layouts # 1 is code:10, 2 is code 11, etc -# Switch workspaces with mainMod + [0-9] +# Switch workspaces with mainMod + [0-9] bindd = $mainMod, code:10, workspace 1, workspace, 1 # NOTE: code:10 = key 1 bindd = $mainMod, code:11, workspace 2, workspace, 2 # NOTE: code:11 = key 2 bindd = $mainMod, code:12, workspace 3, workspace, 3 # NOTE: code:12 = key 3 diff --git a/.config/hypr/configs/Laptops.conf b/.config/hypr/configs/Laptops.conf index d6addb1d..9ee2b2b2 100644 --- a/.config/hypr/configs/Laptops.conf +++ b/.config/hypr/configs/Laptops.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # See https://wiki.hyprland.org/Configuring/Keywords/ for more variable settings # These configs are mostly for laptops. This is addemdum to Keybinds.conf diff --git a/.config/hypr/configs/Startup_Apps.conf b/.config/hypr/configs/Startup_Apps.conf index 0cfb6427..a27a12b9 100644 --- a/.config/hypr/configs/Startup_Apps.conf +++ b/.config/hypr/configs/Startup_Apps.conf @@ -1,60 +1,51 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Commands and Apps to be executed at launch (vendor defaults) - $scriptsDir = $HOME/.config/hypr/scripts $UserScripts = $HOME/.config/hypr/UserScripts - -$wallDIR=$HOME/Pictures/wallpapers $lock = $scriptsDir/LockScreen.sh $SwwwRandom = $UserScripts/WallpaperAutoChange.sh $livewallpaper="" +$wallDIR = $HOME/Pictures/wallpapers # change path manually here if needed ### wallpaper stuff ### -exec-once = swww-daemon --format xrgb +exec-once = $scriptsDir/WallpaperDaemon.sh #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 -exec-once = $scriptsDir/KeybindsLayoutInit.sh - -# 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 = $HOME/.config/hypr/scripts/Dropterminal.sh "kitty --class kitty-dropterm" & 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 = $scriptsDir/PortalHyprlandUbuntu.sh exec-once = waybar exec-once = qs -c overview # Quickshell Overview +exec-once = hypridle +exec-once = $scriptsDir/Hyprsunset.sh init # 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 +# Rainbow borders (disabled by default; use quick settings menu) +#exec-once = $UserScripts/RainbowBorders.sh -# hypridle for hyprlock -exec-once = hypridle - -# Resume Hyprsunset if state is "on" from previous session -exec-once = $scriptsDir/Hyprsunset.sh init # Here are list of features available but disabled by default # Persistent wallpaper -# exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png +# exec-once = sh -c '$HOME/.config/hypr/scripts/WallpaperDaemon.sh && (command -v awww >/dev/null 2>&1 && awww img "$wallDIR/mecha-nostalgia.png" || swww img "$wallDIR/mecha-nostalgia.png")' # Gnome polkit for NixOS #exec-once = $scriptsDir/Polkit-NixOS.sh diff --git a/.config/hypr/configs/SystemSettings.conf b/.config/hypr/configs/SystemSettings.conf index 44521156..6621ffe2 100644 --- a/.config/hypr/configs/SystemSettings.conf +++ b/.config/hypr/configs/SystemSettings.conf @@ -1,4 +1,9 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Default settings # This is where you put your own settings as this will not be touched during update # if the upgrade.sh is used. @@ -9,16 +14,41 @@ $scriptsDir = $HOME/.config/hypr/scripts dwindle { - pseudotile = true - preserve_split = true - #smart_split = true + preserve_split = true + smart_resizing = true + use_active_for_splits = true + smart_split = false + default_split_ratio = 1.0 + split_bias = 0 + precise_mouse_move = false special_scale_factor = 0.8 } master { - new_status = master - new_on_top = 1 - mfact = 0.5 + new_status = slave + new_on_top = false + new_on_active = none + orientation = left + mfact = 0.55 + slave_count_for_center_master = 2 + center_master_fallback = left + smart_resizing = true + drop_at_cursor = true + always_keep_position = false +} + +scrolling { + # Default width of new windows (0.1 - 1.0) + column_width = 0.80 + # If only one window is open, should it span the whole screen? + fullscreen_on_one_column = true + # Direction: right, left, up, or down + direction = right + # Center the focused window automatically + follow_focus = true +} +monocle { + # I can't find any settings on the wiki } general { @@ -34,7 +64,6 @@ input { kb_rules = repeat_rate = 50 repeat_delay = 300 - sensitivity = 0 #mouse sensitivity #accel_profile = # flat or adaptive or blank or EMPTY means libinput’s default mode numlock_by_default = true @@ -63,26 +92,28 @@ input { } } - gestures { - gesture = 3, horizontal, workspace - workspace_swipe_distance = 500 + workspace_swipe_distance = 300 + workspace_swipe_touch = false workspace_swipe_invert = true workspace_swipe_min_speed_to_force = 30 workspace_swipe_cancel_ratio = 0.5 - workspace_swipe_create_new = true - workspace_swipe_forever = true - #workspace_swipe_use_r = true #uncomment if wanted a forever create a new workspace with swipe right + workspace_swipe_create_new = true + workspace_swipe_direction_lock = true + workspace_swipe_forever = false + workspace_swipe_use_r = false + close_max_timeout = 100 - gesture = 4, up, dispatcher, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 1.5}')" - gesture = 4, down, dispatcher, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 1.5}')" - gesture = 3, up, dispatcher, exec, $scriptsDir/OverviewToggle.sh + gesture = 3, horizontal, workspace + gesture = 3, up, dispatcher, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 1.5}')" + gesture = 3, down, dispatcher, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 1.5}')" + gesture = 4, up, dispatcher, exec, $scriptsDir/OverviewToggle.sh + gesture = 4, down, float } misc { disable_hyprland_logo = true disable_splash_rendering = true - vfr = true vrr = 2 mouse_move_enables_dpms = true enable_swallow = off @@ -93,6 +124,11 @@ misc { enable_anr_dialog = true # Application not Responding (ANR) anr_missed_pings = 15 # ANR Threshold default 1 is too low allow_session_lock_restore = true # Prevent lockscreen crash when resume from suspend + # This only works with HL v0.53+ + on_focus_under_fullscreen = 1 + # 0 - Default, no change + # 1 - New focused window takes over fullscreen (Windows-like Alt-Tab) + # 2 - New focused window stays behind the fullscreen one } #opengl { @@ -121,4 +157,16 @@ cursor { enable_hyprcursor = true warp_on_change_workspace = 2 no_warps = true + no_break_fs_vrr = false + min_refresh_rate = 24 + hotspot_padding = 1 + inactive_timeout = 0 + default_monitor = + zoom_factor = 1.0 + zoom_rigid = false + zoom_detached_camera = true + hide_on_key_press = true + hide_on_touch = false + hide_on_tablet = false + use_cpu_buffer = false } diff --git a/.config/hypr/configs/WindowRules-config-v3.conf b/.config/hypr/configs/WindowRules-config-v3.conf index c4a8a624..aab7d005 100644 --- a/.config/hypr/configs/WindowRules-config-v3.conf +++ b/.config/hypr/configs/WindowRules-config-v3.conf @@ -1,204 +1,470 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # -# For window rules and layerrules +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Vendor defaults for window rules and layerrules # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -# NOTES: This is only for Hyprland > 0.52.1 -# note: This should NOT be implemented on Debian and Ubuntu -# Vendor defaults for window rules and layerrules +# NOTES: This is only for Hyprland >= 0.53 -# windowrule - tags - add apps under appropriate tag to use the same settings +# Some samples on hwo to start apps on specific workspaces +# windowrule = match:tag email*, workspace 1 +# windowrule = match:tag browser*, workspace 2 +# windowrule = match:tag projects*, workspace 3 +# windowrule = match:tag screenshare*, workspace 4 silent +# windowrule = match:tag gamestore*, workspace 5 +# windowrule = match:class ^(virt-manager)$, workspace 6 silent +# windowrule = match:class ^(.virt-manager-wrapped)$, workspace 6 silent +# windowrule = match:tag im*, workspace 7 +# windowrule = match:class obsidian, workspace 8 +# windowrule = match:tag games*, workspace 8 +# windowrule = match:tag multimedia*, workspace 9 silent + +# TAGS - add apps under appropriate tag to use the same settings +# browser tags windowrule = match:class ^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$, tag +browser windowrule = match:class ^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$, tag +browser -windowrule = match:class ^(chrome-.+-Default)$ # Chrome PWAs, tag +browser +windowrule = match:class ^(chrome-.+-Default)$, tag +browser windowrule = match:class ^([Cc]hromium)$, tag +browser windowrule = match:class ^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$, tag +browser -windowrule = match:class ^(Brave-browser(-beta|-dev|-unstable)?)$, tag +browser +windowrule = match:class ^([Bb]rave-browser(-beta|-dev|-unstable)?)$, tag +browser windowrule = match:class ^([Tt]horium-browser|[Cc]achy-browser)$, tag +browser windowrule = match:class ^(zen-alpha|zen)$, tag +browser +# notif tags windowrule = match:class ^(swaync-control-center|swaync-notification-window|swaync-client|class)$, tag +notif +# KooL settings tag windowrule = match:title ^(KooL Quick Cheat Sheet)$, tag +KooL_Cheat windowrule = match:title ^(KooL Hyprland Settings)$, tag +KooL_Settings windowrule = match:class ^(nwg-displays|nwg-look)$, tag +KooL-Settings -windowrule = match:class ^(Alacritty|kitty|kitty-dropterm)$, tag +terminal +# terminal tags +windowrule = match:class ^(ghostty|wezterm|Alacritty|kitty|kitty-dropterm)$, tag +terminal -windowrule = match:class ^([Tt]hunderbird|org.gnome.Evolution)$, tag +email +# email tags +windowrule = match:class ^([Tt]hunderbird|org.mozilla.Thunderbird)$, tag +email windowrule = match:class ^(eu.betterbird.Betterbird)$, tag +email +windowrule = match:class ^(org.gnome.Evolution)$, tag +email +# project tags windowrule = match:class ^(codium|codium-url-handler|VSCodium)$, tag +projects windowrule = match:class ^(VSCode|code|code-url-handler)$, tag +projects -windowrule = match:class ^(jetbrains-.+)$ # JetBrains IDEs, tag +projects +windowrule = match:class ^(jetbrains-.+)$, tag +projects +windowrule = match:class ^(dev.zed.Zed|antigravity)$, tag +projects +# screenshare tags windowrule = match:class ^(com.obsproject.Studio)$, tag +screenshare +# IM tags windowrule = match:class ^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$, tag +im windowrule = match:class ^([Ff]erdium)$, tag +im -windowrule = match:class ^([Ww]hatsapp-for-linux)$, tag +im -windowrule = match:class ^(ZapZap|com.rtosta.zapzap)$, tag +im +windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, tag +im windowrule = match:class ^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$, tag +im windowrule = match:class ^(teams-for-linux)$, tag +im -windowrule = match:class ^(im.riot.Riot|Element)$ # Element Matrix client, tag +im +windowrule = match:class ^(im.riot.Riot|Element)$, tag +im +# game tags windowrule = match:class ^(gamescope)$, tag +games -windowrule = match:class ^(steam_app_\d+)$, tag +games +windowrule = match:class ^(steam_app_\\d+)$, tag +games +windowrule = match:xdg_tag ^(proton-game)$, tag +games +# gamestore tags windowrule = match:class ^([Ss]team)$, tag +gamestore windowrule = match:title ^([Ll]utris)$, tag +gamestore windowrule = match:class ^(com.heroicgameslauncher.hgl)$, tag +gamestore +# file-manager tags windowrule = match:class ^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$, tag +file-manager windowrule = match:class ^(app.drey.Warp)$, tag +file-manager +# wallpaper tags windowrule = match:class ^([Ww]aytrogen)$, tag +wallpaper + +# multimedia tags windowrule = match:class ^([Aa]udacious)$, tag +multimedia + +# multimedia-video tags windowrule = match:class ^([Mm]pv|vlc)$, tag +multimedia_video +# settings tags windowrule = match:title ^(ROG Control)$, tag +settings -windowrule = match:class ^(wihotspot(-gui)?)$ # wifi hotspot, tag +settings -windowrule = match:class ^([Bb]aobab|org.gnome.[Bb]aobab)$ # Disk usage analyzer, tag +settings +windowrule = match:class ^(wihotspot(-gui)?)$, tag +settings +windowrule = match:class ^([Bb]aobab|org.gnome.[Bb]aobab)$, tag +settings windowrule = match:class ^(gnome-disks|wihotspot(-gui)?)$, tag +settings windowrule = match:title (Kvantum Manager), tag +settings -windowrule = match:class ^(file-roller|org.gnome.FileRoller)$ # archive manager, tag +settings +windowrule = match:class ^(file-roller|org.gnome.FileRoller)$, tag +settings windowrule = match:class ^(nm-applet|nm-connection-editor|blueman-manager)$, tag +settings windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, tag +settings -windowrule = match:class ^(qt5ct|qt6ct|[Yy]ad)$, tag +settings +windowrule = match:class ^(qt5ct|qt6ct)$, tag +settings windowrule = match:class (xdg-desktop-portal-gtk), tag +settings windowrule = match:class ^(org.kde.polkit-kde-authentication-agent-1)$, tag +settings windowrule = match:class ^([Rr]ofi)$, tag +settings +windowrule = match:class ^(btrfs-assistant)$, tag +settings +windowrule = match:class ^(timeshift-gtk)$, tag +settings -windowrule = match:class ^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$ # system monitor, tag +viewer -windowrule = match:class ^(evince)$ # document viewer, tag +viewer -windowrule = match:class ^(eog|org.gnome.Loupe)$ # image viewer, tag +viewer +# viewer tags +windowrule = match:class ^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$, tag +viewer +windowrule = match:class ^(evince)$, tag +viewer +windowrule = match:class ^(eog|org.gnome.Loupe)$, tag +viewer -windowrule = match:tag multimedia_video*, noblur -windowrule = match:tag multimedia_video*, opacity 1.0 - -# POSITION -windowrule = match:tag KooL_Cheat*, center -windowrule = match:class ([Tt]hunar) title negative:(.*[Tt]hunar.*), center -windowrule = match:title ^(ROG Control)$, center -windowrule = match:tag KooL-Settings*, center -windowrule = match:title ^(Keybindings)$, center -windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, center -windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, center -windowrule = match:class ^([Ff]erdium)$, center -windowrule = match:title ^(Picture-in-Picture)$, move 72% 7% -#windowrule = move 72% 7%,title:^(Firefox)$ - -# windowrule to avoid idle for fullscreen apps -#windowrule = idleinhibit fullscreen, class:^(*)$ -#windowrule = idleinhibit fullscreen, title:^(*)$ -windowrule = match:fullscreen 1, idleinhibit fullscreen - -# windowrule move to workspace -#windowrule = workspace 1, tag:email* -#windowrule = workspace 2, tag:browser* -#windowrule = workspace 3, class:^([Tt]hunar)$ -#windowrule = workspace 3, tag:projects* -#windowrule = workspace 5, tag:gamestore* -#windowrule = workspace 7, tag:im* -#windowrule = workspace 8, tag:games* - -# windowrule move to workspace (silent) -#windowrule = workspace 4 silent, tag:screenshare* -#windowrule = workspace 6 silent, class:^(virt-manager)$ -#windowrule = workspace 6 silent, class:^(.virt-manager-wrapped)$ -#windowrule = workspace 9 silent, tag:multimedia* +# Some special override rules +windowrule = match:tag multimedia, no_blur on +windowrule = match:tag multimedia, opacity 1.0 # FLOAT -windowrule = match:tag KooL_Cheat*, float -windowrule = match:tag wallpaper*, float -windowrule = match:tag settings*, float -windowrule = match:tag viewer*, float -windowrule = match:tag KooL-Settings*, float -windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher)$, float -windowrule = match:class (org.gnome.Calculator) title (Calculator), float -windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float -windowrule = match:class ^([Qq]alculate-gtk)$, float -#windowrule = float, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ -windowrule = match:class ^([Ff]erdium)$, float -windowrule = match:title ^(Picture-in-Picture)$, float -#windowrule = float, title:^(Firefox)$ +windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher), float on +windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float on +windowrule = match:class ^([Qq]alculate-gtk)$, float on -# windowrule - ######### float popups and dialogue ####### -windowrule = match:title ^(Authentication Required)$, float -windowrule = match:title ^(Authentication Required)$, center -windowrule = match:class (codium|codium-url-handler|VSCodium) title negative:(.*codium.*|.*VSCodium.*), float -windowrule = match:class ^(com.heroicgameslauncher.hgl)$ title negative:(Heroic Games Launcher), float -windowrule = match:class ^([Ss]team)$ title negative:^([Ss]team)$, float -windowrule = match:class ([Tt]hunar) title negative:(.*[Tt]hunar.*), float -windowrule = match:title ^(Add Folder to Workspace)$, float -windowrule = match:title ^(Add Folder to Workspace)$, size 70% 60% -windowrule = match:title ^(Add Folder to Workspace)$, center -windowrule = match:title ^(Save As)$, float -windowrule = match:title ^(Save As)$, size 70% 60% -windowrule = match:title ^(Save As)$, center -windowrule = match:initialTitle (Open Files), float -windowrule = match:initialTitle (Open Files), size 70% 60% -windowrule = match:title ^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background, float -windowrule = match:title ^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background, center -windowrule = match:title ^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background, size 16% 12% -# END of float popups and dialogue ####### - -# OPACITY -windowrule = match:tag browser*, opacity 0.99 0.8 -windowrule = match:tag projects*, opacity 0.9 0.8 -windowrule = match:tag im*, opacity 0.94 0.86 -windowrule = match:tag multimedia*, opacity 0.94 0.86 -windowrule = match:tag file-manager*, opacity 0.9 0.8 -windowrule = match:tag terminal*, opacity 0.9 0.7 -windowrule = match:tag settings*, opacity 0.8 0.7 -windowrule = match:tag viewer*, opacity 0.82 0.75 -windowrule = match:tag wallpaper*, opacity 0.9 0.7 -windowrule = match:class ^(gedit|org.gnome.TextEditor|mousepad)$, opacity 0.8 0.7 -windowrule = match:class ^(deluge)$, opacity 0.9 0.8 -windowrule = match:class ^(seahorse)$ # gnome-keyring gui, opacity 0.9 0.8 -windowrule = match:title ^(Picture-in-Picture)$, opacity 0.95 0.75 +# float popups and dialogue +windowrule = match:title ^(Authentication Required)$, float on, center on +windowrule = match:class ^(xfce-polkit|mate-polkit|polkit-mate-authentication-agent-1)$, match:title ^(Authentication required|Authentication Required)$, float on, center on, size (monitor_w*0.35) (monitor_h*0.35) +windowrule = match:class (codium|codium-url-handler|VSCodium), match:title negative:(.*codium.*|.*VSCodium.*), float on +windowrule = match:class ^(com.heroicgameslauncher.hgl)$, match:title negative:(Heroic Games Launcher), float on +windowrule = match:class ^([Ss]team)$, match:title negative:^([Ss]team)$, float on +windowrule = match:title ^(Add Folder to Workspace)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +windowrule = match:title ^(Save As)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +windowrule = match:initial_title (Open Files), float on, size (monitor_w*0.7) (monitor_h*0.6) +windowrule = match:title ^(SDDM Background)$, float on, center on, size (monitor_w*0.16) (monitor_h*0.12) +windowrule = match:class ^(yad)$, float on, center on, size (monitor_w*0.2) (monitor_h*0.2) +windowrule = match:class ^(hyprland-donate-screen)$, float on, center on # SIZE -windowrule = match:tag KooL_Cheat*, size 65% 90% -windowrule = match:tag wallpaper*, size 70% 70% -windowrule = match:tag settings*, size 70% 70% -windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, size 60% 70% -windowrule = match:class ^([Ff]erdium)$, size 60% 70% -#windowrule = size 25% 25%, title:^(Picture-in-Picture)$ -#windowrule = size 25% 25%, title:^(Firefox)$ +# POSITION +windowrule = match:title ^(ROG Control)$, center on +windowrule = match:title ^(Keybindings)$, center on +windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, center on +windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, center on +windowrule = match:class ^(nm-connection-editor)$, center on +windowrule = match:class ^(nm-applet)$, match:title ^(Wi-Fi Network Authentication Required)$, center on -# PINNING -windowrule = match:title ^(Picture-in-Picture)$, pin -#windowrule = pin,title:^(Firefox)$ +# windowrule to avoid idle for fullscreen apps +windowrule = match:fullscreen true, idle_inhibit fullscreen +windowrule = idle_inhibit fullscreen, match:fullscreen 1 +windowrule = idle_inhibit fullscreen, match:class .* +windowrule = idle_inhibit fullscreen, match:title .* -# windowrule - extras -windowrule = match:title ^(Picture-in-Picture)$, keepaspectratio +# OPACITY +windowrule = match:tag browser, opacity 0.99 0.8 +windowrule = match:tag projects, opacity 0.9 0.8 +windowrule = match:tag im, opacity 0.94 0.86 +windowrule = match:tag multimedia, opacity 0.94 0.86 +windowrule = match:tag file-manager, opacity 0.9 0.8 +windowrule = match:tag terminal, opacity 0.9 0.7 +windowrule = match:class ^(gedit|org.gnome.TextEditor|mousepad)$, opacity 0.8 0.7 +windowrule = match:class ^(deluge)$, opacity 0.9 0.8 +windowrule = match:class ^(seahorse)$, opacity 0.9 0.8 # BLUR & FULLSCREEN -windowrule = match:tag games*, noblur -windowrule = match:tag games*, fullscreen -#This not gonna take the focus to the window that appears when hovering over some of the parts of the IntelliJ Products -windowrule = match:class ^(jetbrains-*), noinitialfocus -windowrule = match:title ^(wind.*)$, noinitialfocus - -#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 -#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1 -#windowrule = opacity 0.8 0.8, pinned:1 +# This not gonna take the focus to the window that appears +# when hovering over some of the parts of the IntelliJ Products +windowrule = match:class ^(jetbrains-.*)$, no_initial_focus on +windowrule = match:title ^(wind.*)$, no_initial_focus on # LAYER RULES -layerrule = blur, rofi -layerrule = ignorezero, rofi -layerrule = blur, notifications -layerrule = ignorezero, notifications -layerrule = blur, quickshell:overview -layerrule = ignorezero, quickshell:overview -layerrule = ignorealpha 0.5, quickshell:overview +layerrule = match:namespace rofi, blur on +layerrule = match:namespace notifications, blur on +layerrule = match:namespace quickshell:overview, blur on +layerrule = match:namespace quickshell:overview, ignore_alpha 0.5 + +# +layerrule = blur on, match:namespace wallpaper +layerrule = animation slide, match:namespace rofi +layerrule = animation slide, match:namespace notifications + +# Optional Layer rules +# To Resolve blurred corners in rofi Add to User config +# SUPER SHIFT + E Edit User Window Rules +#layerrule = blur on, ignore_alpha 0, match:namespace rofi +#layerrule = blur on, match:namespace waybar + + +windowrule { + name = Picture-in-Picture + match:title = ^[Pp]icture-in-[Pp]icture$ + float = on + move = 72% 7% + opacity = 0.95 0.75 + pin = on + keep_aspect_ratio = on + size = (monitor_w*0.3) (monitor_h*0.3) +} + +# Named rule for CachyOS Kernel Manager +windowrule { + name = CachyOS Kernel Manager + match:class = ^(org.cachyos.KernelManager)$ + match:title = ^(CachyOS Kernel Manager)$ + match:initial_class = ^(org.cachyos.KernelManager)$ + match:initial_title = ^(CachyOS Kernel Manager)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Mainline Kernels +windowrule { + name = Mainline Kernels + match:class = ^(mainline-gtk)$ + match:title = ^(Mainline Kernels)$ + match:initial_class = ^(mainline-gtk)$ + match:initial_title = ^(Mainline Kernels)$ + float = on + center = on + size = (monitor_w*0.45) (monitor_h*0.55) +} + +# Named rule for Kwallet +windowrule { + name = Kwallet + match:class = ^(org.kde.kwalletmanager)$ + match:title = ^(Wallet Manager)$ + match:initial_class = ^(org.kde.kwalletmanager)$ + match:initial_title = ^(Wallet Manager)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for NVIDIA Settings +windowrule { + name = NVIDIA Settings + match:class = ^(nvidia-settings)$ + match:title = ^(NVIDIA Settings)$ + match:initial_class = ^(nvidia-settings)$ + match:initial_title = ^(NVIDIA Settings)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for CachyOS Package Installer +windowrule { + name = CachyOS Package Installer + match:class = ^(org.cachyos.cachyos-pi)$ + match:title = ^(CachyOS Package Installer)$ + match:initial_class = ^(org.cachyos.cachyos-pi)$ + match:initial_title = ^(CachyOS Package Installer)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for Shelly +windowrule { + name = Shelly + match:class = ^(com.shellyorg.shelly)$ + match:title = ^(Shelly)$ + match:initial_class = ^(com.shellyorg.shelly)$ + match:initial_title = ^(Shelly)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for CachyOS Hello +windowrule { + name = CachyOS Hello + match:class = ^(CachyOSHello)$ + match:title = ^(CachyOS Hello)$ + match:initial_class = ^(CachyOSHello)$ + match:initial_title = ^(CachyOS Hello)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Cache Cleaner - Octopi +windowrule { + name = Cache Cleaner - Octopi + match:class = ^(octopi-cachecleaner)$ + match:title = ^(Cache Cleaner - Octopi)$ + match:initial_class = ^(octopi-cachecleaner)$ + match:initial_title = ^(Cache Cleaner - Octopi)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Octopi Package Manager +windowrule { + name = Octopi Package Manager + match:class = ^(octopi)$ + match:title = ^(Octopi)$ + match:initial_class = ^(octopi)$ + match:initial_title = ^(Octopi)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Repository Editor - Octopi +windowrule { + name = Repository Editor - Octopi + match:class = ^(octopi-repoeditor)$ + match:title = ^(Repository Editor - Octopi)$ + match:initial_class = ^(octopi-repoeditor)$ + match:initial_title = ^(Repository Editor - Octop)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for KooL Cheat (tag) +windowrule { + name = KooL Cheat (tag) + match:tag = KooL_Cheat + float = on + center = on + size = (monitor_w*0.65) (monitor_h*0.9) +} + +# Named rule for Wallpaper (tag) +windowrule { + name = Wallpaper (tag) + match:tag = wallpaper + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.7) + opacity = 0.9 0.7 +} + +# Named rule for Settings (tag) +windowrule { + name = Settings (tag) + match:tag = settings + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.7) + opacity = 0.8 0.7 +} + +# Named rule for Viewer (tag) +windowrule { + name = Viewer (tag) + match:tag = viewer + float = on + center = on + opacity = 0.82 0.75 +} + +# Named rule for KooL Settings (tag) +windowrule { + name = KooL Settings (tag) + match:tag = KooL-Settings + float = on + center = on +} + +# Named rule for Multimedia Video (tag) +windowrule { + name = Multimedia Video (tag) + match:tag = multimedia_video + no_blur = on + opacity = 1.0 +} + +# Named rule for Games (tag) +windowrule { + name = Games (tag) + match:tag = games + no_blur = on + fullscreen = 0 +} + +# Named rule for Ferdium +windowrule { + name = Ferdium + match:class = ^([Ff]erdium)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.7) +} + +# Named rule for Calculators +windowrule { + name = Calculators + match:class = (org.gnome.Calculator|qalculate-gtk) + float = on + center = on + size = (monitor_w*0.55) (monitor_h*0.45) +} + +# Named rule for Thunar Dialogs +windowrule { + name = Thunar Dialogs + match:class = ([Tt]hunar) + match:title = negative:(.*[Tt]hunar.*) + float = on + center = on +} + +# Named rule for Bitwarden +windowrule { + name = Bitwarden + match:class = ^(Bitwarden)$ + match:title = ^(Bitwarden)$ + match:initial_class = ^(Bitwarden)$ + match:initial_title = ^(Bitwarden)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for hyprpwcenter audio control panel +windowrule { + name = hyprland audio panel + match:class = ^(hyprpwcenter)$ + match:initial_class = ^(hyprpwcenter)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for Garida Assistant +windowrule { + name = Garuda Assistant + match:class = ^(garuda-assistant)$ + match:title = ^(Garuda Assistant)$ + match:initial_class = ^(garuda-assistant)$ + match:initial_title = ^(Garuda Assistant)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for HyprMod HL config GUI +windowrule { + name = HyprMod GUI + match:class = ^(com.github.hyprmod)$ + match:title = ^(HyprMod)$ + match:initial_class = ^(com.github.hyprmod)$ + match:initial_title = ^(HyprMod)$ + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.75) +} +# Named rule for easy effects +windowrule { + name = EasyEffects + match:class = ^(com.github.wwmm.easyeffects)$ + match:title = ^(Easy Effects)$ + match:initial_class = ^(com.github.wwmm.easyeffects)$ + match:initial_title = ^(Easy Effects)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.65) +} +# Named rule for Mousam weather GUI +windowrule { + name = Mousam Weather + match:class = ^(io.github.amit9838.mousam)$ + match:title = ^(Mousam)$ + match:initial_class = ^(io.github.amit9838.mousam)$ + match:initial_title = ^(Mousam)$ + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.75) +} + -#layerrule = ignorealpha 0.5, tag:notif* -#layerrule = ignorezero, class:^([Rr]ofi)$ -#layerrule = blur, class:^([Rr]ofi)$ -#layerrule = unset,class:^([Rr]ofi)$ -#layerrule = ignorezero, -#layerrule = ignorezero, overview -#layerrule = blur, overview diff --git a/.config/hypr/configs/WindowRules-pre-53.conf b/.config/hypr/configs/WindowRules-pre-53.conf new file mode 100644 index 00000000..fc74f600 --- /dev/null +++ b/.config/hypr/configs/WindowRules-pre-53.conf @@ -0,0 +1,234 @@ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Vendor defaults for window rules and layerrules +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# NOTES: This is only for Hyprland > 0.48 + +# windowrule - tags - add apps under appropriate tag to use the same settings +# browser tags +windowrule = tag +browser, class:^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$ +windowrule = tag +browser, class:^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$ +windowrule = tag +browser, class:^(chrome-.+-Default)$ # Chrome PWAs +windowrule = tag +browser, class:^([Cc]hromium)$ +windowrule = tag +browser, class:^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$ +windowrule = tag +browser, class:^(Brave-browser(-beta|-dev|-unstable)?)$ +windowrule = tag +browser, class:^([Tt]horium-browser|[Cc]achy-browser)$ +windowrule = tag +browser, class:^(zen-alpha|zen)$ + +# notif tags +windowrule = tag +notif, class:^(swaync-control-center|swaync-notification-window|swaync-client|class)$ + +# KooL settings tag +windowrule = tag +KooL_Cheat, title:^(KooL Quick Cheat Sheet)$ +windowrule = tag +KooL_Settings, title:^(KooL Hyprland Settings)$ +windowrule = tag +KooL-Settings, class:^(nwg-displays|nwg-look)$ + +# terminal tags +windowrule = tag +terminal, class:^(Alacritty|kitty|kitty-dropterm)$ + +# email tags +windowrule = tag +email, class:^([Tt]hunderbird|org.gnome.Evolution)$ +windowrule = tag +email, class:^(eu.betterbird.Betterbird)$ + +# project tags +windowrule = tag +projects, class:^(codium|codium-url-handler|VSCodium)$ +windowrule = tag +projects, class:^(VSCode|code|code-url-handler)$ +windowrule = tag +projects, class:^(jetbrains-.+)$ # JetBrains IDEs + +# screenshare tags +windowrule = tag +screenshare, class:^(com.obsproject.Studio)$ + +# IM tags +windowrule = tag +im, class:^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$ +windowrule = tag +im, class:^([Ff]erdium)$ +windowrule = tag +im, class:^([Ww]hatsapp-for-linux)$ +windowrule = tag +im, class:^(ZapZap|com.rtosta.zapzap)$ +windowrule = tag +im, class:^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$ +windowrule = tag +im, class:^(teams-for-linux)$ +windowrule = tag +im, class:^(im.riot.Riot|Element)$ # Element Matrix client + +# game tags +windowrule = tag +games, class:^(gamescope)$ +windowrule = tag +games, class:^(steam_app_\d+)$ + +# gamestore tags +windowrule = tag +gamestore, class:^([Ss]team)$ +windowrule = tag +gamestore, title:^([Ll]utris)$ +windowrule = tag +gamestore, class:^(com.heroicgameslauncher.hgl)$ + +# file-manager tags +windowrule = tag +file-manager, class:^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$ +windowrule = tag +file-manager, class:^(app.drey.Warp)$ + +# wallpaper tags +windowrule = tag +wallpaper, class:^([Ww]aytrogen)$ + +# multimedia tags +windowrule = tag +multimedia, class:^([Aa]udacious)$ + +# multimedia-video tags +windowrule = tag +multimedia_video, class:^([Mm]pv|vlc)$ + +# settings tags +windowrule = tag +settings, title:^(ROG Control)$ +windowrule = tag +settings, class:^(wihotspot(-gui)?)$ # wifi hotspot +windowrule = tag +settings, class:^([Bb]aobab|org.gnome.[Bb]aobab)$ # Disk usage analyzer +windowrule = tag +settings, class:^(gnome-disks|wihotspot(-gui)?)$ +windowrule = tag +settings, title:(Kvantum Manager) +windowrule = tag +settings, class:^(file-roller|org.gnome.FileRoller)$ # archive manager +windowrule = tag +settings, class:^(nm-applet|nm-connection-editor|blueman-manager)$ +windowrule = tag +settings, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ +windowrule = tag +settings, class:^(qt5ct|qt6ct|[Yy]ad)$ +windowrule = tag +settings, class:(xdg-desktop-portal-gtk) +windowrule = tag +settings, class:^(org.kde.polkit-kde-authentication-agent-1)$ +windowrule = tag +settings, class:^([Rr]ofi)$ + +# viewer tags +windowrule = tag +viewer, class:^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$ # system monitor +windowrule = tag +viewer, class:^(evince)$ # document viewer +windowrule = tag +viewer, class:^(eog|org.gnome.Loupe)$ # image viewer + +# Some special override rules +windowrule = noblur, tag:multimedia_video* +windowrule = opacity 1.0, tag:multimedia_video* + +# POSITION +# windowrule = center,floating:1 # warning, it cause even the menu to float and center. +windowrule = center, tag:KooL_Cheat* +windowrule = center, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) +windowrule = center, title:^(ROG Control)$ +windowrule = center, tag:KooL-Settings* +windowrule = center, title:^(Keybindings)$ +windowrule = center, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ +windowrule = center, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = center, class:^([Ff]erdium)$ +windowrule = move 72% 7%,title:^(Picture-in-Picture)$ +#windowrule = move 72% 7%,title:^(Firefox)$ + +# windowrule to avoid idle for fullscreen apps +#windowrule = idleinhibit fullscreen, class:^(*)$ +#windowrule = idleinhibit fullscreen, title:^(*)$ +windowrule = idleinhibit fullscreen, fullscreen:1 + +# windowrule move to workspace +#windowrule = workspace 1, tag:email* +#windowrule = workspace 2, tag:browser* +#windowrule = workspace 3, class:^([Tt]hunar)$ +#windowrule = workspace 3, tag:projects* +#windowrule = workspace 5, tag:gamestore* +#windowrule = workspace 7, tag:im* +#windowrule = workspace 8, tag:games* + +# windowrule move to workspace (silent) +#windowrule = workspace 4 silent, tag:screenshare* +#windowrule = workspace 6 silent, class:^(virt-manager)$ +#windowrule = workspace 6 silent, class:^(.virt-manager-wrapped)$ +#windowrule = workspace 9 silent, tag:multimedia* +# +# FLOAT +windowrule = float, tag:KooL_Cheat* +windowrule = float, tag:wallpaper* +windowrule = float, tag:settings* +windowrule = float, tag:viewer* +windowrule = float, tag:KooL-Settings* +windowrule = float, class:([Zz]oom|onedriver|onedriver-launcher)$ +windowrule = float, class:(org.gnome.Calculator), title:(Calculator) +windowrule = float, class:^(mpv|com.github.rafostar.Clapper)$ +windowrule = float, class:^([Qq]alculate-gtk)$ +#windowrule = float, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = float, class:^([Ff]erdium)$ +windowrule = float, title:^(Picture-in-Picture)$ +#windowrule = float, title:^(Firefox)$ + +# windowrule - ######### float popups and dialogue ####### +windowrule = float, title:^(Authentication Required)$ +windowrule = center, title:^(Authentication Required)$ +windowrule = float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*) +windowrule = float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Heroic Games Launcher) +windowrule = float, class:^([Ss]team)$, title:negative:^([Ss]team)$ +windowrule = float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) + +windowrule = float, title:^(Add Folder to Workspace)$ +windowrule = size 70% 60%, title:^(Add Folder to Workspace)$ +windowrule = center, title:^(Add Folder to Workspace)$ + +windowrule = float, title:^(Save As)$ +windowrule = size 70% 60%, title:^(Save As)$ +windowrule = center, title:^(Save As)$ + +windowrule = float, initialTitle:(Open Files) +windowrule = size 70% 60%, initialTitle:(Open Files) + +windowrule = float, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +windowrule = center, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +windowrule = size 16% 12%, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +# END of float popups and dialogue ####### + +# OPACITY +windowrule = opacity 0.99 0.8, tag:browser* +windowrule = opacity 0.9 0.8, tag:projects* +windowrule = opacity 0.94 0.86, tag:im* +windowrule = opacity 0.94 0.86, tag:multimedia* +windowrule = opacity 0.9 0.8, tag:file-manager* +windowrule = opacity 0.9 0.7, tag:terminal* +windowrule = opacity 0.8 0.7, tag:settings* +windowrule = opacity 0.82 0.75, tag:viewer* +windowrule = opacity 0.9 0.7, tag:wallpaper* +windowrule = opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$ +windowrule = opacity 0.9 0.8, class:^(deluge)$ +windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui +windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$ + +# SIZE +windowrule = size 65% 90%, tag:KooL_Cheat* +windowrule = size 70% 70%, tag:wallpaper* +windowrule = size 70% 70%, tag:settings* +windowrule = size 60% 70%, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = size 60% 70%, class:^([Ff]erdium)$ + +#windowrule = size 25% 25%, title:^(Picture-in-Picture)$ +#windowrule = size 25% 25%, title:^(Firefox)$ + +# PINNING +windowrule = pin, title:^(Picture-in-Picture)$ +#windowrule = pin,title:^(Firefox)$ + +# windowrule - extras +windowrule = keepaspectratio, title:^(Picture-in-Picture)$ + +# BLUR & FULLSCREEN +windowrule = noblur, tag:games* +windowrule = fullscreen, tag:games* + + +#This not gonna take the focus to the window that appears when hovering over some of the parts of the IntelliJ Products +windowrule = noinitialfocus, class:^(jetbrains-*) +windowrule = noinitialfocus, title:^(wind.*)$ + +#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 +#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1 +#windowrule = opacity 0.8 0.8, pinned:1 + +# LAYER RULES +layerrule = blur, rofi +layerrule = ignorezero, rofi +layerrule = blur, notifications +layerrule = ignorezero, notifications +layerrule = blur, quickshell:overview +layerrule = ignorezero, quickshell:overview +layerrule = ignorealpha 0.5, quickshell:overview + +#layerrule = ignorealpha 0.5, tag:notif* + +#layerrule = ignorezero, class:^([Rr]ofi)$ +#layerrule = blur, class:^([Rr]ofi)$ +#layerrule = unset,class:^([Rr]ofi)$ +#layerrule = ignorezero, + +#layerrule = ignorezero, overview +#layerrule = blur, overview diff --git a/.config/hypr/configs/WindowRules.conf b/.config/hypr/configs/WindowRules.conf index d1fb9315..7082d64c 100644 --- a/.config/hypr/configs/WindowRules.conf +++ b/.config/hypr/configs/WindowRules.conf @@ -1,231 +1,471 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Vendor defaults for window rules and layerrules # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -# NOTES: This is only for Hyprland > 0.48 +# NOTES: This is only for Hyprland >= 0.53 -# note for ja: This should NOT be implemented on Debian and Ubuntu +# Some samples on hwo to start apps on specific workspaces +# windowrule = match:tag email*, workspace 1 +# windowrule = match:tag browser*, workspace 2 +# windowrule = match:tag projects*, workspace 3 +# windowrule = match:tag screenshare*, workspace 4 silent +# windowrule = match:tag gamestore*, workspace 5 +# windowrule = match:class ^(virt-manager)$, workspace 6 silent +# windowrule = match:class ^(.virt-manager-wrapped)$, workspace 6 silent +# windowrule = match:tag im*, workspace 7 +# windowrule = match:class obsidian, workspace 8 +# windowrule = match:tag games*, workspace 8 +# windowrule = match:tag multimedia*, workspace 9 silent -# windowrule - tags - add apps under appropriate tag to use the same settings +# TAGS - add apps under appropriate tag to use the same settings # browser tags -windowrule = tag +browser, class:^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$ -windowrule = tag +browser, class:^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$ -windowrule = tag +browser, class:^(chrome-.+-Default)$ # Chrome PWAs -windowrule = tag +browser, class:^([Cc]hromium)$ -windowrule = tag +browser, class:^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$ -windowrule = tag +browser, class:^(Brave-browser(-beta|-dev|-unstable)?)$ -windowrule = tag +browser, class:^([Tt]horium-browser|[Cc]achy-browser)$ -windowrule = tag +browser, class:^(zen-alpha|zen)$ +windowrule = match:class ^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$, tag +browser +windowrule = match:class ^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$, tag +browser +windowrule = match:class ^(chrome-.+-Default)$, tag +browser +windowrule = match:class ^([Cc]hromium)$, tag +browser +windowrule = match:class ^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$, tag +browser +windowrule = match:class ^([Bb]rave-browser(-beta|-dev|-unstable)?)$, tag +browser +windowrule = match:class ^([Tt]horium-browser|[Cc]achy-browser)$, tag +browser +windowrule = match:class ^(zen-alpha|zen)$, tag +browser # notif tags -windowrule = tag +notif, class:^(swaync-control-center|swaync-notification-window|swaync-client|class)$ +windowrule = match:class ^(swaync-control-center|swaync-notification-window|swaync-client|class)$, tag +notif # KooL settings tag -windowrule = tag +KooL_Cheat, title:^(KooL Quick Cheat Sheet)$ -windowrule = tag +KooL_Settings, title:^(KooL Hyprland Settings)$ -windowrule = tag +KooL-Settings, class:^(nwg-displays|nwg-look)$ +windowrule = match:title ^(KooL Quick Cheat Sheet)$, tag +KooL_Cheat +windowrule = match:title ^(KooL Hyprland Settings)$, tag +KooL_Settings +windowrule = match:class ^(nwg-displays|nwg-look)$, tag +KooL-Settings # terminal tags -windowrule = tag +terminal, class:^(Alacritty|kitty|kitty-dropterm)$ +windowrule = match:class ^(ghostty|wezterm|Alacritty|kitty|kitty-dropterm)$, tag +terminal # email tags -windowrule = tag +email, class:^([Tt]hunderbird|org.gnome.Evolution)$ -windowrule = tag +email, class:^(eu.betterbird.Betterbird)$ +windowrule = match:class ^([Tt]hunderbird|org.mozilla.Thunderbird)$, tag +email +windowrule = match:class ^(eu.betterbird.Betterbird)$, tag +email +windowrule = match:class ^(org.gnome.Evolution)$, tag +email # project tags -windowrule = tag +projects, class:^(codium|codium-url-handler|VSCodium)$ -windowrule = tag +projects, class:^(VSCode|code|code-url-handler)$ -windowrule = tag +projects, class:^(jetbrains-.+)$ # JetBrains IDEs +windowrule = match:class ^(codium|codium-url-handler|VSCodium)$, tag +projects +windowrule = match:class ^(VSCode|code|code-url-handler)$, tag +projects +windowrule = match:class ^(jetbrains-.+)$, tag +projects +windowrule = match:class ^(dev.zed.Zed|antigravity)$, tag +projects # screenshare tags -windowrule = tag +screenshare, class:^(com.obsproject.Studio)$ +windowrule = match:class ^(com.obsproject.Studio)$, tag +screenshare # IM tags -windowrule = tag +im, class:^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$ -windowrule = tag +im, class:^([Ff]erdium)$ -windowrule = tag +im, class:^([Ww]hatsapp-for-linux)$ -windowrule = tag +im, class:^(ZapZap|com.rtosta.zapzap)$ -windowrule = tag +im, class:^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$ -windowrule = tag +im, class:^(teams-for-linux)$ -windowrule = tag +im, class:^(im.riot.Riot|Element)$ # Element Matrix client +windowrule = match:class ^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$, tag +im +windowrule = match:class ^([Ff]erdium)$, tag +im +windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, tag +im +windowrule = match:class ^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$, tag +im +windowrule = match:class ^(teams-for-linux)$, tag +im +windowrule = match:class ^(im.riot.Riot|Element)$, tag +im # game tags -windowrule = tag +games, class:^(gamescope)$ -windowrule = tag +games, class:^(steam_app_\d+)$ +windowrule = match:class ^(gamescope)$, tag +games +windowrule = match:class ^(steam_app_\\d+)$, tag +games +windowrule = match:xdg_tag ^(proton-game)$, tag +games # gamestore tags -windowrule = tag +gamestore, class:^([Ss]team)$ -windowrule = tag +gamestore, title:^([Ll]utris)$ -windowrule = tag +gamestore, class:^(com.heroicgameslauncher.hgl)$ +windowrule = match:class ^([Ss]team)$, tag +gamestore +windowrule = match:title ^([Ll]utris)$, tag +gamestore +windowrule = match:class ^(com.heroicgameslauncher.hgl)$, tag +gamestore # file-manager tags -windowrule = tag +file-manager, class:^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$ -windowrule = tag +file-manager, class:^(app.drey.Warp)$ +windowrule = match:class ^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$, tag +file-manager +windowrule = match:class ^(app.drey.Warp)$, tag +file-manager # wallpaper tags -windowrule = tag +wallpaper, class:^([Ww]aytrogen)$ +windowrule = match:class ^([Ww]aytrogen)$, tag +wallpaper # multimedia tags -windowrule = tag +multimedia, class:^([Aa]udacious)$ +windowrule = match:class ^([Aa]udacious)$, tag +multimedia # multimedia-video tags -windowrule = tag +multimedia_video, class:^([Mm]pv|vlc)$ +windowrule = match:class ^([Mm]pv|vlc)$, tag +multimedia_video # settings tags -windowrule = tag +settings, title:^(ROG Control)$ -windowrule = tag +settings, class:^(wihotspot(-gui)?)$ # wifi hotspot -windowrule = tag +settings, class:^([Bb]aobab|org.gnome.[Bb]aobab)$ # Disk usage analyzer -windowrule = tag +settings, class:^(gnome-disks|wihotspot(-gui)?)$ -windowrule = tag +settings, title:(Kvantum Manager) -windowrule = tag +settings, class:^(file-roller|org.gnome.FileRoller)$ # archive manager -windowrule = tag +settings, class:^(nm-applet|nm-connection-editor|blueman-manager)$ -windowrule = tag +settings, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ -windowrule = tag +settings, class:^(qt5ct|qt6ct|[Yy]ad)$ -windowrule = tag +settings, class:(xdg-desktop-portal-gtk) -windowrule = tag +settings, class:^(org.kde.polkit-kde-authentication-agent-1)$ -windowrule = tag +settings, class:^([Rr]ofi)$ +windowrule = match:title ^(ROG Control)$, tag +settings +windowrule = match:class ^(wihotspot(-gui)?)$, tag +settings +windowrule = match:class ^([Bb]aobab|org.gnome.[Bb]aobab)$, tag +settings +windowrule = match:class ^(gnome-disks|wihotspot(-gui)?)$, tag +settings +windowrule = match:title (Kvantum Manager), tag +settings +windowrule = match:class ^(file-roller|org.gnome.FileRoller)$, tag +settings +windowrule = match:class ^(nm-applet|nm-connection-editor|blueman-manager)$, tag +settings +windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, tag +settings +windowrule = match:class ^(qt5ct|qt6ct)$, tag +settings +windowrule = match:class (xdg-desktop-portal-gtk), tag +settings +windowrule = match:class ^(org.kde.polkit-kde-authentication-agent-1)$, tag +settings +windowrule = match:class ^([Rr]ofi)$, tag +settings +windowrule = match:class ^(btrfs-assistant)$, tag +settings +windowrule = match:class ^(timeshift-gtk)$, tag +settings # viewer tags -windowrule = tag +viewer, class:^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$ # system monitor -windowrule = tag +viewer, class:^(evince)$ # document viewer -windowrule = tag +viewer, class:^(eog|org.gnome.Loupe)$ # image viewer +windowrule = match:class ^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$, tag +viewer +windowrule = match:class ^(evince)$, tag +viewer +windowrule = match:class ^(eog|org.gnome.Loupe)$, tag +viewer # Some special override rules -windowrule = noblur, tag:multimedia_video* -windowrule = opacity 1.0, tag:multimedia_video* - -# POSITION -# windowrule = center,floating:1 # warning, it cause even the menu to float and center. -windowrule = center, tag:KooL_Cheat* -windowrule = center, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) -windowrule = center, title:^(ROG Control)$ -windowrule = center, tag:KooL-Settings* -windowrule = center, title:^(Keybindings)$ -windowrule = center, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ -windowrule = center, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ -windowrule = center, class:^([Ff]erdium)$ -windowrule = move 72% 7%,title:^(Picture-in-Picture)$ -#windowrule = move 72% 7%,title:^(Firefox)$ +windowrule = match:tag multimedia, no_blur on +windowrule = match:tag multimedia, opacity 1.0 -# windowrule to avoid idle for fullscreen apps -#windowrule = idleinhibit fullscreen, class:^(*)$ -#windowrule = idleinhibit fullscreen, title:^(*)$ -windowrule = idleinhibit fullscreen, fullscreen:1 - -# windowrule move to workspace -#windowrule = workspace 1, tag:email* -#windowrule = workspace 2, tag:browser* -#windowrule = workspace 3, class:^([Tt]hunar)$ -#windowrule = workspace 3, tag:projects* -#windowrule = workspace 5, tag:gamestore* -#windowrule = workspace 7, tag:im* -#windowrule = workspace 8, tag:games* - -# windowrule move to workspace (silent) -#windowrule = workspace 4 silent, tag:screenshare* -#windowrule = workspace 6 silent, class:^(virt-manager)$ -#windowrule = workspace 6 silent, class:^(.virt-manager-wrapped)$ -#windowrule = workspace 9 silent, tag:multimedia* -# # FLOAT -windowrule = float, tag:KooL_Cheat* -windowrule = float, tag:wallpaper* -windowrule = float, tag:settings* -windowrule = float, tag:viewer* -windowrule = float, tag:KooL-Settings* -windowrule = float, class:([Zz]oom|onedriver|onedriver-launcher)$ -windowrule = float, class:(org.gnome.Calculator), title:(Calculator) -windowrule = float, class:^(mpv|com.github.rafostar.Clapper)$ -windowrule = float, class:^([Qq]alculate-gtk)$ -#windowrule = float, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ -windowrule = float, class:^([Ff]erdium)$ -windowrule = float, title:^(Picture-in-Picture)$ -#windowrule = float, title:^(Firefox)$ +windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher), float on +windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float on +windowrule = match:class ^([Qq]alculate-gtk)$, float on -# windowrule - ######### float popups and dialogue ####### -windowrule = float, title:^(Authentication Required)$ -windowrule = center, title:^(Authentication Required)$ -windowrule = float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*) -windowrule = float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Heroic Games Launcher) -windowrule = float, class:^([Ss]team)$, title:negative:^([Ss]team)$ -windowrule = float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) - -windowrule = float, title:^(Add Folder to Workspace)$ -windowrule = size 70% 60%, title:^(Add Folder to Workspace)$ -windowrule = center, title:^(Add Folder to Workspace)$ - -windowrule = float, title:^(Save As)$ -windowrule = size 70% 60%, title:^(Save As)$ -windowrule = center, title:^(Save As)$ - -windowrule = float, initialTitle:(Open Files) -windowrule = size 70% 60%, initialTitle:(Open Files) - -windowrule = float, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background -windowrule = center, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background -windowrule = size 16% 12%, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background -# END of float popups and dialogue ####### - -# OPACITY -windowrule = opacity 0.99 0.8, tag:browser* -windowrule = opacity 0.9 0.8, tag:projects* -windowrule = opacity 0.94 0.86, tag:im* -windowrule = opacity 0.94 0.86, tag:multimedia* -windowrule = opacity 0.9 0.8, tag:file-manager* -windowrule = opacity 0.9 0.7, tag:terminal* -windowrule = opacity 0.8 0.7, tag:settings* -windowrule = opacity 0.82 0.75, tag:viewer* -windowrule = opacity 0.9 0.7, tag:wallpaper* -windowrule = opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$ -windowrule = opacity 0.9 0.8, class:^(deluge)$ -windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui -windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$ +# float popups and dialogue +windowrule = match:title ^(Authentication Required)$, float on, center on +windowrule = match:class ^(xfce-polkit|mate-polkit|polkit-mate-authentication-agent-1)$, match:title ^(Authentication required|Authentication Required)$, float on, center on, size (monitor_w*0.35) (monitor_h*0.35) +windowrule = match:class (codium|codium-url-handler|VSCodium), match:title negative:(.*codium.*|.*VSCodium.*), float on +windowrule = match:class ^(com.heroicgameslauncher.hgl)$, match:title negative:(Heroic Games Launcher), float on +windowrule = match:class ^([Ss]team)$, match:title negative:^([Ss]team)$, float on +windowrule = match:title ^(Add Folder to Workspace)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +windowrule = match:title ^(Save As)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +windowrule = match:initial_title (Open Files), float on, size (monitor_w*0.7) (monitor_h*0.6) +windowrule = match:title ^(SDDM Background)$, float on, center on, size (monitor_w*0.16) (monitor_h*0.12) +windowrule = match:class ^(yad)$, float on, center on, size (monitor_w*0.2) (monitor_h*0.2) +windowrule = match:class ^(hyprland-donate-screen)$, float on, center on # SIZE -windowrule = size 65% 90%, tag:KooL_Cheat* -windowrule = size 70% 70%, tag:wallpaper* -windowrule = size 70% 70%, tag:settings* -windowrule = size 60% 70%, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ -windowrule = size 60% 70%, class:^([Ff]erdium)$ -#windowrule = size 25% 25%, title:^(Picture-in-Picture)$ -#windowrule = size 25% 25%, title:^(Firefox)$ +# POSITION +windowrule = match:title ^(ROG Control)$, center on +windowrule = match:title ^(Keybindings)$, center on +windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, center on +windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, center on +windowrule = match:class ^(nm-connection-editor)$, center on +windowrule = match:class ^(nm-applet)$, match:title ^(Wi-Fi Network Authentication Required)$, center on -# PINNING -windowrule = pin, title:^(Picture-in-Picture)$ -#windowrule = pin,title:^(Firefox)$ +# windowrule to avoid idle for fullscreen apps +windowrule = match:fullscreen true, idle_inhibit fullscreen +windowrule = idle_inhibit fullscreen, match:fullscreen 1 +windowrule = idle_inhibit fullscreen, match:class .* +windowrule = idle_inhibit fullscreen, match:title .* -# windowrule - extras -windowrule = keepaspectratio, title:^(Picture-in-Picture)$ +# OPACITY +windowrule = match:tag browser, opacity 0.99 0.8 +windowrule = match:tag projects, opacity 0.9 0.8 +windowrule = match:tag im, opacity 0.94 0.86 +windowrule = match:tag multimedia, opacity 0.94 0.86 +windowrule = match:tag file-manager, opacity 0.9 0.8 +windowrule = match:tag terminal, opacity 0.9 0.7 +windowrule = match:class ^(gedit|org.gnome.TextEditor|mousepad)$, opacity 0.8 0.7 +windowrule = match:class ^(deluge)$, opacity 0.9 0.8 +windowrule = match:class ^(seahorse)$, opacity 0.9 0.8 # BLUR & FULLSCREEN -windowrule = noblur, tag:games* -windowrule = fullscreen, tag:games* - -#This not gonna take the focus to the window that appears when hovering over some of the parts of the IntelliJ Products -windowrule = noinitialfocus, class:^(jetbrains-*) -windowrule = noinitialfocus, title:^(wind.*)$ - -#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 -#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1 -#windowrule = opacity 0.8 0.8, pinned:1 +# This not gonna take the focus to the window that appears +# when hovering over some of the parts of the IntelliJ Products +windowrule = match:class ^(jetbrains-.*)$, no_initial_focus on +windowrule = match:title ^(wind.*)$, no_initial_focus on # LAYER RULES -layerrule = blur, rofi -layerrule = ignorezero, rofi -layerrule = blur, notifications -layerrule = ignorezero, notifications -layerrule = blur, quickshell:overview -layerrule = ignorezero, quickshell:overview -layerrule = ignorealpha 0.5, quickshell:overview +layerrule = match:namespace rofi, blur on +layerrule = match:namespace notifications, blur on +layerrule = match:namespace quickshell:overview, blur on +layerrule = match:namespace quickshell:overview, ignore_alpha 0.5 -#layerrule = ignorealpha 0.5, tag:notif* +# +layerrule = blur on, match:namespace wallpaper +layerrule = animation slide, match:namespace rofi +layerrule = animation slide, match:namespace notifications + +# Optional Layer rules +# To Resolve blurred corners in rofi Add to User config +# SUPER SHIFT + E Edit User Window Rules +#layerrule = blur on, ignore_alpha 0, match:namespace rofi +#layerrule = blur on, match:namespace waybar + + +windowrule { + name = Picture-in-Picture + match:title = ^[Pp]icture-in-[Pp]icture$ + float = on + move = 72% 7% + opacity = 0.95 0.75 + pin = on + keep_aspect_ratio = on + size = (monitor_w*0.3) (monitor_h*0.3) +} + +# Named rule for CachyOS Kernel Manager +windowrule { + name = CachyOS Kernel Manager + match:class = ^(org.cachyos.KernelManager)$ + match:title = ^(CachyOS Kernel Manager)$ + match:initial_class = ^(org.cachyos.KernelManager)$ + match:initial_title = ^(CachyOS Kernel Manager)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Mainline Kernels +windowrule { + name = Mainline Kernels + match:class = ^(mainline-gtk)$ + match:title = ^(Mainline Kernels)$ + match:initial_class = ^(mainline-gtk)$ + match:initial_title = ^(Mainline Kernels)$ + float = on + center = on + size = (monitor_w*0.45) (monitor_h*0.55) +} + +# Named rule for Kwallet +windowrule { + name = Kwallet + match:class = ^(org.kde.kwalletmanager)$ + match:title = ^(Wallet Manager)$ + match:initial_class = ^(org.kde.kwalletmanager)$ + match:initial_title = ^(Wallet Manager)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for NVIDIA Settings +windowrule { + name = NVIDIA Settings + match:class = ^(nvidia-settings)$ + match:title = ^(NVIDIA Settings)$ + match:initial_class = ^(nvidia-settings)$ + match:initial_title = ^(NVIDIA Settings)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for CachyOS Package Installer +windowrule { + name = CachyOS Package Installer + match:class = ^(org.cachyos.cachyos-pi)$ + match:title = ^(CachyOS Package Installer)$ + match:initial_class = ^(org.cachyos.cachyos-pi)$ + match:initial_title = ^(CachyOS Package Installer)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for Shelly +windowrule { + name = Shelly + match:class = ^(com.shellyorg.shelly)$ + match:title = ^(Shelly)$ + match:initial_class = ^(com.shellyorg.shelly)$ + match:initial_title = ^(Shelly)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for CachyOS Hello +windowrule { + name = CachyOS Hello + match:class = ^(CachyOSHello)$ + match:title = ^(CachyOS Hello)$ + match:initial_class = ^(CachyOSHello)$ + match:initial_title = ^(CachyOS Hello)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Cache Cleaner - Octopi +windowrule { + name = Cache Cleaner - Octopi + match:class = ^(octopi-cachecleaner)$ + match:title = ^(Cache Cleaner - Octopi)$ + match:initial_class = ^(octopi-cachecleaner)$ + match:initial_title = ^(Cache Cleaner - Octopi)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Octopi Package Manager +windowrule { + name = Octopi Package Manager + match:class = ^(octopi)$ + match:title = ^(Octopi)$ + match:initial_class = ^(octopi)$ + match:initial_title = ^(Octopi)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for Repository Editor - Octopi +windowrule { + name = Repository Editor - Octopi + match:class = ^(octopi-repoeditor)$ + match:title = ^(Repository Editor - Octopi)$ + match:initial_class = ^(octopi-repoeditor)$ + match:initial_title = ^(Repository Editor - Octop)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for KooL Cheat (tag) +windowrule { + name = KooL Cheat (tag) + match:tag = KooL_Cheat + float = on + center = on + size = (monitor_w*0.65) (monitor_h*0.9) +} + +# Named rule for Wallpaper (tag) +windowrule { + name = Wallpaper (tag) + match:tag = wallpaper + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.7) + opacity = 0.9 0.7 +} + +# Named rule for Settings (tag) +windowrule { + name = Settings (tag) + match:tag = settings + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.7) + opacity = 0.8 0.7 +} + +# Named rule for Viewer (tag) +windowrule { + name = Viewer (tag) + match:tag = viewer + float = on + center = on + opacity = 0.82 0.75 +} + +# Named rule for KooL Settings (tag) +windowrule { + name = KooL Settings (tag) + match:tag = KooL-Settings + float = on + center = on +} + +# Named rule for Multimedia Video (tag) +windowrule { + name = Multimedia Video (tag) + match:tag = multimedia_video + no_blur = on + opacity = 1.0 +} + +# Named rule for Games (tag) +windowrule { + name = Games (tag) + match:tag = games + no_blur = on + fullscreen = 0 +} + +# Named rule for Ferdium +windowrule { + name = Ferdium + match:class = ^([Ff]erdium)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.7) +} + +# Named rule for Calculators +windowrule { + name = Calculators + match:class = (org.gnome.Calculator|qalculate-gtk) + float = on + center = on + size = (monitor_w*0.55) (monitor_h*0.45) +} + +# Named rule for Thunar Dialogs +windowrule { + name = Thunar Dialogs + match:class = ([Tt]hunar) + match:title = negative:(.*[Tt]hunar.*) + float = on + center = on +} + +# Named rule for Bitwarden +windowrule { + name = Bitwarden + match:class = ^(Bitwarden)$ + match:title = ^(Bitwarden)$ + match:initial_class = ^(Bitwarden)$ + match:initial_title = ^(Bitwarden)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for hyprpwcenter audio control panel +windowrule { + name = hyprland audio panel + match:class = ^(hyprpwcenter)$ + match:initial_class = ^(hyprpwcenter)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} +# Named rule for Garida Assistant +windowrule { + name = Garuda Assistant + match:class = ^(garuda-assistant)$ + match:title = ^(Garuda Assistant)$ + match:initial_class = ^(garuda-assistant)$ + match:initial_title = ^(Garuda Assistant)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.6) +} + +# Named rule for HyprMod HL config GUI +windowrule { + name = HyprMod GUI + match:class = ^(com.github.hyprmod)$ + match:title = ^(HyprMod)$ + match:initial_class = ^(com.github.hyprmod)$ + match:initial_title = ^(HyprMod)$ + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.75) +} +# Named rule for easy effects +windowrule { + name = EasyEffects + match:class = ^(com.github.wwmm.easyeffects)$ + match:title = ^(Easy Effects)$ + match:initial_class = ^(com.github.wwmm.easyeffects)$ + match:initial_title = ^(Easy Effects)$ + float = on + center = on + size = (monitor_w*0.6) (monitor_h*0.65) +} + +# Named rule for Mousam weather GUI +windowrule { + name = Mousam Weather + match:class = ^(io.github.amit9838.mousam)$ + match:title = ^(Mousam)$ + match:initial_class = ^(io.github.amit9838.mousam)$ + match:initial_title = ^(Mousam)$ + float = on + center = on + size = (monitor_w*0.7) (monitor_h*0.75) +} -#layerrule = ignorezero, class:^([Rr]ofi)$ -#layerrule = blur, class:^([Rr]ofi)$ -#layerrule = unset,class:^([Rr]ofi)$ -#layerrule = ignorezero, -#layerrule = ignorezero, overview -#layerrule = blur, overview \ No newline at end of file diff --git a/.config/hypr/hypridle.conf b/.config/hypr/hypridle.conf index 4b8cd7e2..fbf0b3ad 100644 --- a/.config/hypr/hypridle.conf +++ b/.config/hypr/hypridle.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # Hypridle # Original config submitted by https://github.com/SherLock707 diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 7119b3df..26701470 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # Always refer to Hyprland wiki # https://wiki.hyprland.org/ diff --git a/.config/hypr/hyprlock-1080p.conf b/.config/hypr/hyprlock-1080p.conf index 4251ac68..b0a0279c 100644 --- a/.config/hypr/hyprlock-1080p.conf +++ b/.config/hypr/hyprlock-1080p.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # Hyprlock config for < 1080p monitor resolutions # Original config submitted by https://github.com/SherLock707 @@ -7,7 +7,6 @@ source = $HOME/.config/hypr/wallust/wallust-hyprland.conf $Scripts = $HOME/.config/hypr/scripts general { - grace = 1 fractional_scaling = 2 immediate_render = true } @@ -72,7 +71,7 @@ label { # } # Seconds-Time -#label { +# label { # monitor = ## text = cmd[update:1000] echo "$(date +"%S")" # text = cmd[update:1000] echo "$(date +"%S %p")" #AM/PM @@ -82,10 +81,10 @@ label { # position = 0, -350 # halign = center # valign = top -#} +# } # Put a picture of choice here. Default is the current wallpaper -#image { +# image { # monitor = # path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_current # size = 160 @@ -97,7 +96,7 @@ label { # position = 0, 280 # halign = center # valign = bottom -} +# } # USER label { @@ -170,7 +169,7 @@ label { # weather edit the scripts for locations # weather scripts are located in ~/.config/hypr/UserScripts Weather.sh and/or Weather.py -# see https://github.com/JaKooLit/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock +# see https://github.com/LinuxBeginnings/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock label { monitor = text = cmd[update:3600000] [ -f "$HOME/.cache/.weather_cache" ] && cat "$HOME/.cache/.weather_cache" diff --git a/.config/hypr/hyprlock-2k.conf b/.config/hypr/hyprlock-2k.conf new file mode 100644 index 00000000..8c357d90 --- /dev/null +++ b/.config/hypr/hyprlock-2k.conf @@ -0,0 +1,182 @@ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # +# Hyprlock config for => 2k monitor resolutions +# Original config submitted by https://github.com/SherLock707 + +# Sourcing colors generated by wallust +source = $HOME/.config/hypr/wallust/wallust-hyprland.conf +$Scripts = $HOME/.config/hypr/scripts + +general { + fractional_scaling = 2 + immediate_render = true +} + +background { + monitor = + # NOTE: use only 1 path + #path = screenshot # screenshot of your desktop + #path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_modified # by wallpaper effects + path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_current # current wallpaper + + color = rgb(0,0,0) # color will be rendered initially until path is available + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_size = 3 + blur_passes = 2 # 0 disables blurring + noise = 0.0117 + contrast = 1.3000 # Vibrant!!! + brightness = 0.8000 + vibrancy = 0.2100 + vibrancy_darkness = 0.0 +} + + +# Date +label { + monitor = + text = cmd[update:18000000] echo " "$(date +'%A, %-d %B')" " + color = $color13 + font_size = 64 + font_family = Victor Mono Bold Italic + position = 0, -20 + halign = center + valign = center +} + +# Hour-Time (single horizontal time like 1080p variant) +label { + monitor = +# text = cmd[update:1000] echo "$(date +"%H:%M")" # 24h option + text = cmd[update:1000] echo "$(date +"%I:%M %p")" # AM/PM + #color = rgba(255, 185, 0, .8) + color = $color8 + font_size = 173 + font_family = JetBrainsMono Nerd Font ExtraBold + position = 0, -133 + halign = center + valign = top +} + +# Minute-Time (disabled; kept for reference) +# label { +# monitor = +# text = cmd[update:1000] echo "$(date +"%M")" +# #color = rgba(15, 10, 222, .8) +# color = $color12 +# font_size = 240 +# font_family = JetBrainsMono Nerd Font ExtraBold +# position = 0, -450 +# halign = center +# valign = top +# } + +# Seconds-Time (disabled; kept for reference) +# label { +# monitor = +# text = cmd[update:1000] echo "$(date +"%S")" +# # text = cmd[update:1000] echo "$(date +"%S %p")" #AM/PM +# color = $color11 +# font_size = 50 +# font_family = JetBrainsMono Nerd Font ExtraBold +# position = 0, -450 +# halign = center +# valign = top +# } + +# Put a picture of choice here. Default is the current wallpaper +# image { +# monitor = +# #path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_current +# size = 160 +# rounding = -1 +# border_size = 0 +# border_color = $color11 +# rotate = 0 +# reload_time = -1 +# position = 0, 400 +# halign = center +# valign = bottom +# } + +# USER +label { + monitor = + text =  $USER + color = $color9 + font_size = 48 + font_family = Victor Mono Bold Oblique + position = 0, 300 + halign = center + valign = bottom +} + +# INPUT FIELD +input-field { + monitor = + size = 306, 93 + outline_thickness = 2 + dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + outer_color = $color8 + inner_color = rgba(255, 255, 255, 0.1) + capslock_color = rgb(255,255,255) + font_color = $color13 + fade_on_empty = false + font_family = Victor Mono Bold Oblique + placeholder_text = 🔒 Type Password + hide_input = false + position = 0, 100 + halign = center + valign = bottom +} + +# Keyboard LAYOUT +label { + monitor = + text = $LAYOUT + color = $color8 + font_size = 19 + font_family = Victor Mono Bold Oblique + position = 0, 53 + halign = center + valign = bottom +} + +# uptime +label { + monitor = + text = cmd[update:60000] echo " "$(uptime -p || $Scripts/UptimeNixOS.sh)" " + color = $color8 + font_size = 32 + font_family = Victor Mono Bold Oblique + position = 0, 0 + halign = right + valign = bottom +} + +# battery information +label { + monitor = + text = cmd[update:1000] echo " "$($Scripts/Battery.sh)" " + color = $color8 + font_size = 21 + font_family = Victor Mono Bold Oblique + position = 0, 40 + halign = right + valign = bottom +} + +# weather edit the scripts for locations +# weather scripts are located in ~/.config/hypr/UserScripts Weather.sh and/or Weather.py +# see https://github.com/LinuxBeginnings/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock +label { + monitor = + text = cmd[update:3600000] [ -f "$HOME/.cache/.weather_cache" ] && cat "$HOME/.cache/.weather_cache" + color = $color8 + font_size = 19 + font_family = Victor Mono Bold Oblique + position = 50, 0 + halign = left + valign = bottom +} diff --git a/.config/hypr/hyprlock.conf b/.config/hypr/hyprlock.conf index f359357f..8c357d90 100644 --- a/.config/hypr/hyprlock.conf +++ b/.config/hypr/hyprlock.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # Hyprlock config for => 2k monitor resolutions # Original config submitted by https://github.com/SherLock707 @@ -7,7 +7,6 @@ source = $HOME/.config/hypr/wallust/wallust-hyprland.conf $Scripts = $HOME/.config/hypr/scripts general { - grace = 1 fractional_scaling = 2 immediate_render = true } @@ -85,7 +84,7 @@ label { # } # Put a picture of choice here. Default is the current wallpaper -#image { +# image { # monitor = # #path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_current # size = 160 @@ -97,7 +96,7 @@ label { # position = 0, 400 # halign = center # valign = bottom -#} +# } # USER label { @@ -170,7 +169,7 @@ label { # weather edit the scripts for locations # weather scripts are located in ~/.config/hypr/UserScripts Weather.sh and/or Weather.py -# see https://github.com/JaKooLit/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock +# see https://github.com/LinuxBeginnings/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock label { monitor = text = cmd[update:3600000] [ -f "$HOME/.cache/.weather_cache" ] && cat "$HOME/.cache/.weather_cache" diff --git a/.config/hypr/initial-boot.sh b/.config/hypr/initial-boot.sh index 1313f104..8ccda640 100755 --- a/.config/hypr/initial-boot.sh +++ b/.config/hypr/initial-boot.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # A bash script designed to run only once dotfiles installed # THIS SCRIPT CAN BE DELETED ONCE SUCCESSFULLY BOOTED!! And also, edit ~/.config/hypr/configs/Settings.conf @@ -17,7 +17,14 @@ gtk_theme="Flat-Remix-GTK-Blue-Dark" icon_theme="Flat-Remix-Blue-Dark" cursor_theme="Bibata-Modern-Ice" -swww="swww img" +if command -v awww >/dev/null 2>&1; then + WWW="awww" + DAEMON="awww-daemon" +else + WWW="swww" + DAEMON="swww-daemon" +fi +swww="$WWW img" effect="--transition-bezier .43,1.19,1,.4 --transition-fps 30 --transition-type grow --transition-pos 0.925,0.977 --transition-duration 2" # Check if a marker file exists. @@ -26,7 +33,7 @@ if [ ! -f "$HOME/.config/hypr/.initial_startup_done" ]; then # Initialize wallust and wallpaper if [ -f "$wallpaper" ]; then wallust run -s $wallpaper > /dev/null - swww query || swww-daemon && $swww $wallpaper $effect + $WWW query || $DAEMON && $swww $wallpaper $effect "$scriptsDir/WallustSwww.sh" > /dev/null 2>&1 & fi @@ -49,9 +56,6 @@ if [ ! -f "$HOME/.config/hypr/.initial_startup_done" ]; then # initiate kvantum theme kvantummanager --set "$kvantum_theme" > /dev/null 2>&1 & - # initiate the kb_layout (for some reason) waybar cant launch it - "$scriptsDir/SwitchKeyboardLayout.sh" > /dev/null 2>&1 & - # waybar style #if [ -L "$HOME/.config/waybar/config" ]; then ## ln -sf "$waybar_style" "$HOME/.config/waybar/style.css" diff --git a/.config/hypr/monitors.conf b/.config/hypr/monitors.conf index 74a60819..2f79d4fd 100644 --- a/.config/hypr/monitors.conf +++ b/.config/hypr/monitors.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # default Monitor config # *********************************************************** # @@ -36,7 +36,7 @@ monitor=,highres,auto,1 #monitor = HDMI-A-1, preferred,auto,1 # QEMU-KVM, virtual box or vmware -#monitor = Virtual-1, 1920x1080@60,auto,1 +monitor = Virtual-1, 1920x1080@60,auto,1 # to disable a monitor #monitor=name,disable diff --git a/.config/hypr/scripts/AirplaneMode.sh b/.config/hypr/scripts/AirplaneMode.sh index 548b9d6b..21aa04a8 100755 --- a/.config/hypr/scripts/AirplaneMode.sh +++ b/.config/hypr/scripts/AirplaneMode.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Airplane Mode. Turning on or off all wifi using rfkill. notif="$HOME/.config/swaync/images/ja.png" diff --git a/.config/hypr/scripts/Animations.sh b/.config/hypr/scripts/Animations.sh index 4bbe050f..5fb77750 100755 --- a/.config/hypr/scripts/Animations.sh +++ b/.config/hypr/scripts/Animations.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For applying Animations from different users # Check if rofi is already running diff --git a/.config/hypr/scripts/Battery.sh b/.config/hypr/scripts/Battery.sh index 2baed6ca..c42a4dac 100755 --- a/.config/hypr/scripts/Battery.sh +++ b/.config/hypr/scripts/Battery.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash - +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== for i in {0..3}; do if [ -f /sys/class/power_supply/BAT$i/capacity ]; then battery_level=$(cat /sys/class/power_supply/BAT$i/status) diff --git a/.config/hypr/scripts/Brightness.sh b/.config/hypr/scripts/Brightness.sh index ce443ef2..bf0f4bf1 100755 --- a/.config/hypr/scripts/Brightness.sh +++ b/.config/hypr/scripts/Brightness.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for Monitor backlights (if supported) using brightnessctl iDIR="$HOME/.config/swaync/icons" diff --git a/.config/hypr/scripts/BrightnessKbd.sh b/.config/hypr/scripts/BrightnessKbd.sh index 93e09d86..5bd09a78 100755 --- a/.config/hypr/scripts/BrightnessKbd.sh +++ b/.config/hypr/scripts/BrightnessKbd.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for keyboard backlights (if supported) using brightnessctl iDIR="$HOME/.config/swaync/icons" diff --git a/.config/hypr/scripts/ChangeBlur.sh b/.config/hypr/scripts/ChangeBlur.sh index 0060285b..10b5914e 100755 --- a/.config/hypr/scripts/ChangeBlur.sh +++ b/.config/hypr/scripts/ChangeBlur.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for changing blurs on the fly notif="$HOME/.config/swaync/images" diff --git a/.config/hypr/scripts/ChangeLayout.sh b/.config/hypr/scripts/ChangeLayout.sh index e2436b79..f9f6b52b 100755 --- a/.config/hypr/scripts/ChangeLayout.sh +++ b/.config/hypr/scripts/ChangeLayout.sh @@ -1,24 +1,110 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# for changing Hyprland Layouts (Master or Dwindle) on the fly +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# for changing Hyprland Layouts (master, dwindle, scrolling, monocle) on the fly notif="$HOME/.config/swaync/images/ja.png" -LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g') +layouts=(master dwindle scrolling monocle) -case $LAYOUT in -"master") - hyprctl keyword general:layout dwindle - # SUPER+J/K are global and managed by KeybindsLayoutInit.sh; only manage SUPER+O here - hyprctl keyword bind SUPER,O,togglesplit - notify-send -e -u low -i "$notif" " Dwindle Layout" - ;; -"dwindle") - hyprctl keyword general:layout master - # Drop togglesplit binding on SUPER+O when switching back to master - hyprctl keyword unbind SUPER,O - notify-send -e -u low -i "$notif" " Master Layout" - ;; -*) ;; +get_layout() { + hyprctl -j getoption general:layout | jq -r '.str' +} +next_layout() { + local current="$1" + local i + for i in "${!layouts[@]}"; do + if [[ "${layouts[i]}" == "$current" ]]; then + echo "${layouts[((i + 1) % ${#layouts[@]})]}" + return + fi + done + echo "${layouts[0]}" +} + +set_layout() { + local target="$1" + + hyprctl keyword general:layout "$target" + hyprctl keyword unbind SUPER,j + hyprctl keyword unbind SUPER,k + hyprctl keyword unbind SUPER,left + hyprctl keyword unbind SUPER,right + hyprctl keyword unbind SUPER,up + hyprctl keyword unbind SUPER,down + hyprctl keyword unbind SUPER,O + + case "$target" in + "dwindle") + hyprctl keyword bind SUPER,j,cyclenext + hyprctl keyword bind SUPER,k,cyclenext,prev + hyprctl keyword bind SUPER,left,cyclenext,prev + hyprctl keyword bind SUPER,up,cyclenext,prev + hyprctl keyword bind SUPER,right,cyclenext + hyprctl keyword bind SUPER,down,cyclenext + hyprctl keyword bind SUPER,O,layoutmsg,togglesplit + notify-send -e -u low -i "$notif" " Dwindle Layout" + ;; + "scrolling") + hyprctl keyword bind SUPER,j,cyclenext + hyprctl keyword bind SUPER,k,cyclenext,prev + hyprctl keyword bind SUPER,left,cyclenext,prev + hyprctl keyword bind SUPER,up,cyclenext,prev + hyprctl keyword bind SUPER,right,cyclenext + hyprctl keyword bind SUPER,down,cyclenext + notify-send -e -u low -i "$notif" " Scrolling Layout" + ;; + "monocle") + hyprctl keyword bind SUPER,j,layoutmsg,cyclenext + hyprctl keyword bind SUPER,k,layoutmsg,cycleprev + hyprctl keyword bind SUPER,left,layoutmsg,cycleprev + hyprctl keyword bind SUPER,up,layoutmsg,cycleprev + hyprctl keyword bind SUPER,right,layoutmsg,cyclenext + hyprctl keyword bind SUPER,down,layoutmsg,cyclenext + notify-send -e -u low -i "$notif" " Monocle Layout" + ;; + "master") + hyprctl keyword bind SUPER,j,layoutmsg,cyclenext + hyprctl keyword bind SUPER,k,layoutmsg,cycleprev + hyprctl keyword bind SUPER,left,movefocus,l + hyprctl keyword bind SUPER,right,movefocus,r + hyprctl keyword bind SUPER,up,movefocus,u + hyprctl keyword bind SUPER,down,movefocus,d + notify-send -e -u low -i "$notif" " Master Layout" + ;; + *) + hyprctl keyword bind SUPER,j,layoutmsg,cyclenext + hyprctl keyword bind SUPER,k,layoutmsg,cycleprev + hyprctl keyword bind SUPER,left,movefocus,l + hyprctl keyword bind SUPER,right,movefocus,r + hyprctl keyword bind SUPER,up,movefocus,u + hyprctl keyword bind SUPER,down,movefocus,d + echo "Unknown layout: $target" >&2 + return 1 + ;; + esac +} + +current="$(get_layout)" +arg="${1:-toggle}" + +case "$arg" in +init) + set_layout "$current" + ;; +toggle|next) + set_layout "$(next_layout "$current")" + ;; +master|dwindle|scrolling|monocle) + set_layout "$arg" + ;; +*) + echo "Usage: $(basename "$0") [toggle|next|init|master|dwindle|scrolling|monocle]" >&2 + exit 1 + ;; esac diff --git a/.config/hypr/scripts/ClipManager.sh b/.config/hypr/scripts/ClipManager.sh index 3ba5d91a..e3fbd066 100755 --- a/.config/hypr/scripts/ClipManager.sh +++ b/.config/hypr/scripts/ClipManager.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Clipboard Manager. This script uses cliphist, rofi, and wl-copy. # Variables diff --git a/.config/hypr/scripts/DarkLight.sh b/.config/hypr/scripts/DarkLight.sh index e473efb2..5b1cc3e7 100755 --- a/.config/hypr/scripts/DarkLight.sh +++ b/.config/hypr/scripts/DarkLight.sh @@ -1,16 +1,24 @@ #!/usr/bin/env bash -## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For Dark and Light switching # Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate directories # Paths -wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallpaper_base_path="$PICTURES_DIR/wallpapers/Dynamic-Wallpapers" dark_wallpapers="$wallpaper_base_path/Dark" light_wallpapers="$wallpaper_base_path/Light" hypr_config_path="$HOME/.config/hypr" swaync_style="$HOME/.config/swaync/style.css" ags_style="$HOME/.config/ags/user/style.css" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" notif="$HOME/.config/swaync/images/bell.png" wallust_rofi="$HOME/.config/wallust/templates/colors-rofi.rasi" @@ -19,6 +27,10 @@ kitty_conf="$HOME/.config/kitty/kitty.conf" wallust_config="$HOME/.config/wallust/wallust.toml" pallete_dark="dark16" pallete_light="light16" +qt5ct_dark="$HOME/.config/qt5ct/colors/Catppuccin-Mocha.conf" +qt5ct_light="$HOME/.config/qt5ct/colors/Catppuccin-Latte.conf" +qt6ct_dark="$HOME/.config/qt6ct/colors/Catppuccin-Mocha.conf" +qt6ct_light="$HOME/.config/qt6ct/colors/Catppuccin-Latte.conf" # intial kill process for pid in waybar rofi swaync ags swaybg; do @@ -26,11 +38,11 @@ for pid in waybar rofi swaync ags swaybg; do done -# Initialize swww if needed -swww query || swww-daemon --format xrgb +# Initialize wallpaper daemon if needed +"$WWW_CMD" query || "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" # Set swww options -swww="swww img" +swww="$WWW_CMD img" effect="--transition-bezier .43,1.19,1,.4 --transition-fps 60 --transition-type grow --transition-pos 0.925,0.977 --transition-duration 2" # Determine current theme mode @@ -43,6 +55,14 @@ else # Logic for Light mode wallpaper_path="$light_wallpapers" fi +# Select Qt color scheme templates for the upcoming mode +if [ "$next_mode" = "Dark" ]; then + qt5ct_color_scheme="$qt5ct_dark" + qt6ct_color_scheme="$qt6ct_dark" +else + qt5ct_color_scheme="$qt5ct_light" + qt6ct_color_scheme="$qt6ct_light" +fi # Function to update theme mode for the next cycle update_theme_mode() { diff --git a/.config/hypr/scripts/Distro_update.sh b/.config/hypr/scripts/Distro_update.sh index 2b3376e3..b9bcae71 100755 --- a/.config/hypr/scripts/Distro_update.sh +++ b/.config/hypr/scripts/Distro_update.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Simple bash script to check and will try to update your system # Local Paths @@ -15,23 +20,23 @@ fi if command -v paru &> /dev/null || command -v yay &> /dev/null; then # Arch-based if command -v paru &> /dev/null; then - kitty -T update paru -Syu + kitty -T update -e paru -Syu notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.' else - kitty -T update yay -Syu + kitty -T update -e yay -Syu notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.' fi elif command -v dnf &> /dev/null; then # Fedora-based - kitty -T update sudo dnf update --refresh -y + kitty -T update -e sudo dnf update --refresh -y notify-send -i "$iDIR/ja.png" -u low 'Fedora system' 'has been updated.' elif command -v apt &> /dev/null; then # Debian-based (Debian, Ubuntu, etc.) - kitty -T update sudo apt update && sudo apt upgrade -y + kitty -T update -e bash -c "sudo apt update && sudo apt upgrade -y" notify-send -i "$iDIR/ja.png" -u low 'Debian/Ubuntu system' 'has been updated.' elif command -v zypper &> /dev/null; then # openSUSE-based - kitty -T update sudo zypper dup -y + kitty -T update -e sudo zypper dup -y notify-send -i "$iDIR/ja.png" -u low 'openSUSE system' 'has been updated.' else # Unsupported distro diff --git a/.config/hypr/scripts/Dropterminal.sh b/.config/hypr/scripts/Dropterminal.sh index 9b2eeecb..81c0f157 100755 --- a/.config/hypr/scripts/Dropterminal.sh +++ b/.config/hypr/scripts/Dropterminal.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # # Made and brought to by Kiran George # /* -- ✨ https://github.com/SherLock707 ✨ -- */ ## @@ -12,7 +17,13 @@ DEBUG=false SPECIAL_WS="special:scratchpad" +SPECIAL_NAME="${SPECIAL_WS#special:}" ADDR_FILE="/tmp/dropdown_terminal_addr" +STATE_FILE="/tmp/dropdown_terminal_state" +LOCK_FILE="/tmp/dropdown_terminal_lock" +LAST_TOGGLE_FILE="/tmp/dropdown_terminal_last_toggle" +MIN_TOGGLE_INTERVAL_MS=250 +DROPDOWN_KITTY_CLASS="kitty-dropterm" # Dropdown size and position configuration (percentages) WIDTH_PERCENT=65 # Width as percentage of screen width @@ -31,14 +42,65 @@ if [ "$1" = "-d" ]; then fi TERMINAL_CMD="$1" +if [[ "$TERMINAL_CMD" == kitty* ]] && [[ "$TERMINAL_CMD" != *"--class"* ]] && [[ "$TERMINAL_CMD" != *"--name"* ]] && [[ "$TERMINAL_CMD" != *"--app-id"* ]]; then + TERMINAL_CMD="$TERMINAL_CMD --class $DROPDOWN_KITTY_CLASS" +fi + +# Ensure only one instance runs at a time (prevents overlapping animations) +exec 9>"$LOCK_FILE" +flock -n 9 || exit 0 + +# Debounce rapid toggles +now_ms="" +if date +%s%3N >/dev/null 2>&1; then + now_ms=$(date +%s%3N) +else + now_ms=$(( $(date +%s) * 1000 )) +fi +if [ -f "$LAST_TOGGLE_FILE" ]; then + last_ms=$(cat "$LAST_TOGGLE_FILE" 2>/dev/null || echo 0) + if [ -n "$last_ms" ] && [ "$last_ms" -ge 0 ] 2>/dev/null; then + delta_ms=$((now_ms - last_ms)) + if [ "$delta_ms" -lt "$MIN_TOGGLE_INTERVAL_MS" ] 2>/dev/null; then + if [ "$DEBUG" = true ]; then + echo "Toggle debounced (${delta_ms}ms < ${MIN_TOGGLE_INTERVAL_MS}ms)" >&2 + fi + exit 0 + fi + fi +fi +echo "$now_ms" >"$LAST_TOGGLE_FILE" # Debug echo function debug_echo() { if [ "$DEBUG" = true ]; then - echo "$@" + echo "$@" >&2 fi } +# Resolve terminal address, recovering by class if needed +resolve_terminal_address() { + local addr + addr=$(get_terminal_address) + if [ -n "$addr" ] && window_exists "$addr"; then + echo "$addr" + return 0 + fi + + local recovered + recovered=$(find_terminal_by_class) + if [ -n "$recovered" ] && [ "$recovered" != "null" ]; then + local mon_name + mon_name=$(get_monitor_info | awk '{print $6}') + echo "$recovered $mon_name" >"$ADDR_FILE" + echo "$recovered" + return 0 + fi + + rm -f "$ADDR_FILE" + return 1 +} + # Validate input if [ -z "$TERMINAL_CMD" ]; then echo "Missing terminal command. Usage: $0 [-d] " @@ -62,6 +124,28 @@ get_window_geometry() { hyprctl clients -j | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | "\(.at[0]) \(.at[1]) \(.size[0]) \(.size[1])"' } +# Function to check if window is currently hidden off-screen +window_is_hidden() { + local addr="$1" + local y + y=$(hyprctl clients -j 2>/dev/null | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | .at[1]' 2>/dev/null) + if [[ "$y" =~ ^-?[0-9]+$ ]] && [ "$y" -lt 0 ]; then + return 0 + fi + return 1 +} + +# State helpers +get_hidden_state() { + if [ -f "$STATE_FILE" ]; then + cat "$STATE_FILE" 2>/dev/null + fi +} + +set_hidden_state() { + echo "$1" >"$STATE_FILE" +} + # Function to animate window slide down (show) animate_slide_down() { local addr="$1" @@ -121,7 +205,30 @@ animate_slide_up() { # Function to get monitor info including scale and name of focused monitor get_monitor_info() { - local monitor_data=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x) \(.y) \(.width) \(.height) \(.scale) \(.name)"') + local monitor_data + monitor_data=$(hyprctl monitors -j 2>/dev/null | jq -er 'map(select(.focused == true)) | .[0] | "\(.x) \(.y) \(.width) \(.height) \(.scale) \(.name)"' 2>/dev/null) || monitor_data="" + if [ -z "$monitor_data" ]; then + # Fallback for older Hyprland without -j support + monitor_data=$(hyprctl monitors 2>/dev/null | awk ' + /^Monitor / {name=$2; sub(/\(.*/, "", name); x=y=w=h=scale=""; focused="no"} + / at / { + # e.g. "1920x1080@74.97300 at 0x0" + split($1, res, "x"); w=res[1]; split(res[2], tmp, "@"); h=tmp[1] + split($4, pos, "x"); x=pos[1]; y=pos[2] + } + /scale:/ {scale=$2} + /focused:/ {focused=$2} + /^$/ { + if (focused=="yes" && x!="" && y!="" && w!="" && h!="" && scale!="" && name!="") { + print x, y, w, h, scale, name; exit + } + } + END { + if (focused=="yes" && x!="" && y!="" && w!="" && h!="" && scale!="" && name!="") { + print x, y, w, h, scale, name + } + }') + fi if [ -z "$monitor_data" ] || [[ "$monitor_data" =~ ^null ]]; then debug_echo "Error: Could not get focused monitor information" return 1 @@ -129,6 +236,7 @@ get_monitor_info() { echo "$monitor_data" } + # Function to calculate dropdown position with proper scaling and centering calculate_dropdown_position() { local monitor_info=$(get_monitor_info) @@ -148,6 +256,13 @@ calculate_dropdown_position() { debug_echo "Monitor info: x=$mon_x, y=$mon_y, width=$mon_width, height=$mon_height, scale=$mon_scale" + # Validate numeric fields + if ! [[ "$mon_x" =~ ^-?[0-9]+$ && "$mon_y" =~ ^-?[0-9]+$ && "$mon_width" =~ ^[0-9]+$ && "$mon_height" =~ ^[0-9]+$ ]]; then + debug_echo "Invalid monitor info format, using fallback values" + echo "100 100 800 600 fallback-monitor" + return 1 + fi + # Validate scale value and provide fallback if [ -z "$mon_scale" ] || [ "$mon_scale" = "null" ] || [ "$mon_scale" = "0" ]; then debug_echo "Invalid scale value, using 1.0 as fallback" @@ -207,6 +322,12 @@ get_terminal_address() { fi } +# Try to find an existing dropdown terminal by class (kitty only) +find_terminal_by_class() { + hyprctl clients -j 2>/dev/null | jq -r --arg CLASS "$DROPDOWN_KITTY_CLASS" \ + '.[] | select(.class == $CLASS) | .address' | head -1 +} + # Function to get stored monitor name get_terminal_monitor() { if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then @@ -218,22 +339,48 @@ get_terminal_monitor() { terminal_exists() { local addr=$(get_terminal_address) if [ -n "$addr" ]; then - hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1 + hyprctl clients -j 2>/dev/null | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1 else return 1 fi } -# Function to check if terminal is in special workspace -terminal_in_special() { - local addr=$(get_terminal_address) +# Function to check if a window address exists +window_exists() { + local addr="$1" if [ -n "$addr" ]; then - hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR and .workspace.name == "special:scratchpad")' >/dev/null 2>&1 + hyprctl clients -j 2>/dev/null | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1 else return 1 fi } + +# Function to check if window is pinned +window_is_pinned() { + local addr="$1" + if [ -n "$addr" ]; then + hyprctl clients -j 2>/dev/null | jq -e --arg ADDR "$addr" '.[] | select(.address == $ADDR) | .pinned == true' >/dev/null 2>&1 + else + return 1 + fi +} + +# Ensure pin state without toggling unexpectedly +ensure_pinned() { + local addr="$1" + if ! window_is_pinned "$addr"; then + hyprctl dispatch pin "address:$addr" >/dev/null 2>&1 + fi +} + +ensure_unpinned() { + local addr="$1" + if window_is_pinned "$addr"; then + hyprctl dispatch pin "address:$addr" >/dev/null 2>&1 + fi +} + # Function to spawn terminal and capture its address spawn_terminal() { debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD" @@ -288,12 +435,13 @@ spawn_terminal() { # Small delay to ensure it's properly in special workspace sleep 0.2 - - # Now bring it back with the same animation as subsequent shows - # Use movetoworkspacesilent to avoid affecting workspace history + # Move to current workspace but start hidden off-screen hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$new_addr" - hyprctl dispatch pin "address:$new_addr" - animate_slide_down "$new_addr" "$target_x" "$target_y" "$width" "$height" + ensure_pinned "$new_addr" + hyprctl dispatch resizewindowpixel "exact $width $height,address:$new_addr" >/dev/null 2>&1 + local off_y=$((target_y - height - 200)) + hyprctl dispatch movewindowpixel "exact $target_x $off_y,address:$new_addr" >/dev/null 2>&1 + set_hidden_state "hidden" return 0 fi @@ -303,8 +451,9 @@ spawn_terminal() { } # Main logic -if terminal_exists; then - TERMINAL_ADDR=$(get_terminal_address) +TERMINAL_ADDR=$(resolve_terminal_address) + +if [ -n "$TERMINAL_ADDR" ]; then debug_echo "Found existing terminal: $TERMINAL_ADDR" focused_monitor=$(get_monitor_info | awk '{print $6}') dropdown_monitor=$(get_terminal_monitor) @@ -324,8 +473,9 @@ if terminal_exists; then echo "$TERMINAL_ADDR $monitor_name" >"$ADDR_FILE" fi - if terminal_in_special; then - debug_echo "Bringing terminal from scratchpad with slide down animation" + hidden_state=$(get_hidden_state) + if [ "$hidden_state" = "hidden" ] || [ -z "$hidden_state" ] || window_is_hidden "$TERMINAL_ADDR"; then + debug_echo "Bringing terminal from hidden position with slide down animation" # Calculate target position pos_info=$(calculate_dropdown_position) @@ -334,17 +484,16 @@ if terminal_exists; then width=$(echo $pos_info | cut -d' ' -f3) height=$(echo $pos_info | cut -d' ' -f4) - # Use movetoworkspacesilent to avoid affecting workspace history - hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$TERMINAL_ADDR" - hyprctl dispatch pin "address:$TERMINAL_ADDR" + ensure_pinned "$TERMINAL_ADDR" # Set size and animate slide down hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" animate_slide_down "$TERMINAL_ADDR" "$target_x" "$target_y" "$width" "$height" hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + set_hidden_state "shown" else - debug_echo "Hiding terminal to scratchpad with slide up animation" + debug_echo "Hiding terminal off-screen with slide up animation" # Get current geometry for animation geometry=$(get_window_geometry "$TERMINAL_ADDR") @@ -359,14 +508,16 @@ if terminal_exists; then # Animate slide up first animate_slide_up "$TERMINAL_ADDR" "$curr_x" "$curr_y" "$curr_width" "$curr_height" - # Small delay then move to special workspace and unpin - sleep 0.1 - hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) - hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" + # Move off-screen after animation + off_y=$((curr_y - curr_height - 200)) + hyprctl dispatch movewindowpixel "exact $curr_x $off_y,address:$TERMINAL_ADDR" >/dev/null 2>&1 + ensure_unpinned "$TERMINAL_ADDR" + set_hidden_state "hidden" else - debug_echo "Could not get window geometry, moving to scratchpad without animation" - hyprctl dispatch pin "address:$TERMINAL_ADDR" - hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" + debug_echo "Could not get window geometry, moving off-screen without animation" + hyprctl dispatch movewindowpixel "exact 0 -1000,address:$TERMINAL_ADDR" >/dev/null 2>&1 + ensure_unpinned "$TERMINAL_ADDR" + set_hidden_state "hidden" fi fi else diff --git a/.config/hypr/scripts/ExternalBrightness.sh b/.config/hypr/scripts/ExternalBrightness.sh new file mode 100755 index 00000000..29c1b238 --- /dev/null +++ b/.config/hypr/scripts/ExternalBrightness.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# External monitor brightness via ddcutil + +set -u + +step=10 +vcp_code=10 + +usage() { + cat <<'EOF' +Usage: ExternalBrightness.sh [--get|--inc|--dec|--set N] [--display N] +Env: + DDCUTIL_DISPLAY Optional display number passed to ddcutil --display + DDCUTIL_OPTS Extra options passed to ddcutil (e.g. "--sleep-multiplier 0.2") +EOF +} + +ddcutil_cmd() { + local display_arg=() + local display="${DDCUTIL_DISPLAY:-}" + if [[ -n "${display}" ]]; then + display_arg+=(--display "${display}") + fi + ddcutil ${DDCUTIL_OPTS:-} "${display_arg[@]}" "$@" +} + +get_brightness() { + # Example output: "VCP code 0x10 (Brightness): current value = 50, max value = 100" + local line + if ! line="$(ddcutil_cmd getvcp "${vcp_code}" 2>/dev/null | tail -n 1)"; then + return 1 + fi + local current max + current="$(printf "%s" "${line}" | sed -n 's/.*current value = \([0-9]\+\).*/\1/p')" + max="$(printf "%s" "${line}" | sed -n 's/.*max value = \([0-9]\+\).*/\1/p')" + [[ -n "${current}" && -n "${max}" ]] || return 1 + printf "%s %s\n" "${current}" "${max}" +} + +set_brightness() { + local value="$1" + ddcutil_cmd setvcp "${vcp_code}" "${value}" >/dev/null 2>&1 +} + +json_output() { + local current max percent icon + if ! read -r current max < <(get_brightness); then + printf '{"text":"󰃜 N/A","tooltip":"External brightness unavailable (load i2c-dev, allow i2c access)","class":"brightness-external-off"}\n' + return 0 + fi + percent=$(( current * 100 / max )) + if (( percent >= 80 )); then + icon="󰃠" + elif (( percent >= 60 )); then + icon="󰃟" + elif (( percent >= 40 )); then + icon="󰃞" + elif (( percent >= 20 )); then + icon="󰃝" + else + icon="" + fi + printf '{"text":"%s %s%%","tooltip":"External display brightness: %s%%","class":"brightness-external"}\n' "${icon}" "${percent}" "${percent}" +} + +case "${1:-}" in + --get|"") + json_output + ;; + --inc|--dec) + read -r current max < <(get_brightness) || exit 1 + delta=$step + [[ "$1" == "--dec" ]] && delta=$(( -step )) + new=$(( current + delta )) + (( new < 5 )) && new=5 + (( new > max )) && new="${max}" + set_brightness "${new}" + json_output + ;; + --set) + [[ -n "${2:-}" ]] || { usage; exit 1; } + set_brightness "${2}" + json_output + ;; + --display) + [[ -n "${2:-}" ]] || { usage; exit 1; } + DDCUTIL_DISPLAY="${2}" shift 2 + "${0}" "${@:-"--get"}" + ;; + -h|--help) + usage + ;; + *) + usage + exit 1 + ;; +esac diff --git a/.config/hypr/scripts/Float-all-Windows.sh b/.config/hypr/scripts/Float-all-Windows.sh new file mode 100755 index 00000000..e658cabb --- /dev/null +++ b/.config/hypr/scripts/Float-all-Windows.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== + +ws=$(hyprctl activeworkspace -j | jq -r .id) +hyprctl clients -j | jq -r --arg ws "$ws" '.[] | select(.workspace.id == ($ws|tonumber)) | .address' | xargs -r -I {} hyprctl dispatch togglefloating address:{} diff --git a/.config/hypr/scripts/GameMode.sh b/.config/hypr/scripts/GameMode.sh index 59cf7372..9c5b8264 100755 --- a/.config/hypr/scripts/GameMode.sh +++ b/.config/hypr/scripts/GameMode.sh @@ -1,9 +1,16 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Game Mode. Turning off all animations notif="$HOME/.config/swaync/images/ja.png" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') @@ -17,13 +24,13 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then keyword general:border_size 1;\ keyword decoration:rounding 0" - hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$" - swww kill +\thyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$" + "$WWW_CMD" kill notify-send -e -u low -i "$notif" " Gamemode:" " enabled" sleep 0.1 exit else - swww-daemon --format xrgb && swww img "$HOME/.config/rofi/.current_wallpaper" & +\t"$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" && "$WWW_CMD" img "$HOME/.config/rofi/.current_wallpaper" & sleep 0.1 ${SCRIPTSDIR}/WallustSwww.sh sleep 0.5 diff --git a/.config/hypr/scripts/Ghostty_themes.sh b/.config/hypr/scripts/Ghostty_themes.sh new file mode 100755 index 00000000..a69f246e --- /dev/null +++ b/.config/hypr/scripts/Ghostty_themes.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Ghostty theme selector + +config_file="$HOME/.config/ghostty/config" +iDIR="$HOME/.config/swaync/images" +rofi_theme_primary="$HOME/.config/rofi/config-ghostty-theme.rasi" +rofi_theme_fallback="$HOME/.config/rofi/config-edit.rasi" + +notify_user() { + local icon="$1" + local title="$2" + local body="$3" + if [[ -n "$icon" && -f "$icon" ]]; then + notify-send -u low -i "$icon" "$title" "$body" + else + notify-send -u low "$title" "$body" + fi +} + +if [[ ! -f "$config_file" ]]; then + notify_user "$iDIR/error.png" "Ghostty Theme" "Config not found: $config_file" + exit 1 +fi + +rofi_config_args=() +if [[ -f "$rofi_theme_primary" ]]; then + rofi_config_args=(-config "$rofi_theme_primary") +elif [[ -f "$rofi_theme_fallback" ]]; then + rofi_config_args=(-config "$rofi_theme_fallback") +fi + +current_theme=$( + awk -F'=' '/^[[:space:]]*theme[[:space:]]*=/ { + val=$2 + sub(/^[[:space:]]+/, "", val) + sub(/[[:space:]]+$/, "", val) + gsub(/^"|"$/, "", val) + print val + exit + }' "$config_file" +) + +mapfile -t available_theme_names < <( + awk -F'=' '/^[[:space:]]*#[[:space:]]*theme[[:space:]]*=/ { + val=$2 + sub(/^[[:space:]]+/, "", val) + sub(/[[:space:]]+$/, "", val) + gsub(/^"|"$/, "", val) + print val + }' "$config_file" +) + +if [[ ${#available_theme_names[@]} -eq 0 ]]; then + notify_user "$iDIR/error.png" "Ghostty Theme" "No commented themes found in $config_file" + exit 1 +fi + +menu_entries=() +if [[ -n "$current_theme" ]]; then + menu_entries+=("Current: $current_theme") +fi +for t in "${available_theme_names[@]}"; do + menu_entries+=("$t") +done + +choice=$( + printf "%s\n" "${menu_entries[@]}" | + rofi -i -dmenu -p "Ghostty Theme" "${rofi_config_args[@]}" -mesg "Select a theme to apply" +) + +[[ -z "$choice" ]] && exit 0 + +if [[ "$choice" == "Current: "* ]]; then + exit 0 +fi + +selected_theme="$choice" + +if [[ -n "$current_theme" && "$selected_theme" == "$current_theme" ]]; then + exit 0 +fi + +format_theme_value() { + if [[ "$1" =~ [[:space:]] ]]; then + printf "\"%s\"" "$1" + else + printf "%s" "$1" + fi +} + +selected_formatted=$(format_theme_value "$selected_theme") + +tmp_file=$(mktemp) +awk -v selected="$selected_theme" -v selected_formatted="$selected_formatted" ' +function trim(s) { sub(/^[[:space:]]+/, "", s); sub(/[[:space:]]+$/, "", s); return s } +function strip_quotes(s) { gsub(/^"|"$/, "", s); return s } +{ + line=$0 + if ($0 ~ /^[[:space:]]*theme[[:space:]]*=/) { + sub(/^[[:space:]]*theme[[:space:]]*=/, "#theme =", line) + print line + next + } + if ($0 ~ /^[[:space:]]*#[[:space:]]*theme[[:space:]]*=/) { + val=$0 + sub(/^[[:space:]]*#[[:space:]]*theme[[:space:]]*=[[:space:]]*/, "", val) + val=trim(val) + val=strip_quotes(val) + if (val == selected) { + print "theme = " selected_formatted + next + } + } + print $0 +}' "$config_file" > "$tmp_file" + +mv "$tmp_file" "$config_file" + +pkill -SIGUSR2 ghostty >/dev/null 2>&1 || true + +notify_user "$iDIR/ja.png" "Ghostty Theme Applied" "$selected_theme" + +exit 0 diff --git a/.config/hypr/scripts/Hypridle.sh b/.config/hypr/scripts/Hypridle.sh index 6acff434..240fec3e 100755 --- a/.config/hypr/scripts/Hypridle.sh +++ b/.config/hypr/scripts/Hypridle.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This is for custom version of waybar idle_inhibitor which activates / deactivates hypridle instead PROCESS="hypridle" @@ -15,7 +20,8 @@ elif [[ "$1" == "toggle" ]]; then if pgrep -x "$PROCESS" >/dev/null; then pkill "$PROCESS" else - "$PROCESS" + "$PROCESS" >/dev/null 2>&1 & + disown fi else echo "Usage: $0 {status|toggle}" diff --git a/.config/hypr/scripts/Hyprsunset.sh b/.config/hypr/scripts/Hyprsunset.sh index 4a2b52f4..52140728 100755 --- a/.config/hypr/scripts/Hyprsunset.sh +++ b/.config/hypr/scripts/Hyprsunset.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== set -euo pipefail # Hyprsunset toggle + Waybar status helper diff --git a/.config/hypr/scripts/KeyBinds.sh b/.config/hypr/scripts/KeyBinds.sh index 4158b762..69111047 100755 --- a/.config/hypr/scripts/KeyBinds.sh +++ b/.config/hypr/scripts/KeyBinds.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # searchable enabled keybinds using rofi (supports bindd descriptions) # kill yad to not interfere with this binds @@ -21,135 +26,19 @@ msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO func files=("$keybinds_conf" "$user_keybinds_conf") [[ -f "$laptop_conf" ]] && files+=("$laptop_conf") -# Parse binds/unbinds from files, detect overrides, and keep unique effective binds -declare -A binding_map # combo -> bind line (effective) -declare -A source_map # combo -> source file -declare -A user_bind_map # combo -> user bind line -declare -A unbound_user # combo -> 1 if explicitly unbound in user file -declare -A seen_any_bind # combo -> 1 if any bind seen (for iteration) -declare -A default_seen # combo -> 1 if default bind exists -declare -a missing_unbind_suggestions_arr +# Parse binds using the python script for speed +# The last argument must be the user config for override logic to work correctly +display_keybinds=$("$HOME/.config/hypr/scripts/keybinds_parser.py" "${files[@]}") -normalize_combo() { echo "$1" | sed -E 's/[[:space:]]//g'; } - -extract_combo() { - # arg: a bind/unbind line; returns "mods,key" via echo - local s="$1" - s="$(echo "$s" | sed -E 's/[[:space:]]+#.*$//')" - if [[ "$s" =~ = ]]; then - local rhs="${s#*=}" - local mods="$(echo "$rhs" | awk -F',' '{gsub(/^[ \t]+|[ \t]+$/,"",$1); print $1}')" - local key="$(echo "$rhs" | awk -F',' '{gsub(/^[ \t]+|[ \t]+$/,"",$2); print $2}')" - echo "${mods},${key}" +# Check for suggestions file created by python script +if [[ -f "/tmp/hypr_keybind_suggestions_file" ]]; then + suggestions_file=$(cat "/tmp/hypr_keybind_suggestions_file") + rm "/tmp/hypr_keybind_suggestions_file" + if [[ -n "$suggestions_file" && -f "$suggestions_file" ]]; then + count=$(wc -l < "$suggestions_file") + msg="$msg | Overrides missing unbind: $count (suggestions: $suggestions_file)" fi -} - -for file in "${files[@]}"; do - [[ ! -f "$file" ]] && continue - while IFS= read -r line; do - [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue - - if [[ "$line" =~ ^[[:space:]]*bind[a-z]*[[:space:]]*= ]]; then - combo_raw="$(extract_combo "$line")" - [[ -z "$combo_raw" ]] && continue - combo="$(normalize_combo "$combo_raw")" - seen_any_bind["$combo"]=1 - - if [[ "$file" != "$user_keybinds_conf" ]]; then - default_seen["$combo"]=1 - fi - - # prefer user bind, else first seen - if [[ -z "${source_map[$combo]}" ]]; then - binding_map["$combo"]="$line" - source_map["$combo"]="$file" - fi - if [[ "$file" == "$user_keybinds_conf" ]]; then - user_bind_map["$combo"]="$line" - binding_map["$combo"]="$line" - source_map["$combo"]="$file" - fi - - elif [[ "$line" =~ ^[[:space:]]*unbind[[:space:]]*= ]]; then - combo_raw="$(extract_combo "$line")" - [[ -z "$combo_raw" ]] && continue - combo="$(normalize_combo "$combo_raw")" - if [[ "$file" == "$user_keybinds_conf" ]]; then - unbound_user["$combo"]=1 - fi - fi - done < "$file" -done - -# Build raw_keybinds for display and collect missing unbind suggestions -raw_keybinds="" -for combo in "${!seen_any_bind[@]}"; do - eff_line="${binding_map[$combo]}" - src="${source_map[$combo]}" - [[ -z "$eff_line" ]] && continue - raw_keybinds+="$eff_line"$'\n' - - # If user overrides a default but didn't unbind in user file, suggest unbind - if [[ "$src" == "$user_keybinds_conf" && -n "${default_seen[$combo]}" && -z "${unbound_user[$combo]}" ]]; then - suggest="$(echo "$eff_line" | sed -E 's/^[[:space:]]*bind[a-z]*/unbind/')" - missing_unbind_suggestions_arr+=("$suggest") - fi -done - -# If there are missing unbinds, write suggestions to a temp file and note in message -if (( ${#missing_unbind_suggestions_arr[@]} > 0 )); then - suggestions_file="$(mktemp -t hypr-unbind-suggestions.XXXX.conf)" - printf '%s\n' "${missing_unbind_suggestions_arr[@]}" > "$suggestions_file" - msg="$msg | Overrides missing unbind: ${#missing_unbind_suggestions_arr[@]} (suggestions: $suggestions_file)" fi -# check for any keybinds to display -if [[ -z "$raw_keybinds" ]]; then - echo "no keybinds found." - exit 1 -fi - -# transform into a readable list: MODS+KEY — DESCRIPTION (for bindd) or DISPATCHER [PARAMS] (for bind) -display_keybinds=$(echo "$raw_keybinds" | awk -F'=' ' - function trim(s){ gsub(/^[ \t]+|[ \t]+$/,"",s); return s } - /^[[:space:]]*bind/ { - binder=$1; gsub(/[ \t]/, "", binder); - hasdesc = (index(binder, "d")>0); - - rhs=$2; rhs=trim(rhs); - n=split(rhs, a, /[ \t]*,[ \t]*/); - - mods=trim(a[1]); key=(n>=2?trim(a[2]):""); - desc=""; dispatcher=""; params=""; - - if (hasdesc) { - desc=(n>=3?trim(a[3]):""); - dispatcher=(n>=4?trim(a[4]):""); - start=5; - } else { - dispatcher=(n>=3?trim(a[3]):""); - start=4; - } - - for(i=start;i<=n;i++){ if(length(a[i])){ p=trim(a[i]); if(p!="") params = (params?params", ":"") p } } - - gsub(/\$mainMod/,"SUPER",mods); - gsub(/[ \t]+/,"+",mods); - - combo = (mods && key) ? mods "+" key : (key?key:mods); - - if (hasdesc && desc != "") { - print combo, " — ", desc; - } else { - if (dispatcher != "" && params != "") - print combo, " — ", dispatcher, " ", params; - else if (dispatcher != "") - print combo, " — ", dispatcher; - else - print combo; - } - } -') - # use rofi to display the keybinds printf '%s\n' "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" diff --git a/.config/hypr/scripts/KeyHints.sh b/.config/hypr/scripts/KeyHints.sh index 8a478039..a9f6660a 100755 --- a/.config/hypr/scripts/KeyHints.sh +++ b/.config/hypr/scripts/KeyHints.sh @@ -1,72 +1,77 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # GDK BACKEND. Change to either wayland or x11 if having issues BACKEND=wayland # Check if rofi or yad is running and kill them if they are -if pidof rofi > /dev/null; then +if pidof rofi >/dev/null; then pkill rofi fi -if pidof yad > /dev/null; then +if pidof yad >/dev/null; then pkill yad fi # Launch yad with calculated width and height GDK_BACKEND=$BACKEND yad \ - --center \ - --title="KooL Quick Cheat Sheet" \ - --no-buttons \ - --list \ - --column=Key: \ - --column=Description: \ - --column=Command: \ - --timeout-indicator=bottom \ -"ESC" "close this app" "" " = " "SUPER KEY (Windows Key Button)" "(SUPER KEY)" \ -" SHIFT K" "Searchable Keybinds" "(Search all Keybinds via rofi)" \ -" SHIFT E" "KooL Hyprland Settings Menu" "" \ -"" "" "" \ -" enter" "Terminal" "(kitty)" \ -" SHIFT enter" "DropDown Terminal" " Q to close" \ -" B" "Launch Browser" "(Default browser)" \ -" A" "Desktop Overview" "(AGS - if opted to install)" \ -" D" "Application Launcher" "(rofi-wayland)" \ -" E" "Open File Manager" "(Thunar)" \ -" S" "Google Search using rofi" "(rofi)" \ -" Q" "close active window" "(not kill)" \ -" Shift Q " "kills an active window" "(kill)" \ -" ALT mouse scroll up/down " "Desktop Zoom" "Desktop Magnifier" \ -" Alt V" "Clipboard Manager" "(cliphist)" \ -" W" "Choose wallpaper" "(Wallpaper Menu)" \ -" Shift W" "Choose wallpaper effects" "(imagemagick + swww)" \ -"CTRL ALT W" "Random wallpaper" "(via swww)" \ -" CTRL ALT B" "Hide/UnHide Waybar" "waybar" \ -" CTRL B" "Choose waybar styles" "(waybar styles)" \ -" ALT B" "Choose waybar layout" "(waybar layout)" \ -" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \ -" SHIFT N" "Launch Notification Panel" "swaync Notification Center" \ -" Print" "screenshot" "(grim)" \ -" Shift Print" "screenshot region" "(grim + slurp)" \ -" Shift S" "screenshot region" "(swappy)" \ -" CTRL Print" "screenshot timer 5 secs " "(grim)" \ -" CTRL SHIFT Print" "screenshot timer 10 secs " "(grim)" \ -"ALT Print" "Screenshot active window" "active window only" \ -"CTRL ALT P" "power-menu" "(wlogout)" \ -"CTRL ALT L" "screen lock" "(hyprlock)" \ -"CTRL ALT Del" "Hyprland Exit" "(NOTE: Hyprland Will exit immediately)" \ -" SHIFT F" "Fullscreen" "Toggles to full screen" \ -" CTL F" "Fake Fullscreen" "Toggles to fake full screen" \ -" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ -" SPACEBAR" "Toggle float" "single window" \ -" ALT SPACEBAR" "Toggle all windows to float" "all windows" \ -" ALT O" "Toggle Blur" "normal or less blur" \ -" CTRL O" "Toggle Opaque ON or OFF" "on active window only" \ -" Shift A" "Animations Menu" "Choose Animations via rofi" \ -" CTRL R" "Rofi Themes Menu" "Choose Rofi Themes via rofi" \ -" CTRL Shift R" "Rofi Themes Menu v2" "Choose Rofi Themes via Theme Selector (modified)" \ -" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \ -" ALT E" "Rofi Emoticons" "Emoticon" \ -" H" "Launch this Quick Cheat Sheet" "" \ -"" "" "" \ -"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\ \ No newline at end of file + --center \ + --title="KooL Quick Cheat Sheet" \ + --no-buttons \ + --list \ + --column=Key: \ + --column=Description: \ + --column=Comment: \ + --timeout-indicator=bottom \ + "ESC" "close this app" "" " = " "SUPER KEY (Windows Key Button)" "(SUPER KEY)" \ + " SHIFT K" "Searchable Keybinds" "(Search all Keybinds via rofi)" \ + " SHIFT E" "KooL Hyprland Settings Menu" "WindowRules,themes,defaults, etc" \ + " enter" "Terminal" "(Default:kitty)" \ + " SHIFT enter" "DropDown Terminal" " Q to close" \ + " B" "Launch Browser" "(Default browser)" \ + " A" "Desktop Overview" "Shows open apps in workspaces" \ + " D" "Application Launcher" "(rofi-wayland)" \ + " E" "Open File Manager" "(Thunar)" \ + " S" "Google Search using rofi" "(rofi)" \ + " T" "Global theme switcher" "(rofi)" \ + " Q" "close active window" "(not kill)" \ + " Shift Q " "kills an active window" "(kill)" \ + " ALT mouse scroll up/down " "Desktop Zoom" "Desktop Magnifier" \ + " Alt V" "Clipboard Manager" "(cliphist)" \ + " W" "Choose wallpaper" "(Wallpaper Menu)" \ + " Shift W" "Choose wallpaper effects" "(imagemagick + awww)" \ + "CTRL ALT W" "Random wallpaper" "(via awww)" \ + " CTRL ALT B" "Hide/UnHide Waybar" "waybar" \ + " CTRL B" "Choose waybar styles" "(waybar styles)" \ + " ALT B" "Choose waybar layout" "(waybar layout)" \ + " ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \ + " SHIFT N" "Launch Notification Panel" "swaync Notification Center" \ + " Print" "screenshot" "(grim)" \ + " Shift Print" "screenshot region" "(grim + slurp)" \ + " Shift S" "screenshot region" "(swappy)" \ + " CTRL Print" "screenshot timer 5 secs " "(grim)" \ + " CTRL SHIFT Print" "screenshot timer 10 secs " "(grim)" \ + "ALT Print" "Screenshot active window" "active window only" \ + "CTRL ALT P" "power-menu" "(wlogout)" \ + "CTRL ALT L" "screen lock" "(hyprlock)" \ + "CTRL ALT Del" "Hyprland Exit" "(NOTE: Hyprland Will exit immediately)" \ + " SHIFT F" "Fullscreen" "Toggles to full screen" \ + " CTL F" "Fake Fullscreen" "Toggles to fake full screen" \ + " ALT L" "Toggle Dwindle|Floating|Monocle|Master layouts" "Hyprland Layouts" \ + " SPACEBAR" "Toggle float" "single window" \ + " ALT SPACEBAR" "Toggle all windows to float" "all windows" \ + " ALT O" "Toggle Blur" "normal or less blur" \ + " CTRL O" "Toggle Opaque ON or OFF" "on active window only" \ + " Shift A" "Animations Menu" "Choose Animations via rofi" \ + " CTRL R" "Rofi Themes Menu" "Choose Rofi Themes via rofi" \ + " CTRL Shift R" "Rofi Themes Menu v2" "Choose Rofi Themes via Theme Selector (modified)" \ + " SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \ + " ALT E" "Rofi Emoticons" "Emoticon" \ + " H" "Launch this Quick Cheat Sheet" "" \ + "" "" "" \ + "More tips:" "https://github.com/LinuxBeginnings/Hyprland-Dots/wiki" "" diff --git a/.config/hypr/scripts/KeybindsLayoutInit.sh b/.config/hypr/scripts/KeybindsLayoutInit.sh index 0a53eaaf..f47197af 100755 --- a/.config/hypr/scripts/KeybindsLayoutInit.sh +++ b/.config/hypr/scripts/KeybindsLayoutInit.sh @@ -1,14 +1,19 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Initialize J/K keybinds so they always cycle windows globally (no layout-specific behavior) # This avoids double-actions when layouts change. set -euo pipefail # Always reset and bind SUPER+J/K the same way on startup -hyprctl keyword unbind SUPER,J || true -hyprctl keyword unbind SUPER,K || true +hyprctl keyword unbind SUPER,j || true +hyprctl keyword unbind SUPER,k || true -# Cycle windows globally: J = next, K = previous -hyprctl keyword bind SUPER,J,cyclenext -hyprctl keyword bind SUPER,K,cyclenext,prev +# Cycle windows globally +hyprctl keyword bind SUPER,j,layoutmsg,cyclenext +hyprctl keyword bind SUPER,k,layoutmsg,cycleprev diff --git a/.config/hypr/scripts/KeyboardLayout.sh b/.config/hypr/scripts/KeyboardLayout.sh index 32767593..fe092e7f 100755 --- a/.config/hypr/scripts/KeyboardLayout.sh +++ b/.config/hypr/scripts/KeyboardLayout.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This is for changing kb_layouts. Set kb_layouts in "$HOME/.config/hypr/UserConfigs/UserSettings.conf" notif_icon="$HOME/.config/swaync/images/ja.png" @@ -9,111 +14,111 @@ SCRIPTSDIR="$HOME/.config/hypr/scripts" ignore_patterns=( "--(avrcp)" "Bluetooth Speaker" - "Other Device + "Other Device Name" - ) - +) # Function to get keyboard names get_keyboard_names() { - hyprctl devices -j | jq -r '.keyboards[].name' + hyprctl devices -j | jq -r '.keyboards[].name' } # Function to check if a device matches any ignore pattern is_ignored() { - local device_name=$1 - for pattern in "${ignore_patterns[@]}"; do - if [[ "$device_name" == *"$pattern"* ]]; then - return 0 # Device matches ignore pattern - fi - done - return 1 # Device does not match any ignore pattern + local device_name=$1 + for pattern in "${ignore_patterns[@]}"; do + if [[ "$device_name" == *"$pattern"* ]]; then + return 0 # Device matches ignore pattern + fi + done + return 1 # Device does not match any ignore pattern } # Function to get current layout info +# Stores values in layout_mapping, variant_mapping and layout_index get_current_layout_info() { - local found_kb=false + local found_kb=false - # Read from the first non-ignored layout - while read -r name; do - if ! is_ignored "$name"; then - found_kb=true - local layout_mapping_str=$(hyprctl devices -j | - jq -r ".keyboards[] | select(.name==\"$name\").layout") - IFS="," read -r -a layout_mapping <<<"$layout_mapping_str" + # Read from the first non-ignored layout + while read -r name; do + if ! is_ignored "$name"; then + found_kb=true + local layout_mapping_str=$(hyprctl devices -j | + jq -r --arg name "$name" '.keyboards[] | select(.name==$name).layout') + IFS="," read -r -a layout_mapping <<<"$layout_mapping_str" - local variant_mapping_str=$(hyprctl devices -j | - jq -r ".keyboards[] | select(.name==\"$name\").variant") - IFS="," read -r -a variant_mapping <<<"$variant_mapping_str" + local variant_mapping_str=$(hyprctl devices -j | + jq -r --arg name "$name" '.keyboards[] | select(.name==$name).variant') + IFS="," read -r -a variant_mapping <<<"$variant_mapping_str" - layout_index=$(hyprctl devices -j | - jq -r ".keyboards[] | select(.name==\"$name\").active_layout_index") - break - fi - done <<< "$(get_keyboard_names)" + layout_index=$(hyprctl devices -j | + jq -r --arg name "$name" '.keyboards[] | select(.name==$name).active_layout_index') + break + fi + done <<< "$(get_keyboard_names)" - $found_kb && return 0 - return 1 + $found_kb && return 0 + return 1 } # Function to change keyboard layout change_layout() { - local error_found=false + local error_found=false - while read -r name; do - if is_ignored "$name"; then - echo "Skipping ignored device: $name" - continue - fi + while read -r name; do + if is_ignored "$name"; then + echo "Skipping ignored device: $name" + continue + fi - echo "Switching layout for $name to $new_layout..." - hyprctl switchxkblayout "$name" "$next_index" - if [ $? -ne 0 ]; then - echo "Error while switching layout for $name." >&2 - error_found=true - fi - done <<< "$(get_keyboard_names)" + echo "Switching layout for $name to $new_layout..." + hyprctl switchxkblayout "$name" "$next_index" + if [ $? -ne 0 ]; then + echo "Error while switching layout for $name." >&2 + error_found=true + fi + done <<<"$(get_keyboard_names)" - $error_found && return 1 - return 0 + $error_found && return 1 + return 0 } # Stores values in layout_mapping, variant_mapping and layout_index if ! get_current_layout_info; then - echo "Could not get current layout information." >&2 - echo "There might not be any keyboards available, \ - or some were unnecessarily set as ignored." >&2 - notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed" - echo "Exiting $0 $@" >&2 - exit 1 + echo "Could not get current layout information." >&2 + echo "There might not be any keyboards available, \ + or some were unnecessarily set as ignored." >&2 + notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed" + echo "Exiting $0 $@" >&2 + exit 1 fi -current_layout=${layout_mapping[layout_index]} -current_variant=${variant_mapping[layout_index]} +current_layout=${layout_mapping[$layout_index]} +current_variant=${variant_mapping[$layout_index]} if [[ "$1" == "status" ]]; then - echo "$current_layout${current_variant:+($current_variant)}" + echo "$current_layout${current_variant:+($current_variant)}" elif [[ "$1" == "switch" ]]; then - echo "Current layout: $current_layout($current_variant)" + echo "Current layout: $current_layout($current_variant)" - layout_count=${#layout_mapping[@]} - echo "Number of layouts: $layout_count" + layout_count=${#layout_mapping[@]} + echo "Number of layouts: $layout_count" - next_index=$(( (layout_index + 1) % layout_count )) - new_layout="${layout_mapping[next_index]}" - new_variant="${variant_mapping[next_index]}" - echo "Next layout: $new_layout" + next_index=$(( (layout_index + 1) % layout_count )) + new_layout="${layout_mapping[$next_index]}" + new_variant="${variant_mapping[$next_index]}" + echo "Next layout: $new_layout" - # Execute layout change and notify - if ! change_layout; then - notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed" - echo "Layout change failed." >&2 - exit 1 - else - notify-send -u low -i "$notif_icon" " kb_layout: $new_layout${new_variant:+($new_variant)}" - echo "Layout change notification sent." - fi + # Execute layout change and notify + if ! change_layout; then + notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed" + echo "Layout change failed." >&2 + exit 1 + else + notify-send -u low -i "$notif_icon" " kb_layout: $new_layout${new_variant:+($new_variant)}" + echo "Layout change notification sent." + fi else - echo "Usage: $0 {status|switch}" + echo "Usage: $0 {status|switch}" fi diff --git a/.config/hypr/scripts/KillActiveProcess.sh b/.config/hypr/scripts/KillActiveProcess.sh index 2bc108f2..66d6b009 100755 --- a/.config/hypr/scripts/KillActiveProcess.sh +++ b/.config/hypr/scripts/KillActiveProcess.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Copied from Discord post. Thanks to @Zorg @@ -7,5 +12,10 @@ # Get id of an active window active_pid=$(hyprctl activewindow | grep -o 'pid: [0-9]*' | cut -d' ' -f2) +if [[ -z "$active_pid" || ! "$active_pid" =~ ^[0-9]+$ ]]; then + notify-send -u low -i "$HOME/.config/swaync/images/error.png" "Kill Active Window" "No active window PID found." + exit 1 +fi + # Close active window -kill $active_pid \ No newline at end of file +kill "$active_pid" diff --git a/.config/hypr/scripts/Kitty_themes.sh b/.config/hypr/scripts/Kitty_themes.sh index 55da7e44..3183b20b 100755 --- a/.config/hypr/scripts/Kitty_themes.sh +++ b/.config/hypr/scripts/Kitty_themes.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Kitty Themes Source https://github.com/dexpota/kitty-themes # # Define directories and variables @@ -16,14 +21,22 @@ notify_user() { # Function to apply the selected kitty theme apply_kitty_theme_to_config() { local theme_name_to_apply="$1" + local apply_mode="${2:-preview}" if [ -z "$theme_name_to_apply" ]; then echo "Error: No theme name provided to apply_kitty_theme_to_config." >&2 return 1 fi + local theme_file_path_to_apply + if [ "$theme_name_to_apply" = "Set by wallpaper" ]; then + theme_file_path_to_apply="$kitty_themes_DiR/01-Wallust.conf" + elif [ "$theme_name_to_apply" = "Default no color" ]; then + theme_file_path_to_apply="$kitty_themes_DiR/00-Default.conf" + else + theme_file_path_to_apply="$kitty_themes_DiR/$theme_name_to_apply.conf" + fi - local theme_file_path_to_apply="$kitty_themes_DiR/$theme_name_to_apply.conf" if [ ! -f "$theme_file_path_to_apply" ]; then - notify_user "$iDIR/error.png" "Error" "Theme file not found: $theme_name_to_apply.conf" + notify_user "$iDIR/error.png" "Error" "Theme file not found: $(basename "$theme_file_path_to_apply")" return 1 fi @@ -31,23 +44,31 @@ apply_kitty_theme_to_config() { temp_kitty_config_file=$(mktemp) cp "$kitty_config" "$temp_kitty_config_file" + local include_target + include_target="include ./kitty-themes/$(basename "$theme_file_path_to_apply")" + if grep -q -E '^[#[:space:]]*include\s+\./kitty-themes/.*\.conf' "$temp_kitty_config_file"; then - sed -i -E "s|^([#[:space:]]*include\s+\./kitty-themes/).*\.conf|include ./kitty-themes/$theme_name_to_apply.conf|g" "$temp_kitty_config_file" + sed -i -E "s|^([#[:space:]]*include\s+\./kitty-themes/).*\.conf|$include_target|g" "$temp_kitty_config_file" else if [ -s "$temp_kitty_config_file" ] && [ "$(tail -c1 "$temp_kitty_config_file")" != "" ]; then echo >>"$temp_kitty_config_file" fi - echo "include ./kitty-themes/$theme_name_to_apply.conf" >>"$temp_kitty_config_file" + echo "$include_target" >>"$temp_kitty_config_file" fi cp "$temp_kitty_config_file" "$kitty_config" rm "$temp_kitty_config_file" - - for pid_kitty in $(pidof kitty); do - if [ -n "$pid_kitty" ]; then - kill -SIGUSR1 "$pid_kitty" + if pidof kitty >/dev/null 2>&1; then + if [ "$apply_mode" = "apply" ] && command -v kitty >/dev/null 2>&1; then + kitty @ load-config >/dev/null 2>&1 + kitty @ set-colors --all --configured "$theme_file_path_to_apply" >/dev/null 2>&1 fi - done + for pid_kitty in $(pidof kitty); do + if [ -n "$pid_kitty" ]; then + kill -SIGUSR1 "$pid_kitty" + fi + done + fi return 0 } @@ -65,7 +86,8 @@ fi original_kitty_config_content_backup=$(cat "$kitty_config") -mapfile -t available_theme_names < <(find "$kitty_themes_DiR" -maxdepth 1 -name "*.conf" -type f -printf "%f\n" | sed 's/\.conf$//' | sort) +mapfile -t available_theme_names < <(find "$kitty_themes_DiR" -maxdepth 1 -name "*.conf" -type f -printf "%f\n" | sed 's/\.conf$//' | grep -v -E '^(00-Default|01-Wallust)$' | sort) +available_theme_names=("Set by wallpaper" "Default no color" "${available_theme_names[@]}") if [ ${#available_theme_names[@]} -eq 0 ]; then notify_user "$iDIR/error.png" "No Kitty Themes" "No .conf files found in $kitty_themes_DiR." @@ -73,7 +95,12 @@ if [ ${#available_theme_names[@]} -eq 0 ]; then fi current_selection_index=0 -current_active_theme_name=$(awk -F'include ./kitty-themes/|\\.conf' '/^[[:space:]]*include \.\/kitty-themes\/.*\.conf/{print $2; exit}' "$kitty_config") +current_active_theme_name=$(awk -F'include ./kitty-themes/|\\.conf' '/^[[:space:]]*include \\.\/kitty-themes\/.*\\.conf/{print $2; exit}' "$kitty_config") +if [ "$current_active_theme_name" = "01-Wallust" ]; then + current_active_theme_name="Set by wallpaper" +elif [ "$current_active_theme_name" = "00-Default" ]; then + current_active_theme_name="Default no color" +fi if [ -n "$current_active_theme_name" ]; then for i in "${!available_theme_names[@]}"; do @@ -85,14 +112,6 @@ if [ -n "$current_active_theme_name" ]; then fi while true; do - theme_to_preview_now="${available_theme_names[$current_selection_index]}" - - if ! apply_kitty_theme_to_config "$theme_to_preview_now"; then - echo "$original_kitty_config_content_backup" >"$kitty_config" - for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done - notify_user "$iDIR/error.png" "Preview Error" "Failed to apply $theme_to_preview_now. Reverted." - exit 1 - fi rofi_input_list="" for theme_name_in_list in "${available_theme_names[@]}"; do @@ -104,16 +123,24 @@ while true; do rofi -dmenu -i \ -format 'i' \ -p "Kitty Theme" \ - -mesg "Preview: ${theme_to_preview_now} | Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -mesg "Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ -config "$rofi_theme_for_this_script" \ -selected-row "$current_selection_index" \ - -kb-custom-1 "Control+s") # MODIFIED HERE: Changed to Control+s for custom action 1 + -kb-custom-1 "Control+s") rofi_exit_code=$? if [ $rofi_exit_code -eq 0 ]; then if [[ "$chosen_index_from_rofi" =~ ^[0-9]+$ ]] && [ "$chosen_index_from_rofi" -lt "${#available_theme_names[@]}" ]; then current_selection_index="$chosen_index_from_rofi" + theme_to_preview_now="${available_theme_names[$current_selection_index]}" + if ! apply_kitty_theme_to_config "$theme_to_preview_now" "preview"; then + echo "$original_kitty_config_content_backup" >"$kitty_config" + for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done + notify_user "$iDIR/error.png" "Preview Error" "Failed to apply $theme_to_preview_now. Reverted." + exit 1 + fi + continue else : fi @@ -123,6 +150,7 @@ while true; do for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done break elif [ $rofi_exit_code -eq 10 ]; then # This is the exit code for -kb-custom-1 + apply_kitty_theme_to_config "$theme_to_preview_now" "apply" notify_user "$iDIR/ja.png" "Kitty Theme Applied" "$theme_to_preview_now" break else diff --git a/.config/hypr/scripts/KooLsDotsUpdate.sh b/.config/hypr/scripts/KooLsDotsUpdate.sh index 51277ab1..887993a5 100755 --- a/.config/hypr/scripts/KooLsDotsUpdate.sh +++ b/.config/hypr/scripts/KooLsDotsUpdate.sh @@ -1,28 +1,39 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # simple bash script to check if update is available by comparing local version and github version # Local Paths local_dir="$HOME/.config/hypr" iDIR="$HOME/.config/swaync/images/" -local_version=$(ls $local_dir/v* 2>/dev/null | sort -V | tail -n 1 | sed 's/.*v\(.*\)/\1/') +local_version=$(find "$local_dir" -maxdepth 1 -name 'v*' -printf '%f\n' 2>/dev/null | sort -V | tail -n 1 | sed 's/^v//') KooL_Dots_DIR="$HOME/Hyprland-Dots" # exit if cannot find local version if [ -z "$local_version" ]; then - notify-send -i "$iDIR/error.png" "ERROR "!?!?!!"" "Unable to find KooL's dots version . exiting.... " + notify-send -i "$iDIR/error.png" 'ERROR !?!?!!' "Unable to find KooL's dots version. Exiting." exit 1 fi # GitHub URL - KooL's dots branch="main" -github_url="https://github.com/JaKooLit/Hyprland-Dots/tree/$branch/config/hypr/" +github_url="https://github.com/LinuxBeginnings/Hyprland-Dots/tree/$branch/config/hypr/" +# Check for required tools (curl) +if ! command -v curl &> /dev/null; then + notify-send -i "$iDIR/error.png" "Need curl:" "curl not found. Please install curl." + exit 1 +fi # Fetch the version from GitHub URL - KooL's dots -github_version=$(curl -s $github_url | grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V | tail -n 1 | sed 's/v//') +github_version=$(curl -fsSL -A "Mozilla/5.0" "$github_url" | grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V | tail -n 1 | sed 's/v//') # Cant find GitHub URL - KooL's dots version if [ -z "$github_version" ]; then + notify-send -i "$iDIR/error.png" 'KooL Hyprland:' "Unable to determine GitHub version." exit 1 fi @@ -39,13 +50,13 @@ else case "$response" in "action1") - if [ -d $KooL_Dots_DIR ]; then + if [ -d "$KooL_Dots_DIR" ]; then if ! command -v kitty &> /dev/null; then notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Kitty terminal not found. Please install Kitty terminal." exit 1 fi kitty -e bash -c " - cd $KooL_Dots_DIR && + cd \"$KooL_Dots_DIR\" && git stash && git pull && ./copy.sh && @@ -58,8 +69,8 @@ else exit 1 fi kitty -e bash -c " - git clone --depth=1 https://github.com/JaKooLit/Hyprland-Dots.git $KooL_Dots_DIR && - cd $KooL_Dots_DIR && + git clone --depth=1 https://github.com/LinuxBeginnings/Hyprland-Dots.git $KooL_Dots_DIR && + cd \"$KooL_Dots_DIR\" && chmod +x copy.sh && ./copy.sh && notify-send -u critical -i "$iDIR/ja.png" 'Update Completed:' 'Kindly log out and relogin to take effect' diff --git a/.config/hypr/scripts/Kool_Quick_Settings.sh b/.config/hypr/scripts/Kool_Quick_Settings.sh index 8ab71ba2..fcd04998 100755 --- a/.config/hypr/scripts/Kool_Quick_Settings.sh +++ b/.config/hypr/scripts/Kool_Quick_Settings.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E) # Updated for UserConfigs/configs separation @@ -22,7 +27,154 @@ UserScripts="$HOME/.config/hypr/UserScripts" # Function to show info notification show_info() { - notify-send -i "$iDIR/info.png" "Info" "$1" + if [[ -f "$iDIR/info.png" ]]; then + notify-send -i "$iDIR/info.png" "Info" "$1" + else + notify-send "Info" "$1" + fi +} +# Function to toggle Rainbow Borders script availability and refresh UI components +toggle_rainbow_borders() { + local rainbow_script="$UserScripts/RainbowBorders.sh" + local disabled_sh_bak="${rainbow_script}.bak" # RainbowBorders.sh.bak + local disabled_bak_sh="$UserScripts/RainbowBorders.bak.sh" # RainbowBorders.bak.sh (created by copy.sh when disabled) + local refresh_script="$scriptsDir/Refresh.sh" + local status="" + + # If both disabled variants exist, keep the newer one to avoid ambiguity + if [[ -f "$disabled_sh_bak" && -f "$disabled_bak_sh" ]]; then + if [[ "$disabled_sh_bak" -nt "$disabled_bak_sh" ]]; then + rm -f "$disabled_bak_sh" + else + rm -f "$disabled_sh_bak" + fi + fi + + if [[ -f "$rainbow_script" ]]; then + # Currently enabled -> disable to canonical .sh.bak + if mv "$rainbow_script" "$disabled_sh_bak"; then + status="disabled" + if command -v hyprctl &>/dev/null; then + hyprctl reload >/dev/null 2>&1 || true + fi + fi + elif [[ -f "$disabled_sh_bak" ]]; then + # Disabled (.sh.bak) -> enable + if mv "$disabled_sh_bak" "$rainbow_script"; then + status="enabled" + fi + elif [[ -f "$disabled_bak_sh" ]]; then + # Disabled (.bak.sh) -> enable (normalize to .sh) + if mv "$disabled_bak_sh" "$rainbow_script"; then + status="enabled" + fi + else + show_info "RainbowBorders script not found in $UserScripts (checked .sh, .sh.bak, .bak.sh)." + return + fi + + # Run refresh if available, otherwise apply borders directly + if [[ -x "$refresh_script" ]]; then + "$refresh_script" >/dev/null 2>&1 & + elif [[ "$current" != "disabled" && -x "$rainbow_script" ]]; then + "$rainbow_script" >/dev/null 2>&1 & + fi + + if [[ -n "$status" ]]; then + show_info "Rainbow Borders ${status}." + fi +} + +# Submenu to choose Rainbow Borders mode (disable, wallust_random, rainbow, gradient_flow) +rainbow_borders_menu() { + local rainbow_script="$UserScripts/RainbowBorders.sh" + local disabled_sh_bak="${rainbow_script}.bak" + local disabled_bak_sh="$UserScripts/RainbowBorders.bak.sh" + local refresh_script="$scriptsDir/Refresh.sh" + + # Determine current mode/status (internal) + local current="disabled" + if [[ -f "$rainbow_script" ]]; then + current=$(grep -E '^EFFECT_TYPE=' "$rainbow_script" 2>/dev/null | sed -E 's/^EFFECT_TYPE="?([^"]*)"?/\1/') + [[ -z "$current" ]] && current="unknown" + fi + + # Map internal mode to friendly display + local current_display="$current" + case "$current" in + wallust_random) current_display="Wallust Color" ;; + rainbow) current_display="Original Rainbow" ;; + gradient_flow) current_display="Gradient Flow" ;; + disabled) current_display="Disabled" ;; + esac + + + # Build options and prompt + local options="Disable Rainbow Borders\nWallust Color\nOriginal Rainbow\nGradient Flow" + local choice + choice=$(printf "%b" "$options" | rofi -i -dmenu -config "$rofi_theme" -mesg "Rainbow Borders: current = $current_display") + + [[ -z "$choice" ]] && return + + local previous="$current" + + case "$choice" in + "Disable Rainbow Borders") + if [[ -f "$rainbow_script" ]]; then + mv "$rainbow_script" "$disabled_sh_bak" + fi + current="disabled" + if command -v hyprctl &>/dev/null; then + hyprctl reload >/dev/null 2>&1 || true + fi + ;; + "Wallust Color"|"Original Rainbow"|"Gradient Flow") + local mode="" + case "$choice" in + "Wallust Color") mode="wallust_random" ;; + "Original Rainbow") mode="rainbow" ;; + "Gradient Flow") mode="gradient_flow" ;; + esac + # Ensure script is enabled + if [[ ! -f "$rainbow_script" ]]; then + if [[ -f "$disabled_sh_bak" ]]; then + mv "$disabled_sh_bak" "$rainbow_script" + elif [[ -f "$disabled_bak_sh" ]]; then + mv "$disabled_bak_sh" "$rainbow_script" + else + show_info "RainbowBorders script not found in $UserScripts." + return + fi + fi + + # Update EFFECT_TYPE in place; insert if missing + if grep -q '^EFFECT_TYPE=' "$rainbow_script" 2>/dev/null; then + sed -i 's/^EFFECT_TYPE=.*/EFFECT_TYPE="'"$mode"'"/' "$rainbow_script" + else + if head -n1 "$rainbow_script" | grep -q '^#!'; then + sed -i '1a EFFECT_TYPE="'"$mode"'"' "$rainbow_script" + else + sed -i '1i EFFECT_TYPE="'"$mode"'"' "$rainbow_script" + fi + fi + # Set current to chosen mode + current="$mode" + ;; + *) + return ;; + esac + + # Run refresh if available + if [[ -x "$refresh_script" ]]; then + "$refresh_script" >/dev/null 2>&1 & + fi + + # Apply mode immediately (in case refresh doesn't trigger it) + if [[ "$current" != "disabled" && -x "$rainbow_script" ]]; then + "$rainbow_script" >/dev/null 2>&1 & + fi + + # No notifications; mode is shown in the menu } # Function to display the menu options without numbers @@ -44,7 +196,9 @@ Edit System Default Startup Apps Edit System Default Window Rules Edit System Default Settings --- UTILITIES --- +Set SDDM Wallpaper Choose Kitty Terminal Theme +Choose Ghostty Terminal Theme Configure Monitors (nwg-displays) Configure Workspace Rules (nwg-displays) GTK Settings (nwg-look) @@ -54,8 +208,10 @@ Choose Hyprland Animations Choose Monitor Profiles Choose Rofi Themes Search for Keybinds +Toggle Waybar Weather units (C/F) Toggle Game Mode Switch Dark-Light Theme +Rainbow Borders Mode EOF } @@ -78,7 +234,9 @@ main() { "Edit System Default Startup Apps") file="$configs/Startup_Apps.conf" ;; "Edit System Default Window Rules") file="$configs/WindowRules.conf" ;; "Edit System Default Settings") file="$configs/SystemSettings.conf" ;; + "Set SDDM Wallpaper") $scriptsDir/sddm_wallpaper.sh --normal ;; "Choose Kitty Terminal Theme") $scriptsDir/Kitty_themes.sh ;; + "Choose Ghostty Terminal Theme") $scriptsDir/Ghostty_themes.sh ;; "Configure Monitors (nwg-displays)") if ! command -v nwg-displays &>/dev/null; then notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-displays first" @@ -113,8 +271,10 @@ main() { "Choose Monitor Profiles") $scriptsDir/MonitorProfiles.sh ;; "Choose Rofi Themes") $scriptsDir/RofiThemeSelector.sh ;; "Search for Keybinds") $scriptsDir/KeyBinds.sh ;; + "Toggle Waybar Weather units (C/F)") $scriptsDir/Toggle-weather-waybar-units.sh ;; "Toggle Game Mode") $scriptsDir/GameMode.sh ;; "Switch Dark-Light Theme") $scriptsDir/DarkLight.sh ;; + "Rainbow Borders Mode") rainbow_borders_menu ;; *) return ;; # Do nothing for invalid choices esac diff --git a/.config/hypr/scripts/LockScreen.sh b/.config/hypr/scripts/LockScreen.sh index d58f5c21..b795a8f7 100755 --- a/.config/hypr/scripts/LockScreen.sh +++ b/.config/hypr/scripts/LockScreen.sh @@ -1,11 +1,16 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For Hyprlock #pidof hyprlock || hyprlock -q # Ensure weather cache is up-to-date before locking (Waybar/lockscreen readers) -bash "$HOME/.config/hypr/UserScripts/WeatherWrap.sh" >/dev/null 2>&1 +bash "$HOME/.config/hypr/UserScripts/WeatherWrap.sh" >/dev/null 2>&1 & loginctl lock-session diff --git a/.config/hypr/scripts/MediaCtrl.sh b/.config/hypr/scripts/MediaCtrl.sh index 9dc3571d..aeabcac9 100755 --- a/.config/hypr/scripts/MediaCtrl.sh +++ b/.config/hypr/scripts/MediaCtrl.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Playerctl music_icon="$HOME/.config/swaync/icons/music.png" diff --git a/.config/hypr/scripts/MonitorProfiles.sh b/.config/hypr/scripts/MonitorProfiles.sh index 1176a46a..78825986 100755 --- a/.config/hypr/scripts/MonitorProfiles.sh +++ b/.config/hypr/scripts/MonitorProfiles.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For applying Pre-configured Monitor Profiles # Check if rofi is already running diff --git a/.config/hypr/scripts/OverviewToggle.sh b/.config/hypr/scripts/OverviewToggle.sh index 8d4b285f..14470eb0 100755 --- a/.config/hypr/scripts/OverviewToggle.sh +++ b/.config/hypr/scripts/OverviewToggle.sh @@ -1,11 +1,16 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Overview toggle wrapper - tries Quickshell first, falls back to AGS set -euo pipefail # 1) Try Quickshell via IPC (works if QS is running and listening) -if pgrep -x quickshell >/dev/null 2>&1; then +if pgrep -x qs >/dev/null 2>&1; then if qs ipc -c overview call overview toggle >/dev/null 2>&1; then exit 0 fi diff --git a/.config/hypr/scripts/Polkit-Diag.sh b/.config/hypr/scripts/Polkit-Diag.sh new file mode 100755 index 00000000..0f32b640 --- /dev/null +++ b/.config/hypr/scripts/Polkit-Diag.sh @@ -0,0 +1,521 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# 💫 https://github.com/LinuxBeginnings 💫 # +# Polkit Diagnostic & Triage Script # + +# Default values +OUTFILE="$HOME/Downloads/Polkit-diag.txt" +DRY_RUN=0 +INSTALL_OVERRIDE=0 +FORCE_OVERRIDE=0 + +# Systemd override details for hyprpolkitagent +OVERRIDE_DIR="$HOME/.config/systemd/user/hyprpolkitagent.service.d" +OVERRIDE_FILE="$OVERRIDE_DIR/override.conf" + +OVERRIDE_CONTENT="[Unit] +After= +After=dbus.service graphical-session.target +PartOf=graphical-session.target + +[Install] +WantedBy=graphical-session.target" + +print_help() { + cat << EOF +Usage: $(basename "$0") [OPTIONS] +Gather diagnostic information for polkit issues and optionally apply a systemd override. +This script is modular and extensible for different Linux distributions. + +Options: + -h, --help Show this help message and exit + -d, --dry-run Run without making changes (output to stdout instead of file) + --install-override Install the systemd override for hyprpolkitagent if not already present + --force-override Overwrite the existing systemd override for hyprpolkitagent + -o, --output FILE Specify custom output file (default: $HOME/Downloads/Polkit-diag.txt) +EOF +} + +setup_output() { + if [[ $DRY_RUN -eq 1 ]]; then + echo "=================================================" + echo " [Dry Run] Diagnostics will be printed to stdout." + echo "=================================================" + exec 3>&1 + else + local outdir + outdir=$(dirname "$OUTFILE") + + # Check and create directory if it doesn't exist + if [[ ! -d "$outdir" ]]; then + echo "Directory $outdir does not exist. Creating..." + mkdir -p "$outdir" + fi + + # Backup existing file + if [[ -f "$OUTFILE" ]]; then + local backup_file="${OUTFILE}.bak.$(date +%Y%m%d%H%M%S)" + echo "Existing output file found. Backing up to: $backup_file" + mv "$OUTFILE" "$backup_file" + fi + + echo "Diagnostics will be saved to: $OUTFILE" + exec 3> "$OUTFILE" + fi +} + +apply_override() { + if [[ $INSTALL_OVERRIDE -eq 1 ]]; then + local msg="\n=== Systemd Override for hyprpolkitagent ===" + [[ $DRY_RUN -eq 0 ]] && echo -e "$msg" >&3 + echo -e "$msg" + + local out + if systemctl --user is-enabled hyprpolkitagent.service >/dev/null 2>&1; then + msg="[STATUS] hyprpolkitagent.service is currently enabled." + else + msg="[STATUS] hyprpolkitagent.service is NOT enabled. You may need to enable it." + fi + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3 + echo "$msg" + + if [[ -f "$OVERRIDE_FILE" && $FORCE_OVERRIDE -eq 0 ]]; then + msg="[INFO] Override already exists at $OVERRIDE_FILE." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + msg="[ACTION] Use --force-override to overwrite it." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + else + if [[ -f "$OVERRIDE_FILE" && $FORCE_OVERRIDE -eq 1 ]]; then + msg="[CONFIRM] Force override requested. Overwriting existing override..." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + fi + + msg="[ACTION] Installing override to $OVERRIDE_FILE..." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + + if [[ $DRY_RUN -eq 0 ]]; then + # Capture dir creation + if out=$(mkdir -p "$OVERRIDE_DIR" 2>&1); then + msg=" [OK] Created/verified directory $OVERRIDE_DIR." + else + msg=" [ERROR] Failed to create directory $OVERRIDE_DIR.\n Details: $out" + fi + echo -e "$msg" >&3; echo -e "$msg" + + # Capture file write + if out=$(echo "$OVERRIDE_CONTENT" > "$OVERRIDE_FILE" 2>&1); then + msg=" [OK] Successfully wrote override file." + else + msg=" [ERROR] Failed to write override file.\n Details: $out" + fi + echo -e "$msg" >&3; echo -e "$msg" + + # Capture daemon-reload + if out=$(systemctl --user daemon-reload 2>&1); then + msg=" [OK] Systemd daemon reloaded." + else + msg=" [ERROR] Failed to reload systemd daemon.\n Details: $out" + fi + echo -e "$msg" >&3; echo -e "$msg" + + # Capture restart + if systemctl --user is-active --quiet hyprpolkitagent.service; then + msg="[ACTION] Restarting hyprpolkitagent.service..." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + + if out=$(systemctl --user restart hyprpolkitagent.service 2>&1); then + msg=" [OK] Service restarted successfully." + else + msg=" [ERROR] Failed to restart service.\n Details: $out" + fi + echo -e "$msg" >&3; echo -e "$msg" + else + msg="[INFO] Service is not currently active, skipping restart step." + [[ $DRY_RUN -eq 0 ]] && echo "$msg" >&3; echo "$msg" + fi + else + msg="[Dry Run] Would create $OVERRIDE_FILE and reload systemd daemon." + echo "$msg" + fi + fi + fi +} + +gather_general_info() { + echo -e "\n=======================================" >&3 + echo -e " General System Information" >&3 + echo -e "=======================================" >&3 + echo "Date: $(date)" >&3 + echo -e "\n--- Kernel ---" >&3 + uname -a >&3 + + echo -e "\n--- OS Release ---" >&3 + cat /etc/os-release >&3 + + echo -e "\n=======================================" >&3 + echo -e " Polkit Service Status" >&3 + echo -e "=======================================" >&3 + + echo -e "\n--- System Polkit Service ---" >&3 + systemctl status polkit.service --no-pager >&3 2>&1 || true + + echo -e "\n--- User Hyprpolkitagent Service ---" >&3 + systemctl --user status hyprpolkitagent.service --no-pager >&3 2>&1 || true + + echo -e "\n--- Running Polkit Processes ---" >&3 + local polkit_procs + polkit_procs=$(ps aux | grep -i '[p]olkit') + if [[ -n "$polkit_procs" ]]; then + echo "$polkit_procs" >&3 + + # Check for conflicting agents + local kde_agent_running=0 + local gnome_agent_running=0 + local hypr_agent_running=0 + + if echo "$polkit_procs" | grep -q "polkit-kde-authentication-agent-1"; then + kde_agent_running=1 + fi + if echo "$polkit_procs" | grep -q "polkit-gnome-authentication-agent-1"; then + gnome_agent_running=1 + fi + if echo "$polkit_procs" | grep -q "hyprpolkitagent"; then + hypr_agent_running=1 + fi + + if [[ $hypr_agent_running -eq 1 && ($kde_agent_running -eq 1 || $gnome_agent_running -eq 1) ]]; then + echo -e "\n[!] CONFLICT DETECTED: Multiple polkit agents are running!" >&3 + echo " Hyprpolkitagent is running alongside another desktop environment's agent." >&3 + echo " Only ONE polkit agent can be registered at a time." >&3 + if [[ $kde_agent_running -eq 1 ]]; then + echo " -> Found KDE polkit agent. You may need to disable it in Hyprland by adding 'NotShowIn=Hyprland;' to its autostart .desktop file." >&3 + fi + if [[ $gnome_agent_running -eq 1 ]]; then + echo " -> Found GNOME polkit agent. You may need to disable it in Hyprland." >&3 + fi + elif [[ $kde_agent_running -eq 1 && $hypr_agent_running -eq 0 ]]; then + echo -e "\n[!] WARNING: KDE polkit agent is running instead of hyprpolkitagent." >&3 + echo " This can cause 'authentication agent already exists' errors if hyprpolkitagent tries to start later." >&3 + fi + else + echo "No polkit processes found running." >&3 + fi + + echo -e "\n=======================================" >&3 + echo -e " Recent Logs" >&3 + echo -e "=======================================" >&3 + + echo -e "\n--- Journalctl (polkit.service) [Last 50 entries, warnings/errors] ---" >&3 + journalctl -u polkit.service -n 50 --no-pager -p 4 >&3 2>&1 || echo "Could not fetch system polkit logs." >&3 + + echo -e "\n--- Journalctl (hyprpolkitagent.service) [Last 50 entries] ---" >&3 + journalctl --user -u hyprpolkitagent.service -n 50 --no-pager >&3 2>&1 || echo "Could not fetch user hyprpolkitagent logs." >&3 +} + +# --- Modular Package Checking System --- +check_packages() { + local check_cmd="$1" + local install_msg="$2" + shift 2 + local pkgs=("$@") + + local missing_pkgs=() + for pkg in "${pkgs[@]}"; do + local out + if out=$(eval "$check_cmd \"$pkg\"" 2>/dev/null); then + # Print the first line of output as the installed info + echo "[INSTALLED] $(echo "$out" | head -n 1)" >&3 + else + echo "[MISSING] $pkg" >&3 + missing_pkgs+=("$pkg") + fi + done + + if [[ ${#missing_pkgs[@]} -gt 0 ]]; then + echo -e "\nWARNING: The following packages are missing:" >&3 + for mpkg in "${missing_pkgs[@]}"; do + echo " - $mpkg" >&3 + done + echo "$install_msg ${missing_pkgs[*]}" >&3 + return 1 + fi + return 0 +} +check_source_binaries() { + local bin_dir="$1" + shift + local bins=("$@") + local found_any=0 + + echo -e "\n--- Source Builds (${bin_dir}) ---" >&3 + for bin in "${bins[@]}"; do + if [[ -x "${bin_dir}/${bin}" ]]; then + echo "[SOURCE] ${bin_dir}/${bin}" >&3 + found_any=1 + else + echo "[MISSING] ${bin_dir}/${bin}" >&3 + fi + done + + return $found_any +} + +gather_arch_info() { + echo -e "\n=======================================" >&3 + echo -e " Package Info (Arch Linux)" >&3 + echo -e "=======================================" >&3 + + # Essential packages required for polkit & related UI + local pkgs=( + "qt5-declarative" + "qt5-quickcontrols2" + "qt6-declarative" + "hyprpolkitagent" + "polkit" + ) + + local aur_pkgs=( + "xfce-polkit" + ) + + local missing_any=0 + + echo -e "\n--- Official Repositories ---" >&3 + check_packages "pacman -Q" "Install official packages by running: sudo pacman -S" "${pkgs[@]}" || missing_any=1 + + echo -e "\n--- AUR ---" >&3 + check_packages "pacman -Q" "Install AUR packages by running: yay -S" "${aur_pkgs[@]}" || missing_any=1 + + if [[ $missing_any -eq 0 ]]; then + echo -e "\nSUCCESS: All expected packages are installed." >&3 + fi +} +gather_ubuntu_info() { + echo -e "\n=======================================" >&3 + echo -e " Package Info (Ubuntu/PPA)" >&3 + echo -e "=======================================" >&3 + + # Essential packages required for polkit & related UI + local pkgs=( + "qml-module-qtqml" + "qml-module-qtquick2" + "qml-module-qtquick-controls" + "qml-module-qtquick-controls2" + "qml-module-qtquick-layouts" + "qml6-module-qtqml" + "qml6-module-qtquick" + "qml6-module-qtquick-controls" + "hyprpolkitagent" + "polkit" + ) + + local extra_pkgs=( + "xfce-polkit" + "polkit-kde-agent-1" + "mate-polkit" + ) + + local missing_any=0 + + echo -e "\n--- Official Repositories / PPA ---" >&3 + check_packages "dpkg -s" "Install packages by running: sudo apt install" "${pkgs[@]}" || missing_any=1 + + echo -e "\n--- Extra/Alternative ---" >&3 + check_packages "dpkg -s" "Install extra packages by running: sudo apt install" "${extra_pkgs[@]}" || missing_any=1 + echo "[INFO] lxqt-polkit (optional) — large dependency set." >&3 + + if [[ $missing_any -eq 0 ]]; then + echo -e "\nSUCCESS: All expected packages are installed." >&3 + fi +} +gather_debian_info() { + echo -e "\n=======================================" >&3 + echo -e " Package Info (Debian/Ubuntu)" >&3 + echo -e "=======================================" >&3 + + local source_bins=( + "hyprpolkitagent" + ) + + local source_found=0 + if check_source_binaries "/usr/local/bin" "${source_bins[@]}"; then + source_found=1 + fi + + # Essential packages required for polkit & related UI + local pkgs=( + "qml-module-qtqml" + "qml-module-qtquick2" + "qml-module-qtquick-controls" + "qml-module-qtquick-controls2" + "qml-module-qtquick-layouts" + "qml6-module-qtqml" + "qml6-module-qtquick" + "qml6-module-qtquick-controls" + "polkit" + ) + + local extra_pkgs=( + "xfce4-polkit" + "lxqt-policykit" + "polkit-kde-agent-1" + "mate-polkit" + ) + + local missing_any=0 + + echo -e "\n--- Official Repositories ---" >&3 + if [[ $source_found -eq 0 ]]; then + pkgs+=("hyprpolkitagent") + else + echo "[INFO] hyprpolkitagent found in /usr/local/bin (source build). Skipping dpkg check for it." >&3 + fi + check_packages "dpkg -s" "Install packages by running: sudo apt install" "${pkgs[@]}" || missing_any=1 + + echo -e "\n--- Extra/Alternative ---" >&3 + check_packages "dpkg -s" "Install extra packages by running: sudo apt install" "${extra_pkgs[@]}" || missing_any=1 + + if [[ $missing_any -eq 0 ]]; then + echo -e "\nSUCCESS: All expected packages are installed." >&3 + fi +} + +gather_fedora_info() { + echo -e "\n=======================================" >&3 + echo -e " Package Info (Fedora)" >&3 + echo -e "=======================================" >&3 + + # Essential packages required for polkit & related UI + local pkgs=( + "qt5-qtdeclarative" + "qt5-qtquickcontrols2" + "qt6-qtdeclarative" + "hyprpolkitagent" + "polkit" + ) + + local extra_pkgs=( + "xfce-polkit" + ) + + local missing_any=0 + + echo -e "\n--- Official Repositories ---" >&3 + check_packages "rpm -q" "Install packages by running: sudo dnf install" "${pkgs[@]}" || missing_any=1 + + echo -e "\n--- Extra/Alternative ---" >&3 + check_packages "rpm -q" "Install extra packages by running: sudo dnf install" "${extra_pkgs[@]}" || missing_any=1 + + if [[ $missing_any -eq 0 ]]; then + echo -e "\nSUCCESS: All expected packages are installed." >&3 + fi +} + +detect_os() { + if [ -f /etc/os-release ]; then + . /etc/os-release + OS=$ID + else + OS="unknown" + fi +} + +# ---------------------------------------------------------------------------- +# Main Execution +# ---------------------------------------------------------------------------- + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case "$1" in + -h|--help) + print_help + exit 0 + ;; + -d|--dry-run) + DRY_RUN=1 + ;; + --install-override) + INSTALL_OVERRIDE=1 + ;; + --force-override) + FORCE_OVERRIDE=1 + INSTALL_OVERRIDE=1 + ;; + -o|--output) + if [[ -n "$2" && "$2" != -* ]]; then + OUTFILE="$2" + shift + else + echo "Error: Argument for $1 is missing" >&2 + exit 1 + fi + ;; + *) + echo "Unknown option: $1" >&2 + print_help + exit 1 + ;; + esac + shift +done + +setup_output + +echo "Starting Polkit Diagnostic Script..." >&3 + +# Optional apply override logic +if [[ $INSTALL_OVERRIDE -eq 1 ]]; then + apply_override +fi + +# Gather general info +gather_general_info + +# Gather OS-specific package info +detect_os +case "$OS" in + arch|artix|manjaro|endeavouros|cachyos) + gather_arch_info + ;; + debian) + gather_debian_info + ;; + ubuntu|pop|linuxmint) + gather_ubuntu_info + ;; + fedora) + gather_fedora_info + ;; + opensuse*) + echo -e "\n=======================================" >&3 + echo -e " Package Info ($OS)" >&3 + echo -e "=======================================" >&3 + echo "OpenSUSE package check is pending implementation." >&3 + ;; + nixos) + echo -e "\n=======================================" >&3 + echo -e " Package Info ($OS)" >&3 + echo -e "=======================================" >&3 + echo "NixOS configuration check is pending implementation." >&3 + ;; + *) + echo -e "\n=======================================" >&3 + echo -e " Package Info" >&3 + echo -e "=======================================" >&3 + echo "Unknown or unsupported OS: $OS. Skipping package checks." >&3 + ;; +esac + +echo -e "\nDiagnostics completed at $(date)" >&3 + +if [[ $DRY_RUN -eq 0 ]]; then + echo "=================================================" + echo " Diagnostic gathering complete!" + echo " Please review the output file: $OUTFILE" + echo "=================================================" +fi diff --git a/.config/hypr/scripts/Polkit-NixOS.sh b/.config/hypr/scripts/Polkit-NixOS.sh index 28642d19..c1e6e0a2 100755 --- a/.config/hypr/scripts/Polkit-NixOS.sh +++ b/.config/hypr/scripts/Polkit-NixOS.sh @@ -1,6 +1,26 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# For NixOS starting of polkit agents. Prefer xfce4-polkit, fallback to polkit-gnome. + +# Find all xfce4-polkit executables in the Nix store +xfce_polkit_paths=$(find /nix/store -name 'xfce4-polkit' -type f 2>/dev/null) + +for xfce_polkit_path in $xfce_polkit_paths; do + # Extract the directory containing the executable + xfce_polkit_dir=$(dirname "$xfce_polkit_path") + + # Check if the executable is valid and exists + if [ -x "$xfce_polkit_dir/xfce4-polkit" ]; then + # Start the xfce4-polkit Authentication Agent + "$xfce_polkit_dir/xfce4-polkit" & + exit 0 + fi +done # Find all polkit-gnome executables in the Nix store polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null) @@ -18,4 +38,4 @@ for polkit_gnome_path in $polkit_gnome_paths; do done # If no valid executable is found, report an error -echo "No valid Polkit-GNOME Authentication Agent executable found." \ No newline at end of file +echo "No valid polkit authentication agent executable found." diff --git a/.config/hypr/scripts/Polkit.sh b/.config/hypr/scripts/Polkit.sh index 1af8fd1b..f09c9e1f 100755 --- a/.config/hypr/scripts/Polkit.sh +++ b/.config/hypr/scripts/Polkit.sh @@ -1,19 +1,55 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This script starts the first available Polkit agent from a list of possible locations +# Avoid duplicate agents (common with UWSM/session autostart) +if pgrep -u "$UID" -f 'xfce-polkit|polkit-gnome-authentication-agent-1|polkit-kde-authentication-agent-1|polkit-mate-authentication-agent-1|mate-polkit|hyprpolkitagent' >/dev/null 2>&1; then + echo "Polkit agent already running. Skipping start." + exit 0 +fi -# List of potential Polkit agent file paths +# Ensure Qt apps default to Wayland in a Wayland session +if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -z "${QT_QPA_PLATFORM:-}" ]; then + export QT_QPA_PLATFORM=wayland +fi + +# Avoid KDE polkit agent crashing if Kvantum QML module is missing +if [ -z "${QT_QUICK_CONTROLS_STYLE:-}" ]; then + export QT_QUICK_CONTROLS_STYLE=Basic +fi + +# Check if kvantum is specified globally but the QML module is missing +if [[ "${QT_STYLE_OVERRIDE:-}" == "kvantum" ]] || [[ "${QT_STYLE_OVERRIDE:-}" == "kvantum-dark" ]]; then + # Check common Qt5/Qt6 QML directories for the Kvantum module + if ! find /usr/lib /usr/lib64 /usr/share -type d -path "*/qml/*/kvantum" -print -quit 2>/dev/null | grep -q .; then + echo "Kvantum QML module not found. Overriding QT_STYLE_OVERRIDE for Polkit to prevent crash." + export QT_STYLE_OVERRIDE=Fusion + fi +elif [ -z "${QT_STYLE_OVERRIDE:-}" ]; then + export QT_STYLE_OVERRIDE=Fusion +fi + +# List of potential Polkit agent file paths (preferred order) polkit=( - "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" "/usr/libexec/hyprpolkitagent" "/usr/lib/hyprpolkitagent" "/usr/lib/hyprpolkitagent/hyprpolkitagent" - "/usr/lib/polkit-kde-authentication-agent-1" + "/usr/bin/xfce-polkit" + "/usr/lib/xfce4/polkit-agent/xfce-polkit" + "/usr/libexec/xfce-polkit" + "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" "/usr/lib/polkit-gnome-authentication-agent-1" "/usr/libexec/polkit-gnome-authentication-agent-1" "/usr/libexec/polkit-mate-authentication-agent-1" - "/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1" + "/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" + "/usr/bin/polkit-mate-authentication-agent-1" "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" + "/usr/lib/polkit-kde-authentication-agent-1" + "/usr/libexec/polkit-kde-authentication-agent-1" ) executed=false diff --git a/.config/hypr/scripts/PortalHyprland.sh b/.config/hypr/scripts/PortalHyprland.sh index 21cb7db4..243ee2e8 100755 --- a/.config/hypr/scripts/PortalHyprland.sh +++ b/.config/hypr/scripts/PortalHyprland.sh @@ -1,16 +1,45 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For manually starting xdg-desktop-portal-hyprland -sleep 1 -killall xdg-desktop-portal-hyprland -killall xdg-desktop-portal-wlr -killall xdg-desktop-portal-gnome -killall xdg-desktop-portal -sleep 1 -/usr/lib/xdg-desktop-portal-hyprland & -/usr/libexec/xdg-desktop-portal-hyprland & -sleep 2 -/usr/lib/xdg-desktop-portal & -/usr/libexec/xdg-desktop-portal & +set -euo pipefail + +kill_quietly() { + killall -q "$1" 2>/dev/null || true +} + +start_portal_binary() { + local description="$1" + shift + for candidate in "$@"; do + if [[ -x "$candidate" ]]; then + "$candidate" & + return 0 + fi + done + echo "Warning: no $description binary found (checked: $*)" >&2 + return 1 +} + +sleep 1 +kill_quietly xdg-desktop-portal-hyprland +kill_quietly xdg-desktop-portal-wlr +kill_quietly xdg-desktop-portal-gnome +kill_quietly xdg-desktop-portal +sleep 1 + +start_portal_binary "xdg-desktop-portal-hyprland" \ + /usr/lib/xdg-desktop-portal-hyprland \ + /usr/libexec/xdg-desktop-portal-hyprland + +sleep 2 + +start_portal_binary "xdg-desktop-portal" \ + /usr/lib/xdg-desktop-portal \ + /usr/libexec/xdg-desktop-portal diff --git a/.config/hypr/scripts/PortalHyprlandUbuntu.sh b/.config/hypr/scripts/PortalHyprlandUbuntu.sh new file mode 100755 index 00000000..86e1a6d3 --- /dev/null +++ b/.config/hypr/scripts/PortalHyprlandUbuntu.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Ubuntu-based workaround: start portals manually before waybar. + +set -euo pipefail + +if [[ -r /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + if [[ "${ID:-}" == "ubuntu" \ + || "${ID:-}" == "linuxmint" \ + || "${ID:-}" == "zorin" \ + || "${ID:-}" == "rhino" \ + || "${ID_LIKE:-}" == *ubuntu* ]]; then + if [[ -x "$HOME/.config/hypr/scripts/PortalHyprland.sh" ]]; then + "$HOME/.config/hypr/scripts/PortalHyprland.sh" + fi + fi +fi diff --git a/.config/hypr/scripts/Refresh.sh b/.config/hypr/scripts/Refresh.sh index 76757aa4..03f55fa0 100755 --- a/.config/hypr/scripts/Refresh.sh +++ b/.config/hypr/scripts/Refresh.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Scripts for refreshing ags, waybar, rofi, swaync, wallust SCRIPTSDIR=$HOME/.config/hypr/scripts @@ -14,18 +19,17 @@ file_exists() { fi } -# Kill already running processes -_ps=(waybar rofi swaync ags) +# Kill already running processes (exclude waybar to avoid double reloads) +_ps=(rofi swaync ags) for _prs in "${_ps[@]}"; do if pidof "${_prs}" >/dev/null; then pkill "${_prs}" fi done -# added since wallust sometimes not applying -killall -SIGUSR2 waybar -# Added sleep for GameMode causing multiple waybar -sleep 0.1 +# Clean up any Waybar-spawned cava instances (unique temp conf names) +pkill -f 'waybar-cava\..*\.conf' 2>/dev/null || true + # quit ags & relaunch ags #ags -q && ags & @@ -33,15 +37,22 @@ sleep 0.1 # quit quickshell & relaunch quickshell #pkill qs && qs & -# some process to kill -for pid in $(pidof waybar rofi swaync ags swaybg); do +# some process to kill (exclude waybar to avoid restart loops) +for pid in $(pidof rofi swaync ags swaybg); do kill -SIGUSR1 "$pid" sleep 0.1 done -#Restart waybar -sleep 0.1 -waybar & +# Reload or start waybar once +if pidof waybar >/dev/null; then + if command -v waybar-msg >/dev/null 2>&1; then + waybar-msg cmd reload >/dev/null 2>&1 || true + else + killall -SIGUSR2 waybar 2>/dev/null || true + fi +else + waybar & +fi # relaunch swaync sleep 0.3 diff --git a/.config/hypr/scripts/RefreshNoWaybar.sh b/.config/hypr/scripts/RefreshNoWaybar.sh index 54c760bd..f5d564ac 100755 --- a/.config/hypr/scripts/RefreshNoWaybar.sh +++ b/.config/hypr/scripts/RefreshNoWaybar.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Modified version of Refresh.sh but waybar wont refresh # Used by automatic wallpaper change @@ -31,9 +36,6 @@ done # quit quickshell & relaunch quickshell #pkill qs && qs & -# Wallust refresh (synchronous to ensure colors are ready) -${SCRIPTSDIR}/WallustSwww.sh -sleep 0.2 # reload swaync swaync-client --reload-config diff --git a/.config/hypr/scripts/RofiEmoji.sh b/.config/hypr/scripts/RofiEmoji.sh index 7e3ef0f3..539a03b6 100755 --- a/.config/hypr/scripts/RofiEmoji.sh +++ b/.config/hypr/scripts/RofiEmoji.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Variables rofi_theme="$HOME/.config/rofi/config-emoji.rasi" diff --git a/.config/hypr/scripts/RofiSearch.sh b/.config/hypr/scripts/RofiSearch.sh index 8ef12c46..42b54d75 100755 --- a/.config/hypr/scripts/RofiSearch.sh +++ b/.config/hypr/scripts/RofiSearch.sh @@ -1,9 +1,18 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For Searching via web browsers # Define the path to the config file config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf +if ! command -v jq >/dev/null 2>&1; then + notify-send -u low "Rofi Search" "jq is required for URL encoding. Please install jq." + exit 1 +fi # Check if the config file exists if [[ ! -f "$config_file" ]]; then @@ -32,5 +41,12 @@ if pgrep -x "rofi" >/dev/null; then pkill rofi fi -# Open Rofi and pass the selected query to xdg-open for Google search -echo "" | rofi -dmenu -config "$rofi_theme" -mesg "$msg" | xargs -I{} xdg-open $Search_Engine \ No newline at end of file +# Open Rofi and pass the selected query to xdg-open for the configured search engine +query=$(printf '' | rofi -dmenu -config "$rofi_theme" -mesg "$msg") + +if [[ -z "$query" ]]; then + exit 0 +fi + +encoded_query=$(printf '%s' "$query" | jq -sRr @uri) +xdg-open "${Search_Engine}${encoded_query}" >/dev/null 2>&1 & diff --git a/.config/hypr/scripts/RofiThemeSelector-modified.sh b/.config/hypr/scripts/RofiThemeSelector-modified.sh index d6a353c0..535b7313 100755 --- a/.config/hypr/scripts/RofiThemeSelector-modified.sh +++ b/.config/hypr/scripts/RofiThemeSelector-modified.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # A modified version of Rofi-Theme-Selector, concentrating only on ~/.local and also, applying only 10 @themes in ~/.config/rofi/config.rasi # as opposed to continous adding of //@theme diff --git a/.config/hypr/scripts/RofiThemeSelector.sh b/.config/hypr/scripts/RofiThemeSelector.sh index b7236e8f..db723b6f 100755 --- a/.config/hypr/scripts/RofiThemeSelector.sh +++ b/.config/hypr/scripts/RofiThemeSelector.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Rofi Themes - Script to preview and apply themes by live-reloading the config. # --- Configuration --- diff --git a/.config/hypr/scripts/ScreenShot.sh b/.config/hypr/scripts/ScreenShot.sh index 0ef70964..baad89a1 100755 --- a/.config/hypr/scripts/ScreenShot.sh +++ b/.config/hypr/scripts/ScreenShot.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Screenshots scripts # variables time=$(date "+%d-%b_%H-%M-%S") -dir="$(xdg-user-dir PICTURES)/Screenshots" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +dir="$PICTURES_DIR/Screenshots" file="Screenshot_${time}_${RANDOM}.png" iDIR="$HOME/.config/swaync/icons" @@ -24,7 +30,7 @@ notify_cmd_NOT="notify-send -u low -i ${iDoR}/note.png " notify_view() { if [[ "$1" == "active" ]]; then if [[ -e "${active_window_path}" ]]; then - "${sDIR}/Sounds.sh" --screenshot + "${sDIR}/Sounds.sh" --screenshot >/dev/null 2>&1 & resp=$(timeout 5 ${notify_cmd_shot_win} " Screenshot of:" " ${active_window_class} Saved.") case "$resp" in action1) @@ -36,11 +42,11 @@ notify_view() { esac else ${notify_cmd_NOT} " Screenshot of:" " ${active_window_class} NOT Saved." - "${sDIR}/Sounds.sh" --error + "${sDIR}/Sounds.sh" --error >/dev/null 2>&1 & fi elif [[ "$1" == "swappy" ]]; then - "${sDIR}/Sounds.sh" --screenshot + "${sDIR}/Sounds.sh" --screenshot >/dev/null 2>&1 & resp=$(${notify_cmd_shot} " Screenshot:" " Captured by Swappy") case "$resp" in action1) @@ -54,7 +60,7 @@ notify_view() { else local check_file="${dir}/${file}" if [[ -e "$check_file" ]]; then - "${sDIR}/Sounds.sh" --screenshot + "${sDIR}/Sounds.sh" --screenshot >/dev/null 2>&1 & resp=$(timeout 5 ${notify_cmd_shot} " Screenshot" " Saved") case "$resp" in action1) @@ -66,7 +72,7 @@ notify_view() { esac else ${notify_cmd_NOT} " Screenshot" " NOT Saved" - "${sDIR}/Sounds.sh" --error + "${sDIR}/Sounds.sh" --error >/dev/null 2>&1 & fi fi } @@ -82,14 +88,12 @@ countdown() { # take shots shotnow() { cd ${dir} && grim - | tee "$file" | wl-copy - sleep 2 notify_view } shot5() { countdown '5' sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy - sleep 1 notify_view } @@ -124,7 +128,6 @@ shotactive() { active_window_path="${dir}/${active_window_file}" hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}" - sleep 1 notify_view "active" } @@ -155,10 +158,10 @@ elif [[ "$1" == "--area" ]]; then shotarea elif [[ "$1" == "--active" ]]; then shotactive -elif [[ "$1" == "--swappy" ]]; then +elif [[ "$1" == "--swappy" || "$1" == "--swapp" || "$1" == "--swap" ]]; then shotswappy else - echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy" + echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy (--swapp/--swap)" fi exit 0 diff --git a/.config/hypr/scripts/Sounds.sh b/.config/hypr/scripts/Sounds.sh index b372d714..3af4944f 100755 --- a/.config/hypr/scripts/Sounds.sh +++ b/.config/hypr/scripts/Sounds.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This script is used to play system sounds. # Script is used by Volume.Sh and ScreenShots.sh theme="freedesktop" # Set the theme for the system sounds. mute=false # Set to true to mute the system sounds. +directSoundDir="$HOME/.config/hypr/sounds" # Mute individual sounds here. muteScreenshots=false @@ -20,16 +26,19 @@ if [[ "$1" == "--screenshot" ]]; then if [[ "$muteScreenshots" = true ]]; then exit 0 fi + directSound="$directSoundDir/screenshot.ogg" soundoption="screen-capture.*" elif [[ "$1" == "--volume" ]]; then if [[ "$muteVolume" = true ]]; then exit 0 fi + directSound="$directSoundDir/volume.ogg" soundoption="audio-volume-change.*" elif [[ "$1" == "--error" ]]; then if [[ "$muteScreenshots" = true ]]; then exit 0 fi + directSound="$directSoundDir/error.ogg" soundoption="dialog-error.*" else echo -e "Available sounds: --screenshot, --volume, --error" @@ -57,6 +66,29 @@ fi iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2) iDIR="$sDIR/../$iTheme" +# Helper to play in the background (fast return). +play_sound() { + if command -v paplay >/dev/null 2>&1; then + paplay "$1" >/dev/null 2>&1 & + exit 0 + fi + if command -v pw-play >/dev/null 2>&1; then + pw-play "$1" >/dev/null 2>&1 & + exit 0 + fi + if command -v aplay >/dev/null 2>&1; then + aplay "$1" >/dev/null 2>&1 & + exit 0 + fi + echo "Error: No suitable audio player found. Install paplay (pulseaudio-utils) or PipeWire/ALSA tools." + exit 1 +} + +# If a direct sound file exists, play it immediately to avoid lookup delay. +if [[ -n "$directSound" && -f "$directSound" ]]; then + play_sound "$directSound" +fi + # Find the sound file and play it. sound_file=$(find -L $sDIR/stereo -name "$soundoption" -print -quit) if ! test -f "$sound_file"; then @@ -72,6 +104,5 @@ if ! test -f "$sound_file"; then fi fi fi - -# pipewire priority, fallback pulseaudio -pw-play "$sound_file" || pa-play "$sound_file" \ No newline at end of file +# Play the sound (background for quick return). +play_sound "$sound_file" diff --git a/.config/hypr/scripts/Tak0-Autodispatch.sh b/.config/hypr/scripts/Tak0-Autodispatch.sh index 114a3e8e..034a6402 100755 --- a/.config/hypr/scripts/Tak0-Autodispatch.sh +++ b/.config/hypr/scripts/Tak0-Autodispatch.sh @@ -1,90 +1,234 @@ #!/usr/bin/env bash -# USAGE / ІНСТРУКЦІЯ: -# 1) Run from terminal: -# ./dispatch.sh -# Example: -# ./dispatch.sh discord 2 +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# ───────────────────────────────────────────────────────────────────────────── +# Tak0-Autodispatch.sh +# ───────────────────────────────────────────────────────────────────────────── +# This script is an "authoritative spawn dispatcher" for Hyprland. # -# 2) Call from Hyprland config (in hyprland.conf file): -# exec-once = /path/to/dispatch.sh +# Its purpose is to FORCE all windows belonging to a single application launch +# (main window + helpers + Electron / Steam child processes) +# onto a specific workspace. # -# Logs are saved in dispatch.log file next to the script. -# If the window doesn't appear or is dispatched incorrectly — info will be there. +# It explicitly ignores: +# • spawn race conditions +# • delayed window creation +# • detached helper processes +# • Electron / Chromium / Steam madness # -# Notes: -# - Script waits about ~9 seconds (30 iterations of 0.3 sec) for window to appear. -# - Uses hyprctl and jq, so these tools must be installed. +# Typical use cases: +# • Launch Steam / Discord / browsers without window leakage +# • Prevent apps from spawning on the currently focused workspace +# • Control applications that completely ignore static windowrules # -# USAGE / ІНСТРУКЦІЯ: -# 1) Запуск з терміналу: -# ./dispatch.sh -# Наприклад: -# ./dispatch.sh discord 2 +# Invocation: +# ./Tak0-Autodispatch.sh [rule ...] -- # -# 2) Виклик з конфігурації Hyprland (у файлі hyprland.conf): -# exec-once = /path/to/dispatch.sh -# -# Логи зберігаються у файлі dispatch.log поруч зі скриптом. -# Якщо вікно не з'явилось або неправильно диспатчилось — інформація там. -# -# Примітки: -# - Скрипт чекає до ~9 секунд (30 ітерацій по 0.3 сек) поки вікно з'явиться. -# - Використовує hyprctl і jq, тому ці інструменти мають бути встановлені. +# Important notes: +# • All window rules are TEMPORARY +# • No permanent pollution of Hyprland configuration +# ───────────────────────────────────────────────────────────────────────────── +# REQUIREMENTS: +# - hyprctl → runtime control of Hyprland +# - jq → JSON client parsing +# - pgrep/ps → process tree inspection + +set -u LOGFILE="$(dirname "$0")/dispatch.log" -# Log file path located next to the script. -# Файл логів розташований поруч зі скриптом. -APP=$1 -# The application command or window class to launch or match. -# Команда для запуску аплікації або клас вікна для пошуку. +# ───────────────────────────────────────────────────────────────────────────── +# 0️⃣ ARGUMENT PARSING +# ───────────────────────────────────────────────────────────────────────────── +# $1 → target workspace +# Next args → optional capture rules (windowrulev2 syntax) +# "--" → argument separator +# After "--" → command to execute (verbatim) -TARGET_WORKSPACE=$2 -# The target workspace number where the window should be moved. -# Цільовий номер воркспейсу, куди потрібно перемістити вікно. +TARGET_WS="$1" +shift || true -# Check if required arguments are provided. -# Перевірка наявності необхідних параметрів. -if [[ -z "$APP" || -z "$TARGET_WORKSPACE" ]]; then - echo "Usage: $0 " >> "$LOGFILE" 2>&1 - exit 1 -fi - -echo "Starting dispatch of '$APP' to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE" -# Starting the dispatch process and logging the event. -# Початок процесу диспатчу, запис у лог. - -# Avoid early workspace focus issues by switching workspace first. -# Уникаємо проблем з раннім фокусом, спочатку переключаємо воркспейс. -hyprctl dispatch workspace "$TARGET_WORKSPACE" >> "$LOGFILE" 2>&1 -sleep 0.4 - -# Launch the application in the background and disown it. -# Запускаємо аплікацію у фоновому режимі та відв’язуємо від терміналу. -$APP & disown -pid=$! - -echo "Launched '$APP' with PID $pid" >> "$LOGFILE" -# Log the launched process ID. -# Лог процесу запуску з PID. - -# Wait for the application window to appear (matching window class). -# Чекаємо появи вікна аплікації (за класом вікна). -for i in {1..30}; do - win=$(hyprctl clients -j | jq -r --arg APP "$APP" ' - .[] | select(.class | test($APP;"i")) | .address' 2>>"$LOGFILE") - - if [[ -n "$win" ]]; then - echo "Found window $win for app '$APP', moving to workspace $TARGET_WORKSPACE" >> "$LOGFILE" - # Move the window to the target workspace. - # Переміщаємо вікно на цільовий воркспейс. - hyprctl dispatch movetoworkspace "$TARGET_WORKSPACE,address:$win" >> "$LOGFILE" 2>&1 - exit 0 - fi - sleep 0.3 +CAPTURE_RULES=() +while [[ "${1-}" != "--" && -n "${1-}" ]]; do + CAPTURE_RULES+=("$1") + shift || break done -echo "ERROR: Window for '$APP' was NOT found or dispatched properly to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE" -# Log error if window was not found or dispatched correctly. -# Запис помилки, якщо вікно не знайдено або неправильно диспатчено. -exit 1 +if [[ "${1-}" == "--" ]]; then + shift +fi + +CMD="$*" + +if [[ -z "$TARGET_WS" || -z "$CMD" ]]; then + echo "Usage: $0 [rule rule ...] -- " >>"$LOGFILE" + exit 1 +fi + +echo "=== Deploy '$CMD' → WS $TARGET_WS @ $(date) ===" >>"$LOGFILE" + +# ───────────────────────────────────────────────────────────────────────────── +# 1️⃣ HYPRLAND READINESS GATE +# ───────────────────────────────────────────────────────────────────────────── +# Hyprland may not be fully initialized during early autostart. +# hyprctl silently fails if called too early. + +for _ in {1..50}; do + hyprctl -j monitors >/dev/null 2>&1 && break + sleep 0.1 +done + +# ───────────────────────────────────────────────────────────────────────────── +# 2️⃣ CLEANUP GUARANTEE +# ───────────────────────────────────────────────────────────────────────────── +# Ensures that ALL temporary rules are removed +# even on crash, SIGTERM, or user interruption. + +cleanup() { + echo "Cleanup: removing temporary capture rules and initialWorkspace at $(date)" >>"$LOGFILE" + + hyprctl keyword windowrulev2 "unset, initialClass:.*" >>"$LOGFILE" 2>&1 || true + for RULE in "${CAPTURE_RULES[@]}"; do + echo "Cleanup: removing temporary capture rule: $RULE" >>"$LOGFILE" + hyprctl keyword windowrulev2 "unset, $RULE" >>"$LOGFILE" 2>&1 || true + done +} + +trap cleanup EXIT INT TERM ERR + +# ───────────────────────────────────────────────────────────────────────────── +# 3️⃣ ULTRA-EARLY GLOBAL CAPTURE (NUCLEAR OPTION) +# ───────────────────────────────────────────────────────────────────────────── +# Temporarily forces ALL windows (initialClass:.*) +# onto the target workspace. +# +# Protects against ultra-fast helpers: +# • gpu-process +# • renderer +# • steamwebhelper + +echo "Applying temporary initialWorkspace capture (initialClass:.*)" >>"$LOGFILE" +hyprctl keyword windowrulev2 \ + "initialWorkspace $TARGET_WS silent, initialClass:.*" \ + >>"$LOGFILE" 2>&1 || true + +# ───────────────────────────────────────────────────────────────────────────── +# 3️⃣.1 OPTIONAL CLASS-BASED PRE-CAPTURE +# ───────────────────────────────────────────────────────────────────────────── +# Additional precision rules. +# Useful for Electron / Steam multi-process hell. + +for RULE in "${CAPTURE_RULES[@]}"; do + echo "Applying temporary capture rule: $RULE" >>"$LOGFILE" + hyprctl keyword windowrulev2 \ + "initialWorkspace $TARGET_WS silent, $RULE" \ + >>"$LOGFILE" 2>&1 || true +done + +# ───────────────────────────────────────────────────────────────────────────── +# 4️⃣ APPLICATION LAUNCH +# ───────────────────────────────────────────────────────────────────────────── +# bash -c allows aliases, env vars, wrappers. +# ROOT_PID is the root of process lineage. + +bash -c "$CMD" & +ROOT_PID=$! +echo "Root PID: $ROOT_PID" >>"$LOGFILE" + +# Resolve canonical process name +APP_NAME="" +for _ in {1..20}; do + if [[ -r "/proc/$ROOT_PID/comm" ]]; then + APP_NAME="$(tr -d '\0' /dev/null || true)" + break + fi + sleep 0.05 +done + +if [[ -z "$APP_NAME" ]]; then + read -r -a __toks <<<"$CMD" + APP_NAME="$(basename "${__toks[0]}")" +fi + +echo "App gate name: $APP_NAME" >>"$LOGFILE" + +sleep 1.5 + +#!TO-DO: Release the nuclear option ASAP +echo "Releasing ultra-early wide capture" >>"$LOGFILE" +hyprctl keyword windowrulev2 "unset, initialClass:.*" >>"$LOGFILE" 2>&1 || true + +# ───────────────────────────────────────────────────────────────────────────── +# 5️⃣ SUPERVISION LOOP (AUTHORITATIVE PHASE) +# ───────────────────────────────────────────────────────────────────────────── +# This loop: +# • scans ALL Hyprland clients +# • matches PID lineage +# • matches detached helpers +# • matches class rules + +get_descendants() { + local root="$1" + local all=("$root") + local changed=1 + + while ((changed)); do + changed=0 + for p in "${all[@]}"; do + for c in $(pgrep -P "$p" 2>/dev/null || true); do + if [[ ! " ${all[*]} " =~ " $c " ]]; then + all+=("$c") + changed=1 + fi + done + done + done + + echo "${all[@]}" +} + +pid_matches_app() { + local pid="$1" + local comm + comm="$(ps -p "$pid" -o comm= 2>/dev/null)" || return 1 + [[ "$comm" == "$APP_NAME" || "$comm" == "$APP_NAME"* ]] +} + +END_TIME=$((SECONDS + 20)) +declare -A SEEN + +while ((SECONDS < END_TIME)); do + PIDS="$(get_descendants "$ROOT_PID")" + + while IFS=$'\t' read -r PID ADDR CLASS; do + MATCH=0 + + for TPID in $PIDS; do + [[ "$PID" == "$TPID" ]] && MATCH=1 && break + done + + pid_matches_app "$PID" && MATCH=1 + + for RULE in "${CAPTURE_RULES[@]}"; do + if [[ "$RULE" =~ class:\^\((.*)\)\$ ]]; then + [[ "$CLASS" =~ ${BASH_REMATCH[1]} ]] && MATCH=1 + fi + done + + if ((MATCH)) && [[ -z "${SEEN[$ADDR]-}" ]]; then + echo "Placing window $ADDR (pid $PID, class $CLASS) → WS $TARGET_WS" >>"$LOGFILE" + hyprctl dispatch movetoworkspacesilent \ + "$TARGET_WS,address:$ADDR" >>"$LOGFILE" 2>&1 || true + SEEN[$ADDR]=1 + fi + done < <(hyprctl clients -j | jq -r '.[] | [.pid, .address, .class] | @tsv') + + sleep 0.01 +done + +echo "=== Deploy finished: '$CMD' ===" >>"$LOGFILE" +exit 0 diff --git a/.config/hypr/scripts/Tak0-Per-Window-Switch.sh b/.config/hypr/scripts/Tak0-Per-Window-Switch.sh index 76b6ad2d..04baebe0 100755 --- a/.config/hypr/scripts/Tak0-Per-Window-Switch.sh +++ b/.config/hypr/scripts/Tak0-Per-Window-Switch.sh @@ -1,5 +1,11 @@ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== ################################################################## -# # +# # # # # TAK_0'S Per-Window-Switch # # # @@ -7,21 +13,14 @@ # # # Just a little script that I made to switch keyboard layouts # # per-window instead of global switching for the more # -# smooth and comfortable workflow. # +# smooth and comfortable workflow. # # # ################################################################## - - - - - - - - # This is for changing kb_layouts. Set kb_layouts in MAP_FILE="$HOME/.cache/kb_layout_per_window" -CFG_FILE="$HOME/.config/hypr/UserConfigs/UserSettings.conf" +USER_CFG="$HOME/.config/hypr/UserConfigs/UserSettings.conf" +SYS_CFG="$HOME/.config/hypr/configs/SystemSettings.conf" ICON="$HOME/.config/swaync/images/ja.png" SCRIPT_NAME="$(basename "$0")" @@ -29,13 +28,16 @@ SCRIPT_NAME="$(basename "$0")" touch "$MAP_FILE" # Read layouts from config -if ! grep -q 'kb_layout' "$CFG_FILE"; then - echo "Error: cannot find kb_layout in $CFG_FILE" >&2 +if grep -q 'kb_layout' "$USER_CFG" 2>/dev/null; then + CFG_FILE="$USER_CFG" +elif grep -q 'kb_layout' "$SYS_CFG" 2>/dev/null; then + CFG_FILE="$SYS_CFG" +else + echo "Error: cannot find kb_layout in UserSettings.conf nor SystemSettings.conf" >&2 exit 1 fi kb_layouts=($(grep 'kb_layout' "$CFG_FILE" | cut -d '=' -f2 | tr -d '[:space:]' | tr ',' ' ')) count=${#kb_layouts[@]} - # Get current active window ID get_win() { hyprctl activewindow -j | jq -r '.address // .id' @@ -104,7 +106,10 @@ cmd_restore() { # Listen to focus events and restore window-specific layouts subscribe() { local SOCKET2="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" - [[ -S "$SOCKET2" ]] || { echo "Error: Hyprland socket not found." >&2; exit 1; } + [[ -S "$SOCKET2" ]] || { + echo "Error: Hyprland socket not found." >&2 + exit 1 + } socat -u UNIX-CONNECT:"$SOCKET2" - | while read -r line; do [[ "$line" =~ ^activewindow ]] && cmd_restore diff --git a/.config/hypr/scripts/ThemeChanger.sh b/.config/hypr/scripts/ThemeChanger.sh new file mode 100755 index 00000000..b41738f6 --- /dev/null +++ b/.config/hypr/scripts/ThemeChanger.sh @@ -0,0 +1,151 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +set -euo pipefail + +# SPDX-FileCopyrightText: 2025-present Ahum Maitra theahummaitra@gmail.com +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Repository url : https://github.com/TheAhumMaitra/cautious-waddle + +require() { + command -v "$1" >/dev/null 2>&1 || { + printf '%s\n' "Missing dependency: $1" >&2 + exit 127 + } +} + +require wallust +require rofi + +# notify-send is optional +have_notify() { command -v notify-send >/dev/null 2>&1; } + +# Prompt for theme; guard -e on cancel +set +e +choice="$(wallust theme list \ + | sed -e '1d' -e 's/^- //' \ + | rofi -dmenu -i -p 'Select Global Theme')" +prompt_status=$? +set -e + +# Exit cleanly on cancel or empty selection +if (( prompt_status != 0 )) || [[ -z "${choice}" ]]; then + exit 0 +fi + +# Record time before applying so we can wait for fresh template outputs +start_ts=$(date +%s) + +# Apply the theme and report result +if wallust theme -- "${choice}"; then + have_notify && notify-send -a ThemeChanger \ + -h string:x-dunst-stack-tag:themechanger \ + "Global theme changed" "Selected: ${choice}" + + # Wait until template targets exist, are newer than start_ts, and are stable (size/mtime stops changing) + # Ensure Ghostty directory exists so Wallust can write target even if Ghostty isn't installed + mkdir -p "$HOME/.config/ghostty" || true + + targets=( + "$HOME/.config/waybar/wallust/colors-waybar.css" + "$HOME/.config/rofi/wallust/colors-rofi.rasi" + "$HOME/.config/kitty/kitty-themes/01-Wallust.conf" + "$HOME/.config/hypr/wallust/wallust-hyprland.conf" + "$HOME/.config/ghostty/wallust.conf" + ) + + # Normalize Ghostty palette syntax in case upstream templates or older targets used ':' + ghostty_conf="$HOME/.config/ghostty/wallust.conf" + if [ -f "$ghostty_conf" ]; then + sed -i -E 's/^(\s*palette\s*=\s*)([0-9]{1,2}):/\1\2=/' "$ghostty_conf" 2>/dev/null || true + fi + + # Phase 1: appearance + freshness + for _ in $(seq 1 100); do # up to ~10s + ok=1 + for f in "${targets[@]}"; do + [ -s "$f" ] || { ok=0; break; } + mtime=$(stat -c %Y "$f" 2>/dev/null || echo 0) + [ "$mtime" -ge "$start_ts" ] || { ok=0; break; } + done + [ $ok -eq 1 ] && break + sleep 0.1 + done + + # Phase 2: stability (avoid reading half-written files) + if [ $ok -eq 1 ]; then + for _ in 1 2 3; do + sizes_a=(); mtimes_a=() + for f in "${targets[@]}"; do + sizes_a+=("$(stat -c %s "$f" 2>/dev/null || echo 0)") + mtimes_a+=("$(stat -c %Y "$f" 2>/dev/null || echo 0)") + done + sleep 0.15 + sizes_b=(); mtimes_b=() + for f in "${targets[@]}"; do + sizes_b+=("$(stat -c %s "$f" 2>/dev/null || echo 0)") + mtimes_b+=("$(stat -c %Y "$f" 2>/dev/null || echo 0)") + done + if [ "${sizes_a[*]}" = "${sizes_b[*]}" ] && [ "${mtimes_a[*]}" = "${mtimes_b[*]}" ]; then + break + fi + done + else + # As a safety net, wait a bit to avoid racing rofi reload against template writes + sleep 0.5 + fi + + # Small cushion before refresh to mirror wallpaper flow + sleep 0.2 + # Normalize Rofi selection colors to use the palette's accent (color12) + rofi_colors="$HOME/.config/rofi/wallust/colors-rofi.rasi" + if [ -f "$rofi_colors" ]; then + accent_hex=$(sed -n 's/^\s*color12:\s*\(#[0-9A-Fa-f]\{6\}\).*/\1/p' "$rofi_colors" | head -n1) + [ -z "$accent_hex" ] && accent_hex=$(sed -n 's/^\s*color13:\s*\(#[0-9A-Fa-f]\{6\}\).*/\1/p' "$rofi_colors" | head -n1) + if [ -n "$accent_hex" ]; then + sed -i -E "s|^(\s*selected-normal-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-active-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-urgent-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-normal-foreground:\s*).*$|\1#000000;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-active-foreground:\s*).*$|\1#000000;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-urgent-foreground:\s*).*$|\1#000000;|" "$rofi_colors" + fi + fi + + # Reload Hyprland so new border colors from wallust-hyprland.conf take effect + if command -v hyprctl >/dev/null 2>&1; then + hyprctl reload >/dev/null 2>&1 || true + fi + + # Refresh bars/menus after files are ready + if [ -x "$HOME/.config/hypr/scripts/Refresh.sh" ]; then + "$HOME/.config/hypr/scripts/Refresh.sh" >/dev/null 2>&1 || true + else + if command -v waybar-msg >/dev/null 2>&1; then + waybar-msg cmd reload >/dev/null 2>&1 || true + else + pkill -SIGUSR2 waybar >/dev/null 2>&1 || true + fi + fi + + # Ask kitty to reload its config so the new 01-Wallust.conf is picked up + if pidof kitty >/dev/null; then + for pid in $(pidof kitty); do kill -SIGUSR1 "$pid" 2>/dev/null || true; done + fi + + # Ask ghostty to reload its config so the updated wallust.conf is applied + if pidof ghostty >/dev/null; then + for pid in $(pidof ghostty); do kill -SIGUSR2 "$pid" 2>/dev/null || true; done + fi +else + have_notify && notify-send -u critical -a ThemeChanger \ + -h string:x-dunst-stack-tag:themechanger \ + "Failed to apply theme" "${choice}" + exit 1 +fi diff --git a/.config/hypr/scripts/Toggle-Active-Window-Audio.sh b/.config/hypr/scripts/Toggle-Active-Window-Audio.sh new file mode 100755 index 00000000..f32ded0e --- /dev/null +++ b/.config/hypr/scripts/Toggle-Active-Window-Audio.sh @@ -0,0 +1,153 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +set -euo pipefail + +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +swayIconDir="${XDG_CONFIG_HOME}/swaync/icons" + +#// Credits to sl1ng for the orginal script. Rewritten by Vyle. +ctlcheck=("pactl" "jq" "notify-send" "awk" "pgrep" "hyprctl" "iconv") +missing=() + +for ctl in "${ctlcheck[@]}"; do + command -v "${ctl}" >/dev/null || missing+=("${ctl}") +done + +if (( ${#missing[@]} )) 2>/dev/null; then + if printf '%s\n' "${missing[@]}" | grep -qx "pactl"; then + notify-send -a "t1" -r 91190 -t 2000 -i "${swayIconDir}/volume-low.png" "ERROR: pactl not installed" "Install 'pactl' (pulseaudio-utils or pipewire-pulse)." + fi + echo "Missing required dependencies: \"${missing[*]}\"" + exit 1 +fi + +#// Parse .pid, .class, .title to __pid, __class, __title. +active_json="$(hyprctl -j activewindow 2>/dev/null || { echo -e "Did hyprctl fail to run? [EXIT-CODE:-1]"; exit 1; } )" +PID="$(jq -r '"\(.pid)\t\(.class)\t\(.title)"' <<< "${active_json}" || { echo -e "Did jq fail to run? [EXIT-CODE:-1]"; exit 1; } )" + +IFS=$'\t' read -r __pid __class __title <<< "${PID}" + +[[ -z "${__pid}" ]] && { echo -e "Could not resolve PID for focused window."; exit 1; } +sink_json="$(pactl -f json list sink-inputs 2>/dev/null | iconv -f utf-8 -t utf-8 -c || { echo -e "Did pactl or iconv fail to run? Required manual intervention."; exit 1; } )" +#// Collect all descendant PIDs for the active window (Chrome/Wayland audio often runs in child processes). +declare -A seen_pids=() +queue=("${__pid}") +all_pids=() +while ((${#queue[@]})); do + pid="${queue[0]}" + queue=("${queue[@]:1}") + [[ -n "${seen_pids[$pid]:-}" ]] && continue + seen_pids["$pid"]=1 + all_pids+=("$pid") + mapfile -t children < <(pgrep -P "$pid" || true) + for child in "${children[@]}"; do + [[ -n "${seen_pids[$child]:-}" ]] || queue+=("$child") + done +done +pidsJson="$(printf '%s\n' "${all_pids[@]}" | jq -s 'map(tonumber)')" + +#// Check if any descendant PID matches application.process.id or else verify other statements. +mapfile -t sink_ids < <(jq -r --argjson pids "${pidsJson}" --arg class "${__class}" --arg title "${__title}" ' +.[] | + def lc(x): (x // "" | ascii_downcase); + def normalize(x): x | gsub("[-_~.]+";" ") ; + select( + (.properties["application.process.id"] | tostring | tonumber? as $p | $p != null and ($pids | index($p))) + or + (lc(.properties["application.name"]) | contains(lc($class))) + or + (lc(.properties["application.id"]) | contains(lc($class))) + or + (lc(.properties["application.process.binary"]) | contains(lc($class))) + or + (normalize(lc(.properties["media.name"])) | contains(normalize(lc($title)))) + ) | .index' <<< "${sink_json}" +) + +if [[ "${#sink_ids[@]}" -eq 0 ]]; then + mapfile -t fallback_pids < <(pgrep -x "${__class}" || true) + if [[ "${#fallback_pids[@]}" -gt 0 ]]; then + declare -A seen_fallback=() + queue=("${fallback_pids[@]}") + all_fallback=() + while ((${#queue[@]})); do + pid="${queue[0]}" + queue=("${queue[@]:1}") + [[ -n "${seen_fallback[$pid]:-}" ]] && continue + seen_fallback["$pid"]=1 + all_fallback+=("$pid") + mapfile -t children < <(pgrep -P "$pid" || true) + for child in "${children[@]}"; do + [[ -n "${seen_fallback[$child]:-}" ]] || queue+=("$child") + done + done + fallbackJson="$(printf '%s\n' "${all_fallback[@]}" | jq -s 'map(tonumber)')" + mapfile -t sink_ids < <( jq -r --argjson pids "${fallbackJson}" '.[] | + select((.properties["application.process.id"] | tostring | tonumber? as $p | $p != null and ($pids | index($p)))) | .index' <<< "${sink_json}" ) + fi +fi + +#// Auto-Detect if the environment is on Hyprland or $HYPRLAND_INSTANCE_SIGNATURE. +if [[ ${#sink_ids[@]} -eq 0 ]]; then + if [[ -n "${HYPRLAND_INSTANCE_SIGNATURE}" ]]; then + # Even if the fallback_pid remains empty, we will dispatch exit code based on $HYPRLAND_INSTANCE_SIGNATURE. + notify-send -a "t1" -r 91190 -t 1200 -i "${swayIconDir}/volume-low.png" "No sink input for the active_window: ${__class}" + echo "No sink input for focused window: ${__class}" + exit 1 + else + echo "No sink input for focused active_window ${__class}" + exit 1 + fi +fi + +idsJson=$(printf '%s\n' "${sink_ids[@]}" | jq -s 'map(tonumber)') + +#// Get the available option from pactl. +want_mute=$(jq -r --argjson ids "$idsJson" ' + [ .[] | select(.index as $i | $ids | index($i)) | .mute ] as $m | + if all($m[]; . == true) then "no" + else "yes" + end' <<< "${sink_json}" +) + +if [[ "${want_mute}" == "no" ]]; then + state_msg="Unmuted" + swayIcon="${swayIconDir}/volume-high.png" +else + state_msg="Muted" + swayIcon="${swayIconDir}/volume-mute.png" +fi + +[[ -f "${swayIcon}" ]] || echo -e "Missing swaync icons." + +changed=0 +failed_ids=() +for id in "${sink_ids[@]}"; do + if pactl set-sink-input-mute "$id" "$want_mute"; then + changed=1 + else + failed_ids+=("$id") + fi +done + +if [[ "$changed" -eq 0 ]]; then + notify-send -a "t2" -r 91190 -t 1200 -i "${swayIconDir}/volume-low.png" "Failed to change sink input(s)" "${failed_ids[*]:-unknown}" + exit 1 +fi + +#// Append pamixer to get a nice result. Pamixer is complete optional here. +if command -v pamixer >/dev/null; then + sink_name="$(pamixer --get-default-sink 2>/dev/null | awk -F '"' 'END{print $(NF - 1)}' 2>/dev/null || true)" + if [[ -n "${sink_name}" ]]; then + notify-send -a "t2" -r 91190 -t 800 -i "${swayIcon}" "${state_msg} ${__class}" "${sink_name}" + else + notify-send -a "t2" -r 91190 -t 800 -i "${swayIcon}" "${state_msg} ${__class}" + fi +else + notify-send -a "t2" -r 91190 -t 800 -i "${swayIcon}" "${state_msg} ${__class}" +fi diff --git a/.config/hypr/scripts/Toggle-weather-waybar-units.sh b/.config/hypr/scripts/Toggle-weather-waybar-units.sh new file mode 100755 index 00000000..abc089ff --- /dev/null +++ b/.config/hypr/scripts/Toggle-weather-waybar-units.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Toggle waybar-weather units between metric and imperial + +CONFIG_FILE="$HOME/.config/waybar-weather/config.toml" + +if [ ! -f "$CONFIG_FILE" ]; then + notify-send "Weather units" "Config not found: $CONFIG_FILE" + exit 1 +fi + +# Determine current units (default to metric when unset/commented) +current_units="metric" +if grep -qE '^[[:space:]]*units[[:space:]]*=' "$CONFIG_FILE"; then + current_units=$(sed -nE 's/^[[:space:]]*units[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' "$CONFIG_FILE" | head -n1) +fi + +if [ "$current_units" = "imperial" ]; then + new_units="metric" +else + new_units="imperial" +fi + +# Update config: prefer replacing existing units line, otherwise uncomment default, else append +if grep -qE '^[[:space:]]*units[[:space:]]*=' "$CONFIG_FILE"; then + sed -i 's/^[[:space:]]*units[[:space:]]*=.*/units = "'"$new_units"'"/' "$CONFIG_FILE" +elif grep -qE '^[[:space:]]*#\s*units[[:space:]]*=' "$CONFIG_FILE"; then + sed -i 's/^[[:space:]]*#\s*units[[:space:]]*=.*/units = "'"$new_units"'"/' "$CONFIG_FILE" +else + printf '\nunits = "%s"\n' "$new_units" >> "$CONFIG_FILE" +fi + +pkill waybar-weather 2>/dev/null || true +notify-send "Weather units now ${new_units}" "Click on waybar-weather to update units" diff --git a/.config/hypr/scripts/TouchPad.sh b/.config/hypr/scripts/TouchPad.sh index 030c36de..1042a652 100755 --- a/.config/hypr/scripts/TouchPad.sh +++ b/.config/hypr/scripts/TouchPad.sh @@ -1,32 +1,59 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # For disabling touchpad. # Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system # use hyprctl devices to get your system touchpad device name # source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109 -notif="$HOME/.config/swaync/images/ja.png" +set -euo pipefail -export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" +notif="$HOME/.config/swaync/images/ja.png" +laptops_conf="$HOME/.config/hypr/UserConfigs/Laptops.conf" + +touchpad_device="${TOUCHPAD_DEVICE:-}" +if [[ -z "$touchpad_device" && -f "$laptops_conf" ]]; then + touchpad_device="$( + awk -F= '/^\$Touchpad_Device/ { + gsub(/[[:space:]]*/, "", $1); + gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); + print $2; + exit + }' "$laptops_conf" + )" +fi + +if [[ -z "$touchpad_device" ]]; then + notify-send -u low -i "$notif" " Touchpad" " Device name not set (check Laptops.conf)" + exit 1 +fi + +touchpad_keyword="${TOUCHPAD_KEYWORD:-device:${touchpad_device}:enabled}" +status_file="${XDG_RUNTIME_DIR:-/tmp}/touchpad.status" enable_touchpad() { - printf "true" >"$STATUS_FILE" - notify-send -u low -i $notif " Enabling" " touchpad" - hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r + printf "true" >"$status_file" + notify-send -u low -i "$notif" " Enabling" " touchpad" + hyprctl keyword "$touchpad_keyword" true -r } disable_touchpad() { - printf "false" >"$STATUS_FILE" - notify-send -u low -i $notif " Disabling" " touchpad" - hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r + printf "false" >"$status_file" + notify-send -u low -i "$notif" " Disabling" " touchpad" + hyprctl keyword "$touchpad_keyword" false -r } -if ! [ -f "$STATUS_FILE" ]; then - enable_touchpad -else - if [ $(cat "$STATUS_FILE") = "true" ]; then - disable_touchpad - elif [ $(cat "$STATUS_FILE") = "false" ]; then - enable_touchpad - fi +current_state="false" +if [[ -f "$status_file" ]]; then + current_state="$(<"$status_file")" +fi + +if [[ "$current_state" == "true" ]]; then + disable_touchpad +else + enable_touchpad fi diff --git a/.config/hypr/scripts/UptimeNixOS.sh b/.config/hypr/scripts/UptimeNixOS.sh index 654ae2c8..5c3085b1 100755 --- a/.config/hypr/scripts/UptimeNixOS.sh +++ b/.config/hypr/scripts/UptimeNixOS.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script parses /proc/uptime to get the system uptime # and prints it in a human-readable format # This is a workaround for system where `uptime` command is taken from coreutils diff --git a/.config/hypr/scripts/UserConfigsSwitcher.sh b/.config/hypr/scripts/UserConfigsSwitcher.sh index ad1d4e63..7d9968a6 100755 --- a/.config/hypr/scripts/UserConfigsSwitcher.sh +++ b/.config/hypr/scripts/UserConfigsSwitcher.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script to manage UserConfigs and UserConfigsBak HYPR_CONFIG_DIR="$HOME/.config/hypr" diff --git a/.config/hypr/scripts/Volume.sh b/.config/hypr/scripts/Volume.sh index 4c82f543..dec7837c 100755 --- a/.config/hypr/scripts/Volume.sh +++ b/.config/hypr/scripts/Volume.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Scripts for volume controls for audio and mic iDIR="$HOME/.config/swaync/icons" @@ -7,8 +12,14 @@ sDIR="$HOME/.config/hypr/scripts" # Get Volume get_volume() { + if [[ "$(pamixer --get-mute)" == "true" ]]; then + echo "Muted" + return + fi + + local volume volume=$(pamixer --get-volume) - if [[ "$volume" -eq "0" ]]; then + if [[ "$volume" -eq 0 ]]; then echo "Muted" else echo "$volume %" @@ -17,12 +28,15 @@ get_volume() { # Get icons get_icon() { - current=$(get_volume) - if [[ "$current" == "Muted" ]]; then + if [[ "$(pamixer --get-mute)" == "true" ]]; then echo "$iDIR/volume-mute.png" - elif [[ "${current%\%}" -le 30 ]]; then + return + fi + + current=$(pamixer --get-volume) + if [[ "$current" -le 30 ]]; then echo "$iDIR/volume-low.png" - elif [[ "${current%\%}" -le 60 ]]; then + elif [[ "$current" -le 60 ]]; then echo "$iDIR/volume-mid.png" else echo "$iDIR/volume-high.png" @@ -31,11 +45,18 @@ get_icon() { # Notify notify_user() { - if [[ "$(get_volume)" == "Muted" ]]; then - notify-send -e -h string:x-canonical-private-synchronous:volume_notif -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" " Volume:" " Muted" + local muted="$(pamixer --get-mute)" + local level="$(pamixer --get-volume)" + + if [[ "$muted" == "true" || "$level" -eq 0 ]]; then + notify-send -e -h string:x-canonical-private-synchronous:volume_notif \ + -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" \ + " Volume:" " Muted" else - notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" " Volume Level:" " $(get_volume)" && - "$sDIR/Sounds.sh" --volume + notify-send -e -h int:value:"$level" -h string:x-canonical-private-synchronous:volume_notif \ + -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" \ + " Volume Level:" " ${level}%" && + "$sDIR/Sounds.sh" --volume fi } @@ -44,7 +65,7 @@ inc_volume() { if [ "$(pamixer --get-mute)" == "true" ]; then toggle_mute else - pamixer -i 5 --allow-boost --set-limit 150 && notify_user + pamixer -i "$1" --allow-boost --set-limit 150 && notify_user fi } @@ -53,7 +74,7 @@ dec_volume() { if [ "$(pamixer --get-mute)" == "true" ]; then toggle_mute else - pamixer -d 5 && notify_user + pamixer -d "$1" && notify_user fi } @@ -71,13 +92,14 @@ toggle_mic() { if [ "$(pamixer --default-source --get-mute)" == "false" ]; then pamixer --default-source -m && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/microphone-mute.png" " Microphone:" " Switched OFF" elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then - pamixer -u --default-source u && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/microphone.png" " Microphone:" " Switched ON" + pamixer --default-source -u && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/microphone.png" " Microphone:" " Switched ON" fi } # Get Mic Icon get_mic_icon() { - current=$(pamixer --default-source --get-volume) - if [[ "$current" -eq "0" ]]; then + local muted="$(pamixer --default-source --get-mute)" + local current="$(pamixer --default-source --get-volume)" + if [[ "$muted" == "true" || "$current" -eq "0" ]]; then echo "$iDIR/microphone-mute.png" else echo "$iDIR/microphone.png" @@ -86,8 +108,14 @@ get_mic_icon() { # Get Microphone Volume get_mic_volume() { + if [[ "$(pamixer --default-source --get-mute)" == "true" ]]; then + echo "Muted" + return + fi + + local volume volume=$(pamixer --default-source --get-volume) - if [[ "$volume" -eq "0" ]]; then + if [[ "$volume" -eq 0 ]]; then echo "Muted" else echo "$volume %" @@ -96,9 +124,21 @@ get_mic_volume() { # Notify for Microphone notify_mic_user() { - volume=$(get_mic_volume) - icon=$(get_mic_icon) - notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$icon" " Mic Level:" " $volume" + local muted="$(pamixer --default-source --get-mute)" + local level="$(pamixer --default-source --get-volume)" + local icon message + + if [[ "$muted" == "true" || "$level" -eq 0 ]]; then + icon="$iDIR/microphone-mute.png" + notify-send -e -h "string:x-canonical-private-synchronous:volume_notif" \ + -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$icon" \ + " Mic Level:" " Muted" + else + icon="$iDIR/microphone.png" + notify-send -e -h int:value:"$level" -h "string:x-canonical-private-synchronous:volume_notif" \ + -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$icon" \ + " Mic Level:" " ${level}%" + fi } # Increase MIC Volume @@ -113,31 +153,48 @@ inc_mic_volume() { # Decrease MIC Volume dec_mic_volume() { if [ "$(pamixer --default-source --get-mute)" == "true" ]; then - toggle-mic + toggle_mic else pamixer --default-source -d 5 && notify_mic_user fi } # Execute accordingly -if [[ "$1" == "--get" ]]; then - get_volume -elif [[ "$1" == "--inc" ]]; then - inc_volume -elif [[ "$1" == "--dec" ]]; then - dec_volume -elif [[ "$1" == "--toggle" ]]; then - toggle_mute -elif [[ "$1" == "--toggle-mic" ]]; then - toggle_mic -elif [[ "$1" == "--get-icon" ]]; then - get_icon -elif [[ "$1" == "--get-mic-icon" ]]; then - get_mic_icon -elif [[ "$1" == "--mic-inc" ]]; then - inc_mic_volume -elif [[ "$1" == "--mic-dec" ]]; then - dec_mic_volume -else - get_volume -fi \ No newline at end of file +case "$1" in +"--get") + get_volume + ;; +"--inc") + inc_volume 5 + ;; +"--inc-precise") + inc_volume 1 + ;; +"--dec") + dec_volume 5 + ;; +"--dec-precise") + dec_volume 1 + ;; +"--toggle") + toggle_mute + ;; +"--toggle-mic") + toggle_mic + ;; +"--get-icon") + get_icon + ;; +"--get-mic-icon") + get_mic_icon + ;; +"--mic-inc") + inc_mic_volume + ;; +"--mic-dec") + dec_mic_volume + ;; +*) + get_volume + ;; +esac diff --git a/.config/hypr/scripts/WallpaperCmd.sh b/.config/hypr/scripts/WallpaperCmd.sh new file mode 100755 index 00000000..0191ee14 --- /dev/null +++ b/.config/hypr/scripts/WallpaperCmd.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Wallpaper command selector (awww preferred, swww fallback) + +if command -v awww >/dev/null 2>&1; then + WWW_CMD="awww" + WWW_DAEMON="awww-daemon" + WWW_CACHE_DIR="$HOME/.cache/awww" + WWW_DAEMON_ARGS=() + WWW_MIGRATION_MARKER="$WWW_CACHE_DIR/.cache_cleared" +else + WWW_CMD="swww" + WWW_DAEMON="swww-daemon" + WWW_CACHE_DIR="$HOME/.cache/swww" + WWW_DAEMON_ARGS=(--format xrgb) +fi +# One-time cache clear when migrating from swww to awww +if [ "$WWW_CMD" = "awww" ]; then + mkdir -p "$WWW_CACHE_DIR" + if [ ! -f "$WWW_MIGRATION_MARKER" ]; then + awww clear-cache >/dev/null 2>&1 || true + touch "$WWW_MIGRATION_MARKER" + fi +fi + +export WWW_CMD WWW_DAEMON WWW_CACHE_DIR WWW_DAEMON_ARGS WWW_MIGRATION_MARKER diff --git a/.config/hypr/scripts/WallpaperDaemon.sh b/.config/hypr/scripts/WallpaperDaemon.sh new file mode 100755 index 00000000..4d1c6e86 --- /dev/null +++ b/.config/hypr/scripts/WallpaperDaemon.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Start wallpaper daemon, preferring awww with swww fallback + +SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" + +if command -v "$WWW_DAEMON" >/dev/null 2>&1 && command -v "$WWW_CMD" >/dev/null 2>&1; then + "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & +fi + +# Give the daemon a moment to become ready +for _ in {1..20}; do + "$WWW_CMD" query >/dev/null 2>&1 && break + sleep 0.1 +done + +wallpaper_link="$HOME/.config/rofi/.current_wallpaper" +wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" + +read_cached_wallpaper() { + local cache_file="$1" + [ -f "$cache_file" ] || return 1 + awk 'NF && $0 !~ /^filter/ {print; exit}' "$cache_file" +} + +get_monitors() { + if command -v jq >/dev/null 2>&1; then + hyprctl monitors -j | jq -r '.[].name' + else + hyprctl monitors | awk '/^Monitor/{print $2}' + fi +} + +apply_wallpaper_for_monitor() { + local monitor="$1" + local per_monitor_link="$HOME/.config/rofi/.current_wallpaper_${monitor}" + local per_monitor_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current_${monitor}" + local wallpaper_path="" + + # Prefer per-monitor symlink target if valid + if [ -L "$per_monitor_link" ]; then + local resolved + resolved="$(readlink -f "$per_monitor_link")" + if [ -n "$resolved" ] && [ -f "$resolved" ]; then + wallpaper_path="$resolved" + fi + fi + + # Fall back to per-monitor files + if [ -z "$wallpaper_path" ] && [ -f "$per_monitor_link" ]; then + wallpaper_path="$per_monitor_link" + fi + if [ -z "$wallpaper_path" ] && [ -f "$per_monitor_current" ]; then + wallpaper_path="$per_monitor_current" + fi + + # Fall back to global files + if [ -z "$wallpaper_path" ] && [ -L "$wallpaper_link" ]; then + local resolved_global + resolved_global="$(readlink -f "$wallpaper_link")" + if [ -n "$resolved_global" ] && [ -f "$resolved_global" ]; then + wallpaper_path="$resolved_global" + fi + fi + if [ -z "$wallpaper_path" ] && [ -f "$wallpaper_link" ]; then + wallpaper_path="$wallpaper_link" + fi + if [ -z "$wallpaper_path" ] && [ -f "$wallpaper_current" ]; then + wallpaper_path="$wallpaper_current" + fi + + # Last resort: use per-monitor cache + if [ -z "$wallpaper_path" ]; then + local cache_file="$WWW_CACHE_DIR/$monitor" + local cache_fallback="" + if [ "$WWW_CACHE_DIR" = "$HOME/.cache/awww" ]; then + cache_fallback="$HOME/.cache/swww/$monitor" + else + cache_fallback="$HOME/.cache/awww/$monitor" + fi + wallpaper_path="$(read_cached_wallpaper "$cache_file")" + if [ -z "$wallpaper_path" ] && [ -n "$cache_fallback" ]; then + wallpaper_path="$(read_cached_wallpaper "$cache_fallback")" + fi + fi + + if [ -n "$wallpaper_path" ] && [ -f "$wallpaper_path" ]; then + if ! "$WWW_CMD" img -o "$monitor" "$wallpaper_path" >/dev/null 2>&1; then + sleep 0.3 + "$WWW_CMD" img -o "$monitor" "$wallpaper_path" >/dev/null 2>&1 & + fi + fi +} + +while read -r monitor; do + [ -n "$monitor" ] || continue + apply_wallpaper_for_monitor "$monitor" +done < <(get_monitors) diff --git a/.config/hypr/scripts/WallustSwww.sh b/.config/hypr/scripts/WallustSwww.sh index 657f41ab..9df3ed61 100755 --- a/.config/hypr/scripts/WallustSwww.sh +++ b/.config/hypr/scripts/WallustSwww.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Wallust: derive colors from the current wallpaper and update templates # Usage: WallustSwww.sh [absolute_path_to_wallpaper] @@ -7,9 +12,38 @@ set -euo pipefail # Inputs and paths passed_path="${1:-}" -cache_dir="$HOME/.cache/swww/" +if command -v awww >/dev/null 2>&1; then + WWW="awww" + cache_dir="$HOME/.cache/awww/" + cache_dir_fallback="$HOME/.cache/swww/" +else + WWW="swww" + cache_dir="$HOME/.cache/swww/" + cache_dir_fallback="$HOME/.cache/awww/" +fi rofi_link="$HOME/.config/rofi/.current_wallpaper" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" +read_cached_wallpaper() { + local cache_file="$1" + if [[ -f "$cache_file" ]]; then + awk 'NF && $0 !~ /^filter/ {print; exit}' "$cache_file" + fi +} + +read_wallpaper_from_query() { + local monitor="$1" + $WWW query | awk -v mon="$monitor" ' + /^Monitor/ { + cur=$2 + gsub(":", "", cur) + } + /image:/ && cur==mon { + sub(/^.*image: /,"") + print + exit + } + ' +} # Helper: get focused monitor name (prefer JSON) get_focused_monitor() { @@ -25,22 +59,29 @@ wallpaper_path="" if [[ -n "$passed_path" && -f "$passed_path" ]]; then wallpaper_path="$passed_path" else - # Try to read from swww cache for the focused monitor, with a short retry loop + # Try to read from awww/swww cache for the focused monitor, with a short retry loop current_monitor="$(get_focused_monitor)" cache_file="$cache_dir$current_monitor" + alt_cache_file="${cache_dir_fallback}${current_monitor}" - # Wait briefly for swww to write its cache after an image change + # Wait briefly for awww/swww to write its cache after an image change for i in {1..10}; do - if [[ -f "$cache_file" ]]; then + if [[ -f "$cache_file" || -f "$alt_cache_file" ]]; then break fi sleep 0.1 done + if [[ ! -f "$cache_file" && -f "$alt_cache_file" ]]; then + cache_file="$alt_cache_file" + fi if [[ -f "$cache_file" ]]; then # The first non-filter line is the original wallpaper path - # wallpaper_path="$(grep -v 'Lanczos3' "$cache_file" | head -n 1)" - wallpaper_path=$(swww query | grep $current_monitor | awk '{print $9}') + wallpaper_path="$(read_cached_wallpaper "$cache_file")" + fi + + if [[ -z "$wallpaper_path" ]]; then + wallpaper_path="$(read_wallpaper_from_query "$current_monitor")" fi fi @@ -54,6 +95,108 @@ ln -sf "$wallpaper_path" "$rofi_link" || true mkdir -p "$(dirname "$wallpaper_current")" cp -f "$wallpaper_path" "$wallpaper_current" || true +# Ensure Ghostty directory exists so Wallust can write target even if Ghostty isn't installed +mkdir -p "$HOME/.config/ghostty" || true +wait_for_templates() { + local start_ts="$1" + shift + local files=("$@") + for _ in {1..50}; do + local ready=true + for file in "${files[@]}"; do + if [[ ! -s "$file" ]]; then + ready=false + break + fi + local mtime + mtime=$(stat -c %Y "$file" 2>/dev/null || echo 0) + if (( mtime < start_ts )); then + ready=false + break + fi + done + $ready && return 0 + sleep 0.1 + done + return 1 +} + # Run wallust (silent) to regenerate templates defined in ~/.config/wallust/wallust.toml # -s is used in this repo to keep things quiet and avoid extra prompts +start_ts=$(date +%s) wallust run -s "$wallpaper_path" || true +wallust_targets=( + "$HOME/.config/waybar/wallust/colors-waybar.css" + "$HOME/.config/rofi/wallust/colors-rofi.rasi" + "$HOME/.config/hypr/wallust/wallust-hyprland.conf" +) +wait_for_templates "$start_ts" "${wallust_targets[@]}" || true + +# Normalize Rofi selection colors to a brighter accent and readable foreground +rofi_colors="$HOME/.config/rofi/wallust/colors-rofi.rasi" +if [ -f "$rofi_colors" ]; then + accent_hex=$(sed -n 's/^\s*color13:\s*\(#[0-9A-Fa-f]\{6\}\).*/\1/p' "$rofi_colors" | head -n1) + [ -z "$accent_hex" ] && accent_hex=$(sed -n 's/^\s*color12:\s*\(#[0-9A-Fa-f]\{6\}\).*/\1/p' "$rofi_colors" | head -n1) + fg_hex=$(sed -n 's/^\s*foreground:\s*\(#[0-9A-Fa-f]\{6\}\).*/\1/p' "$rofi_colors" | head -n1) + if [ -n "$accent_hex" ]; then + sed -i -E "s|^(\s*selected-normal-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-active-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-urgent-background:\s*).*$|\1$accent_hex;|" "$rofi_colors" + fi + if [ -n "$fg_hex" ]; then + sed -i -E "s|^(\s*selected-normal-foreground:\s*).*$|\1$fg_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-active-foreground:\s*).*$|\1$fg_hex;|" "$rofi_colors" + sed -i -E "s|^(\s*selected-urgent-foreground:\s*).*$|\1$fg_hex;|" "$rofi_colors" + fi +fi + +# Run kitty-only wallust config to keep terminal palette separate +run_wallust_with_config() { + local cfg="$1" + if wallust run --help 2>&1 | grep -q -E '(^|[[:space:]])-c([,[:space:]]|$)|--config'; then + wallust run -s -c "$cfg" "$wallpaper_path" || true + else + WALLUST_CONFIG="$cfg" wallust run -s "$wallpaper_path" || true + fi +} + +kitty_cfg="$HOME/.config/wallust/wallust-kitty.toml" +( + if [ -f "$kitty_cfg" ]; then + kitty_ts=$(date +%s) + run_wallust_with_config "$kitty_cfg" + wait_for_templates "$kitty_ts" "$HOME/.config/kitty/kitty-themes/01-Wallust.conf" || true + fi + + # Reload kitty colors when wallpaper-based theme is active + kitty_wallust_theme="$HOME/.config/kitty/kitty-themes/01-Wallust.conf" + if [ -s "$kitty_wallust_theme" ]; then + if command -v kitty >/dev/null 2>&1; then + kitty @ load-config >/dev/null 2>&1 || true + kitty @ set-colors --all --configured "$kitty_wallust_theme" >/dev/null 2>&1 || true + fi + if pidof kitty >/dev/null 2>&1; then + for pid in $(pidof kitty); do + kill -SIGUSR1 "$pid" 2>/dev/null || true + done + fi + fi + + # Normalize Ghostty palette syntax in case ':' was used by older files + if [ -f "$HOME/.config/ghostty/wallust.conf" ]; then + sed -i -E 's/^(\s*palette\s*=\s*)([0-9]{1,2}):/\1\2=/' "$HOME/.config/ghostty/wallust.conf" 2>/dev/null || true + fi + + # Light wait for Ghostty colors file to be present then signal Ghostty to reload (SIGUSR2) + for _ in 1 2 3; do + [ -s "$HOME/.config/ghostty/wallust.conf" ] && break + sleep 0.1 + done + if pidof ghostty >/dev/null; then + for pid in $(pidof ghostty); do kill -SIGUSR2 "$pid" 2>/dev/null || true; done + fi + # Reload Hyprland so new border colors from wallust-hyprland.conf take effect + if command -v hyprctl >/dev/null 2>&1; then + hyprctl reload >/dev/null 2>&1 || true + fi +) >/dev/null 2>&1 & diff --git a/.config/hypr/scripts/WaybarCava.sh b/.config/hypr/scripts/WaybarCava.sh index 6809e60e..2295f0ab 100755 --- a/.config/hypr/scripts/WaybarCava.sh +++ b/.config/hypr/scripts/WaybarCava.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # WaybarCava.sh — safer single-instance handling, cleanup, and robustness -# Original concept by JaKooLit; this variant focuses on lifecycle hardening. +# Original concept by LinuxBeginnings; this variant focuses on lifecycle hardening. set -euo pipefail @@ -10,6 +16,9 @@ if ! command -v cava >/dev/null 2>&1; then exit 1 fi +# Proactively reap any stale Waybar-spawned cava (unique temp conf names) +pkill -f 'waybar-cava\..*\.conf' 2>/dev/null || true + # 0..7 → ▁▂▃▄▅▆▇█ bar="▁▂▃▄▅▆▇█" dict="s/;//g" @@ -32,7 +41,11 @@ printf '%d' $$ >"$pidfile" # Unique temp config + cleanup on exit config_file="$(mktemp "$RUNTIME_DIR/waybar-cava.XXXXXX.conf")" -cleanup() { rm -f "$config_file" "$pidfile"; } +cleanup() { + # Kill children (cava, sed) of this script, then remove files + pkill -P "$$" 2>/dev/null || true + rm -f "$config_file" "$pidfile" +} trap cleanup EXIT INT TERM cat >"$config_file" <&2 + exit 1 +} + +info() { + printf "${BLUE}${ICON_INFO} %s${NC}\n" "$1" +} + +warn() { + printf "${YELLOW}${ICON_WARN} %s${NC}\n" "$1" +} + +ok() { + printf "${GREEN}${ICON_OK} %s${NC}\n" "$1" +} + +trap 'fail "Script failed at line $LINENO."' ERR + +if [[ ! -t 0 ]]; then + fail "This script requires an interactive terminal. Run it directly in a terminal (e.g. ./build-awww.sh)." +fi + +info "Starting awww installer..." + +if command -v awww >/dev/null 2>&1; then + ok "awww is already installed. Nothing to do." + exit 0 +fi + +if ! command -v git >/dev/null 2>&1; then + fail "git is required but not installed." +fi + +detect_distro() { + if [[ -r /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + echo "${ID:-}" + return + fi + echo "" +} + +prompt_confirm_distro() { + local detected="$1" + local choice="" + if [[ -n "$detected" ]]; then + printf "${BLUE}${ICON_INFO} Detected distro: %s${NC}\n" "$detected" >/dev/tty + printf "Confirm? (Y/y to confirm, N/n to choose, Q/q to quit): " >/dev/tty + read -r choice /dev/tty + read -r choice /dev/null 2>&1 || missing+=("$pkg") + done + if (( ${#missing[@]} )); then + info "Installing deps: ${missing[*]}" + sudo apt update + sudo apt install -y "${missing[@]}" + else + ok "All required deps already installed." + fi +} + +install_deps_fedora() { + local missing=() + for pkg in wayland-protocols lz4-devel wayland-devel; do + rpm -q "$pkg" >/dev/null 2>&1 || missing+=("$pkg") + done + if (( ${#missing[@]} )); then + info "Installing deps: ${missing[*]}" + sudo dnf install -y "${missing[@]}" + else + ok "All required deps already installed." + fi +} + +install_deps_opensuse() { + local missing=() + for pkg in pkg-config liblz4-devel; do + rpm -q "$pkg" >/dev/null 2>&1 || missing+=("$pkg") + done + if (( ${#missing[@]} )); then + info "Installing deps: ${missing[*]}" + sudo zypper install -y "${missing[@]}" + else + ok "All required deps already installed." + fi +} + +install_deps_arch() { + local missing=() + for pkg in pkgconf lz4 wayland-protocols; do + pacman -Qi "$pkg" >/dev/null 2>&1 || missing+=("$pkg") + done + if (( ${#missing[@]} )); then + info "Installing deps: ${missing[*]}" + sudo pacman -S --needed --noconfirm "${missing[@]}" + else + ok "All required deps already installed." + fi +} + +ensure_cargo() { + if command -v cargo >/dev/null 2>&1; then + ok "cargo is available." + return + fi + case "$distro" in + debian|ubuntu|fedora|opensuse) + info "Installing Rust toolchain via rustup..." + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + # shellcheck disable=SC1091 + source "$HOME/.cargo/env" + ;; + arch) + info "Installing Rust toolchain..." + sudo pacman -S --needed --noconfirm rust + ;; + gentoo) + ;; + *) + fail "Unknown distro for cargo install." + ;; + esac + command -v cargo >/dev/null 2>&1 || fail "cargo is still not available." +} + +case "$distro" in + debian) install_deps_debian_ubuntu ;; + ubuntu) install_deps_debian_ubuntu ;; + fedora) install_deps_fedora ;; + opensuse) install_deps_opensuse ;; + arch) install_deps_arch ;; + gentoo) + info "Installing awww via Portage..." + sudo emerge gui-apps/awww + ok "awww installed successfully." + exit 0 + ;; + *) fail "Unsupported distro: $distro" ;; +esac + +ensure_cargo + +info "Cloning or updating awww..." +cd "$HOME" +if [[ -d awww/.git ]]; then + git -C awww pull --rebase +else + git clone https://codeberg.org/LGFae/awww.git +fi + +cd "$HOME/awww" +info "Building awww..." +cargo build --release + +info "Installing binaries..." +sudo install -vDm755 target/release/awww -t /usr/bin/ +sudo install -vDm755 target/release/awww-daemon -t /usr/bin/ +sudo install -vDm644 completions/_awww -t /usr/share/zsh/site-functions/ + +ok "awww installed successfully." diff --git a/.config/hypr/scripts/disable.cpu.turbo.sh b/.config/hypr/scripts/disable.cpu.turbo.sh new file mode 100755 index 00000000..dafee76b --- /dev/null +++ b/.config/hypr/scripts/disable.cpu.turbo.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +set -euo pipefail + +require_root() { + if [[ ${EUID} -ne 0 ]]; then + exec sudo -- "$0" "$@" + fi +} + +write_sysfs() { + local path="$1" + local value="$2" + if [[ -w "$path" ]]; then + printf '%s' "$value" >"$path" + return 0 + fi + return 1 +} + +require_root "$@" + +changed=0 + +# Intel P-State turbo control +if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then + if write_sysfs /sys/devices/system/cpu/intel_pstate/no_turbo 1; then + changed=1 + fi +fi + +# Generic cpufreq boost control (AMD/Intel) +if [[ -e /sys/devices/system/cpu/cpufreq/boost ]]; then + if write_sysfs /sys/devices/system/cpu/cpufreq/boost 0; then + changed=1 + fi +fi + +# Prefer a quieter governor if available +for gov in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do + if [[ -w "$gov" ]]; then + current=$(cat "$gov") + if [[ "$current" != "powersave" ]] && grep -q powersave "${gov%/*}/scaling_available_governors"; then + printf '%s' powersave >"$gov" + changed=1 + fi + fi +done + +# Lower energy/performance preference if supported +for epp in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference; do + if [[ -w "$epp" ]]; then + printf '%s' power >"$epp" 2>/dev/null || true + changed=1 + fi +done + +if [[ $changed -eq 1 ]]; then + echo "CPU turbo/boost disabled and power-saving preferences applied." + exit 0 +fi + +echo "No writable turbo/boost controls found. Check kernel driver support." +exit 1 diff --git a/.config/hypr/scripts/dots-tui b/.config/hypr/scripts/dots-tui new file mode 120000 index 00000000..007282b4 --- /dev/null +++ b/.config/hypr/scripts/dots-tui @@ -0,0 +1 @@ +dots-tui-ubuntu-2404 \ No newline at end of file diff --git a/.config/hypr/scripts/dots-tui-ubuntu-2404 b/.config/hypr/scripts/dots-tui-ubuntu-2404 new file mode 100755 index 00000000..9aad6ecf Binary files /dev/null and b/.config/hypr/scripts/dots-tui-ubuntu-2404 differ diff --git a/.config/hypr/scripts/fastfetch-wrapper.sh b/.config/hypr/scripts/fastfetch-wrapper.sh new file mode 100755 index 00000000..ad5f7873 --- /dev/null +++ b/.config/hypr/scripts/fastfetch-wrapper.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# 1. Get the specific ID and the "ID_LIKE" family +source /etc/os-release +SPECIFIC_ID=$ID +FAMILY_ID=$ID_LIKE + +# 2. Define your asset directory +ASSET_DIR="$HOME/.config/fastfetch/images" + +# 3. Selection Logic +if [ -f "$ASSET_DIR/$SPECIFIC_ID.png" ]; then + # Use exact match if available (e.g., soplos.png) + SELECTED_LOGO="$ASSET_DIR/$SPECIFIC_ID.png" +elif [ -n "$FAMILY_ID" ] && [ -f "$ASSET_DIR/${FAMILY_ID%% *}.png" ]; then + # Fallback to family (e.g., debian.png) - takes the first word of ID_LIKE + SELECTED_LOGO="$ASSET_DIR/${FAMILY_ID%% *}.png" +else + # Let fastfetch handle it natively if no custom image found + fastfetch + exit 0 +fi + +fastfetch --kitty "$SELECTED_LOGO" diff --git a/.config/hypr/scripts/hyprshot.sh b/.config/hypr/scripts/hyprshot.sh new file mode 100755 index 00000000..0e97d15b --- /dev/null +++ b/.config/hypr/scripts/hyprshot.sh @@ -0,0 +1,322 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +set -e + +function Help() { + cat <&2 printf "$@" +} + +function send_notification() { + if [ $SILENT -eq 1 ]; then + return 0 + fi + + local message=$([ $CLIPBOARD -eq 1 ] && \ + echo "Image copied to the clipboard" || \ + echo "Image saved in ${1} and copied to the clipboard.") + notify-send "Screenshot saved" \ + "${message}" \ + -t "$NOTIF_TIMEOUT" -i "${1}" -a Hyprshot +} + +function trim() { + Print "Geometry: %s\n" "${1}" + local geometry="${1}" + local xy_str=$(echo "${geometry}" | cut -d' ' -f1) + local wh_str=$(echo "${geometry}" | cut -d' ' -f2) + local x=`echo "${xy_str}" | cut -d',' -f1` + local y=`echo "${xy_str}" | cut -d',' -f2` + local width=`echo "${wh_str}" | cut -dx -f1` + local height=`echo "${wh_str}" | cut -dx -f2` + + local max_width=`hyprctl monitors -j | jq -r '[.[] | if (.transform % 2 == 0) then (.x + .width) else (.x + .height) end] | max'` + local max_height=`hyprctl monitors -j | jq -r '[.[] | if (.transform % 2 == 0) then (.y + .height) else (.y + .width) end] | max'` + + local min_x=`hyprctl monitors -j | jq -r '[.[] | (.x)] | min'` + local min_y=`hyprctl monitors -j | jq -r '[.[] | (.y)] | min'` + + local cropped_x=$x + local cropped_y=$y + local cropped_width=$width + local cropped_height=$height + + if ((x + width > max_width)); then + cropped_width=$((max_width - x)) + fi + if ((y + height > max_height)); then + cropped_height=$((max_height - y)) + fi + + if ((x < min_x)); then + cropped_x="$min_x" + cropped_width=$((cropped_width + x - min_x)) + fi + if ((y < min_y)); then + cropped_y="$min_y" + cropped_height=$((cropped_height + y - min_y)) + fi + + local cropped=`printf "%s,%s %sx%s\n" \ + "${cropped_x}" "${cropped_y}" \ + "${cropped_width}" "${cropped_height}"` + Print "Crop: %s\n" "${cropped}" + echo ${cropped} +} + +function save_geometry() { + local geometry="${1}" + local output="" + + if [ $RAW -eq 1 ]; then + grim -g "${geometry}" - + return 0 + fi + + if [ $CLIPBOARD -eq 0 ]; then + mkdir -p "$SAVEDIR" + grim -g "${geometry}" "$SAVE_FULLPATH" + output="$SAVE_FULLPATH" + wl-copy --type image/png < "$output" + [ -z "$COMMAND" ] || { + "$COMMAND" "$output" + } + else + wl-copy --type image/png < <(grim -g "${geometry}" -) + fi + + send_notification $output +} + +function checkRunning() { + sleep 1 + while [[ 1 == 1 ]]; do + if [[ $(pgrep slurp | wc -m) == 0 ]]; then + pkill hyprpicker + exit + fi + done +} + +function begin_grab() { + if [ $FREEZE -eq 1 ] && [ "$(command -v "hyprpicker")" ] >/dev/null 2>&1; then + hyprpicker -r -z & + sleep 0.2 + HYPRPICKER_PID=$! + fi + local option=$1 + case $option in + output) + if [ $CURRENT -eq 1 ]; then + local geometry=`grab_active_output` + elif [ -z $SELECTED_MONITOR ]; then + local geometry=`grab_output` + else + local geometry=`grab_selected_output $SELECTED_MONITOR` + fi + ;; + region) + local geometry=`grab_region` + ;; + window) + if [ $CURRENT -eq 1 ]; then + local geometry=`grab_active_window` + else + local geometry=`grab_window` + fi + geometry=`trim "${geometry}"` + ;; + esac + if [ ${DELAY} -gt 0 ] 2>/dev/null; then + sleep ${DELAY} + fi + save_geometry "${geometry}" +} + +function grab_output() { + slurp -or +} + +function grab_active_output() { + local active_workspace=`hyprctl -j activeworkspace` + local monitors=`hyprctl -j monitors` + Print "Monitors: %s\n" "$monitors" + Print "Active workspace: %s\n" "$active_workspace" + local current_monitor="$(echo $monitors | jq -r 'first(.[] | select(.activeWorkspace.id == '$(echo $active_workspace | jq -r '.id')'))')" + Print "Current output: %s\n" "$current_monitor" + echo $current_monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"' +} + +function grab_selected_output() { + local monitor=`hyprctl -j monitors | jq -r '.[] | select(.name == "'$(echo $1)'")'` + Print "Capturing: %s\n" "${1}" + echo $monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"' +} + +function grab_region() { + slurp -d +} + +function grab_window() { + local monitors=`hyprctl -j monitors` + local clients=`hyprctl -j clients | jq -r '[.[] | select(.workspace.id | contains('$(echo $monitors | jq -r 'map(.activeWorkspace.id) | join(",")')'))]'` + Print "Monitors: %s\n" "$monitors" + Print "Clients: %s\n" "$clients" + # Generate boxes for each visible window and send that to slurp + # through stdin + local boxes="$(echo $clients | jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1]) \(.title)"' | cut -f1,2 -d' ')" + Print "Boxes:\n%s\n" "$boxes" + slurp -r <<< "$boxes" +} + +function grab_active_window() { + local active_window=`hyprctl -j activewindow` + local box=$(echo $active_window | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | cut -f1,2 -d' ') + Print "Box:\n%s\n" "$box" + echo "$box" +} + +function parse_mode() { + local mode="${1}" + + case $mode in + window | region | output) + OPTION=$mode + ;; + active) + CURRENT=1 + ;; + *) + hyprctl monitors -j | jq -re '.[] | select(.name == "'$(echo $mode)'")' &>/dev/null + SELECTED_MONITOR=$mode + ;; + esac +} + +function args() { + local options=$(getopt -o hf:o:m:D:dszr:t: --long help,filename:,output-folder:,mode:,delay:,clipboard-only,debug,silent,freeze,raw,notif-timeout: -- "$@") + eval set -- "$options" + + while true; do + case "$1" in + -h | --help) + Help + exit + ;; + -o | --output-folder) + shift; + SAVEDIR=$1 + ;; + -f | --filename) + shift; + FILENAME=$1 + ;; + -D | --delay) + shift; + DELAY=$1 + ;; + -m | --mode) + shift; + parse_mode $1 + ;; + --clipboard-only) + CLIPBOARD=1 + ;; + -d | --debug) + DEBUG=1 + ;; + -z | --freeze) + FREEZE=1 + ;; + -s | --silent) + SILENT=1 + ;; + -r | --raw) + RAW=1 + ;; + -t | --notif-timeout) + shift; + NOTIF_TIMEOUT=$1 + ;; + --) + shift # Skip -- argument + COMMAND=${@:2} + break;; + esac + shift + done + + if [ -z $OPTION ]; then + Print "A mode is required\n\nAvailable modes are:\n\toutput\n\tregion\n\twindow\n" + exit 2 + fi +} + +if [ -z $1 ]; then + Help + exit +fi + +CLIPBOARD=0 +DEBUG=0 +SILENT=0 +RAW=0 +NOTIF_TIMEOUT=5000 +CURRENT=0 +FREEZE=0 +[ -z "$XDG_PICTURES_DIR" ] && type xdg-user-dir &> /dev/null && XDG_PICTURES_DIR=$(xdg-user-dir PICTURES) +FILENAME="$(date +'%Y-%m-%d-%H%M%S_hyprshot.png')" +[ -z "$HYPRSHOT_DIR" ] && SAVEDIR=${XDG_PICTURES_DIR:=~} || SAVEDIR=${HYPRSHOT_DIR} + +args $0 "$@" + +SAVE_FULLPATH="$SAVEDIR/$FILENAME" +[ $CLIPBOARD -eq 0 ] && Print "Saving in: %s\n" "$SAVE_FULLPATH" +begin_grab $OPTION & checkRunning diff --git a/.config/hypr/scripts/install-uv.sh b/.config/hypr/scripts/install-uv.sh new file mode 100755 index 00000000..da4b2d86 --- /dev/null +++ b/.config/hypr/scripts/install-uv.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/.config/hypr/scripts/keybinds_parser.py b/.config/hypr/scripts/keybinds_parser.py new file mode 100755 index 00000000..5b75d81c --- /dev/null +++ b/.config/hypr/scripts/keybinds_parser.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python3 +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +import sys +import re +import os + +def normalize_combo(combo): + return combo.replace(" ", "").replace("\t", "") + +def extract_combo(line): + # Remove comments and whitespace + line = re.sub(r'\s*#.*$', '', line).strip() + + if '=' not in line: + return None + + try: + rhs = line.split('=', 1)[1] + parts = [p.strip() for p in rhs.split(',')] + if len(parts) < 2: + return None + + mods = parts[0] + key = parts[1] + return f"{mods},{key}" + except Exception: + return None + +def parse_files(files): + # Data structures to match original logic + binding_map = {} # combo -> effective line + source_map = {} # combo -> source file + user_bind_map = {} # combo -> user bind line + unbound_user = {} # combo -> True if explicitly unbound in user file + seen_any_bind = {} # combo -> True if seen + default_seen = {} # combo -> True if default bind exists + + # We assume the last file in the list is the user config (UserKeybinds.conf) + # This matches the bash script logic where user_keybinds_conf is passed last + if not files: + return [], [] + + user_conf_path = files[-1] if len(files) > 1 else None + + for file_path in files: + if not os.path.exists(file_path): + continue + + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + for line in f: + line = line.rstrip('\n') + if not line or line.strip().startswith('#'): + continue + + is_bind = re.match(r'^\s*bind[a-z]*\s*=', line) + is_unbind = re.match(r'^\s*unbind\s*=', line) + + if is_bind: + combo_raw = extract_combo(line) + if not combo_raw: + continue + combo = normalize_combo(combo_raw) + seen_any_bind[combo] = True + + is_user_file = (file_path == user_conf_path) + + if not is_user_file: + default_seen[combo] = True + + # prefer user bind, else first seen + if combo not in source_map: + binding_map[combo] = line + source_map[combo] = file_path + + if is_user_file: + user_bind_map[combo] = line + binding_map[combo] = line + source_map[combo] = file_path + + elif is_unbind: + combo_raw = extract_combo(line) + if not combo_raw: + continue + combo = normalize_combo(combo_raw) + + if file_path == user_conf_path: + unbound_user[combo] = True + + # If unbind is found, we should remove the bind from our map + # so it doesn't show up in the menu. + if combo in binding_map: + del binding_map[combo] + if combo in source_map: + del source_map[combo] + + except Exception as e: + # Silently ignore read errors to mimic bash behavior or log to stderr + sys.stderr.write(f"Error reading {file_path}: {e}\n") + continue + + # Build results + raw_keybinds = [] + missing_unbind_suggestions = [] + + for combo in seen_any_bind: + eff_line = binding_map.get(combo) + src = source_map.get(combo) + + if not eff_line: + continue + + raw_keybinds.append(eff_line) + + # Check for missing unbind suggestions + # If user overrides a default but didn't unbind in user file + if (src == user_conf_path and + combo in default_seen and + combo not in unbound_user): + + # Create suggestion: replace 'bind' with 'unbind' + suggest = re.sub(r'^\s*bind[a-z]*', 'unbind', eff_line) + missing_unbind_suggestions.append(suggest) + + return raw_keybinds, missing_unbind_suggestions + +def format_for_rofi(raw_binds): + formatted_lines = [] + + for line in raw_binds: + # line is like "bind = MODS, KEY, DISPATCHER, PARAMS" or "bindd = ..." + # Parsing logic from awk script: + + # 1. Cleaner binder + match = re.match(r'^\s*(bind[a-z]*)\s*=(.*)', line) + if not match: + continue + + binder = match.group(1).replace(" ", "").replace("\t", "") + rhs = match.group(2).strip() + + # "bind" ends in d, but doesn't have a description. "bindd" does. + # Original script logic `index(binder, "d")>0` was likely buggy for "bind". + # We'll assume strict check for bindd or similar if needed, + # but avoiding "bind" having a description is crucial for correct output. + has_desc = 'd' in binder and binder != 'bind' + + # Split by comma regex (handling spaces) + parts = [p.strip() for p in rhs.split(',')] + + if len(parts) < 2: + continue + + mods = parts[0] + key = parts[1] + + desc = "" + dispatcher = "" + params = "" + + start_idx = 0 + + if has_desc: + desc = parts[2] if len(parts) >= 3 else "" + dispatcher = parts[3] if len(parts) >= 4 else "" + start_idx = 4 + else: + dispatcher = parts[2] if len(parts) >= 3 else "" + start_idx = 3 + + # Collect params + remaining_parts = [] + if start_idx < len(parts): + for i in range(start_idx, len(parts)): + if parts[i]: + remaining_parts.append(parts[i]) + + if remaining_parts: + params = ", ".join(remaining_parts) + + # Formatting mods + mods = mods.replace("$mainMod", "SUPER") + mods = re.sub(r'[ \t]+', '+', mods) + + # Build combo string + if mods and key: + combo_str = f"{mods}+{key}" + elif key: + combo_str = key + else: + combo_str = mods + + # Final Print Format + if has_desc and desc: + formatted_lines.append(f"{combo_str} — {desc}") + elif dispatcher: + if params: + formatted_lines.append(f"{combo_str} — {dispatcher} {params}") + else: + formatted_lines.append(f"{combo_str} — {dispatcher}") + else: + formatted_lines.append(combo_str) + + return formatted_lines + +def main(): + if len(sys.argv) < 2: + # No files provided + sys.exit(0) + + config_files = sys.argv[1:] + + binds, suggestions = parse_files(config_files) + + if not binds: + print("no keybinds found.") + sys.exit(1) + + formatted = format_for_rofi(binds) + + for line in formatted: + print(line) + + # Handle suggestions (print to stderr or a specific file if needed, + # but the original script assigns it to a variable 'msg'. + # To pass this back to bash, we might need a separate mechanism or just print to a known file.) + if suggestions: + import tempfile + try: + with tempfile.NamedTemporaryFile(mode='w', delete=False, prefix='hypr-unbind-suggestions-', suffix='.conf') as tf: + tf.write('\n'.join(suggestions) + '\n') + # We print a special marker line to stdout that the bash script can capture? + # Or better, just print to stderr and let the user ignore it, + # OR, since the original script specifically puts it in the Rofi message, + # we can print a special string at the END of stdout or to a side channel. + + # Let's decide to print the valid keybinds to stdout (for rofi). + # And print the suggestion file path to a known location or specific fd if possible. + # Simplest: Write to a fixed temp file location that the bash script checks. + with open("/tmp/hypr_keybind_suggestions_file", "w") as sf: + sf.write(tf.name) + except Exception: + pass + +if __name__ == "__main__": + main() diff --git a/.config/hypr/scripts/rofi-emacs-keybinds b/.config/hypr/scripts/rofi-emacs-keybinds new file mode 100755 index 00000000..bee1a54d --- /dev/null +++ b/.config/hypr/scripts/rofi-emacs-keybinds @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -u +set -o pipefail + +ROFI_CONFIG="${HOME}/.config/rofi/config-emacs-keybinds.rasi" +CACHE_FILE="${HOME}/.cache/rofi-emacs-keybinds.txt" + +if [[ ! -s "${CACHE_FILE}" ]]; then + notify-send "Rofi Emacs Keybinds" "Keybind cache missing. In Emacs, run: M-x rofi-emacs-keybinds-refresh" + exit 1 +fi + +rofi -dmenu -i -p "Emacs Keybinds" -config "${ROFI_CONFIG}" < "${CACHE_FILE}" diff --git a/.config/hypr/scripts/rofi-ssh-menu.sh b/.config/hypr/scripts/rofi-ssh-menu.sh new file mode 100755 index 00000000..d1640c66 --- /dev/null +++ b/.config/hypr/scripts/rofi-ssh-menu.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Rofi SSH menu - list SSH hosts from ~/.ssh/config and connect. + +set -euo pipefail + +SSH_CONFIG="${HOME}/.ssh/config" +ROFI_CONFIG="${HOME}/.config/rofi/config.rasi" +MSG='Select a host to connect via SSH' + +notify() { + if command -v notify-send >/dev/null 2>&1; then + notify-send -u low "Rofi SSH" "$1" + else + printf '%s\n' "$1" >&2 + fi +} + +if [[ ! -f "${SSH_CONFIG}" ]]; then + notify "SSH config not found: ${SSH_CONFIG}" + exit 1 +fi + +# Build list: host|user|hostname +host_entries="$( + awk ' + function is_wildcard(h) { return (h ~ /[*?]/ || h ~ /^!/); } + function remember_hosts(list, i, n, h) { + delete current + n = split(list, parts, /[ \t]+/) + for (i = 1; i <= n; i++) { + h = parts[i] + if (h == "") continue + if (is_wildcard(h)) continue + current[h] = 1 + if (!(h in seen)) { + seen[h] = 1 + order[++count] = h + } + } + } + { + sub(/[ \t]*#.*/, "", $0) + if ($0 ~ /^[ \t]*$/) next + if ($1 == "Host") { + $1 = "" + sub(/^[ \t]+/, "", $0) + remember_hosts($0) + next + } + if ($1 == "HostName") { + for (h in current) hostname[h] = $2 + next + } + if ($1 == "User") { + for (h in current) user[h] = $2 + next + } + } + END { + for (i = 1; i <= count; i++) { + h = order[i] + print h "|" (h in user ? user[h] : "") "|" (h in hostname ? hostname[h] : "") + } + } + ' "${SSH_CONFIG}" +)" + +if [[ -z "${host_entries}" ]]; then + notify "No SSH hosts found in ${SSH_CONFIG}" + exit 1 +fi + +menu_entries="$( + while IFS='|' read -r host user hostname; do + [[ -n "${host}" ]] || continue + [[ -n "${user}" ]] || user="${USER}" + [[ -n "${hostname}" ]] || hostname="${host}" + printf '%s | %s@%s\n' "${host}" "${user}" "${hostname}" + done <<< "${host_entries}" +)" + +# Close any existing rofi before launching +if pgrep -x "rofi" >/dev/null 2>&1; then + pkill rofi +fi + +selection="$(printf '%s\n' "${menu_entries}" | rofi -dmenu -i -p "SSH" -mesg "${MSG}" -config "${ROFI_CONFIG}")" + +if [[ -z "${selection}" ]]; then + exit 0 +fi + +selected_host="${selection%% | *}" +if [[ -z "${selected_host}" ]]; then + exit 0 +fi + +if command -v kitty >/dev/null 2>&1; then + exec kitty --title "SSH ${selected_host}" sh -lc "ssh ${selected_host}" +fi + +if command -v ghostty >/dev/null 2>&1; then + exec ghostty -e sh -lc "ssh ${selected_host}" +fi + +if command -v alacritty >/dev/null 2>&1; then + exec alacritty -e sh -lc "ssh ${selected_host}" +fi + +notify "No supported terminal found (kitty, ghostty, alacritty). Unable to start SSH session." +exit 1 diff --git a/.config/hypr/scripts/sddm_wallpaper.sh b/.config/hypr/scripts/sddm_wallpaper.sh index 9dca2f72..deee938c 100755 --- a/.config/hypr/scripts/sddm_wallpaper.sh +++ b/.config/hypr/scripts/sddm_wallpaper.sh @@ -1,12 +1,18 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # SDDM Wallpaper and Wallust Colors Setter # for the upcoming changes on the simple_sddm_theme # variables terminal=kitty -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" @@ -20,6 +26,10 @@ sddm_simple="$sddm_themes_dir/simple_sddm_2" # rofi-wallust-sddm colors path rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi" sddm_theme_conf="$sddm_simple/theme.conf" +if [[ ! -f "$rofi_wallust" ]]; then + notify-send -i "$iDIR/error.png" "SDDM" "Wallust colors file not found ($rofi_wallust). Aborting." + exit 1 +fi # Directory for swaync iDIR="$HOME/.config/swaync/images" @@ -33,15 +43,45 @@ elif [[ "$1" == "--effects" ]]; then mode="effects" fi +# Abort if SDDM is not running (avoid errors on non-SDDM systems) +if command -v systemctl >/dev/null 2>&1; then + if ! systemctl is-active --quiet sddm; then + notify-send -i "$iDIR/error.png" "SDDM" "SDDM is not running. Skipping SDDM wallpaper update." + exit 0 + fi +elif ! pidof sddm >/dev/null 2>&1; then + notify-send -i "$iDIR/error.png" "SDDM" "SDDM is not running. Skipping SDDM wallpaper update." + exit 0 +fi + # Extract colors from rofi wallust config -color0=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color1=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color7=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color10=$(grep -oP 'color10:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -foreground=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +extract_color() { + local key="$1" + local value + value=$(grep -oP "$key:\s*\K#[A-Fa-f0-9]+" "$rofi_wallust" | head -n1) + echo "$value" +} + +color0=$(extract_color "color1") +color1=$(extract_color "color0") +color7=$(extract_color "color14") +color10=$(extract_color "color10") +color12=$(extract_color "color12") +color13=$(extract_color "color13") +foreground=$(extract_color "foreground") + +missing_colors=() +for var in color0 color1 color7 color10 color12 color13 foreground; do + if [[ -z "${!var}" ]]; then + missing_colors+=("$var") + fi +done + +if [[ ${#missing_colors[@]} -gt 0 ]]; then + notify-send -i "$iDIR/error.png" "SDDM" "Missing color(s): ${missing_colors[*]}. Run Wallust first." + exit 1 +fi #background-color=$(grep -oP 'background:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") # wallpaper to use diff --git a/.config/hypr/scripts/set-default-thunar-terminal.sh b/.config/hypr/scripts/set-default-thunar-terminal.sh new file mode 100755 index 00000000..fd50eb6c --- /dev/null +++ b/.config/hypr/scripts/set-default-thunar-terminal.sh @@ -0,0 +1,148 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# +setup_default_terminal() { + echo "Setting kitty as the default terminal for Thunar and CLI apps..." + + # 1. Configure XFCE/Exo (Thunar's primary helper) + # This handles "Open Terminal Here" and "Open with [CLI App]" + HELPER_DIR="$HOME/.config/xfce4" + mkdir -p "$HELPER_DIR" + KITTY_PATH="$(command -v kitty 2>/dev/null || true)" + if [ -z "$KITTY_PATH" ]; then + echo "Warning: kitty not found in PATH. Thunar may report no terminal available." + fi + # Prefer exo-preferred-applications when available (XFCE/Thunar) + if command -v exo-preferred-applications >/dev/null 2>&1; then + exo-preferred-applications --set TerminalEmulator kitty >/dev/null 2>&1 || true + fi + + # Ensure helpers.rc exists and has a [Default] section + if [ ! -f "$HELPER_DIR/helpers.rc" ]; then + printf "[Default]\n" >"$HELPER_DIR/helpers.rc" + elif ! grep -q '^\[Default\]$' "$HELPER_DIR/helpers.rc"; then + printf "[Default]\n%s" "$(cat "$HELPER_DIR/helpers.rc")" >"$HELPER_DIR/helpers.rc" + fi + + # Update TerminalEmulator entry in [Default] section + if grep -q '^TerminalEmulator=' "$HELPER_DIR/helpers.rc"; then + sed -i 's|^TerminalEmulator=.*|TerminalEmulator=kitty|' "$HELPER_DIR/helpers.rc" + else + sed -i '/^\[Default\]$/a TerminalEmulator=kitty' "$HELPER_DIR/helpers.rc" + fi + # Set a full path if available (GUI PATH can differ) + if [ -n "$KITTY_PATH" ]; then + if grep -q '^TerminalEmulatorPath=' "$HELPER_DIR/helpers.rc"; then + sed -i "s|^TerminalEmulatorPath=.*|TerminalEmulatorPath=$KITTY_PATH|" "$HELPER_DIR/helpers.rc" + else + sed -i "/^\[Default\]$/a TerminalEmulatorPath=$KITTY_PATH" "$HELPER_DIR/helpers.rc" + fi + fi + + # 2. Create a User-Level "xterm" Shim + # Many older .desktop files and scripts have 'xterm' hardcoded. + # By placing this in ~/.local/bin, we intercept those calls. + BIN_DIR="$HOME/.local/bin" + mkdir -p "$BIN_DIR" + if ! printf "%s" "$PATH" | tr ':' '\n' | grep -qx "$BIN_DIR"; then + echo "Warning: $BIN_DIR is not in PATH for this session. GUI apps may still use /usr/bin/xterm." + fi + + cat <"$BIN_DIR/xterm" +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# +# Shim to redirect xterm calls to kitty +# Resolves Open with (vim/neovim/etc) opening in xterm +args=() +pass_through=() +while [ \$# -gt 0 ]; do + case "\$1" in + -e) + shift + if [ \$# -gt 0 ]; then + pass_through+=("\$@") + fi + break + ;; + -T|-title|-geometry|-bg|-fg|-fs|-fa|-fn) + # Skip common xterm-only flags and their values + shift + [ \$# -gt 0 ] && shift + ;; + -class|-name) + shift + [ \$# -gt 0 ] && shift + ;; + -hold|-ls|-sb|-sk|-sr|-s) + # Ignore boolean flags that kitty doesn't understand + shift + ;; + *) + args+=("\$1") + shift + ;; + esac +done + +if [ \${#pass_through[@]} -gt 0 ]; then + exec kitty "\${args[@]}" -- "\${pass_through[@]}" +else + exec kitty "\${args[@]}" +fi +EOF + chmod +x "$BIN_DIR/xterm" + + # 3. Update GLib/GIO Default Terminal (for GNOME-based backends) + # Some distros use gsettings to define the terminal schema. + if command -v gsettings >/dev/null 2>&1; then + gsettings set org.gnome.desktop.default-applications.terminal exec 'kitty' 2>/dev/null || true + fi + + # 4. Refresh Mime Database + # Ensures Thunar sees the changes to terminal handling immediately. + if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database ~/.local/share/applications 2>/dev/null || true + fi + + # 5. Hide Kitty URL Handler from "Open With" + # Prevents Kitty URL handler from showing up for text files. + USER_APP_DIR="$HOME/.local/share/applications" + mkdir -p "$USER_APP_DIR" + KITTY_URL_HANDLER="" + for dir in $XDG_DATA_DIRS /usr/local/share /usr/share; do + [ -z "$dir" ] && continue + if [ -f "$dir/applications/kitty-url-handler.desktop" ]; then + KITTY_URL_HANDLER="$dir/applications/kitty-url-handler.desktop" + break + fi + done + + if [ -n "$KITTY_URL_HANDLER" ]; then + cp "$KITTY_URL_HANDLER" "$USER_APP_DIR/kitty-url-handler.desktop" + if grep -q '^NoDisplay=' "$USER_APP_DIR/kitty-url-handler.desktop"; then + sed -i 's|^NoDisplay=.*|NoDisplay=true|' "$USER_APP_DIR/kitty-url-handler.desktop" + else + printf "\nNoDisplay=true\n" >>"$USER_APP_DIR/kitty-url-handler.desktop" + fi + if grep -q '^Hidden=' "$USER_APP_DIR/kitty-url-handler.desktop"; then + sed -i 's|^Hidden=.*|Hidden=true|' "$USER_APP_DIR/kitty-url-handler.desktop" + else + printf "Hidden=true\n" >>"$USER_APP_DIR/kitty-url-handler.desktop" + fi + fi + + echo "Default terminal set to kitty successfully." +} + +setup_default_terminal diff --git a/.config/hypr/scripts/update_WindowRules.sh b/.config/hypr/scripts/update_WindowRules.sh new file mode 100755 index 00000000..c8d236c4 --- /dev/null +++ b/.config/hypr/scripts/update_WindowRules.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Script to update WindowRules config if Hyprland version is >= 0.53 + +CONFIGS_DIR="$HOME/.config/hypr/configs" +TARGET_FILE="$CONFIGS_DIR/WindowRules.conf" +V3_FILE="$CONFIGS_DIR/WindowRules-config-v3.conf" + +if [[ ! -f "$V3_FILE" ]]; then + echo "Error: Source configuration file not found: $V3_FILE" + exit 1 +fi + +get_hyprland_version() { + local ver="0.0.0" + local raw_ver="" + + if command -v hyprctl &>/dev/null; then + raw_ver=$(hyprctl version 2>/dev/null | grep "Tag:" | cut -d 'v' -f2) + fi + + if [ -z "$raw_ver" ] && command -v Hyprland &>/dev/null; then + raw_ver=$(Hyprland --version 2>/dev/null | grep "Tag:" | cut -d 'v' -f2 | awk '{print $1}') + fi + + if [ -n "$raw_ver" ]; then + ver=$(echo "$raw_ver" | grep -oE '^[0-9]+\.[0-9]+(\.[0-9]+)?') + fi + + if [ -z "$ver" ]; then + echo "0.0.0" + else + echo "$ver" + fi +} + +VERSION=$(get_hyprland_version) +REQUIRED_VER="0.53" + +# Check if version >= REQUIRED_VER +SMALLEST=$(printf '%s\n' "$REQUIRED_VER" "$VERSION" | sort -V | head -n1) + +if [ "$SMALLEST" = "$REQUIRED_VER" ]; then + echo "Version $VERSION >= $REQUIRED_VER. Updating WindowRules config..." + # Backup existing config if it exists + if [ -f "$TARGET_FILE" ]; then + echo "Backing up existing WindowRules.conf to WindowRules.conf.bak" + mv "$TARGET_FILE" "$TARGET_FILE.bak" + fi + cp "$V3_FILE" "$TARGET_FILE" + + if command -v hyprctl &>/dev/null; then + if hyprctl instances &>/dev/null; then + echo "Reloading Hyprland..." + hyprctl reload + fi + fi +else + echo "Version $VERSION < $REQUIRED_VER. No update needed." +fi + diff --git a/.config/hypr/v2.3.18 b/.config/hypr/v2.3.23 similarity index 55% rename from .config/hypr/v2.3.18 rename to .config/hypr/v2.3.23 index 31b3414d..51de9972 100644 --- a/.config/hypr/v2.3.18 +++ b/.config/hypr/v2.3.23 @@ -1,5 +1,5 @@ -### https://github.com/JaKooLit ### -## https://github.com/JaKooLit/Hyprland-Dots +### https://github.com/LinuxBeginnings ### +## https://github.com/LinuxBeginnings/Hyprland-Dots ## This is to have a reference of which version would be ## note that this will always be higher than the released versions \ No newline at end of file diff --git a/.config/hypr/wallust/wallust-hyprland.conf b/.config/hypr/wallust/wallust-hyprland.conf index c7c1debe..88845f82 100644 --- a/.config/hypr/wallust/wallust-hyprland.conf +++ b/.config/hypr/wallust/wallust-hyprland.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # /* wallust template - colors-hyprland */ $background = rgb(010102) diff --git a/.config/hypr/workspaces.conf b/.config/hypr/workspaces.conf index 708dee00..5417d940 100644 --- a/.config/hypr/workspaces.conf +++ b/.config/hypr/workspaces.conf @@ -1,4 +1,4 @@ -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # # *********************************************************** # #