diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-02-23 18:47:47 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2026-02-23 18:47:47 -0500 |
| commit | 59e87cbf4482efb6d7c8ff766f80b0286a20732b (patch) | |
| tree | 7b2bdf7ae6c399a54e154896b78dfef9ec0dd2b7 /config/hypr | |
| parent | c8767dfaa8c9efbeeec0293ffe4287a40c02b34c (diff) | |
| parent | c1ae43efc9196eca55c59cc43dd8f85975d84206 (diff) | |
Merge branch 'development'
Conflicts:
README.md
config/fastfetch/config-compact.jsonc
config/fastfetch/config.jsonc
config/hypr/scripts/Tak0-Per-Window-Switch.sh
i18n/README/README.de.md
i18n/README/README.jp.md
i18n/README/README.ro.md
i18n/README/README.ru.md
i18n/README/README.ua.md
It looks like you may be committing a merge.
If this is not correct, please run
git update-ref -d MERGE_HEAD
and try again.
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
On branch main
Your branch is up to date with 'origin/main'.
All conflicts fixed but you are still merging.
Changes to be committed:
modified: CHANGELOG.md
modified: README.md
renamed: update-dots.sh -> archive/update-dots.sh
new file: assets/waybar-weather.gz
new file: config/fastfetch/config-compact-legacy.jsonc
modified: config/fastfetch/config-compact.jsonc
modified: config/fastfetch/config.jsonc
new file: config/fastfetch/config.legacy.jsonc
modified: config/hypr/UserConfigs/WindowRules.conf
new file: config/hypr/UserScripts/RainbowBorders-low-cpu.sh
modified: config/hypr/configs/ENVariables.conf
modified: config/hypr/configs/Keybinds.conf
modified: config/hypr/configs/Startup_Apps.conf
modified: config/hypr/configs/WindowRules-config-v3.conf
modified: config/hypr/configs/WindowRules.conf
modified: config/hypr/monitors.conf
modified: config/hypr/scripts/Kitty_themes.sh
modified: config/hypr/scripts/Kool_Quick_Settings.sh
new file: config/hypr/scripts/PortalHyprlandUbuntu2604.sh
modified: config/hypr/scripts/Refresh.sh
modified: config/hypr/scripts/Tak0-Per-Window-Switch.sh
new file: config/hypr/scripts/Toggle-Active-Window-Audio.sh
new file: config/hypr/scripts/Toggle-weather-waybar-units.sh
modified: config/hypr/scripts/WallustSwww.sh
modified: config/hypr/scripts/WaybarCava.sh
new file: config/hypr/scripts/dots-tui
new file: config/hypr/scripts/dots-tui-ubuntu-2404
new file: config/hypr/scripts/hyprshot.sh
new file: config/hypr/scripts/install-uv.sh
renamed: config/hypr/v2.3.20 -> config/hypr/v2.3.21
modified: config/hypr/wallpaper_effects/.wallpaper_current
modified: config/kitty/kitty.conf
new file: config/rofi/00-terminal.rasi
modified: config/rofi/config.rasi
modified: config/wallust/templates/colors-waybar.css
new file: config/wallust/wallust-kitty.toml
modified: config/wallust/wallust.toml
new file: config/waybar-weather/cityname.txt
new file: config/waybar-weather/config.toml
new file: config/waybar-weather/geolocation.txt
modified: config/waybar/ModulesCustom
modified: config/waybar/config
renamed: config/waybar/configs/[BOT & Left] SouthWest -> config/waybar/configs/BOT-&-Left-SouthWest
renamed: config/waybar/configs/[BOT & Right] SouthEast -> config/waybar/configs/BOT-&-Right-SouthEast
renamed: config/waybar/configs/[BOT] Camellia -> config/waybar/configs/BOT-Camellia
renamed: config/waybar/configs/[BOT] Chrysanthemum -> config/waybar/configs/BOT-Chrysanthemum
renamed: config/waybar/configs/[BOT] Default -> config/waybar/configs/BOT-Default
renamed: config/waybar/configs/[BOT] Default Laptop -> config/waybar/configs/BOT-Default-Laptop
renamed: config/waybar/configs/[BOT] Gardenia -> config/waybar/configs/BOT-Gardenia
renamed: config/waybar/configs/[BOT] Peony -> config/waybar/configs/BOT-Peony
renamed: config/waybar/configs/[BOT] Simple -> config/waybar/configs/BOT-Simple
renamed: config/waybar/configs/[BOT] Sleek -> config/waybar/configs/BOT-Sleek
renamed: config/waybar/configs/[LEFT] WestWing -> config/waybar/configs/LEFT-WestWing
renamed: config/waybar/configs/[LEFT] WestWing v2 -> config/waybar/configs/LEFT-WestWing-v2
renamed: config/waybar/configs/[RIGHT] EastWing -> config/waybar/configs/RIGHT-EastWing
renamed: config/waybar/configs/[RIGHT] EastWing v2 -> config/waybar/configs/RIGHT-EastWing-v2
renamed: config/waybar/configs/[TOP & BOT] SummitSplit -> config/waybar/configs/TOP-&-BOT-SummitSplit
renamed: config/waybar/configs/[TOP & BOT] SummitSplit-glass -> config/waybar/configs/TOP-&-BOT-SummitSplit-glass
renamed: config/waybar/configs/[TOP & BOT] SummitSplit v2 -> config/waybar/configs/TOP-&-BOT-SummitSplit-v2
new file: config/waybar/configs/TOP-&-BOT-SummitSplit-v3
renamed: config/waybar/configs/[TOP & Left] NorthWest -> config/waybar/configs/TOP-&-Left-NorthWest
renamed: config/waybar/configs/[TOP & Right] NorthEast -> config/waybar/configs/TOP-&-Right-NorthEast
renamed: config/waybar/configs/[TOP] 0-Ja-0 -> config/waybar/configs/TOP-0-Ja-0
renamed: config/waybar/configs/[TOP] Arrow -> config/waybar/configs/TOP-Arrow
renamed: config/waybar/configs/[TOP] Camellia -> config/waybar/configs/TOP-Camellia
renamed: config/waybar/configs/[TOP] Chrysanthemum -> config/waybar/configs/TOP-Chrysanthemum
renamed: config/waybar/configs/[TOP] Default -> config/waybar/configs/TOP-Default
renamed: config/waybar/configs/[TOP] Default Laptop -> config/waybar/configs/TOP-Default-Laptop
renamed: config/waybar/configs/[TOP] Default Laptop-glass -> config/waybar/configs/TOP-Default-Laptop-glass
renamed: config/waybar/configs/[TOP] Default Laptop (old v1) -> config/waybar/configs/TOP-Default-Laptop-old-v1
renamed: config/waybar/configs/[TOP] Default Laptop (old v2) -> config/waybar/configs/TOP-Default-Laptop-old-v2
renamed: config/waybar/configs/[TOP] Default Laptop (old v3) -> config/waybar/configs/TOP-Default-Laptop-old-v3
renamed: config/waybar/configs/[TOP] Default Laptop (old v4) -> config/waybar/configs/TOP-Default-Laptop-old-v4
renamed: config/waybar/configs/[TOP] Default Laptop (old v5) -> config/waybar/configs/TOP-Default-Laptop-old-v5
renamed: config/waybar/configs/[TOP] Default (old v1) -> config/waybar/configs/TOP-Default-old-v1
renamed: config/waybar/configs/[TOP] Default (old v2) -> config/waybar/configs/TOP-Default-old-v2
renamed: config/waybar/configs/[TOP] Default (old v3) -> config/waybar/configs/TOP-Default-old-v3
renamed: config/waybar/configs/[TOP] Default (old v4) -> config/waybar/configs/TOP-Default-old-v4
renamed: config/waybar/configs/[TOP] Everforest -> config/waybar/configs/TOP-Everforest
renamed: config/waybar/configs/[TOP] Everforest-glass -> config/waybar/configs/TOP-Everforest-glass
renamed: config/waybar/configs/[TOP] Gardenia -> config/waybar/configs/TOP-Gardenia
renamed: config/waybar/configs/[TOP] Minimal - Long -> config/waybar/configs/TOP-Minimal-Long
renamed: config/waybar/configs/[TOP] Minimal - Short -> config/waybar/configs/TOP-Minimal-Short
renamed: config/waybar/configs/[TOP] Peony -> config/waybar/configs/TOP-Peony
renamed: config/waybar/configs/[TOP] Simple -> config/waybar/configs/TOP-Simple
renamed: config/waybar/configs/[TOP] Simpliest -> config/waybar/configs/TOP-Simpliest
renamed: config/waybar/configs/[TOP] Sleek -> config/waybar/configs/TOP-Sleek
new file: config/waybar/configs/TOP-ddubs-simple-bar
modified: config/waybar/style.css
renamed: config/waybar/style/[0 VERTICAL] [Catpuccin] Mocha.css -> config/waybar/style/0-VERTICAL-Catpuccin-Mocha.css
renamed: config/waybar/style/[0 VERTICAL] Golden Noir.css -> config/waybar/style/0-VERTICAL-Golden-Noir.css
renamed: config/waybar/style/[0 VERTICAL] Oglo Chicklets.css -> config/waybar/style/0-VERTICAL-Oglo-Chicklets.css
renamed: config/waybar/style/[Black & White] Monochrome.css -> config/waybar/style/Black-&-White-Monochrome.css
renamed: config/waybar/style/[Catppuccin] Frappe.css -> config/waybar/style/Catppuccin-Frappe.css
renamed: config/waybar/style/[Catppuccin] Latte.css -> config/waybar/style/Catppuccin-Latte.css
renamed: config/waybar/style/[Catppuccin] Mocha.css -> config/waybar/style/Catppuccin-Mocha.css
renamed: config/waybar/style/[Colored] Chroma Glow.css -> config/waybar/style/Colored-Chroma-Glow.css
renamed: config/waybar/style/[Colored] Translucent.css -> config/waybar/style/Colored-Translucent.css
renamed: config/waybar/style/[Colorful] Aurora Blossom.css -> config/waybar/style/Colorful-Aurora-Blossom.css
renamed: config/waybar/style/[Colorful] Aurora.css -> config/waybar/style/Colorful-Aurora.css
renamed: config/waybar/style/[Colorful] Oglo Chicklets.css -> config/waybar/style/Colorful-Oglo-Chicklets.css
renamed: config/waybar/style/[Colorful] Rainbow Spectrum.css -> config/waybar/style/Colorful-Rainbow-Spectrum.css
renamed: config/waybar/style/[Colorful] stolen-style.css -> config/waybar/style/Colorful-stolen-style.css
renamed: config/waybar/style/Crystal Clear Glass.css -> config/waybar/style/Crystal-Clear-Glass.css
renamed: config/waybar/style/[Dark] Golden Eclipse.css -> config/waybar/style/Dark-Golden-Eclipse.css
renamed: config/waybar/style/[Dark] Golden Noir.css -> config/waybar/style/Dark-Golden-Noir.css
renamed: config/waybar/style/[Dark] Half-Moon.css -> config/waybar/style/Dark-Half-Moon.css
renamed: config/waybar/style/[Dark] Latte-Wallust combined v2.css -> config/waybar/style/Dark-Latte-Wallust-combined-v2.css
renamed: config/waybar/style/[Dark] Latte-Wallust combined.css -> config/waybar/style/Dark-Latte-Wallust-combined.css
renamed: config/waybar/style/[Dark] Purpl.css -> config/waybar/style/Dark-Purpl.css
renamed: config/waybar/style/[Dark] Wallust Obsidian Edge.css -> config/waybar/style/Dark-Wallust-Obsidian-Edge.css
renamed: config/waybar/style/[Extra] Arrow.css -> config/waybar/style/Extra-Arrow.css
renamed: config/waybar/style/[Extra] Crimson.css -> config/waybar/style/Extra-Crimson.css
renamed: config/waybar/style/[Extra] EverForest.css -> config/waybar/style/Extra-EverForest.css
renamed: config/waybar/style/[Extra] ML4W starter.css -> config/waybar/style/Extra-ML4W-starter.css
renamed: config/waybar/style/[Extra] Mauve.css -> config/waybar/style/Extra-Mauve.css
renamed: config/waybar/style/[Extra] Modern-Combined - Transparent.css -> config/waybar/style/Extra-Modern-Combined-Transparent.css
renamed: config/waybar/style/[Extra] Modern-Combined.css -> config/waybar/style/Extra-Modern-Combined.css
renamed: config/waybar/style/[Extra] Neon Circuit.css -> config/waybar/style/Extra-Neon-Circuit.css
renamed: config/waybar/style/[Extra] Prismatic Glow.css -> config/waybar/style/Extra-Prismatic-Glow.css
renamed: config/waybar/style/[Extra] Rose Pine.css -> config/waybar/style/Extra-Rose-Pine.css
renamed: config/waybar/style/[Extra] Simple Pink.css -> config/waybar/style/Extra-Simple-Pink.css
renamed: config/waybar/style/[Light] Monochrome Contrast.css -> config/waybar/style/Light-Monochrome-Contrast.css
renamed: config/waybar/style/[Light] Obsidian Glow.css -> config/waybar/style/Light-Obsidian-Glow.css
renamed: config/waybar/style/ML4W Glass-3d.css -> config/waybar/style/ML4W-Glass-3d.css
renamed: config/waybar/style/ML4W Glass.css -> config/waybar/style/ML4W-Glass.css
renamed: config/waybar/style/[Rainbow] RGB Bordered.css -> config/waybar/style/Rainbow-RGB-Bordered.css
renamed: config/waybar/style/[Retro] Simple Style.css -> config/waybar/style/Retro-Simple-Style.css
renamed: config/waybar/style/[Transparent] Crystal Clear.css -> config/waybar/style/Transparent-Crystal-Clear.css
renamed: config/waybar/style/[VERTICAL] [Catpuccin] Mocha.css -> config/waybar/style/VERTICAL-Catpuccin-Mocha.css
renamed: config/waybar/style/[Wallust Bordered] Chroma Fusion Edge.css -> config/waybar/style/Wallust-Bordered-Chroma-Fusion-Edge.css
renamed: config/waybar/style/[Wallust Bordered] Chroma Simple.css -> config/waybar/style/Wallust-Bordered-Chroma-Simple.css
renamed: config/waybar/style/[Wallust] Box type.css -> config/waybar/style/Wallust-Box-type.css
renamed: config/waybar/style/[Wallust] Chroma Edge.css -> config/waybar/style/Wallust-Chroma-Edge.css
renamed: config/waybar/style/[Wallust] Chroma Fusion.css -> config/waybar/style/Wallust-Chroma-Fusion.css
renamed: config/waybar/style/[Wallust] Chroma Tally V2.css -> config/waybar/style/Wallust-Chroma-Tally-V2.css
renamed: config/waybar/style/[Wallust] Chroma Tally.css -> config/waybar/style/Wallust-Chroma-Tally.css
renamed: config/waybar/style/[Wallust] Colored.css -> config/waybar/style/Wallust-Colored.css
renamed: config/waybar/style/[WALLUST] ML4W-modern-mixed.css -> config/waybar/style/Wallust-ML4W-modern-mixed.css
renamed: config/waybar/style/[WALLUST] ML4W-modern.css -> config/waybar/style/Wallust-ML4W-modern.css
renamed: config/waybar/style/[Wallust] Simple.css -> config/waybar/style/Wallust-Simple.css
renamed: config/waybar/style/[Wallust Transparent] Crystal Clear.css -> config/waybar/style/Wallust-Transparent-Crystal-Clear.css
modified: config/waybar/wallust/colors-waybar.css
modified: copy.sh
renamed: CODE_OF_CONDUCT.es.md -> i18n/CODE_OF_CONDUCT/CODE_OF_CONDUCT.es.md
new file: i18n/CODE_OF_CONDUCT/CODE_OF_CONDUCT.fr.md
renamed: COMMIT_MESSAGE_GUIDELINES.es.md -> i18n/COMMIT_MESSAGE_GUIDELINES/COMMIT_MESSAGE_GUIDELINES.es.md
new file: i18n/COMMIT_MESSAGE_GUIDELINES/COMMIT_MESSAGE_GUIDELINES.fr.md
renamed: CONTRIBUTING.es.md -> i18n/CONTRIBUTING/CONTRIBUTING.es.md
new file: i18n/CONTRIBUTING/CONTRIBUTING.fr.md
renamed: i18n/README.de.md -> i18n/README/README.de.md
new file: i18n/README/README.fr.md
renamed: i18n/README.jp.md -> i18n/README/README.jp.md
renamed: i18n/README.ro.md -> i18n/README/README.ro.md
renamed: i18n/README.ru.md -> i18n/README/README.ru.md
renamed: i18n/README.ua.md -> i18n/README/README.ua.md
modified: scripts/lib_apps.sh
modified: scripts/lib_copy.sh
modified: scripts/lib_prompts.sh
Diffstat (limited to 'config/hypr')
23 files changed, 1249 insertions, 164 deletions
diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index 460c9a2a..79fbc24e 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -4,3 +4,4 @@ # This file is used to add or overwrite window rules # This file will not be modified during dotfiles updates + diff --git a/config/hypr/UserScripts/RainbowBorders-low-cpu.sh b/config/hypr/UserScripts/RainbowBorders-low-cpu.sh new file mode 100755 index 00000000..bc0ab9ef --- /dev/null +++ b/config/hypr/UserScripts/RainbowBorders-low-cpu.sh @@ -0,0 +1,231 @@ +#!/usr/bin/env bash +# 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 <opt> 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/configs/ENVariables.conf b/config/hypr/configs/ENVariables.conf index e40773ac..585ae9f5 100644 --- a/config/hypr/configs/ENVariables.conf +++ b/config/hypr/configs/ENVariables.conf @@ -5,7 +5,7 @@ # environment-variables # Current Version of JakooLit Dotfiles: -env = DOTS_VERSION,2.3.20 +env = DOTS_VERSION,2.3.21 ### Toolkit Backend Variables ### env = GDK_BACKEND,wayland,x11,* diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 57cc7d8d..ba0201f1 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -35,6 +35,10 @@ bindd = $mainMod ALT, L, toggle master/dwindle layout, exec, $scriptsDir/ChangeL 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 diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index c0ca9c41..67680af4 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -24,6 +24,7 @@ exec-once = swaync #exec-once = ags #exec-once = blueman-applet #exec-once = rog-control-center +exec-once = $scriptsDir/PortalHyprlandUbuntu2604.sh exec-once = waybar exec-once = qs -c overview # Quickshell Overview exec-once = hypridle diff --git a/config/hypr/configs/WindowRules-config-v3.conf b/config/hypr/configs/WindowRules-config-v3.conf index a1fd0985..8212e9bf 100644 --- a/config/hypr/configs/WindowRules-config-v3.conf +++ b/config/hypr/configs/WindowRules-config-v3.conf @@ -17,8 +17,6 @@ # 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 @@ -26,9 +24,9 @@ windowrule = match:class ^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$, tag +brows 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)$, 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 @@ -42,7 +40,7 @@ windowrule = match:class ^(nwg-displays|nwg-look)$, tag +KooL-Settings windowrule = match:class ^(Alacritty|kitty|kitty-dropterm)$, tag +terminal # email tags -windowrule = match:class ^([Tt]hunderbird|org.gnome.Evolution)$, tag +email +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 @@ -58,7 +56,7 @@ 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 ^([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 @@ -66,6 +64,7 @@ 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:xdg_tag ^(proton-game)$, tag +games # gamestore tags windowrule = match:class ^([Ss]team)$, tag +gamestore @@ -107,55 +106,41 @@ windowrule = match:class ^(evince)$, tag +viewer windowrule = match:class ^(eog|org.gnome.Loupe)$, tag +viewer # Some special override rules -windowrule = match:tag multimedia_video, no_blur on -windowrule = match:tag multimedia_video, opacity 1.0 - -# POSITION -# windowrule = match:floating true, center on -windowrule = match:tag KooL_Cheat, center on -windowrule = match:class ([Tt]hunar) match:title negative:(.*[Tt]hunar.*), center on -windowrule = match:title ^(ROG Control)$, center on -windowrule = match:tag KooL-Settings, 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 ^([Ff]erdium)$, center on -windowrule = match:title ^(Picture-in-Picture)$, move 72% 7% - -# windowrule to avoid idle for fullscreen apps -windowrule = match:fullscreen true, idle_inhibit fullscreen +windowrule = match:tag multimedia, no_blur on +windowrule = match:tag multimedia, opacity 1.0 # FLOAT -windowrule = match:tag KooL_Cheat, float on -windowrule = match:tag wallpaper, float on -windowrule = match:tag settings, float on -windowrule = match:tag viewer, float on -windowrule = match:tag KooL-Settings, float on windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher), float on -windowrule = match:class (org.gnome.Calculator) match:title (Calculator), float on windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float on windowrule = match:class ^([Qq]alculate-gtk)$, float on -windowrule = match:class ^([Ff]erdium)$, float on -windowrule = match:title ^(Picture-in-Picture)$, float on -# windowrule - ######### float popups and dialogue ####### +# float popups and dialogue windowrule = match:title ^(Authentication Required)$, float on, center on -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:class ([Tt]hunar) match:title negative:(.*[Tt]hunar.*), float on - +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 + +# 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 -# YAD dialog for wallpaper confirmation -windowrule = match:class ^(yad)$ match:title ^(YAD)$, float on, center on, size (monitor_w*0.2) (monitor_h*0.2) -# END of float popups and dialogue ####### +# 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 .* # OPACITY windowrule = match:tag browser, opacity 0.99 0.8 @@ -164,28 +149,15 @@ 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)$, opacity 0.9 0.8 -# SIZE -windowrule = match:tag KooL_Cheat, size (monitor_w*0.65) (monitor_h*0.9) -windowrule = match:tag wallpaper, size (monitor_w*0.7) (monitor_h*0.7) -windowrule = match:tag settings, size (monitor_w*0.7) (monitor_h*0.7) -windowrule = match:class ^([Ff]erdium)$, size (monitor_w*0.6) (monitor_h*0.7) -windowrule = match:class (org.gnome.Calculator|qalculate-gtk), center on, size (monitor_w*0.25) (monitor_h*0.3) - - # BLUR & FULLSCREEN -windowrule = match:tag games, no_blur on, fullscreen 0 -windowrule = match:tag games, fullscreen 0 -# 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 +# 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 @@ -194,16 +166,9 @@ layerrule = match:namespace notifications, blur on layerrule = match:namespace quickshell:overview, blur on layerrule = match:namespace quickshell:overview, ignore_alpha 0.5 -# Named rules for special cases -windowrule { - name = Whatsapp-zapzap - match:class = ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ - size = (monitor_w*0.6) (monitor_h*0.7) - center = on -} windowrule { name = Picture-in-Picture - match:title = ^(Picture-in-Picture)$ + match:title = ^[Pp]icture-in-[Pp]icture$ float = on move = 72% 7% opacity = 0.95 0.75 @@ -211,13 +176,176 @@ windowrule { keep_aspect_ratio = on size = (monitor_w*0.3) (monitor_h*0.3) } -# Thunar copy progress dialog + +# 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 CachyOS Package Installer windowrule { - name = Thunar-Progress-bar - match:class = ^(thunar)$ - match:title = ^(File Operation Progress)$ + 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.26) (monitor_h*0.18) + 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.25) (monitor_h*0.3) +} + +# 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) +} diff --git a/config/hypr/configs/WindowRules.conf b/config/hypr/configs/WindowRules.conf index e94cc536..8212e9bf 100644 --- a/config/hypr/configs/WindowRules.conf +++ b/config/hypr/configs/WindowRules.conf @@ -17,8 +17,6 @@ # 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 @@ -26,7 +24,7 @@ windowrule = match:class ^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$, tag +brows 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 @@ -58,7 +56,7 @@ 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 ^([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 @@ -66,6 +64,7 @@ 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:xdg_tag ^(proton-game)$, tag +games # gamestore tags windowrule = match:class ^([Ss]team)$, tag +gamestore @@ -107,42 +106,19 @@ windowrule = match:class ^(evince)$, tag +viewer windowrule = match:class ^(eog|org.gnome.Loupe)$, tag +viewer # Some special override rules -windowrule = match:tag multimedia_video, no_blur on -windowrule = match:tag multimedia_video, opacity 1.0 windowrule = match:tag multimedia, no_blur on windowrule = match:tag multimedia, opacity 1.0 -# POSITION -windowrule = match:tag KooL_Cheat, center on -windowrule = match:tag KooL-Settings, center on -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 ^([Ff]erdium)$, center on - -# 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 ^(*)$ - # FLOAT -windowrule = match:tag KooL_Cheat, float on -windowrule = match:tag wallpaper, float on, center on -windowrule = match:tag settings, float on, center on -windowrule = match:tag viewer, float on, center on -windowrule = match:tag KooL-Settings, float on, center on windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher), float on -windowrule = match:class (org.gnome.Calculator|qalculate-gtk), float on windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float on windowrule = match:class ^([Qq]alculate-gtk)$, float on -windowrule = match:class ^([Ff]erdium)$, float on -# popups and dialogue +# float popups and dialogue windowrule = match:title ^(Authentication Required)$, float on, center on -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: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) @@ -150,6 +126,22 @@ windowrule = match:title ^(SDDM Background)$, float on, center on, size (monitor 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 + +# 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 + +# 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 .* + # OPACITY windowrule = match:tag browser, opacity 0.99 0.8 windowrule = match:tag projects, opacity 0.9 0.8 @@ -157,28 +149,15 @@ 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)$, opacity 0.9 0.8 -windowrule = match:title ^(Picture-in-Picture)$, opacity 0.95 0.75 - -# SIZE -windowrule = match:tag KooL_Cheat, size (monitor_w*0.65) (monitor_h*0.9) -windowrule = match:tag wallpaper, size (monitor_w*0.7) (monitor_h*0.7) -windowrule = match:tag settings, size (monitor_w*0.7) (monitor_h*0.7) -windowrule = match:class ^([Ff]erdium)$, size (monitor_w*0.6) (monitor_h*0.7) - # BLUR & FULLSCREEN -windowrule = match:tag games, no_blur on, fullscreen 0 -windowrule = match:tag games, fullscreen 0 -# 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 +# 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 @@ -187,16 +166,9 @@ layerrule = match:namespace notifications, blur on layerrule = match:namespace quickshell:overview, blur on layerrule = match:namespace quickshell:overview, ignore_alpha 0.5 -# Named rules for special cases -windowrule { - name = Whatsapp-zapzap - match:class = ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ - size = (monitor_w*0.6) (monitor_h*0.7) - center = on -} windowrule { name = Picture-in-Picture - match:title = ^(Picture-in-Picture)$ + match:title = ^[Pp]icture-in-[Pp]icture$ float = on move = 72% 7% opacity = 0.95 0.75 @@ -204,13 +176,176 @@ windowrule { keep_aspect_ratio = on size = (monitor_w*0.3) (monitor_h*0.3) } -# Thunar copy progress dialog + +# 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 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 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 = Thunar-Progress-bar - match:class = ^(thunar)$ - match:title = ^(File Operation Progress)$ + name = KooL Settings (tag) + match:tag = KooL-Settings float = on center = on - size = (monitor_w*0.26) (monitor_h*0.18) } +# 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.25) (monitor_h*0.3) +} + +# 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) +} diff --git a/config/hypr/monitors.conf b/config/hypr/monitors.conf index dc24fa5c..2f79d4fd 100644 --- a/config/hypr/monitors.conf +++ b/config/hypr/monitors.conf @@ -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/Kitty_themes.sh b/config/hypr/scripts/Kitty_themes.sh index 585bc7fc..8bc6e0f0 100755 --- a/config/hypr/scripts/Kitty_themes.sh +++ b/config/hypr/scripts/Kitty_themes.sh @@ -16,14 +16,20 @@ 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/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 +37,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 +79,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" "${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 +88,10 @@ 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" = "00-Default" ]; then + current_active_theme_name="Set by wallpaper" +fi if [ -n "$current_active_theme_name" ]; then for i in "${!available_theme_names[@]}"; do @@ -85,14 +103,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 +114,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 +141,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/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index 2e4004c5..5081fe72 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -202,6 +202,7 @@ 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 @@ -263,6 +264,7 @@ 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 ;; diff --git a/config/hypr/scripts/PortalHyprlandUbuntu2604.sh b/config/hypr/scripts/PortalHyprlandUbuntu2604.sh new file mode 100755 index 00000000..5cb3c01b --- /dev/null +++ b/config/hypr/scripts/PortalHyprlandUbuntu2604.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ ## +# Ubuntu 26.04 workaround: start portals manually before waybar. + +set -euo pipefail + +if [[ -r /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + if [[ "${ID:-}" == "ubuntu" && "${VERSION_ID:-}" == "26.04" ]]; 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 10901dbb..95248b35 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -22,6 +22,9 @@ for _prs in "${_ps[@]}"; do fi done +# Clean up any Waybar-spawned cava instances (unique temp conf names) +pkill -f 'waybar-cava\..*\.conf' 2>/dev/null || true + # added since wallust sometimes not applying killall -SIGUSR2 waybar # Added sleep for GameMode causing multiple waybar diff --git a/config/hypr/scripts/Tak0-Per-Window-Switch.sh b/config/hypr/scripts/Tak0-Per-Window-Switch.sh index 6cd0c564..3ba2c7af 100755 --- a/config/hypr/scripts/Tak0-Per-Window-Switch.sh +++ b/config/hypr/scripts/Tak0-Per-Window-Switch.sh @@ -1,5 +1,5 @@ ################################################################## -# # +# # # # # TAK_0'S Per-Window-Switch # # # @@ -7,13 +7,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/configs/SystemSettings.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")" @@ -21,13 +22,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' @@ -96,7 +100,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/Toggle-Active-Window-Audio.sh b/config/hypr/scripts/Toggle-Active-Window-Audio.sh new file mode 100755 index 00000000..4d9bcd33 --- /dev/null +++ b/config/hypr/scripts/Toggle-Active-Window-Audio.sh @@ -0,0 +1,147 @@ +#!/usr/bin/env bash +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..4007536c --- /dev/null +++ b/config/hypr/scripts/Toggle-weather-waybar-units.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# 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/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh index 4d1fdd25..1f0f50c7 100755 --- a/config/hypr/scripts/WallustSwww.sh +++ b/config/hypr/scripts/WallustSwww.sh @@ -114,6 +114,37 @@ wallust_targets=( ) wait_for_templates "$start_ts" "${wallust_targets[@]}" || true +# 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 diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh index 3305bb67..98db60dd 100755 --- a/config/hypr/scripts/WaybarCava.sh +++ b/config/hypr/scripts/WaybarCava.sh @@ -10,6 +10,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 +35,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" <<EOF @@ -52,4 +59,5 @@ ascii_max_range = 7 EOF # Stream cava output and translate digits 0..7 to bar glyphs -exec cava -p "$config_file" | sed -u "$dict" +# (no exec: keep this shell as the parent so the trap can reap children) +cava -p "$config_file" | sed -u "$dict" 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 Binary files differnew file mode 100755 index 00000000..9aad6ecf --- /dev/null +++ b/config/hypr/scripts/dots-tui-ubuntu-2404 diff --git a/config/hypr/scripts/hyprshot.sh b/config/hypr/scripts/hyprshot.sh new file mode 100755 index 00000000..0fb976fa --- /dev/null +++ b/config/hypr/scripts/hyprshot.sh @@ -0,0 +1,317 @@ +#!/usr/bin/env bash + +set -e + +function Help() { + cat <<EOF +Usage: hyprshot [options ..] [-m [mode] ..] -- [command] + +Hyprshot is an utility to easily take screenshot in Hyprland using your mouse. + +It allows taking screenshots of windows, regions and monitors which are saved to a folder of your choosing and copied to your clipboard. + +Examples: + capture a window \`hyprshot -m window\` + capture active window to clipboard \`hyprshot -m window -m active --clipboard-only\` + capture selected monitor \`hyprshot -m output -m DP-1\` + +Options: + -h, --help show help message + -m, --mode one of: output, window, region, active, OUTPUT_NAME + -o, --output-folder directory in which to save screenshot + -f, --filename the file name of the resulting screenshot + -D, --delay how long to delay taking the screenshot after selection (seconds) + -z, --freeze freeze the screen on initialization + -d, --debug print debug information + -s, --silent don't send notification when screenshot is saved + -r, --raw output raw image data to stdout + -t, --notif-timeout notification timeout in milliseconds (default 5000) + --clipboard-only copy screenshot to clipboard and don't save image in disk + -- [command] open screenshot with a command of your choosing. e.g. hyprshot -m window -- mirage + +Modes: + output take screenshot of an entire monitor + window take screenshot of an open window + region take screenshot of selected region + active take screenshot of active window|output + (you must use --mode again with the intended selection) + OUTPUT_NAME take screenshot of output with OUTPUT_NAME + (you must use --mode again with the intended selection) + (you can get this from \`hyprctl monitors\`) +EOF +} + +function Print() { + if [ $DEBUG -eq 0 ]; then + return 0 + fi + + 1>&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 <i>${1}</i> 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..3582a78e --- /dev/null +++ b/config/hypr/scripts/install-uv.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/config/hypr/v2.3.20 b/config/hypr/v2.3.21 index 51de9972..51de9972 100644 --- a/config/hypr/v2.3.20 +++ b/config/hypr/v2.3.21 diff --git a/config/hypr/wallpaper_effects/.wallpaper_current b/config/hypr/wallpaper_effects/.wallpaper_current Binary files differindex ceb42fa1..caa4bbfa 100644 --- a/config/hypr/wallpaper_effects/.wallpaper_current +++ b/config/hypr/wallpaper_effects/.wallpaper_current |
