diff options
Diffstat (limited to 'config/hypr')
102 files changed, 8739 insertions, 1915 deletions
diff --git a/config/hypr/.luarc.json b/config/hypr/.luarc.json new file mode 100644 index 00000000..e01b5803 --- /dev/null +++ b/config/hypr/.luarc.json @@ -0,0 +1,9 @@ +{ + "diagnostics.globals": [ + "hl" + ], + "workspace.checkThirdParty": false, + "workspace.library": [ + "${HOME}/.config/hypr" + ] +} diff --git a/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.conf b/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.conf new file mode 100644 index 00000000..11f7db56 --- /dev/null +++ b/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.conf @@ -0,0 +1,11 @@ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # +# default Monitor config + +# Monitor Configuration +# See Hyprland wiki for more details +# https://wiki.hyprland.org/Configuring/Monitors/ +# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + +monitor = HDMI-A-1, highrr,auto,1 + + diff --git a/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.lua b/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.lua new file mode 100644 index 00000000..dddb042a --- /dev/null +++ b/config/hypr/Monitor_Profiles/HDMI-A-1-HighRefreshRate.lua @@ -0,0 +1,15 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- HDMI-A-1 High Refresh Rate profile + +hl.monitor({ + output = "HDMI-A-1", + mode = "highrr", + position = "auto", + scale = "1", +}) diff --git a/config/hypr/Monitor_Profiles/README b/config/hypr/Monitor_Profiles/README index 86075d77..478f2601 100644 --- a/config/hypr/Monitor_Profiles/README +++ b/config/hypr/Monitor_Profiles/README @@ -3,11 +3,14 @@ # Create a unique file name i.e. Mirror, or Office, Scale, etc etc # tip: You can easily create a profile using nwg-displays -# after creating a profile using nwg-displays, copy the ~/.config/hypr/monitors.conf file to this directory with a unique file name +# after creating a profile using nwg-displays: +# - Hyprlang workflow: copy ~/.config/hypr/monitors.conf here as <name>.conf +# - Lua workflow: copy ~/.config/hypr/UserConfigs/monitors.lua here as <name>.lua # suggest not to call it default - -# Note, after selecting Profiles wanted via Rofi (SUPER SHIFT E), previous content of ~/.config/hypr/monitors.conf will be backed up and named as Previous_Profile.conf +# Note, after selecting Profiles wanted via Rofi (SUPER SHIFT E): +# - Hyprlang workflow writes ~/.config/hypr/monitors.conf +# - Lua workflow writes ~/.config/hypr/UserConfigs/monitors.lua # Monitor profile should be loaded automatically once selected by KooL Rofi Settings ROfi Menu, unless you disabled the auto-reload function on Hyprland settings. # However, if it does not load, kindly log out and re-login. This seem apparent if you are using a Virtual Environment. diff --git a/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.conf b/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.conf new file mode 100644 index 00000000..d06f1e62 --- /dev/null +++ b/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.conf @@ -0,0 +1,11 @@ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # +# default Monitor config + +# Monitor Configuration +# See Hyprland wiki for more details +# https://wiki.hyprland.org/Configuring/Monitors/ +# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + +# Monitors +monitor = Virtual-1, 1920x1080@60,auto,1 + diff --git a/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.lua b/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.lua new file mode 100644 index 00000000..2360d12e --- /dev/null +++ b/config/hypr/Monitor_Profiles/Virtual-1-1920x1080.lua @@ -0,0 +1,15 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Virtual-1 1920x1080 profile + +hl.monitor({ + output = "Virtual-1", + mode = "1920x1080@60", + position = "auto", + scale = "1", +}) diff --git a/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.conf b/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.conf new file mode 100644 index 00000000..1120e741 --- /dev/null +++ b/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.conf @@ -0,0 +1,11 @@ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # +# default Monitor config + +# Monitor Configuration +# See Hyprland wiki for more details +# https://wiki.hyprland.org/Configuring/Monitors/ +# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + +# Monitors +monitor = Virtual-1, 2560x1080@60,auto,1 + diff --git a/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.lua b/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.lua new file mode 100644 index 00000000..4fbdbb38 --- /dev/null +++ b/config/hypr/Monitor_Profiles/Virtual-1-2560x1080.lua @@ -0,0 +1,15 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Virtual-1 2560x1080 profile + +hl.monitor({ + output = "Virtual-1", + mode = "2560x1080@60", + position = "auto", + scale = "1", +}) diff --git a/config/hypr/Monitor_Profiles/default.lua b/config/hypr/Monitor_Profiles/default.lua new file mode 100644 index 00000000..5ae297c4 --- /dev/null +++ b/config/hypr/Monitor_Profiles/default.lua @@ -0,0 +1,32 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- default Monitor config +-- Monitor Configuration +-- See Hyprland wiki for more details +-- https://wiki.hyprland.org/Configuring/Monitors/ + +hl.monitor({ + output = "", + mode = "preferred", + position = "auto", + scale = "1", +}) + +hl.monitor({ + output = "", + mode = "highrr", + position = "auto", + scale = "1", +}) + +hl.monitor({ + output = "", + mode = "highres", + position = "auto", + scale = "1", +}) diff --git a/config/hypr/Monitor_Profiles/eDP-1-disable.conf b/config/hypr/Monitor_Profiles/eDP-1-disable.conf new file mode 100644 index 00000000..ac8a306f --- /dev/null +++ b/config/hypr/Monitor_Profiles/eDP-1-disable.conf @@ -0,0 +1,4 @@ +# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # +# Disable eDP-1 (laptop panel) + +monitor = eDP-1,disable diff --git a/config/hypr/Monitor_Profiles/eDP-1-disable.lua b/config/hypr/Monitor_Profiles/eDP-1-disable.lua new file mode 100644 index 00000000..c07673e2 --- /dev/null +++ b/config/hypr/Monitor_Profiles/eDP-1-disable.lua @@ -0,0 +1,13 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Disable eDP-1 (laptop panel) + +hl.monitor({ + output = "eDP-1", + disabled = true, +}) diff --git a/config/hypr/UserConfigs/01-UserDefaults.conf b/config/hypr/UserConfigs/01-UserDefaults.conf index dd5f299a..2dc537df 100644 --- a/config/hypr/UserConfigs/01-UserDefaults.conf +++ b/config/hypr/UserConfigs/01-UserDefaults.conf @@ -9,15 +9,18 @@ # Set your default editor here uncomment and reboot to take effect. # NOTE, this will be automatically uncommented if you select neovim or vim to your default editor -#env = EDITOR,vim #default editor +env = EDITOR,nvim #default editor # Define preferred text editor for the KooL Quick Settings Menu (SUPER SHIFT E) # script will take the default EDITOR and nano as fallback $edit=${EDITOR:-nano} +# Optional visual editor for Quick Settings (GUI or TTY command) +$visual=${VISUAL:-} # These two are for UserKeybinds.conf & Waybar Modules $term = kitty # Terminal $files = thunar # File Manager # Default Search Engine for ROFI Search (SUPER S) -$Search_Engine = "https://www.google.com/search?q={}"
\ No newline at end of file +$Search_Engine = "https://www.google.com/search?q={}" +env = VISUAL,nvim #default visual editor for quick settings (optional) diff --git a/config/hypr/UserConfigs/ENVariables.conf b/config/hypr/UserConfigs/ENVariables.conf index e2b3498a..c9c229ed 100644 --- a/config/hypr/UserConfigs/ENVariables.conf +++ b/config/hypr/UserConfigs/ENVariables.conf @@ -54,3 +54,5 @@ # env = AQ_MGPU_NO_EXPLICIT,1 # Disables explicit syncing on mgpu buffers # env = AQ_NO_MODIFIERS,1 # Disables modifiers for DRM buffers + + diff --git a/config/hypr/UserConfigs/LayerRules.conf b/config/hypr/UserConfigs/LayerRules.conf new file mode 100644 index 00000000..6ca3c180 --- /dev/null +++ b/config/hypr/UserConfigs/LayerRules.conf @@ -0,0 +1,14 @@ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# For layerrules +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# This file is used to add or overwrite layer rules +# This file will not be modified during dotfiles updates + +# Example: +# layerrule = blur on, ignore_alpha 0, match:namespace rofi diff --git a/config/hypr/UserConfigs/UserDecorations.conf b/config/hypr/UserConfigs/UserDecorations.conf index d962092f..e7e30651 100644 --- a/config/hypr/UserConfigs/UserDecorations.conf +++ b/config/hypr/UserConfigs/UserDecorations.conf @@ -14,9 +14,9 @@ source = $HOME/.config/hypr/wallust/wallust-hyprland.conf general { - border_size = 2 - gaps_in = 2 - gaps_out = 4 + border_size = 1 + gaps_in = 4 + gaps_out = 6 col.active_border = $color12 col.inactive_border = $color10 diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index cc19ff78..38407eec 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -1,15 +1,11 @@ -# ================================================== -# KoolDots (2026) -# Project URL: https://github.com/LinuxBeginnings -# License: GNU GPLv3 -# SPDX-License-Identifier: GPL-3.0-or-later -# ================================================== +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # # 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 @@ -33,10 +29,14 @@ $UserConfigs = $HOME/.config/hypr/UserConfigs # E.g. # bindd = $mainMod, Z, My z app, exec APPNAME +############## +# Rebinds # +############## - - +############## +# unbinds # +############## diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index b6d65135..7ec0fd08 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -4,15 +4,12 @@ # License: GNU GPLv3 # SPDX-License-Identifier: GPL-3.0-or-later # ================================================== -# For window rules and layerrules +# For window rules # 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 - +# Layer rules now belong in UserConfigs/LayerRules.conf diff --git a/config/hypr/UserConfigs/monitors.lua b/config/hypr/UserConfigs/monitors.lua new file mode 100644 index 00000000..544380ed --- /dev/null +++ b/config/hypr/UserConfigs/monitors.lua @@ -0,0 +1,18 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- User monitor overrides for Lua workflow. +-- MonitorProfiles.sh writes selected Lua monitor profiles into this file. +-- Keep custom hl.monitor(...) entries here so upgrades preserve them. + +-- Example: +-- hl.monitor({ +-- output = "eDP-1", +-- mode = "preferred", +-- position = "auto", +-- scale = "1", +-- }) diff --git a/config/hypr/UserConfigs/user_decorations.lua b/config/hypr/UserConfigs/user_decorations.lua new file mode 100644 index 00000000..6b34666e --- /dev/null +++ b/config/hypr/UserConfigs/user_decorations.lua @@ -0,0 +1,106 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- User decorations overrides (auto-generated). +-- This file is intentionally split from other user overrides. +-- Add only user-specific Lua overrides here. +-- Example: +-- hl.config({ general = { gaps_in = 4, gaps_out = 8 } }) + +-- Source reference from UserDecorations.conf (hyprlang): +-- source = $HOME/.config/hypr/wallust/wallust-hyprland.conf +-- general { +-- border_size = 2 +-- gaps_in = 2 +-- gaps_out = 4 +-- col.active_border = $color12 +-- col.inactive_border = $color10 +-- } +-- decoration { +-- rounding = 10 +-- active_opacity = 1.0 +-- inactive_opacity = 0.9 +-- fullscreen_opacity = 1.0 +-- dim_inactive = true +-- dim_strength = 0.1 +-- dim_special = 0.8 +-- shadow { +-- enabled = true +-- range = 3 +-- render_power = 1 +-- color = $color12 +-- color_inactive = $color10 +-- } +-- blur { +-- enabled = true +-- size = 6 +-- passes = 3 +-- new_optimizations = true +-- xray = true +-- ignore_opacity = true +-- special = true +-- popups = true +-- } +-- } +-- group { +-- col.border_active = $color15 +-- groupbar { +-- col.active = $color0 +-- } +-- } + +local function read_wallust_colors(path) + local colors = {} + local handle = io.open(path, "r") + if not handle then + return colors + end + for line in handle:lines() do + local key, hex = line:match("^%$([%w_]+)%s*=%s*rgb%(([0-9A-Fa-f]+)%)") + if key and hex then + colors[key] = "rgb(" .. hex .. ")" + end + end + handle:close() + return colors +end + +local wallust_path = (os.getenv("HOME") or "") .. "/.config/hypr/wallust/wallust-hyprland.conf" +local colors = read_wallust_colors(wallust_path) + +if next(colors) then + hl.config({ + general = { + col = { + active_border = colors.color12 or "rgba(8db4ffff)", + inactive_border = colors.color10 or "rgba(5f6578ff)", + }, + }, + }) + + hl.config({ + decoration = { + shadow = { + color = colors.color12 or "rgba(8db4ffff)", + color_inactive = colors.color10 or "rgba(5f6578ff)", + }, + }, + }) + + hl.config({ + group = { + col = { + border_active = colors.color15 or "rgba(ffffffff)", + }, + groupbar = { + col = { + active = colors.color0 or "rgba(0f111aff)", + }, + }, + }, + }) +end diff --git a/config/hypr/UserConfigs/user_keybinds.lua b/config/hypr/UserConfigs/user_keybinds.lua new file mode 100644 index 00000000..91872105 --- /dev/null +++ b/config/hypr/UserConfigs/user_keybinds.lua @@ -0,0 +1,40 @@ +-- User keybind overrides (auto-generated). +-- Add keybinds with bind("MODS", "KEY", fn, opts). +-- Example: +-- bind("SUPER", "Z", exec_cmd("ghostty"), { description = "Launch ghostty" }) +-- Helper functions live in ~/.config/hypr/lua/user_keybinds_helper.lua so they can be updated separately. +local user_keybinds_helper = nil +do + local source = (debug.getinfo(1, "S") or {}).source or "" + local source_path = source:match("^@(.+)$") + local source_dir = source_path and source_path:match("^(.*)/[^/]+$") or nil + local home = os.getenv("HOME") or "" + local candidate_paths = { + source_dir and (source_dir .. "/../lua/user_keybinds_helper.lua") or nil, + home ~= "" and (home .. "/.config/hypr/lua/user_keybinds_helper.lua") or nil, + home ~= "" and (home .. "/.config/hypr/user_keybinds_helper.lua") or nil, + } + + local tried_paths = {} + for _, helper_path in ipairs(candidate_paths) do + if helper_path then + table.insert(tried_paths, helper_path) + local f = io.open(helper_path, "r") + if f then + f:close() + local loaded_ok, loaded_helpers = pcall(dofile, helper_path) + if loaded_ok and type(loaded_helpers) == "table" and loaded_helpers.bind then + user_keybinds_helper = loaded_helpers + break + end + end + end + end + + if not user_keybinds_helper then + error("Failed to load user_keybinds_helper.lua from: " .. table.concat(tried_paths, ", ")) + end +end +local exec_cmd = user_keybinds_helper.exec_cmd +local bind = user_keybinds_helper.bind + diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index faec6335..5cee2a1e 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -13,13 +13,11 @@ # NOTE: this script uses bash (not POSIX shell) for the RANDOM variable wallust_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh +SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.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: @@ -41,12 +39,13 @@ while true; do done \ | sort -n | cut -d':' -f2- \ | while read -r img; do - $WWW img -o $focused_monitor "$img" + resize_mode="$(wallpaper_resize_mode "$img" "$focused_monitor")" + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$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 $wallust_refresh sleep $INTERVAL - + done done diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index e1c8fe83..297c77fa 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -12,13 +12,10 @@ terminal=kitty wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" wallpaper_output="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" 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" @@ -29,10 +26,10 @@ FPS=60 TYPE="wipe" DURATION=2 BEZIER=".43,1.19,1,.4" -if [[ "$WWW" == "swww" || "$WWW" == "awww" ]]; then - 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="" + SWWW_PARAMS=() fi # Define ImageMagick effects @@ -59,12 +56,15 @@ declare -A effects=( # Function to apply no effects no-effects() { - $WWW img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && - wait $! - wallust run "$wallpaper_current" -s && - wait $! + local resize_mode + resize_mode="$(wallpaper_resize_mode "$wallpaper_current" "$focused_monitor")" + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$wallpaper_current" "${SWWW_PARAMS[@]}" || return 1 + if ! "$SCRIPTSDIR/WallustSwww.sh" "$wallpaper_current"; then + notify-send -u critical -i "$iDIR/error.png" "Wallust failed" "Wallpaper theme not refreshed" + return 1 + fi # Refresh rofi, waybar, wallust palettes - sleep 2 + sleep 0.5 "$SCRIPTSDIR/Refresh.sh" notify-send -u low -i "$iDIR/ja.png" "No wallpaper" "effects applied" @@ -90,19 +90,21 @@ main() { # Apply selected effect notify-send -u normal -i "$iDIR/ja.png" "Applying:" "$choice effects" eval "${effects[$choice]}" - + # intial kill process for pid in swaybg mpvpaper; do killall -SIGUSR1 "$pid" done sleep 1 - $WWW img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & - - sleep 2 - - wallust run "$wallpaper_output" -s & - sleep 1 + local resize_mode + resize_mode="$(wallpaper_resize_mode "$wallpaper_output" "$focused_monitor")" + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$wallpaper_output" "${SWWW_PARAMS[@]}" + sleep 0.5 + if ! "$SCRIPTSDIR/WallustSwww.sh" "$wallpaper_output"; then + notify-send -u critical -i "$iDIR/error.png" "Wallust failed" "Wallpaper theme not refreshed" + return 1 + fi # Refresh rofi, waybar, wallust palettes "${SCRIPTSDIR}/Refresh.sh" notify-send -u low -i "$iDIR/ja.png" "$choice" "effects applied" diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 70f051f7..aae80426 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -25,20 +25,23 @@ TYPE="random" DURATION=1 BEZIER=".43,1.19,1,.4" if [[ "$WWW_CMD" == "swww" || "$WWW_CMD" == "awww" ]]; then - SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" + SWWW_PARAMS=(--transition-fps "$FPS" --transition-type "$TYPE" --transition-duration "$DURATION" --transition-bezier "$BEZIER") else - SWWW_PARAMS="" + SWWW_PARAMS=() fi if ! "$WWW_CMD" query >/dev/null 2>&1; then "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & fi - -"$WWW_CMD" img -o "$focused_monitor" "$RANDOMPICS" $SWWW_PARAMS +resize_mode="$(wallpaper_resize_mode "$RANDOMPICS" "$focused_monitor")" +"$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$RANDOMPICS" "${SWWW_PARAMS[@]}" wait $! -"$SCRIPTSDIR/WallustSwww.sh" "$RANDOMPICS" && +if ! "$SCRIPTSDIR/WallustSwww.sh" "$RANDOMPICS"; then + notify-send -u critical "Wallust failed" "Wallpaper theme not refreshed" + exit 1 +fi wait $! -sleep 2 +sleep 0.5 "$SCRIPTSDIR/Refresh.sh" diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 31c7969a..2e5ecd86 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -27,9 +27,9 @@ TYPE="any" DURATION=2 BEZIER=".43,1.19,1,.4" if [[ "$WWW_CMD" == "swww" || "$WWW_CMD" == "awww" ]]; then - SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" + SWWW_PARAMS=(--transition-fps "$FPS" --transition-type "$TYPE" --transition-duration "$DURATION" --transition-bezier "$BEZIER") else - SWWW_PARAMS="" + SWWW_PARAMS=() fi @@ -173,11 +173,13 @@ apply_image_wallpaper() { "$WWW_CMD" query >/dev/null 2>&1 && break sleep 0.1 done - "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS || { + local resize_mode + resize_mode="$(wallpaper_resize_mode "$image_path" "$focused_monitor")" + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$image_path" "${SWWW_PARAMS[@]}" || { sleep 0.2 - "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$image_path" "${SWWW_PARAMS[@]}" } - "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$image_path" "${SWWW_PARAMS[@]}" # Persist per-monitor wallpaper selection mkdir -p "$(dirname "$per_monitor_wallpaper_current")" "$(dirname "$per_monitor_wallpaper_link")" @@ -185,10 +187,13 @@ apply_image_wallpaper() { 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" - sleep 2 + if ! "$SCRIPTSDIR/WallustSwww.sh" "$image_path"; then + notify-send -i "$iDIR/error.png" "Wallust failed" "Wallpaper theme not refreshed" + return 1 + fi + sleep 0.5 "$SCRIPTSDIR/Refresh.sh" - sleep 1 + sleep 0.3 } diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh index a95bbd51..d2952d76 100755 --- a/config/hypr/UserScripts/WeatherWrap.sh +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -17,15 +17,15 @@ 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 } diff --git a/config/hypr/configs/ENVariables.conf b/config/hypr/configs/ENVariables.conf index 0226d053..b134b60d 100644 --- a/config/hypr/configs/ENVariables.conf +++ b/config/hypr/configs/ENVariables.conf @@ -10,7 +10,7 @@ # environment-variables # Current Version of KoolDots: -env = DOTS_VERSION,2.3.23 +env = DOTS_VERSION,2.3.24 ### Toolkit Backend Variables ### env = GDK_BACKEND,wayland,x11,* @@ -22,6 +22,8 @@ env = CLUTTER_BACKEND,wayland #env = SDL_VIDEODRIVER,wayland ### XDG Specifications ### +# Trying to fix flatpak not being seen in rofi this fix below errors +#env = XDG_DATA_DIRS,/usr/local/share:/usr/share:$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/home/$USER/.local/share/flatpak/exports/share env = XDG_CURRENT_DESKTOP,Hyprland env = XDG_SESSION_DESKTOP,Hyprland env = XDG_SESSION_TYPE,wayland diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index bbc93b25..82693694 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -18,172 +18,174 @@ source= $UserConfigs/01-UserDefaults.conf #### 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 -bindd = $mainMod, B, open default browser, exec, xdg-open "https://" -bindd = $mainMod, A, desktop overview, exec, $scriptsDir/OverviewToggle.sh # toggles quickshell or ags overview (tries QS first, falls back to AGS) -#bindd = $mainMod, A, ags overview, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed) +bindd = $mainMod, D, App launcher, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window +bindd = $mainMod, B, Open default browser, exec, xdg-open "https://" +bindd = $mainMod, A, Desktop overview, exec, $scriptsDir/OverviewToggle.sh # toggles quickshell or ags overview (tries QS first, falls back to AGS) +#bindd = $mainMod, A, Ags overview, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed) #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, 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 -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 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, 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 +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 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 CTRL, G, Ghostty theme selector, exec, $scriptsDir/Ghostty_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 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, $scriptsDir/Float-all-Windows.sh -bindd = $mainMod SHIFT, Return, DropDown terminal, exec, $scriptsDir/Dropterminal.sh $term +# NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. +bindd = $mainMod SHIFT, Return, DropDown terminal, exec, $scriptsDir/Dropterminal.sh kitty # 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_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}')" # Waybar / Bar related -bindd = $mainMod CTRL ALT, B, toggle waybar on/off, exec, pkill -SIGUSR1 waybar -bindd = $mainMod CTRL, B, waybar styles menu, exec, $scriptsDir/WaybarStyles.sh -bindd = $mainMod ALT, B, waybar layout menu, exec, $scriptsDir/WaybarLayout.sh +bindd = $mainMod CTRL ALT, B, Toggle waybar on/off, exec, pkill -SIGUSR1 waybar +bindd = $mainMod CTRL, B, Waybar styles menu, exec, $scriptsDir/WaybarStyles.sh +bindd = $mainMod ALT, B, Waybar layout menu, exec, $scriptsDir/WaybarLayout.sh # Night light toggle (Hyprsunset) -bindd = $mainMod, N, toggle night light, exec, $scriptsDir/Hyprsunset.sh toggle +bindd = $mainMod, N, Toggle Hyprsunset - night light, exec, $scriptsDir/Hyprsunset.sh toggle # FEATURES / EXTRAS (UserScripts) -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, 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 -bindlnd = ALT_L, SHIFT_L, switch keyboard layout globally, exec, $scriptsDir/KeyboardLayout.sh switch -bindlnd = SHIFT_L, ALT_L, switch keyboard layout per-window, exec, $scriptsDir/Tak0-Per-Window-Switch.sh -bindd = $mainMod ALT, C, calculator, exec, $UserScripts/RofiCalc.sh +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, 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 ZSH (oh-my-zsh) theme, exec, $UserScripts/ZshChangeTheme.sh +bindlnd = ALT_L, SHIFT_L, Switch keyboard layout globally, exec, $scriptsDir/KeyboardLayout.sh switch +bindlnd = SHIFT_L, ALT_L, Switch keyboard layout per-window, exec, $scriptsDir/Tak0-Per-Window-Switch.sh +bindd = $mainMod ALT, C, Calculator, exec, $UserScripts/RofiCalc.sh # Move current workspaces to monitors (left right up or down) -bindd = $mainMod CTRL, F9, move workspace to left monitor, movecurrentworkspacetomonitor, l -bindd = $mainMod CTRL, F10, move workspace to right monitor, movecurrentworkspacetomonitor, r -bindd = $mainMod CTRL, F11, move workspace to up monitor, movecurrentworkspacetomonitor, u -bindd = $mainMod CTRL, F12, move workspace to down monitor, movecurrentworkspacetomonitor, d +bindd = $mainMod CTRL, F9, Move workspace to left monitor, movecurrentworkspacetomonitor, l +bindd = $mainMod CTRL, F10, Move workspace to right monitor, movecurrentworkspacetomonitor, r +bindd = $mainMod CTRL, F11, Move workspace to up monitor, movecurrentworkspacetomonitor, u +bindd = $mainMod CTRL, F12, Move workspace to down monitor, movecurrentworkspacetomonitor, d #### SYSTEM #### -bindd = CTRL ALT, Delete, exit Hyprland, exec, hyprctl dispatch exit 0 -bindd = $mainMod, Q, close active window, killactive, +bindd = CTRL ALT,Delete, Exit Hyprland, exec, $scriptsDir/Logout.sh +bindd = $mainMod, Q, Close active window, killactive, bindd = $mainMod SHIFT, Q, Terminate active process, exec, $scriptsDir/KillActiveProcess.sh -bindd = CTRL ALT, L, lock screen, exec, $scriptsDir/LockScreen.sh -bindd = CTRL ALT, P, powermenu, exec, $scriptsDir/Wlogout.sh -bindd = $mainMod SHIFT, N, notification panel, exec, swaync-client -t -sw +bindd = CTRL ALT, L, Lock screen, exec, $scriptsDir/LockScreen.sh +bindd = CTRL ALT, P, Powermenu, exec, $scriptsDir/Wlogout.sh +bindd = $mainMod SHIFT, N, Notification panel, exec, swaync-client -t -sw bindd = $mainMod SHIFT, E, Quick settings menu, exec, $scriptsDir/Kool_Quick_Settings.sh # Master Layout -bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster -bindd = $mainMod, I, add master, layoutmsg, addmaster +bindd = $mainMod CTRL, D, Remove master, layoutmsg, removemaster +bindd = $mainMod, I, Add master, layoutmsg, addmaster # 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 +bindd = $mainMod, j, Cycle next, cyclenext +bindd = $mainMod, k, Cycle previous, cyclenext, prev +bindd = $mainMod CTRL, Return, Swap with master, layoutmsg, swapwithmaster # Dwindle Layout -bindd = $mainMod SHIFT, I, toggle split (dwindle), layoutmsg, togglesplit -bindd = $mainMod, P, toggle pseudo (dwindle), pseudo, +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 +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 +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 +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' +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 -bindd = ALT, tab, bring active to top, bringactivetotop +bindd = ALT, Tab, Cycle next window, cyclenext +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 -bindld = , xf86Rfkill, airplane mode, exec, $scriptsDir/AirplaneMode.sh +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 +bindld = , xf86Rfkill, Airplane mode, exec, $scriptsDir/AirplaneMode.sh # media controls using keyboards -bindld = , xf86AudioPlayPause, play/pause, exec, $scriptsDir/MediaCtrl.sh --pause -bindld = , xf86AudioPause, pause, exec, $scriptsDir/MediaCtrl.sh --pause -bindld = , xf86AudioPlay, play, exec, $scriptsDir/MediaCtrl.sh --pause -bindld = , xf86AudioNext, next track, exec, $scriptsDir/MediaCtrl.sh --nxt -bindld = , xf86AudioPrev, previous track, exec, $scriptsDir/MediaCtrl.sh --prv -bindld = , xf86audiostop, stop, exec, $scriptsDir/MediaCtrl.sh --stop +bindld = , xf86AudioPlayPause, Play/pause, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioPause, Pause, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioPlay, Play, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioNext, Next track, exec, $scriptsDir/MediaCtrl.sh --nxt +bindld = , xf86AudioPrev, Previous track, exec, $scriptsDir/MediaCtrl.sh --prv +bindld = , xf86audiostop, Stop, exec, $scriptsDir/MediaCtrl.sh --stop # Screenshot keybindings NOTE: You may need to press Fn key as well -bindd = $mainMod, Print, screenshot now, exec, $scriptsDir/ScreenShot.sh --now -bindd = $mainMod SHIFT, Print, screenshot (area), exec, $scriptsDir/ScreenShot.sh --area -bindd = $mainMod CTRL, Print, screenshot in 5s, exec, $scriptsDir/ScreenShot.sh --in5 -bindd = $mainMod CTRL SHIFT, Print, screenshot in 10s, exec, $scriptsDir/ScreenShot.sh --in10 -bindd = ALT, Print, screenshot active window, exec, $scriptsDir/ScreenShot.sh --active +bindd = $mainMod, Print, Screenshot now, exec, $scriptsDir/ScreenShot.sh --now +bindd = $mainMod SHIFT, Print, Screenshot (area), exec, $scriptsDir/ScreenShot.sh --area +bindd = $mainMod CTRL, Print, Screenshot in 5s, exec, $scriptsDir/ScreenShot.sh --in5 +bindd = $mainMod CTRL SHIFT, Print, Screenshot in 10s, exec, $scriptsDir/ScreenShot.sh --in10 +bindd = ALT, Print, Screenshot active window, exec, $scriptsDir/ScreenShot.sh --active # screenshot with swappy (another screenshot tool) -bindd = $mainMod SHIFT, S, screenshot (swappy), exec, $scriptsDir/ScreenShot.sh --swappy +bindd = $mainMod SHIFT, S, Screenshot (swappy), exec, $scriptsDir/ScreenShot.sh --swappy # Resize windows -binded = $mainMod SHIFT, left, resize left (-50), resizeactive, -50 0 -binded = $mainMod SHIFT, right, resize right (+50), resizeactive, 50 0 -binded = $mainMod SHIFT, up, resize up (-50), resizeactive, 0 -50 -binded = $mainMod SHIFT, down, resize down (+50), resizeactive, 0 50 +binded = $mainMod SHIFT, left, Resize left (-50), resizeactive, -50 0 +binded = $mainMod SHIFT, right, Resize right (+50), resizeactive, 50 0 +binded = $mainMod SHIFT, up, Resize up (-50), resizeactive, 0 -50 +binded = $mainMod SHIFT, down, Resize down (+50), resizeactive, 0 50 # Move windows -bindd = $mainMod CTRL, left, move window left, movewindow, l -bindd = $mainMod CTRL, right, move window right, movewindow, r -bindd = $mainMod CTRL, up, move window up, movewindow, u -bindd = $mainMod CTRL, down, move window down, movewindow, d +bindd = $mainMod CTRL, left, Move window left, movewindow, l +bindd = $mainMod CTRL, right, Move window right, movewindow, r +bindd = $mainMod CTRL, up, Move window up, movewindow, u +bindd = $mainMod CTRL, down, Move window down, movewindow, d # Swap windows -bindd = $mainMod ALT, left, swap window left, swapwindow, l -bindd = $mainMod ALT, right, swap window right, swapwindow, r -bindd = $mainMod ALT, up, swap window up, swapwindow, u -bindd = $mainMod ALT, down, swap window down, swapwindow, d +bindd = $mainMod ALT, left, Swap window left, swapwindow, l +bindd = $mainMod ALT, right, Swap window right, swapwindow, r +bindd = $mainMod ALT, up, Swap window up, swapwindow, u +bindd = $mainMod ALT, down, Swap window down, swapwindow, d # group -bindd = $mainMod, G, toggle group, togglegroup +bindd = $mainMod, G, Toggle group, togglegroup # Navigate within a group bindd = $mainMod, Tab, Change Group Forward, changegroupactive, f -bindd = $mainMod CTRL, tab, change active in group, changegroupactive +bindd = $mainMod CTRL, tab, Change active in group, changegroupactive bindd = $mainMod SHIFT, Tab, Change Group Back, changegroupactive, b # Move window into/out of group @@ -193,71 +195,71 @@ bindd = $mainMod CTRL, H, Move active out of group, moveoutofgroup # Move active # 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' +#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' # Move focus with mainMod + arrow keys -bindd = $mainMod, left, focus left, movefocus, l -bindd = $mainMod, right, focus right, movefocus, r -bindd = $mainMod, up, focus up, movefocus, u -bindd = $mainMod, down, focus down, movefocus, d +bindd = $mainMod, left, Focus left, movefocus, l +bindd = $mainMod, right, Focus right, movefocus, r +bindd = $mainMod, up, Focus up, movefocus, u +bindd = $mainMod, down, Focus down, movefocus, d # Workspaces related -bindd = $mainMod, tab, next workspace, workspace, m+1 -bindd = $mainMod SHIFT, tab, previous workspace, workspace, m-1 +bindd = $mainMod, tab, Next workspace, workspace, m+1 +bindd = $mainMod SHIFT, tab, Previous workspace, workspace, m-1 # Special workspace -bindd = $mainMod SHIFT, U, move to special workspace, movetoworkspace, special -bindd = $mainMod, U, toggle special workspace, togglespecialworkspace, +bindd = $mainMod SHIFT, U, Move to special workspace, movetoworkspace, special +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] -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 -bindd = $mainMod, code:13, workspace 4, workspace, 4 # NOTE: code:13 = key 4 -bindd = $mainMod, code:14, workspace 5, workspace, 5 # NOTE: code:14 = key 5 -bindd = $mainMod, code:15, workspace 6, workspace, 6 # NOTE: code:15 = key 6 -bindd = $mainMod, code:16, workspace 7, workspace, 7 # NOTE: code:16 = key 7 -bindd = $mainMod, code:17, workspace 8, workspace, 8 # NOTE: code:17 = key 8 -bindd = $mainMod, code:18, workspace 9, workspace, 9 # NOTE: code:18 = key 9 -bindd = $mainMod, code:19, workspace 10, workspace, 10 # NOTE: code:19 = key 0 +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 +bindd = $mainMod, code:13, Workspace 4, workspace, 4 # NOTE: code:13 = key 4 +bindd = $mainMod, code:14, Workspace 5, workspace, 5 # NOTE: code:14 = key 5 +bindd = $mainMod, code:15, Workspace 6, workspace, 6 # NOTE: code:15 = key 6 +bindd = $mainMod, code:16, Workspace 7, workspace, 7 # NOTE: code:16 = key 7 +bindd = $mainMod, code:17, Workspace 8, workspace, 8 # NOTE: code:17 = key 8 +bindd = $mainMod, code:18, Workspace 9, workspace, 9 # NOTE: code:18 = key 9 +bindd = $mainMod, code:19, Workspace 10, workspace, 10 # NOTE: code:19 = key 0 # Move active window and follow to workspace mainMod + SHIFT [0-9] -bindd = $mainMod SHIFT, code:10, move to workspace 1, movetoworkspace, 1 # NOTE: code:10 = key 1 -bindd = $mainMod SHIFT, code:11, move to workspace 2, movetoworkspace, 2 # NOTE: code:11 = key 2 -bindd = $mainMod SHIFT, code:12, move to workspace 3, movetoworkspace, 3 # NOTE: code:12 = key 3 -bindd = $mainMod SHIFT, code:13, move to workspace 4, movetoworkspace, 4 # NOTE: code:13 = key 4 -bindd = $mainMod SHIFT, code:14, move to workspace 5, movetoworkspace, 5 # NOTE: code:14 = key 5 -bindd = $mainMod SHIFT, code:15, move to workspace 6, movetoworkspace, 6 # NOTE: code:15 = key 6 -bindd = $mainMod SHIFT, code:16, move to workspace 7, movetoworkspace, 7 # NOTE: code:16 = key 7 -bindd = $mainMod SHIFT, code:17, move to workspace 8, movetoworkspace, 8 # NOTE: code:17 = key 8 -bindd = $mainMod SHIFT, code:18, move to workspace 9, movetoworkspace, 9 # NOTE: code:18 = key 9 -bindd = $mainMod SHIFT, code:19, move to workspace 10, movetoworkspace, 10 # NOTE: code:19 = key 0 -bindd = $mainMod SHIFT, bracketleft, move to previous workspace, movetoworkspace, -1 # brackets [ -bindd = $mainMod SHIFT, bracketright, move to next workspace, movetoworkspace, +1 # brackets ] +bindd = $mainMod SHIFT, code:10, Move to workspace 1, movetoworkspace, 1 # NOTE: code:10 = key 1 +bindd = $mainMod SHIFT, code:11, Move to workspace 2, movetoworkspace, 2 # NOTE: code:11 = key 2 +bindd = $mainMod SHIFT, code:12, Move to workspace 3, movetoworkspace, 3 # NOTE: code:12 = key 3 +bindd = $mainMod SHIFT, code:13, Move to workspace 4, movetoworkspace, 4 # NOTE: code:13 = key 4 +bindd = $mainMod SHIFT, code:14, Move to workspace 5, movetoworkspace, 5 # NOTE: code:14 = key 5 +bindd = $mainMod SHIFT, code:15, Move to workspace 6, movetoworkspace, 6 # NOTE: code:15 = key 6 +bindd = $mainMod SHIFT, code:16, Move to workspace 7, movetoworkspace, 7 # NOTE: code:16 = key 7 +bindd = $mainMod SHIFT, code:17, Move to workspace 8, movetoworkspace, 8 # NOTE: code:17 = key 8 +bindd = $mainMod SHIFT, code:18, Move to workspace 9, movetoworkspace, 9 # NOTE: code:18 = key 9 +bindd = $mainMod SHIFT, code:19, Move to workspace 10, movetoworkspace, 10 # NOTE: code:19 = key 0 +bindd = $mainMod SHIFT, bracketleft, Move to previous workspace, movetoworkspace, -1 # brackets [ +bindd = $mainMod SHIFT, bracketright, Move to next workspace, movetoworkspace, +1 # brackets ] # Move active window to a workspace silently mainMod + CTRL [0-9] -bindd = $mainMod CTRL, code:10, move silently to workspace 1, movetoworkspacesilent, 1 # NOTE: code:10 = key 1 -bindd = $mainMod CTRL, code:11, move silently to workspace 2, movetoworkspacesilent, 2 # NOTE: code:11 = key 2 -bindd = $mainMod CTRL, code:12, move silently to workspace 3, movetoworkspacesilent, 3 # NOTE: code:12 = key 3 -bindd = $mainMod CTRL, code:13, move silently to workspace 4, movetoworkspacesilent, 4 # NOTE: code:13 = key 4 -bindd = $mainMod CTRL, code:14, move silently to workspace 5, movetoworkspacesilent, 5 # NOTE: code:14 = key 5 -bindd = $mainMod CTRL, code:15, move silently to workspace 6, movetoworkspacesilent, 6 # NOTE: code:15 = key 6 -bindd = $mainMod CTRL, code:16, move silently to workspace 7, movetoworkspacesilent, 7 # NOTE: code:16 = key 7 -bindd = $mainMod CTRL, code:17, move silently to workspace 8, movetoworkspacesilent, 8 # NOTE: code:17 = key 8 -bindd = $mainMod CTRL, code:18, move silently to workspace 9, movetoworkspacesilent, 9 # NOTE: code:18 = key 9 -bindd = $mainMod CTRL, code:19, move silently to workspace 10, movetoworkspacesilent, 10 # NOTE: code:19 = key 0 -bindd = $mainMod CTRL, bracketleft, move silently to previous workspace, movetoworkspacesilent, -1 # brackets [ -bindd = $mainMod CTRL, bracketright, move silently to next workspace, movetoworkspacesilent, +1 # brackets ] +bindd = $mainMod CTRL, code:10, Move silently to workspace 1, movetoworkspacesilent, 1 # NOTE: code:10 = key 1 +bindd = $mainMod CTRL, code:11, Move silently to workspace 2, movetoworkspacesilent, 2 # NOTE: code:11 = key 2 +bindd = $mainMod CTRL, code:12, Move silently to workspace 3, movetoworkspacesilent, 3 # NOTE: code:12 = key 3 +bindd = $mainMod CTRL, code:13, Move silently to workspace 4, movetoworkspacesilent, 4 # NOTE: code:13 = key 4 +bindd = $mainMod CTRL, code:14, Move silently to workspace 5, movetoworkspacesilent, 5 # NOTE: code:14 = key 5 +bindd = $mainMod CTRL, code:15, Move silently to workspace 6, movetoworkspacesilent, 6 # NOTE: code:15 = key 6 +bindd = $mainMod CTRL, code:16, Move silently to workspace 7, movetoworkspacesilent, 7 # NOTE: code:16 = key 7 +bindd = $mainMod CTRL, code:17, Move silently to workspace 8, movetoworkspacesilent, 8 # NOTE: code:17 = key 8 +bindd = $mainMod CTRL, code:18, Move silently to workspace 9, movetoworkspacesilent, 9 # NOTE: code:18 = key 9 +bindd = $mainMod CTRL, code:19, Move silently to workspace 10, movetoworkspacesilent, 10 # NOTE: code:19 = key 0 +bindd = $mainMod CTRL, bracketleft, Move silently to previous workspace, movetoworkspacesilent, -1 # brackets [ +bindd = $mainMod CTRL, bracketright, Move silently to next workspace, movetoworkspacesilent, +1 # brackets ] # Scroll through existing workspaces with mainMod + scroll -bindd = $mainMod, mouse_down, next workspace, workspace, e+1 -bindd = $mainMod, mouse_up, previous workspace, workspace, e-1 -bindd = $mainMod, period, next workspace, workspace, e+1 -bindd = $mainMod, comma, previous workspace, workspace, e-1 +bindd = $mainMod, mouse_down, Next workspace, workspace, e+1 +bindd = $mainMod, mouse_up, Previous workspace, workspace, e-1 +bindd = $mainMod, period, Next workspace, workspace, e+1 +bindd = $mainMod, comma, Previous workspace, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging -bindmd = $mainMod, mouse:272, move window, movewindow # NOTE: mouse:272 = left click -bindmd = $mainMod, mouse:273, resize window, resizewindow # NOTE: mouse:272 = right click +bindmd = $mainMod, mouse:272, Move window, movewindow # NOTE: mouse:272 = left click +bindmd = $mainMod, mouse:273, Resize window, resizewindow # NOTE: mouse:272 = right click diff --git a/config/hypr/configs/LayerRules.conf b/config/hypr/configs/LayerRules.conf new file mode 100644 index 00000000..a5b1ea0f --- /dev/null +++ b/config/hypr/configs/LayerRules.conf @@ -0,0 +1,26 @@ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Vendor defaults for layerrules +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# LAYER RULES +layerrule = match:namespace rofi, blur on, ignore_alpha 0, animation slide +layerrule = match:namespace notifications, blur on, ignore_alpha 0, animation slide +layerrule = match:namespace quickshell:overview, blur on, ignore_alpha 0.5 +layerrule = match:namespace wallpaper, blur on, ignore_alpha 0 + +# swaync + helper overlays +layerrule = match:namespace swaync-control-center, blur on, ignore_alpha 0 +layerrule = match:namespace swaync-notification-window, blur on, ignore_alpha 0 +layerrule = match:namespace com.aurora.keybinds_help, blur on, ignore_alpha 0 +layerrule = match:namespace logout_dialog, blur on, ignore_alpha 0 + +# Optional Layer rules +# To Resolve blurred corners in rofi Add to User config +# SUPER SHIFT + E Edit User Layer Rules +#layerrule = blur on, ignore_alpha 0, match:namespace rofi +#layerrule = blur on, match:namespace waybar diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index a27a12b9..bf8b3b4b 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -13,7 +13,7 @@ $livewallpaper="" $wallDIR = $HOME/Pictures/wallpapers # change path manually here if needed ### wallpaper stuff ### -exec-once = $scriptsDir/WallpaperDaemon.sh +exec-once = sh -c 'sleep 2; $HOME/.config/hypr/scripts/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 @@ -21,19 +21,21 @@ exec-once = $scriptsDir/WallpaperDaemon.sh ### 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 = $HOME/.config/hypr/scripts/Dropterminal.sh "kitty --class kitty-dropterm" & exec-once = $scriptsDir/Polkit.sh -exec-once = nm-applet --indicator +exec-once = nm-applet 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 = $scriptsDir/PortalHyprland.sh +exec-once = sh $scriptsDir/WaybarStartup.sh exec-once = qs -c overview # Quickshell Overview exec-once = hypridle +exec-once = $scriptsDir/LuaAutoReload.sh exec-once = $scriptsDir/Hyprsunset.sh init +# NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. +exec-once = $scriptsDir/Dropterminal.sh --startup kitty # Clipboard manager exec-once = wl-paste --type text --watch cliphist store @@ -52,3 +54,5 @@ exec-once = wl-paste --type image --watch cliphist store # xdg-desktop-portal-hyprland (should be auto starting. However, you can force to start) #exec-once = $scriptsDir/PortalHyprland.sh +exec-once = blueman-applet +exec-once = $scriptsDir/KeybindsLayoutInit.sh diff --git a/config/hypr/configs/Startup_Apps.disable b/config/hypr/configs/Startup_Apps.disable new file mode 100644 index 00000000..3b2a5bd4 --- /dev/null +++ b/config/hypr/configs/Startup_Apps.disable @@ -0,0 +1 @@ +$scriptsDir/Polkit.sh diff --git a/config/hypr/configs/SystemSettings.conf b/config/hypr/configs/SystemSettings.conf index 6621ffe2..8e64a78a 100644 --- a/config/hypr/configs/SystemSettings.conf +++ b/config/hypr/configs/SystemSettings.conf @@ -5,7 +5,7 @@ # 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 +# This is where you put your own settings as this will not be touched during update # if the upgrade.sh is used. # refer to Hyprland wiki for more info https://wiki.hyprland.org/Configuring/Variables/ @@ -14,9 +14,10 @@ $scriptsDir = $HOME/.config/hypr/scripts dwindle { - preserve_split = true - smart_resizing = true - use_active_for_splits = true + #pseudotile = false # Not supported 0.55+ + preserve_split = true + smart_resizing = true + use_active_for_splits = true smart_split = false default_split_ratio = 1.0 split_bias = 0 @@ -73,18 +74,18 @@ input { touchpad { disable_while_typing = true - natural_scroll = true + natural_scroll = true clickfinger_behavior = false middle_button_emulation = false tap-to-click = true drag_lock = false } - + # below for devices with touchdevice ie. touchscreen touchdevice { enabled = true } - + # below is for table see link above for proper variables tablet { transform = 0 @@ -106,15 +107,18 @@ gestures { 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 = 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 - vrr = 2 + force_default_wallpaper = false + # vfr = true # Not supported past v0.54.3 + vrr = 0 # Disabling by default causes MPV to black screen when maximixes + #vrr = 0,disabled, 1, alweays on, 2, only on when fullscreen mouse_move_enables_dpms = true enable_swallow = off swallow_regex = ^(kitty)$ @@ -156,12 +160,12 @@ cursor { no_hardware_cursors = 2 # change to 1 if want to disable enable_hyprcursor = true warp_on_change_workspace = 2 - no_warps = true + no_warps = true no_break_fs_vrr = false min_refresh_rate = 24 hotspot_padding = 1 inactive_timeout = 0 - default_monitor = + default_monitor = zoom_factor = 1.0 zoom_rigid = false zoom_detached_camera = true diff --git a/config/hypr/configs/WindowRules-config-v3.conf b/config/hypr/configs/WindowRules-config-v3.conf deleted file mode 100644 index aab7d005..00000000 --- a/config/hypr/configs/WindowRules-config-v3.conf +++ /dev/null @@ -1,470 +0,0 @@ -# ================================================== -# 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.53 - -# 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)$, 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 = 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 - -# terminal tags -windowrule = match:class ^(ghostty|wezterm|Alacritty|kitty|kitty-dropterm)$, tag +terminal - -# 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-.+)$, 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|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 = 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 -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)?)$, 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 = 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 = match:tag multimedia, no_blur on -windowrule = match:tag multimedia, opacity 1.0 - -# FLOAT -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 - -# 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 - -# 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 -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 - -# 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 = 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) -} - - diff --git a/config/hypr/configs/WindowRules-pre-53.conf b/config/hypr/configs/WindowRules-pre-53.conf deleted file mode 100644 index fc74f600..00000000 --- a/config/hypr/configs/WindowRules-pre-53.conf +++ /dev/null @@ -1,234 +0,0 @@ -# ================================================== -# 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, <rofi> - -#layerrule = ignorezero, overview -#layerrule = blur, overview diff --git a/config/hypr/configs/WindowRules.conf b/config/hypr/configs/WindowRules.conf index 7082d64c..8aa9186c 100644 --- a/config/hypr/configs/WindowRules.conf +++ b/config/hypr/configs/WindowRules.conf @@ -4,12 +4,12 @@ # License: GNU GPLv3 # SPDX-License-Identifier: GPL-3.0-or-later # ================================================== -# Vendor defaults for window rules and layerrules +# Vendor defaults for window rules # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # NOTES: This is only for Hyprland >= 0.53 -# Some samples on hwo to start apps on specific workspaces +# 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 @@ -24,165 +24,241 @@ # TAGS - add apps under appropriate tag to use the same settings # browser tags +# name: tag-browser-firefox windowrule = match:class ^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$, tag +browser +# name: tag-browser-google-chrome windowrule = match:class ^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$, tag +browser +# name: tag-browser-chrome-default-profile windowrule = match:class ^(chrome-.+-Default)$, tag +browser +# name: tag-browser-chromium windowrule = match:class ^([Cc]hromium)$, tag +browser +# name: tag-browser-microsoft-edge windowrule = match:class ^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$, tag +browser +# name: tag-browser-brave windowrule = match:class ^([Bb]rave-browser(-beta|-dev|-unstable)?)$, tag +browser +# name: tag-browser-thorium-cachy windowrule = match:class ^([Tt]horium-browser|[Cc]achy-browser)$, tag +browser +# name: tag-browser-zen windowrule = match:class ^(zen-alpha|zen)$, tag +browser # notif tags +# name: tag-notifications-swaync windowrule = match:class ^(swaync-control-center|swaync-notification-window|swaync-client|class)$, tag +notif # KooL settings tag +# name: tag-kool-cheat-sheet windowrule = match:title ^(KooL Quick Cheat Sheet)$, tag +KooL_Cheat +# name: tag-kool-hyprland-settings windowrule = match:title ^(KooL Hyprland Settings)$, tag +KooL_Settings +# name: tag-kool-settings-nwg-tools windowrule = match:class ^(nwg-displays|nwg-look)$, tag +KooL-Settings # terminal tags +# name: tag-terminal-emulators windowrule = match:class ^(ghostty|wezterm|Alacritty|kitty|kitty-dropterm)$, tag +terminal # email tags +# name: tag-email-thunderbird windowrule = match:class ^([Tt]hunderbird|org.mozilla.Thunderbird)$, tag +email +# name: tag-email-betterbird windowrule = match:class ^(eu.betterbird.Betterbird)$, tag +email +# name: tag-email-evolution windowrule = match:class ^(org.gnome.Evolution)$, tag +email # project tags +# name: tag-projects-vscodium windowrule = match:class ^(codium|codium-url-handler|VSCodium)$, tag +projects +# name: tag-projects-vscode windowrule = match:class ^(VSCode|code|code-url-handler)$, tag +projects +# name: tag-projects-jetbrains windowrule = match:class ^(jetbrains-.+)$, tag +projects +# name: tag-projects-zed windowrule = match:class ^(dev.zed.Zed|antigravity)$, tag +projects # screenshare tags +# name: tag-screenshare-obs windowrule = match:class ^(com.obsproject.Studio)$, tag +screenshare +windowrule = match:class ^(com.obsproject.Studio)$, workspace 10 silent # IM tags +# name: tag-im-discord-family windowrule = match:class ^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$, tag +im +# name: tag-im-ferdium windowrule = match:class ^([Ff]erdium)$, tag +im +# name: tag-im-whatsapp windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, tag +im +# name: tag-im-telegram windowrule = match:class ^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$, tag +im +# name: tag-im-teams windowrule = match:class ^(teams-for-linux)$, tag +im +# name: tag-im-element windowrule = match:class ^(im.riot.Riot|Element)$, tag +im # game tags +# name: tag-games-gamescope windowrule = match:class ^(gamescope)$, tag +games +# name: tag-games-steam-app windowrule = match:class ^(steam_app_\\d+)$, tag +games +# name: tag-games-proton windowrule = match:xdg_tag ^(proton-game)$, tag +games # gamestore tags +# name: tag-gamestore-steam windowrule = match:class ^([Ss]team)$, tag +gamestore +# name: tag-gamestore-lutris windowrule = match:title ^([Ll]utris)$, tag +gamestore +# name: tag-gamestore-heroic windowrule = match:class ^(com.heroicgameslauncher.hgl)$, tag +gamestore # file-manager tags +# name: tag-file-manager-common windowrule = match:class ^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$, tag +file-manager +# name: tag-file-manager-warp windowrule = match:class ^(app.drey.Warp)$, tag +file-manager # wallpaper tags +# name: tag-wallpaper-waytrogen windowrule = match:class ^([Ww]aytrogen)$, tag +wallpaper # multimedia tags +# name: tag-multimedia-audacious windowrule = match:class ^([Aa]udacious)$, tag +multimedia # multimedia-video tags +# name: tag-multimedia-video-players windowrule = match:class ^([Mm]pv|vlc)$, tag +multimedia_video # settings tags +# name: tag-settings-rog-control windowrule = match:title ^(ROG Control)$, tag +settings +# name: tag-settings-wihotspot windowrule = match:class ^(wihotspot(-gui)?)$, tag +settings +# name: tag-settings-baobab windowrule = match:class ^([Bb]aobab|org.gnome.[Bb]aobab)$, tag +settings +# name: tag-settings-disks-and-hotspot windowrule = match:class ^(gnome-disks|wihotspot(-gui)?)$, tag +settings +# name: tag-settings-kvantum windowrule = match:title (Kvantum Manager), tag +settings +# name: tag-settings-file-roller windowrule = match:class ^(file-roller|org.gnome.FileRoller)$, tag +settings +# name: tag-settings-network-blueman windowrule = match:class ^(nm-applet|nm-connection-editor|blueman-manager)$, tag +settings +# name: tag-settings-pavucontrol windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, tag +settings +# name: tag-settings-qtct windowrule = match:class ^(qt5ct|qt6ct)$, tag +settings +# name: tag-settings-xdg-portal-gtk windowrule = match:class (xdg-desktop-portal-gtk), tag +settings +# name: tag-settings-polkit-kde windowrule = match:class ^(org.kde.polkit-kde-authentication-agent-1)$, tag +settings +# name: tag-settings-rofi windowrule = match:class ^([Rr]ofi)$, tag +settings +# name: tag-settings-btrfs-assistant windowrule = match:class ^(btrfs-assistant)$, tag +settings +# name: tag-settings-timeshift windowrule = match:class ^(timeshift-gtk)$, tag +settings # viewer tags +# name: tag-viewer-system-monitor windowrule = match:class ^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$, tag +viewer +# name: tag-viewer-evince windowrule = match:class ^(evince)$, tag +viewer +# name: tag-viewer-image-viewers windowrule = match:class ^(eog|org.gnome.Loupe)$, tag +viewer # Some special override rules +# name: multimedia-disable-blur windowrule = match:tag multimedia, no_blur on +# name: multimedia-force-opacity windowrule = match:tag multimedia, opacity 1.0 # FLOAT +# name: float-zoom-onedriver windowrule = match:class ([Zz]oom|onedriver|onedriver-launcher), float on +# name: float-video-players windowrule = match:class ^(mpv|com.github.rafostar.Clapper)$, float on +# name: float-qalculate windowrule = match:class ^([Qq]alculate-gtk)$, float on # float popups and dialogue +# name: float-center-auth-required-title windowrule = match:title ^(Authentication Required)$, float on, center on +# name: float-center-polkit-auth-dialog 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) +# name: float-vscodium-secondary-window windowrule = match:class (codium|codium-url-handler|VSCodium), match:title negative:(.*codium.*|.*VSCodium.*), float on +# name: float-heroic-secondary-window windowrule = match:class ^(com.heroicgameslauncher.hgl)$, match:title negative:(Heroic Games Launcher), float on +# name: float-steam-secondary-window windowrule = match:class ^([Ss]team)$, match:title negative:^([Ss]team)$, float on +# name: float-center-add-folder-dialog windowrule = match:title ^(Add Folder to Workspace)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +# name: float-center-save-as-dialog windowrule = match:title ^(Save As)$, float on, size (monitor_w*0.7) (monitor_h*0.6), center on +# name: float-open-files-dialog windowrule = match:initial_title (Open Files), float on, size (monitor_w*0.7) (monitor_h*0.6) +# name: float-center-sddm-background windowrule = match:title ^(SDDM Background)$, float on, center on, size (monitor_w*0.16) (monitor_h*0.12) +# name: float-center-yad-dialog windowrule = match:class ^(yad)$, float on, center on, size (monitor_w*0.2) (monitor_h*0.2) +# name: float-center-hyprland-donate windowrule = match:class ^(hyprland-donate-screen)$, float on, center on # SIZE # POSITION +# name: center-rog-control windowrule = match:title ^(ROG Control)$, center on +# name: center-keybindings windowrule = match:title ^(Keybindings)$, center on +# name: center-pavucontrol windowrule = match:class ^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$, center on +# name: center-whatsapp windowrule = match:class ^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$, center on +# name: center-network-editor windowrule = match:class ^(nm-connection-editor)$, center on +# name: center-nm-auth-dialog windowrule = match:class ^(nm-applet)$, match:title ^(Wi-Fi Network Authentication Required)$, center on # windowrule to avoid idle for fullscreen apps +# name: idle-inhibit-fullscreen-bool windowrule = match:fullscreen true, idle_inhibit fullscreen +# name: idle-inhibit-fullscreen-int windowrule = idle_inhibit fullscreen, match:fullscreen 1 +# name: idle-inhibit-any-class windowrule = idle_inhibit fullscreen, match:class .* +# name: idle-inhibit-any-title windowrule = idle_inhibit fullscreen, match:title .* # OPACITY +# name: opacity-browser-tag windowrule = match:tag browser, opacity 0.99 0.8 +# name: opacity-projects-tag windowrule = match:tag projects, opacity 0.9 0.8 +# name: opacity-im-tag windowrule = match:tag im, opacity 0.94 0.86 +# name: opacity-multimedia-tag windowrule = match:tag multimedia, opacity 0.94 0.86 +# name: opacity-file-manager-tag windowrule = match:tag file-manager, opacity 0.9 0.8 +# name: opacity-terminal-tag windowrule = match:tag terminal, opacity 0.9 0.7 +# name: opacity-text-editors windowrule = match:class ^(gedit|org.gnome.TextEditor|mousepad)$, opacity 0.8 0.7 +# name: opacity-deluge windowrule = match:class ^(deluge)$, opacity 0.9 0.8 +# name: opacity-seahorse windowrule = match:class ^(seahorse)$, opacity 0.9 0.8 # BLUR & FULLSCREEN -# This not gonna take the focus to the window that appears +# This not gonna take the focus to the window that appears # when hovering over some of the parts of the IntelliJ Products +# name: no-initial-focus-jetbrains windowrule = match:class ^(jetbrains-.*)$, no_initial_focus on +# name: no-initial-focus-wind-title windowrule = match:title ^(wind.*)$, no_initial_focus on -# LAYER RULES -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 @@ -219,7 +295,7 @@ windowrule { size = (monitor_w*0.45) (monitor_h*0.55) } -# Named rule for Kwallet +# Named rule for Kwallet windowrule { name = Kwallet match:class = ^(org.kde.kwalletmanager)$ @@ -412,18 +488,22 @@ windowrule { 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:title = ^(Pipewire Control Center)$ match:initial_class = ^(hyprpwcenter)$ + match:initial_title = ^(Pipewire Control Center)$ float = on center = on size = (monitor_w*0.6) (monitor_h*0.6) } -# Named rule for Garida Assistant + +# Named rule for Garuda Assistant windowrule { - name = Garuda Assistant + name = Garuda Assistant match:class = ^(garuda-assistant)$ match:title = ^(Garuda Assistant)$ match:initial_class = ^(garuda-assistant)$ @@ -433,9 +513,9 @@ windowrule { size = (monitor_w*0.6) (monitor_h*0.6) } -# Named rule for HyprMod HL config GUI +# Named rule for HyprMod HL config GUI windowrule { - name = HyprMod GUI + name = HyprMod GUI match:class = ^(com.github.hyprmod)$ match:title = ^(HyprMod)$ match:initial_class = ^(com.github.hyprmod)$ @@ -444,9 +524,10 @@ windowrule { center = on size = (monitor_w*0.7) (monitor_h*0.75) } -# Named rule for easy effects + +# Named rule for EasyEffects windowrule { - name = EasyEffects + name = EasyEffects match:class = ^(com.github.wwmm.easyeffects)$ match:title = ^(Easy Effects)$ match:initial_class = ^(com.github.wwmm.easyeffects)$ @@ -456,9 +537,19 @@ windowrule { size = (monitor_w*0.6) (monitor_h*0.65) } -# Named rule for Mousam weather GUI +# Named rule for Megasync windowrule { - name = Mousam Weather + name = Megasync + match:class = ^(nz\.co\.mega\.megasync)$ + match:initial_class = ^(nz\.co\.mega\.megasync)$ + float = on + center = on + size = (monitor_w*0.1) (monitor_h*0.3) +} + +# 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)$ @@ -467,5 +558,3 @@ windowrule { center = on size = (monitor_w*0.7) (monitor_h*0.75) } - - diff --git a/config/hypr/hl.meta.lua b/config/hypr/hl.meta.lua new file mode 100644 index 00000000..76fc923b --- /dev/null +++ b/config/hypr/hl.meta.lua @@ -0,0 +1,1252 @@ +-- This file is autogenerated. Do not edit by hand. +-- Generator: scripts/generateLuaStubs.py +---@meta + +---@alias HL.EventName +---| "config.reloaded" +---| "hyprland.shutdown" +---| "hyprland.start" +---| "keybinds.submap" +---| "layer.closed" +---| "layer.opened" +---| "monitor.added" +---| "monitor.focused" +---| "monitor.layout_changed" +---| "monitor.removed" +---| "screenshare.state" +---| "window.active" +---| "window.class" +---| "window.close" +---| "window.destroy" +---| "window.fullscreen" +---| "window.kill" +---| "window.move_to_workspace" +---| "window.open" +---| "window.open_early" +---| "window.pin" +---| "window.title" +---| "window.update_rules" +---| "window.urgent" +---| "workspace.active" +---| "workspace.created" +---| "workspace.move_to_monitor" +---| "workspace.removed" + +---@alias HL.ConfigKey +---| "animations.enabled" +---| "animations.workspace_wraparound" +---| "binds.allow_pin_fullscreen" +---| "binds.allow_workspace_cycles" +---| "binds.disable_keybind_grabbing" +---| "binds.drag_threshold" +---| "binds.focus_preferred_method" +---| "binds.hide_special_on_workspace_change" +---| "binds.ignore_group_lock" +---| "binds.movefocus_cycles_fullscreen" +---| "binds.movefocus_cycles_groupfirst" +---| "binds.pass_mouse_when_bound" +---| "binds.scroll_event_delay" +---| "binds.window_direction_monitor_fallback" +---| "binds.workspace_back_and_forth" +---| "binds.workspace_center_on" +---| "cursor.default_monitor" +---| "cursor.enable_hyprcursor" +---| "cursor.hide_on_key_press" +---| "cursor.hide_on_tablet" +---| "cursor.hide_on_touch" +---| "cursor.hotspot_padding" +---| "cursor.inactive_timeout" +---| "cursor.invisible" +---| "cursor.min_refresh_rate" +---| "cursor.no_break_fs_vrr" +---| "cursor.no_hardware_cursors" +---| "cursor.no_warps" +---| "cursor.persistent_warps" +---| "cursor.sync_gsettings_theme" +---| "cursor.use_cpu_buffer" +---| "cursor.warp_back_after_non_mouse_input" +---| "cursor.warp_on_change_workspace" +---| "cursor.warp_on_toggle_special" +---| "cursor.zoom_detached_camera" +---| "cursor.zoom_disable_aa" +---| "cursor.zoom_factor" +---| "cursor.zoom_rigid" +---| "debug.colored_stdout_logs" +---| "debug.damage_blink" +---| "debug.damage_tracking" +---| "debug.disable_logs" +---| "debug.disable_scale_checks" +---| "debug.disable_time" +---| "debug.ds_handle_same_buffer" +---| "debug.ds_handle_same_buffer_fifo" +---| "debug.enable_stdout_logs" +---| "debug.error_limit" +---| "debug.error_position" +---| "debug.fifo_pending_workaround" +---| "debug.full_cm_proto" +---| "debug.gl_debugging" +---| "debug.invalidate_fp16" +---| "debug.log_damage" +---| "debug.manual_crash" +---| "debug.overlay" +---| "debug.pass" +---| "debug.render_solitary_wo_damage" +---| "debug.suppress_errors" +---| "debug.vfr" +---| "decoration.active_opacity" +---| "decoration.blur.brightness" +---| "decoration.blur.contrast" +---| "decoration.blur.enabled" +---| "decoration.blur.ignore_opacity" +---| "decoration.blur.input_methods" +---| "decoration.blur.input_methods_ignorealpha" +---| "decoration.blur.new_optimizations" +---| "decoration.blur.noise" +---| "decoration.blur.passes" +---| "decoration.blur.popups" +---| "decoration.blur.popups_ignorealpha" +---| "decoration.blur.size" +---| "decoration.blur.special" +---| "decoration.blur.vibrancy" +---| "decoration.blur.vibrancy_darkness" +---| "decoration.blur.xray" +---| "decoration.border_part_of_window" +---| "decoration.dim_around" +---| "decoration.dim_inactive" +---| "decoration.dim_modal" +---| "decoration.dim_special" +---| "decoration.dim_strength" +---| "decoration.fullscreen_opacity" +---| "decoration.glow.color" +---| "decoration.glow.color_inactive" +---| "decoration.glow.enabled" +---| "decoration.glow.range" +---| "decoration.glow.render_power" +---| "decoration.inactive_opacity" +---| "decoration.rounding" +---| "decoration.rounding_power" +---| "decoration.screen_shader" +---| "decoration.shadow.color" +---| "decoration.shadow.color_inactive" +---| "decoration.shadow.enabled" +---| "decoration.shadow.offset" +---| "decoration.shadow.range" +---| "decoration.shadow.render_power" +---| "decoration.shadow.scale" +---| "decoration.shadow.sharp" +---| "dwindle.default_split_ratio" +---| "dwindle.force_split" +---| "dwindle.permanent_direction_override" +---| "dwindle.precise_mouse_move" +---| "dwindle.preserve_split" +---| "dwindle.smart_resizing" +---| "dwindle.smart_split" +---| "dwindle.special_scale_factor" +---| "dwindle.split_bias" +---| "dwindle.split_width_multiplier" +---| "dwindle.use_active_for_splits" +---| "ecosystem.enforce_permissions" +---| "ecosystem.no_donation_nag" +---| "ecosystem.no_update_news" +---| "experimental.wp_cm_1_2" +---| "general.allow_tearing" +---| "general.border_size" +---| "general.col.active_border" +---| "general.col.inactive_border" +---| "general.col.nogroup_border" +---| "general.col.nogroup_border_active" +---| "general.extend_border_grab_area" +---| "general.float_gaps" +---| "general.gaps_in" +---| "general.gaps_out" +---| "general.gaps_workspaces" +---| "general.hover_icon_on_border" +---| "general.layout" +---| "general.locale" +---| "general.modal_parent_blocking" +---| "general.no_focus_fallback" +---| "general.resize_corner" +---| "general.resize_on_border" +---| "general.snap.border_overlap" +---| "general.snap.enabled" +---| "general.snap.monitor_gap" +---| "general.snap.respect_gaps" +---| "general.snap.window_gap" +---| "gestures.close_max_timeout" +---| "gestures.scrolling.move_snap_cursor" +---| "gestures.scrolling.move_snap_to_grid" +---| "gestures.workspace_swipe_cancel_ratio" +---| "gestures.workspace_swipe_create_new" +---| "gestures.workspace_swipe_direction_lock" +---| "gestures.workspace_swipe_direction_lock_threshold" +---| "gestures.workspace_swipe_distance" +---| "gestures.workspace_swipe_forever" +---| "gestures.workspace_swipe_invert" +---| "gestures.workspace_swipe_min_speed_to_force" +---| "gestures.workspace_swipe_touch" +---| "gestures.workspace_swipe_touch_invert" +---| "gestures.workspace_swipe_use_r" +---| "group.auto_group" +---| "group.col.border_active" +---| "group.col.border_inactive" +---| "group.col.border_locked_active" +---| "group.col.border_locked_inactive" +---| "group.drag_into_group" +---| "group.focus_removed_window" +---| "group.group_on_movetoworkspace" +---| "group.groupbar.blur" +---| "group.groupbar.col.active" +---| "group.groupbar.col.inactive" +---| "group.groupbar.col.locked_active" +---| "group.groupbar.col.locked_inactive" +---| "group.groupbar.enabled" +---| "group.groupbar.font_family" +---| "group.groupbar.font_size" +---| "group.groupbar.font_weight_active" +---| "group.groupbar.font_weight_inactive" +---| "group.groupbar.gaps_in" +---| "group.groupbar.gaps_out" +---| "group.groupbar.gradient_round_only_edges" +---| "group.groupbar.gradient_rounding" +---| "group.groupbar.gradient_rounding_power" +---| "group.groupbar.gradients" +---| "group.groupbar.height" +---| "group.groupbar.indicator_gap" +---| "group.groupbar.indicator_height" +---| "group.groupbar.keep_upper_gap" +---| "group.groupbar.middle_click_close" +---| "group.groupbar.priority" +---| "group.groupbar.render_titles" +---| "group.groupbar.round_only_edges" +---| "group.groupbar.rounding" +---| "group.groupbar.rounding_power" +---| "group.groupbar.scrolling" +---| "group.groupbar.stacked" +---| "group.groupbar.text_color" +---| "group.groupbar.text_color_inactive" +---| "group.groupbar.text_color_locked_active" +---| "group.groupbar.text_color_locked_inactive" +---| "group.groupbar.text_offset" +---| "group.groupbar.text_padding" +---| "group.insert_after_current" +---| "group.merge_floated_into_tiled_on_groupbar" +---| "group.merge_groups_on_drag" +---| "group.merge_groups_on_groupbar" +---| "input.accel_profile" +---| "input.emulate_discrete_scroll" +---| "input.float_switch_override_focus" +---| "input.focus_on_close" +---| "input.follow_mouse" +---| "input.follow_mouse_shrink" +---| "input.follow_mouse_threshold" +---| "input.force_no_accel" +---| "input.kb_file" +---| "input.kb_layout" +---| "input.kb_model" +---| "input.kb_options" +---| "input.kb_rules" +---| "input.kb_variant" +---| "input.left_handed" +---| "input.mouse_refocus" +---| "input.natural_scroll" +---| "input.numlock_by_default" +---| "input.off_window_axis_events" +---| "input.repeat_delay" +---| "input.repeat_rate" +---| "input.resolve_binds_by_sym" +---| "input.rotation" +---| "input.scroll_button" +---| "input.scroll_button_lock" +---| "input.scroll_factor" +---| "input.scroll_method" +---| "input.scroll_points" +---| "input.sensitivity" +---| "input.special_fallthrough" +---| "input.tablet.absolute_region_position" +---| "input.tablet.active_area_position" +---| "input.tablet.active_area_size" +---| "input.tablet.left_handed" +---| "input.tablet.output" +---| "input.tablet.region_position" +---| "input.tablet.region_size" +---| "input.tablet.relative_input" +---| "input.tablet.transform" +---| "input.touchdevice.enabled" +---| "input.touchdevice.output" +---| "input.touchdevice.transform" +---| "input.touchpad.clickfinger_behavior" +---| "input.touchpad.disable_while_typing" +---| "input.touchpad.drag_3fg" +---| "input.touchpad.drag_lock" +---| "input.touchpad.flip_x" +---| "input.touchpad.flip_y" +---| "input.touchpad.middle_button_emulation" +---| "input.touchpad.natural_scroll" +---| "input.touchpad.scroll_factor" +---| "input.touchpad.tap_and_drag" +---| "input.touchpad.tap_button_map" +---| "input.touchpad.tap_to_click" +---| "input.virtualkeyboard.release_pressed_on_close" +---| "input.virtualkeyboard.share_states" +---| "layout.single_window_aspect_ratio" +---| "layout.single_window_aspect_ratio_tolerance" +---| "master.allow_small_split" +---| "master.always_keep_position" +---| "master.center_ignores_reserved" +---| "master.center_master_fallback" +---| "master.drop_at_cursor" +---| "master.focus_master_on_close" +---| "master.mfact" +---| "master.new_on_active" +---| "master.new_on_top" +---| "master.new_status" +---| "master.orientation" +---| "master.slave_count_for_center_master" +---| "master.smart_resizing" +---| "master.special_scale_factor" +---| "misc.allow_session_lock_restore" +---| "misc.always_follow_on_dnd" +---| "misc.animate_manual_resizes" +---| "misc.animate_mouse_windowdragging" +---| "misc.anr_missed_pings" +---| "misc.background_color" +---| "misc.close_special_on_empty" +---| "misc.col.splash" +---| "misc.disable_autoreload" +---| "misc.disable_hyprland_guiutils_check" +---| "misc.disable_hyprland_logo" +---| "misc.disable_scale_notification" +---| "misc.disable_splash_rendering" +---| "misc.disable_watchdog_warning" +---| "misc.disable_xdg_env_checks" +---| "misc.enable_anr_dialog" +---| "misc.enable_swallow" +---| "misc.exit_window_retains_fullscreen" +---| "misc.focus_on_activate" +---| "misc.font_family" +---| "misc.force_default_wallpaper" +---| "misc.initial_workspace_tracking" +---| "misc.key_press_enables_dpms" +---| "misc.layers_hog_keyboard_focus" +---| "misc.lockdead_screen_delay" +---| "misc.middle_click_paste" +---| "misc.mouse_move_enables_dpms" +---| "misc.mouse_move_focuses_monitor" +---| "misc.name_vk_after_proc" +---| "misc.on_focus_under_fullscreen" +---| "misc.render_unfocused_fps" +---| "misc.screencopy_force_8b" +---| "misc.session_lock_xray" +---| "misc.size_limits_tiled" +---| "misc.splash_font_family" +---| "misc.swallow_exception_regex" +---| "misc.swallow_regex" +---| "misc.vrr" +---| "opengl.nvidia_anti_flicker" +---| "quirks.prefer_hdr" +---| "quirks.skip_non_kms_dmabuf_formats" +---| "render.cm_auto_hdr" +---| "render.cm_enabled" +---| "render.cm_sdr_eotf" +---| "render.commit_timing_enabled" +---| "render.ctm_animation" +---| "render.direct_scanout" +---| "render.expand_undersized_textures" +---| "render.fp16_sdr_tf" +---| "render.icc_vcgt_enabled" +---| "render.keep_unmodified_copy" +---| "render.new_render_scheduling" +---| "render.non_shader_cm" +---| "render.non_shader_cm_interop" +---| "render.send_content_type" +---| "render.use_fp16" +---| "render.use_shader_blur_blend" +---| "render.xp_mode" +---| "scrolling.column_width" +---| "scrolling.direction" +---| "scrolling.explicit_column_widths" +---| "scrolling.focus_fit_method" +---| "scrolling.follow_focus" +---| "scrolling.follow_min_visible" +---| "scrolling.fullscreen_on_one_column" +---| "scrolling.wrap_focus" +---| "scrolling.wrap_swapcol" +---| "xwayland.create_abstract_socket" +---| "xwayland.enabled" +---| "xwayland.force_zero_scaling" +---| "xwayland.use_nearest_neighbor" + +---@alias HL.MonitorSelector string|integer|HL.Monitor +---@alias HL.WorkspaceSelector string|integer|HL.Workspace +---@alias HL.WindowSelector string|integer|HL.Window +---@alias HL.Vec2Like HL.Vec2|{x:number, y:number}|{number, number}|string +---@alias HL.CssGap integer|{top?:integer, right?:integer, bottom?:integer, left?:integer} +---@alias HL.Gradient string|{colors:string[], angle?:number} + +---@class HL.Dispatcher +local __HL_Dispatcher = {} + +---@class HL.Vec2 +---@field x number +---@field y number +local __HL_Vec2 = {} + +---@class HL.Box +---@field x number +---@field y number +---@field w number +---@field h number +local __HL_Box = {} + +---@class HL.LayoutTarget +---@field index integer +---@field window HL.Window|nil +---@field box HL.Box +---@field place fun(self: HL.LayoutTarget, box: HL.Box): nil +---@field set_box fun(self: HL.LayoutTarget, box: HL.Box): nil +local __HL_LayoutTarget = {} + +---@class HL.LayoutContext +---@field area HL.Box +---@field targets HL.LayoutTarget[] +---@field grid_cell fun(self: HL.LayoutContext, i: integer, cols: integer, rows?: integer): HL.Box +---@field column fun(self: HL.LayoutContext, i: integer, n: integer): HL.Box +---@field row fun(self: HL.LayoutContext, i: integer, n: integer): HL.Box +---@field split fun(self: HL.LayoutContext, box: HL.Box, side: 'left'|'right'|'top'|'bottom'|'up'|'down', ratio: number): HL.Box +local __HL_LayoutContext = {} + +---@class HL.LayoutProvider +---@field recalculate fun(ctx: HL.LayoutContext): nil +---@field layout_msg? fun(ctx: HL.LayoutContext, msg: string): boolean|string|nil +local __HL_LayoutProvider = {} + +---@class HL.BindOptions +---@field repeating? boolean +---@field locked? boolean +---@field release? boolean +---@field non_consuming? boolean +---@field transparent? boolean +---@field ignore_mods? boolean +---@field dont_inhibit? boolean +---@field long_press? boolean +---@field submap_universal? boolean +---@field click? boolean +---@field drag? boolean +---@field description? string +---@field desc? string +---@field device? {inclusive?: boolean, list?: string[]} +local __HL_BindOptions = {} + +---@class HL.TimerOptions +---@field timeout integer +---@field type "repeat"|"oneshot" +local __HL_TimerOptions = {} + +---@class HL.GestureSpec +---@field fingers integer +---@field direction string +---@field action string +---@field mods? string +---@field scale? number +---@field mode? string +---@field zoom_level? number +---@field workspace_name? string +---@field disable_inhibit? boolean +local __HL_GestureSpec = {} + +---@class HL.PermissionSpec +---@field binary string +---@field type string +---@field mode string +local __HL_PermissionSpec = {} + +---@class HL.NotificationOptions +---@field color? string +---@field timeout? number +---@field icon? integer|string +---@field font_size? number +local __HL_NotificationOptions = {} + +---@class HL.LayerQueryFilter +---@field monitor? HL.MonitorSelector +---@field namespace? string +local __HL_LayerQueryFilter = {} + +---@class HL.WindowQueryFilter +---@field class? string +---@field floating? boolean +---@field mapped? boolean +---@field monitor? HL.MonitorSelector +---@field tag? string +---@field title? string +---@field workspace? HL.WorkspaceSelector +local __HL_WindowQueryFilter = {} + +---@class HL.DeviceSpec +---@field absolute_region_position? boolean +---@field accel_profile? string +---@field active_area_position? HL.Vec2Like +---@field active_area_size? HL.Vec2Like +---@field clickfinger_behavior? boolean +---@field disable_while_typing? boolean +---@field drag_3fg? integer|boolean +---@field drag_lock? integer|boolean +---@field enabled? boolean +---@field flip_x? boolean +---@field flip_y? boolean +---@field kb_file? string +---@field kb_layout? string +---@field kb_model? string +---@field kb_options? string +---@field kb_rules? string +---@field kb_variant? string +---@field keybinds? boolean +---@field left_handed? boolean +---@field middle_button_emulation? boolean +---@field name string +---@field natural_scroll? boolean +---@field numlock_by_default? boolean +---@field output? string +---@field region_position? HL.Vec2Like +---@field region_size? HL.Vec2Like +---@field relative_input? boolean +---@field release_pressed_on_close? boolean +---@field repeat_delay? integer|boolean +---@field repeat_rate? integer|boolean +---@field resolve_binds_by_sym? boolean +---@field rotation? integer|boolean +---@field scroll_button? integer|boolean +---@field scroll_button_lock? boolean +---@field scroll_factor? number|boolean +---@field scroll_method? string +---@field scroll_points? string +---@field sensitivity? number|boolean +---@field share_states? integer|boolean +---@field tags? string +---@field tap_and_drag? boolean +---@field tap_button_map? string +---@field tap_to_click? boolean +---@field transform? integer|boolean +local __HL_DeviceSpec = {} + +---@class HL.LayerRuleSpec +---@field above_lock? integer|boolean +---@field animation? string +---@field blur? boolean +---@field blur_popups? boolean +---@field dim_around? boolean +---@field enabled? boolean +---@field ignore_alpha? number|boolean +---@field match? table<string, string|boolean> +---@field name? string +---@field no_anim? boolean +---@field no_screen_share? boolean +---@field order? integer|boolean +---@field xray? boolean +local __HL_LayerRuleSpec = {} + +---@class HL.MonitorSpec +---@field bitdepth? integer|boolean +---@field cm? string +---@field disabled? boolean +---@field icc? string +---@field max_avg_luminance? integer|boolean +---@field max_luminance? integer|boolean +---@field min_luminance? number|boolean +---@field mirror? string +---@field mode? string +---@field output string +---@field position? string +---@field reserved? integer|HL.CssGap +---@field reserved_area? integer|HL.CssGap +---@field scale? string|number +---@field sdr_eotf? string +---@field sdr_max_luminance? integer|boolean +---@field sdr_min_luminance? number|boolean +---@field sdrbrightness? number|boolean +---@field sdrsaturation? number|boolean +---@field supports_hdr? integer|boolean +---@field supports_wide_color? integer|boolean +---@field transform? integer|boolean +---@field vrr? integer|boolean +local __HL_MonitorSpec = {} + +---@class HL.WindowRuleSpec +---@field enabled? boolean +---@field match? table<string, string|number|boolean> +---@field name? string +local __HL_WindowRuleSpec = {} + +---@class HL.WorkspaceRuleSpec +---@field animation? string +---@field border_size? integer|boolean +---@field decorate? boolean +---@field default? boolean +---@field default_name? string +---@field enabled? boolean +---@field float_gaps? integer|HL.CssGap +---@field gaps_in? integer|HL.CssGap +---@field gaps_out? integer|HL.CssGap +---@field layout? string +---@field layout_opts? table<string, string|number|boolean> +---@field monitor? string +---@field no_border? boolean +---@field no_rounding? boolean +---@field no_shadow? boolean +---@field on_created_empty? string +---@field persistent? boolean +---@field workspace string +local __HL_WorkspaceRuleSpec = {} + +---@class HL.EventSubscription +---@field is_active fun(self: HL.EventSubscription, ...): any +---@field remove fun(self: HL.EventSubscription, ...): any +local __HL_EventSubscription = {} + +---@class HL.Group +---@field current HL.Window|nil +---@field current_index integer +---@field denied boolean +---@field locked boolean +---@field members HL.Window|table|nil +---@field size integer +local __HL_Group = {} + +---@class HL.Keybind +---@field is_enabled fun(self: HL.Keybind, ...): any +---@field remove fun(self: HL.Keybind, ...): any +---@field set_enabled fun(self: HL.Keybind, ...): any +---@field unbind fun(self: HL.Keybind, ...): any +---@field arg string +---@field auto_consuming boolean +---@field catchall boolean +---@field click boolean +---@field description any +---@field device_inclusive boolean +---@field devices nil +---@field display_key string +---@field dont_inhibit boolean +---@field drag boolean +---@field enabled boolean +---@field handler string +---@field has_description boolean +---@field ignore_mods boolean +---@field key string +---@field keycode integer +---@field locked boolean +---@field long_press boolean +---@field modmask integer +---@field mouse boolean +---@field non_consuming boolean +---@field release boolean +---@field repeating boolean +---@field submap string +---@field submap_universal boolean +---@field transparent boolean +local __HL_Keybind = {} + +---@class HL.LayerRule +---@field is_enabled fun(self: HL.LayerRule, ...): any +---@field set_enabled fun(self: HL.LayerRule, ...): any +local __HL_LayerRule = {} + +---@class HL.LayerSurface +---@field above_fullscreen boolean|nil +---@field address string +---@field h integer +---@field interactivity integer +---@field layer integer +---@field mapped boolean +---@field monitor HL.Monitor|nil +---@field namespace string +---@field pid integer +---@field w integer +---@field x integer +---@field y integer +local __HL_LayerSurface = {} + +---@class HL.Monitor +---@field active_special_workspace HL.Workspace|nil +---@field active_workspace HL.Workspace|nil +---@field description string +---@field dpms_status boolean +---@field focused boolean|nil +---@field height integer +---@field id integer +---@field is_mirror boolean +---@field mirrors HL.Monitor|table +---@field name string +---@field position integer|table +---@field refresh_rate number +---@field scale number +---@field size integer|table +---@field transform integer +---@field vrr_active boolean +---@field width integer +---@field x integer +---@field y integer +local __HL_Monitor = {} + +---@class HL.Notification +---@field dismiss fun(self: HL.Notification, ...): any +---@field get_color fun(self: HL.Notification, ...): any +---@field get_elapsed fun(self: HL.Notification, ...): any +---@field get_elapsed_since_creation fun(self: HL.Notification, ...): any +---@field get_font_size fun(self: HL.Notification, ...): any +---@field get_icon fun(self: HL.Notification, ...): any +---@field get_text fun(self: HL.Notification, ...): any +---@field get_timeout fun(self: HL.Notification, ...): any +---@field is_alive fun(self: HL.Notification, ...): any +---@field is_paused fun(self: HL.Notification, ...): any +---@field pause fun(self: HL.Notification, ...): any +---@field resume fun(self: HL.Notification, ...): any +---@field set_color fun(self: HL.Notification, ...): any +---@field set_font_size fun(self: HL.Notification, ...): any +---@field set_icon fun(self: HL.Notification, ...): any +---@field set_paused fun(self: HL.Notification, ...): any +---@field set_text fun(self: HL.Notification, ...): any +---@field set_timeout fun(self: HL.Notification, ...): any +local __HL_Notification = {} + +---@class HL.Timer +---@field is_enabled fun(self: HL.Timer, ...): any +---@field set_enabled fun(self: HL.Timer, ...): any +---@field set_timeout fun(self: HL.Timer, ...): any +local __HL_Timer = {} + +---@class HL.Window +---@field accepts_input boolean +---@field active boolean|nil +---@field address string +---@field at integer|table +---@field class string +---@field content_type string +---@field floating boolean +---@field focus_history_id integer +---@field fullscreen integer +---@field fullscreen_client integer +---@field group HL.Group|nil +---@field hidden boolean +---@field inhibiting_idle boolean +---@field initial_class string +---@field initial_title string +---@field layout HL.Window|boolean|integer|number|string|table|nil +---@field mapped boolean +---@field monitor HL.Monitor|nil +---@field over_fullscreen boolean +---@field pid integer +---@field pinned boolean +---@field size integer|table +---@field stable_id integer +---@field swallowing HL.Window|nil +---@field tags string|table +---@field title string +---@field visible boolean +---@field workspace HL.Workspace|nil +---@field xdg_description string|nil +---@field xdg_tag string|nil +---@field xwayland boolean +local __HL_Window = {} + +---@class HL.WindowRule +---@field is_enabled fun(self: HL.WindowRule, ...): any +---@field set_enabled fun(self: HL.WindowRule, ...): any +local __HL_WindowRule = {} + +---@class HL.Workspace +---@field get_groups fun(self: HL.Workspace, ...): any +---@field get_windows fun(self: HL.Workspace, ...): any +---@field active boolean +---@field config_name string +---@field fullscreen_mode integer +---@field fullscreen_window HL.Window|nil +---@field groups integer|nil +---@field has_fullscreen boolean +---@field has_urgent boolean +---@field id integer +---@field is_empty boolean +---@field is_persistent boolean +---@field last_window HL.Window|nil +---@field monitor HL.Monitor|nil +---@field name string +---@field special boolean +---@field tiled_layout string +---@field visible boolean +---@field windows integer +local __HL_Workspace = {} + +---@class HL.API +---@field animation fun(...): any +---@field bind fun(keys: string, dispatcher: HL.Dispatcher|function, opts?: HL.BindOptions): HL.Keybind +---@field config fun(config: table): nil +---@field curve fun(...): any +---@field define_submap fun(name: string, reset_or_fn: string|function, fn?: function): nil +---@field device fun(spec: HL.DeviceSpec): nil +---@field dispatch fun(dispatcher: HL.Dispatcher|function): any +---@field env fun(...): any +---@field exec_cmd fun(cmd: string, rules?: table<string, string|number|boolean>): nil +---@field gesture fun(spec: HL.GestureSpec): nil +---@field get_active_monitor fun(): HL.Monitor|nil +---@field get_active_special_workspace fun(monitor?: HL.MonitorSelector): HL.Workspace|nil +---@field get_active_window fun(): HL.Window|nil +---@field get_active_workspace fun(monitor?: HL.MonitorSelector): HL.Workspace|nil +---@field get_config fun(key: HL.ConfigKey|string): any, string? +---@field get_current_submap fun(): string +---@field get_cursor_pos fun(): HL.Vec2|nil +---@field get_last_window fun(): HL.Window|nil +---@field get_last_workspace fun(monitor?: HL.MonitorSelector): HL.Workspace|nil +---@field get_layers fun(filters?: HL.LayerQueryFilter): HL.LayerSurface[] +---@field get_monitor fun(selector: HL.MonitorSelector): HL.Monitor|nil +---@field get_monitor_at fun(x: number|HL.Vec2, y?: number): HL.Monitor|nil +---@field get_monitor_at_cursor fun(): HL.Monitor|nil +---@field get_monitors fun(): HL.Monitor[] +---@field get_urgent_window fun(): HL.Window|nil +---@field get_window fun(selector: HL.WindowSelector): HL.Window|nil +---@field get_windows fun(filters?: HL.WindowQueryFilter): HL.Window[] +---@field get_workspace fun(selector: HL.WorkspaceSelector): HL.Workspace|nil +---@field get_workspace_windows fun(workspace: HL.WorkspaceSelector): HL.Window[] +---@field get_workspaces fun(): HL.Workspace[] +---@field layer_rule fun(spec: HL.LayerRuleSpec): HL.LayerRule +---@field monitor fun(spec: HL.MonitorSpec): nil +---@field on fun(event: HL.EventName, cb: fun(...)): HL.EventSubscription +---@field permission fun(spec: HL.PermissionSpec): nil +---@field timer fun(callback: function, opts: HL.TimerOptions): HL.Timer +---@field unbind fun(...): any +---@field version fun(...): any +---@field window_rule fun(spec: HL.WindowRuleSpec): HL.WindowRule +---@field workspace_rule fun(spec: HL.WorkspaceRuleSpec): nil +---@field dsp HL.DspNamespace +---@field layout HL.LayoutNamespace +---@field notification HL.NotificationNamespace +---@field plugin HL.PluginNamespace +local __HL_API = {} + +---@class HL.DspNamespace +---@field dpms fun(...): HL.Dispatcher +---@field event fun(...): HL.Dispatcher +---@field exec_cmd fun(...): HL.Dispatcher +---@field exec_raw fun(...): HL.Dispatcher +---@field exit fun(...): HL.Dispatcher +---@field focus fun(...): HL.Dispatcher +---@field force_idle fun(...): HL.Dispatcher +---@field force_renderer_reload fun(...): HL.Dispatcher +---@field global fun(...): HL.Dispatcher +---@field layout fun(...): HL.Dispatcher +---@field no_op fun(...): HL.Dispatcher +---@field pass fun(...): HL.Dispatcher +---@field send_key_state fun(...): HL.Dispatcher +---@field send_shortcut fun(...): HL.Dispatcher +---@field submap fun(...): HL.Dispatcher +---@field cursor HL.DspCursorNamespace +---@field group HL.DspGroupNamespace +---@field window HL.DspWindowNamespace +---@field workspace HL.DspWorkspaceNamespace +local __HL_DspNamespace = {} + +---@class HL.DspCursorNamespace +---@field move fun(...): HL.Dispatcher +---@field move_to_corner fun(...): HL.Dispatcher +local __HL_DspCursorNamespace = {} + +---@class HL.DspGroupNamespace +---@field active fun(...): HL.Dispatcher +---@field lock fun(...): HL.Dispatcher +---@field lock_active fun(...): HL.Dispatcher +---@field move_window fun(...): HL.Dispatcher +---@field next fun(...): HL.Dispatcher +---@field prev fun(...): HL.Dispatcher +---@field toggle fun(...): HL.Dispatcher +local __HL_DspGroupNamespace = {} + +---@class HL.DspWindowNamespace +---@field alter_zorder fun(...): HL.Dispatcher +---@field bring_to_top fun(...): HL.Dispatcher +---@field center fun(...): HL.Dispatcher +---@field clear_tags fun(...): HL.Dispatcher +---@field close fun(...): HL.Dispatcher +---@field cycle_next fun(...): HL.Dispatcher +---@field deny_from_group fun(...): HL.Dispatcher +---@field drag fun(...): HL.Dispatcher +---@field float fun(...): HL.Dispatcher +---@field fullscreen fun(...): HL.Dispatcher +---@field fullscreen_state fun(...): HL.Dispatcher +---@field kill fun(...): HL.Dispatcher +---@field move fun(...): HL.Dispatcher +---@field pin fun(...): HL.Dispatcher +---@field pseudo fun(...): HL.Dispatcher +---@field resize fun(...): HL.Dispatcher +---@field set_prop fun(...): HL.Dispatcher +---@field signal fun(...): HL.Dispatcher +---@field swap fun(...): HL.Dispatcher +---@field tag fun(...): HL.Dispatcher +---@field toggle_swallow fun(...): HL.Dispatcher +local __HL_DspWindowNamespace = {} + +---@class HL.DspWorkspaceNamespace +---@field move fun(...): HL.Dispatcher +---@field rename fun(...): HL.Dispatcher +---@field swap_monitors fun(...): HL.Dispatcher +---@field toggle_special fun(...): HL.Dispatcher +local __HL_DspWorkspaceNamespace = {} + +---@class HL.LayoutNamespace +---@field register fun(name: string, provider: HL.LayoutProvider): nil +local __HL_LayoutNamespace = {} + +---@class HL.NotificationNamespace +---@field create fun(opts?: HL.NotificationOptions): HL.Notification +---@field get fun(): HL.Notification[] +local __HL_NotificationNamespace = {} + +---@class HL.PluginNamespace +---@field load fun(...): any +---@field [string] any +local __HL_PluginNamespace = {} + +---@type HL.API +hl = {} + +---@class HL.ConfigValueTypes +---@field ['animations.enabled'] boolean +---@field ['animations.workspace_wraparound'] boolean +---@field ['binds.allow_pin_fullscreen'] boolean +---@field ['binds.allow_workspace_cycles'] boolean +---@field ['binds.disable_keybind_grabbing'] boolean +---@field ['binds.drag_threshold'] integer|boolean +---@field ['binds.focus_preferred_method'] integer|boolean +---@field ['binds.hide_special_on_workspace_change'] boolean +---@field ['binds.ignore_group_lock'] boolean +---@field ['binds.movefocus_cycles_fullscreen'] boolean +---@field ['binds.movefocus_cycles_groupfirst'] boolean +---@field ['binds.pass_mouse_when_bound'] boolean +---@field ['binds.scroll_event_delay'] integer|boolean +---@field ['binds.window_direction_monitor_fallback'] boolean +---@field ['binds.workspace_back_and_forth'] boolean +---@field ['binds.workspace_center_on'] integer|boolean +---@field ['cursor.default_monitor'] string +---@field ['cursor.enable_hyprcursor'] boolean +---@field ['cursor.hide_on_key_press'] boolean +---@field ['cursor.hide_on_tablet'] boolean +---@field ['cursor.hide_on_touch'] boolean +---@field ['cursor.hotspot_padding'] integer|boolean +---@field ['cursor.inactive_timeout'] number|boolean +---@field ['cursor.invisible'] boolean +---@field ['cursor.min_refresh_rate'] integer|boolean +---@field ['cursor.no_break_fs_vrr'] integer|boolean +---@field ['cursor.no_hardware_cursors'] integer|boolean +---@field ['cursor.no_warps'] boolean +---@field ['cursor.persistent_warps'] boolean +---@field ['cursor.sync_gsettings_theme'] boolean +---@field ['cursor.use_cpu_buffer'] integer|boolean +---@field ['cursor.warp_back_after_non_mouse_input'] boolean +---@field ['cursor.warp_on_change_workspace'] integer|boolean +---@field ['cursor.warp_on_toggle_special'] integer|boolean +---@field ['cursor.zoom_detached_camera'] boolean +---@field ['cursor.zoom_disable_aa'] boolean +---@field ['cursor.zoom_factor'] number|boolean +---@field ['cursor.zoom_rigid'] boolean +---@field ['debug.colored_stdout_logs'] boolean +---@field ['debug.damage_blink'] boolean +---@field ['debug.damage_tracking'] integer|boolean +---@field ['debug.disable_logs'] boolean +---@field ['debug.disable_scale_checks'] boolean +---@field ['debug.disable_time'] boolean +---@field ['debug.ds_handle_same_buffer'] boolean +---@field ['debug.ds_handle_same_buffer_fifo'] boolean +---@field ['debug.enable_stdout_logs'] boolean +---@field ['debug.error_limit'] integer|boolean +---@field ['debug.error_position'] integer|boolean +---@field ['debug.fifo_pending_workaround'] boolean +---@field ['debug.full_cm_proto'] boolean +---@field ['debug.gl_debugging'] boolean +---@field ['debug.invalidate_fp16'] integer|boolean +---@field ['debug.log_damage'] boolean +---@field ['debug.manual_crash'] integer|boolean +---@field ['debug.overlay'] boolean +---@field ['debug.pass'] boolean +---@field ['debug.render_solitary_wo_damage'] boolean +---@field ['debug.suppress_errors'] boolean +---@field ['debug.vfr'] boolean +---@field ['decoration.active_opacity'] number|boolean +---@field ['decoration.blur.brightness'] number|boolean +---@field ['decoration.blur.contrast'] number|boolean +---@field ['decoration.blur.enabled'] boolean +---@field ['decoration.blur.ignore_opacity'] boolean +---@field ['decoration.blur.input_methods'] boolean +---@field ['decoration.blur.input_methods_ignorealpha'] number|boolean +---@field ['decoration.blur.new_optimizations'] boolean +---@field ['decoration.blur.noise'] number|boolean +---@field ['decoration.blur.passes'] integer|boolean +---@field ['decoration.blur.popups'] boolean +---@field ['decoration.blur.popups_ignorealpha'] number|boolean +---@field ['decoration.blur.size'] integer|boolean +---@field ['decoration.blur.special'] boolean +---@field ['decoration.blur.vibrancy'] number|boolean +---@field ['decoration.blur.vibrancy_darkness'] number|boolean +---@field ['decoration.blur.xray'] boolean +---@field ['decoration.border_part_of_window'] boolean +---@field ['decoration.dim_around'] number|boolean +---@field ['decoration.dim_inactive'] boolean +---@field ['decoration.dim_modal'] boolean +---@field ['decoration.dim_special'] number|boolean +---@field ['decoration.dim_strength'] number|boolean +---@field ['decoration.fullscreen_opacity'] number|boolean +---@field ['decoration.glow.color'] string +---@field ['decoration.glow.color_inactive'] string +---@field ['decoration.glow.enabled'] boolean +---@field ['decoration.glow.range'] integer|boolean +---@field ['decoration.glow.render_power'] integer|boolean +---@field ['decoration.inactive_opacity'] number|boolean +---@field ['decoration.rounding'] integer|boolean +---@field ['decoration.rounding_power'] number|boolean +---@field ['decoration.screen_shader'] string +---@field ['decoration.shadow.color'] string +---@field ['decoration.shadow.color_inactive'] string +---@field ['decoration.shadow.enabled'] boolean +---@field ['decoration.shadow.offset'] HL.Vec2Like +---@field ['decoration.shadow.range'] integer|boolean +---@field ['decoration.shadow.render_power'] integer|boolean +---@field ['decoration.shadow.scale'] number|boolean +---@field ['decoration.shadow.sharp'] boolean +---@field ['dwindle.default_split_ratio'] number|boolean +---@field ['dwindle.force_split'] integer|boolean +---@field ['dwindle.permanent_direction_override'] boolean +---@field ['dwindle.precise_mouse_move'] boolean +---@field ['dwindle.preserve_split'] boolean +---@field ['dwindle.smart_resizing'] boolean +---@field ['dwindle.smart_split'] boolean +---@field ['dwindle.special_scale_factor'] number|boolean +---@field ['dwindle.split_bias'] integer|boolean +---@field ['dwindle.split_width_multiplier'] number|boolean +---@field ['dwindle.use_active_for_splits'] boolean +---@field ['ecosystem.enforce_permissions'] boolean +---@field ['ecosystem.no_donation_nag'] boolean +---@field ['ecosystem.no_update_news'] boolean +---@field ['experimental.wp_cm_1_2'] boolean +---@field ['general.allow_tearing'] boolean +---@field ['general.border_size'] integer|boolean +---@field ['general.col.active_border'] string|HL.Gradient +---@field ['general.col.inactive_border'] string|HL.Gradient +---@field ['general.col.nogroup_border'] string|HL.Gradient +---@field ['general.col.nogroup_border_active'] string|HL.Gradient +---@field ['general.extend_border_grab_area'] integer|boolean +---@field ['general.float_gaps'] integer|HL.CssGap +---@field ['general.gaps_in'] integer|HL.CssGap +---@field ['general.gaps_out'] integer|HL.CssGap +---@field ['general.gaps_workspaces'] integer|boolean +---@field ['general.hover_icon_on_border'] boolean +---@field ['general.layout'] string +---@field ['general.locale'] string +---@field ['general.modal_parent_blocking'] boolean +---@field ['general.no_focus_fallback'] boolean +---@field ['general.resize_corner'] integer|boolean +---@field ['general.resize_on_border'] boolean +---@field ['general.snap.border_overlap'] boolean +---@field ['general.snap.enabled'] boolean +---@field ['general.snap.monitor_gap'] integer|boolean +---@field ['general.snap.respect_gaps'] boolean +---@field ['general.snap.window_gap'] integer|boolean +---@field ['gestures.close_max_timeout'] integer|boolean +---@field ['gestures.scrolling.move_snap_cursor'] boolean +---@field ['gestures.scrolling.move_snap_to_grid'] boolean +---@field ['gestures.workspace_swipe_cancel_ratio'] number|boolean +---@field ['gestures.workspace_swipe_create_new'] boolean +---@field ['gestures.workspace_swipe_direction_lock'] boolean +---@field ['gestures.workspace_swipe_direction_lock_threshold'] integer|boolean +---@field ['gestures.workspace_swipe_distance'] integer|boolean +---@field ['gestures.workspace_swipe_forever'] boolean +---@field ['gestures.workspace_swipe_invert'] boolean +---@field ['gestures.workspace_swipe_min_speed_to_force'] integer|boolean +---@field ['gestures.workspace_swipe_touch'] boolean +---@field ['gestures.workspace_swipe_touch_invert'] boolean +---@field ['gestures.workspace_swipe_use_r'] boolean +---@field ['group.auto_group'] boolean +---@field ['group.col.border_active'] string|HL.Gradient +---@field ['group.col.border_inactive'] string|HL.Gradient +---@field ['group.col.border_locked_active'] string|HL.Gradient +---@field ['group.col.border_locked_inactive'] string|HL.Gradient +---@field ['group.drag_into_group'] integer|boolean +---@field ['group.focus_removed_window'] boolean +---@field ['group.group_on_movetoworkspace'] boolean +---@field ['group.groupbar.blur'] boolean +---@field ['group.groupbar.col.active'] string|HL.Gradient +---@field ['group.groupbar.col.inactive'] string|HL.Gradient +---@field ['group.groupbar.col.locked_active'] string|HL.Gradient +---@field ['group.groupbar.col.locked_inactive'] string|HL.Gradient +---@field ['group.groupbar.enabled'] boolean +---@field ['group.groupbar.font_family'] string +---@field ['group.groupbar.font_size'] integer|boolean +---@field ['group.groupbar.font_weight_active'] integer|string +---@field ['group.groupbar.font_weight_inactive'] integer|string +---@field ['group.groupbar.gaps_in'] integer|boolean +---@field ['group.groupbar.gaps_out'] integer|boolean +---@field ['group.groupbar.gradient_round_only_edges'] boolean +---@field ['group.groupbar.gradient_rounding'] integer|boolean +---@field ['group.groupbar.gradient_rounding_power'] number|boolean +---@field ['group.groupbar.gradients'] boolean +---@field ['group.groupbar.height'] integer|boolean +---@field ['group.groupbar.indicator_gap'] integer|boolean +---@field ['group.groupbar.indicator_height'] integer|boolean +---@field ['group.groupbar.keep_upper_gap'] boolean +---@field ['group.groupbar.middle_click_close'] boolean +---@field ['group.groupbar.priority'] integer|boolean +---@field ['group.groupbar.render_titles'] boolean +---@field ['group.groupbar.round_only_edges'] boolean +---@field ['group.groupbar.rounding'] integer|boolean +---@field ['group.groupbar.rounding_power'] number|boolean +---@field ['group.groupbar.scrolling'] boolean +---@field ['group.groupbar.stacked'] boolean +---@field ['group.groupbar.text_color'] string +---@field ['group.groupbar.text_color_inactive'] string +---@field ['group.groupbar.text_color_locked_active'] string +---@field ['group.groupbar.text_color_locked_inactive'] string +---@field ['group.groupbar.text_offset'] integer|boolean +---@field ['group.groupbar.text_padding'] integer|boolean +---@field ['group.insert_after_current'] boolean +---@field ['group.merge_floated_into_tiled_on_groupbar'] boolean +---@field ['group.merge_groups_on_drag'] boolean +---@field ['group.merge_groups_on_groupbar'] boolean +---@field ['input.accel_profile'] string +---@field ['input.emulate_discrete_scroll'] integer|boolean +---@field ['input.float_switch_override_focus'] integer|boolean +---@field ['input.focus_on_close'] integer|boolean +---@field ['input.follow_mouse'] integer|boolean +---@field ['input.follow_mouse_shrink'] integer|boolean +---@field ['input.follow_mouse_threshold'] number|boolean +---@field ['input.force_no_accel'] boolean +---@field ['input.kb_file'] string +---@field ['input.kb_layout'] string +---@field ['input.kb_model'] string +---@field ['input.kb_options'] string +---@field ['input.kb_rules'] string +---@field ['input.kb_variant'] string +---@field ['input.left_handed'] boolean +---@field ['input.mouse_refocus'] boolean +---@field ['input.natural_scroll'] boolean +---@field ['input.numlock_by_default'] boolean +---@field ['input.off_window_axis_events'] integer|boolean +---@field ['input.repeat_delay'] integer|boolean +---@field ['input.repeat_rate'] integer|boolean +---@field ['input.resolve_binds_by_sym'] boolean +---@field ['input.rotation'] integer|boolean +---@field ['input.scroll_button'] integer|boolean +---@field ['input.scroll_button_lock'] boolean +---@field ['input.scroll_factor'] number|boolean +---@field ['input.scroll_method'] string +---@field ['input.scroll_points'] string +---@field ['input.sensitivity'] number|boolean +---@field ['input.special_fallthrough'] boolean +---@field ['input.tablet.absolute_region_position'] boolean +---@field ['input.tablet.active_area_position'] HL.Vec2Like +---@field ['input.tablet.active_area_size'] HL.Vec2Like +---@field ['input.tablet.left_handed'] boolean +---@field ['input.tablet.output'] string +---@field ['input.tablet.region_position'] HL.Vec2Like +---@field ['input.tablet.region_size'] HL.Vec2Like +---@field ['input.tablet.relative_input'] boolean +---@field ['input.tablet.transform'] integer|boolean +---@field ['input.touchdevice.enabled'] boolean +---@field ['input.touchdevice.output'] string +---@field ['input.touchdevice.transform'] integer|boolean +---@field ['input.touchpad.clickfinger_behavior'] boolean +---@field ['input.touchpad.disable_while_typing'] boolean +---@field ['input.touchpad.drag_3fg'] integer|boolean +---@field ['input.touchpad.drag_lock'] integer|boolean +---@field ['input.touchpad.flip_x'] boolean +---@field ['input.touchpad.flip_y'] boolean +---@field ['input.touchpad.middle_button_emulation'] boolean +---@field ['input.touchpad.natural_scroll'] boolean +---@field ['input.touchpad.scroll_factor'] number|boolean +---@field ['input.touchpad.tap_and_drag'] boolean +---@field ['input.touchpad.tap_button_map'] string +---@field ['input.touchpad.tap_to_click'] boolean +---@field ['input.virtualkeyboard.release_pressed_on_close'] boolean +---@field ['input.virtualkeyboard.share_states'] integer|boolean +---@field ['layout.single_window_aspect_ratio'] HL.Vec2Like +---@field ['layout.single_window_aspect_ratio_tolerance'] number|boolean +---@field ['master.allow_small_split'] boolean +---@field ['master.always_keep_position'] boolean +---@field ['master.center_ignores_reserved'] boolean +---@field ['master.center_master_fallback'] string +---@field ['master.drop_at_cursor'] boolean +---@field ['master.focus_master_on_close'] boolean +---@field ['master.mfact'] number|boolean +---@field ['master.new_on_active'] string +---@field ['master.new_on_top'] boolean +---@field ['master.new_status'] string +---@field ['master.orientation'] string +---@field ['master.slave_count_for_center_master'] integer|boolean +---@field ['master.smart_resizing'] boolean +---@field ['master.special_scale_factor'] number|boolean +---@field ['misc.allow_session_lock_restore'] boolean +---@field ['misc.always_follow_on_dnd'] boolean +---@field ['misc.animate_manual_resizes'] boolean +---@field ['misc.animate_mouse_windowdragging'] boolean +---@field ['misc.anr_missed_pings'] integer|boolean +---@field ['misc.background_color'] string +---@field ['misc.close_special_on_empty'] boolean +---@field ['misc.col.splash'] string +---@field ['misc.disable_autoreload'] boolean +---@field ['misc.disable_hyprland_guiutils_check'] boolean +---@field ['misc.disable_hyprland_logo'] boolean +---@field ['misc.disable_scale_notification'] boolean +---@field ['misc.disable_splash_rendering'] boolean +---@field ['misc.disable_watchdog_warning'] boolean +---@field ['misc.disable_xdg_env_checks'] boolean +---@field ['misc.enable_anr_dialog'] boolean +---@field ['misc.enable_swallow'] boolean +---@field ['misc.exit_window_retains_fullscreen'] boolean +---@field ['misc.focus_on_activate'] boolean +---@field ['misc.font_family'] string +---@field ['misc.force_default_wallpaper'] integer|boolean +---@field ['misc.initial_workspace_tracking'] integer|boolean +---@field ['misc.key_press_enables_dpms'] boolean +---@field ['misc.layers_hog_keyboard_focus'] boolean +---@field ['misc.lockdead_screen_delay'] integer|boolean +---@field ['misc.middle_click_paste'] boolean +---@field ['misc.mouse_move_enables_dpms'] boolean +---@field ['misc.mouse_move_focuses_monitor'] boolean +---@field ['misc.name_vk_after_proc'] boolean +---@field ['misc.on_focus_under_fullscreen'] integer|boolean +---@field ['misc.render_unfocused_fps'] integer|boolean +---@field ['misc.screencopy_force_8b'] boolean +---@field ['misc.session_lock_xray'] boolean +---@field ['misc.size_limits_tiled'] boolean +---@field ['misc.splash_font_family'] string +---@field ['misc.swallow_exception_regex'] string +---@field ['misc.swallow_regex'] string +---@field ['misc.vrr'] integer|boolean +---@field ['opengl.nvidia_anti_flicker'] boolean +---@field ['quirks.prefer_hdr'] integer|boolean +---@field ['quirks.skip_non_kms_dmabuf_formats'] boolean +---@field ['render.cm_auto_hdr'] integer|boolean +---@field ['render.cm_enabled'] boolean +---@field ['render.cm_sdr_eotf'] string +---@field ['render.commit_timing_enabled'] boolean +---@field ['render.ctm_animation'] integer|boolean +---@field ['render.direct_scanout'] integer|boolean +---@field ['render.expand_undersized_textures'] boolean +---@field ['render.fp16_sdr_tf'] integer|boolean +---@field ['render.icc_vcgt_enabled'] boolean +---@field ['render.keep_unmodified_copy'] integer|boolean +---@field ['render.new_render_scheduling'] boolean +---@field ['render.non_shader_cm'] integer|boolean +---@field ['render.non_shader_cm_interop'] integer|boolean +---@field ['render.send_content_type'] boolean +---@field ['render.use_fp16'] integer|boolean +---@field ['render.use_shader_blur_blend'] boolean +---@field ['render.xp_mode'] boolean +---@field ['scrolling.column_width'] number|boolean +---@field ['scrolling.direction'] string +---@field ['scrolling.explicit_column_widths'] string +---@field ['scrolling.focus_fit_method'] integer|boolean +---@field ['scrolling.follow_focus'] boolean +---@field ['scrolling.follow_min_visible'] number|boolean +---@field ['scrolling.fullscreen_on_one_column'] boolean +---@field ['scrolling.wrap_focus'] boolean +---@field ['scrolling.wrap_swapcol'] boolean +---@field ['xwayland.create_abstract_socket'] boolean +---@field ['xwayland.enabled'] boolean +---@field ['xwayland.force_zero_scaling'] boolean +---@field ['xwayland.use_nearest_neighbor'] boolean +local __HL_ConfigValueTypes = {} diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 26701470..43ad22f3 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -26,8 +26,10 @@ source= $UserConfigs/Laptops.conf source= $UserConfigs/LaptopDisplay.conf # Load defaults, then user additions -source= $configs/WindowRules.conf # Window Rules and Layer Rules (defaults) -source= $UserConfigs/WindowRules.conf # Window Rules and Layer Rules (user) +source= $configs/WindowRules.conf # Window Rules (defaults) +source= $UserConfigs/WindowRules.conf # Window Rules (user) +source= $configs/LayerRules.conf # Layer Rules (defaults) +source= $UserConfigs/LayerRules.conf # Layer Rules (user) source= $configs/SystemSettings.conf # Default config for hypr diff --git a/config/hypr/hyprland.lua.disable b/config/hypr/hyprland.lua.disable new file mode 100644 index 00000000..920976ba --- /dev/null +++ b/config/hypr/hyprland.lua.disable @@ -0,0 +1,25 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- KoolDots Hyprland Lua config entrypoint. +-- Mirrors hyprland.conf include order for features currently supported by Lua config. +local configHome = os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config") +local hyprDir = configHome .. "/hypr" + +local function load_module(name) + dofile(hyprDir .. "/lua/" .. name .. ".lua") +end + +-- In Lua workflow, runtime config is loaded from split files under: +-- ~/.config/hypr/configs/system_*.lua +-- ~/.config/hypr/UserConfigs/user_*.lua +-- via lua/user_overrides.lua. Base lua/*.lua modules are templates and should +-- not also be loaded directly here, or bindings/settings can be duplicated. +load_module("user_defaults") +load_module("user_overrides") +load_module("monitors") +load_module("workspaces") diff --git a/config/hypr/hyprlock-1080p.conf b/config/hypr/hyprlock-1080p.conf deleted file mode 100644 index b0a0279c..00000000 --- a/config/hypr/hyprlock-1080p.conf +++ /dev/null @@ -1,182 +0,0 @@ -# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # -# Hyprlock config for < 1080p 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 "<b> "$(date +'%A, %-d %B')" </b>" - color = $color13 - font_size = 48 - font_family = Victor Mono Bold Italic - position = 0, -60 - halign = center - valign = center -} - -# Hour-Time -label { - monitor = -# text = cmd[update:1000] echo "$(date +"%H")" - text = cmd[update:1000] echo "$(date +"%I:%M %p")" #AM/PM - #color = rgba(255, 185, 0, .8) - color = $color8 - font_size = 130 - font_family = JetBrainsMono Nerd Font ExtraBold - position = 0, -250 - halign = center - valign = top -} - -# Minute-Time -# label { -# monitor = -# text = cmd[update:1000] echo "$(date +"%M")" -# #color = rgba(15, 10, 222, .8) -# color = $color12 -# font_size = 150 -# font_family = JetBrainsMono Nerd Font ExtraBold -# position = 0, -340 -# halign = center - # valign = top -# } - -# Seconds-Time -# label { -# monitor = -## text = cmd[update:1000] echo "$(date +"%S")" -# text = cmd[update:1000] echo "$(date +"%S %p")" #AM/PM -# color = $color11 -# font_size = 32 -# font_family = JetBrainsMono Nerd Font ExtraBold -# position = 0, -350 -# 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, 280 -# halign = center -# valign = bottom -# } - -# USER -label { - monitor = - text = $USER - color = $color9 - font_size = 36 - font_family = Victor Mono Bold Oblique - position = 0, 275 - halign = center - valign = bottom -} - -# INPUT FIELD -input-field { - monitor = - size = 230, 70 - 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 = <i><span foreground="##ffffff99">🔒 Type Password</span></i> - hide_input = false - position = 0, 100 - halign = center - valign = bottom -} - -# Keyboard LAYOUT -label { - monitor = - text = $LAYOUT - color = $color8 - font_size = 14 - font_family = Victor Mono Bold Oblique - position = 0, 70 - halign = center - valign = bottom -} - -# uptime -label { - monitor = - text = cmd[update:60000] echo "<b> "$(uptime -p || $Scripts/UptimeNixOS.sh)" </b>" - color = $color8 - font_size = 24 - font_family = Victor Mono Bold Oblique - position = 0, 0 - halign = right - valign = bottom -} - -# battery information -label { - monitor = - text = cmd[update:1000] echo "<b> "$($Scripts/Battery.sh)" </b>" - color = $color8 - font_size = 16 - font_family = Victor Mono Bold Oblique - position = 0, 30 - 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 = 14 - font_family = Victor Mono Bold Oblique - position = 50, 0 - halign = left - valign = bottom -} diff --git a/config/hypr/hyprlock-2k.conf b/config/hypr/hyprlock-2k.conf index 8c357d90..08fa8539 100644 --- a/config/hypr/hyprlock-2k.conf +++ b/config/hypr/hyprlock-2k.conf @@ -1,5 +1,5 @@ # /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ # -# Hyprlock config for => 2k monitor resolutions +# Hyprlock config for < 1080p monitor resolutions # Original config submitted by https://github.com/SherLock707 # Sourcing colors generated by wallust @@ -17,7 +17,7 @@ background { #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 @@ -36,64 +36,64 @@ label { monitor = text = cmd[update:18000000] echo "<b> "$(date +'%A, %-d %B')" </b>" color = $color13 - font_size = 64 + font_size = 48 font_family = Victor Mono Bold Italic - position = 0, -20 + position = 0, -60 halign = center valign = center } -# Hour-Time (single horizontal time like 1080p variant) +# Hour-Time label { monitor = -# text = cmd[update:1000] echo "$(date +"%H:%M")" # 24h option - text = cmd[update:1000] echo "$(date +"%I:%M %p")" # AM/PM +# text = cmd[update:1000] echo "$(date +"%H")" + 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 + font_size = 130 + font_family = JetBrainsMono Nerd Font ExtraBold + position = 0, -250 halign = center valign = top } -# Minute-Time (disabled; kept for reference) +# Minute-Time # label { # monitor = # text = cmd[update:1000] echo "$(date +"%M")" # #color = rgba(15, 10, 222, .8) # color = $color12 -# font_size = 240 +# font_size = 150 # font_family = JetBrainsMono Nerd Font ExtraBold -# position = 0, -450 +# position = 0, -340 # halign = center -# valign = top + # valign = top # } -# Seconds-Time (disabled; kept for reference) +# Seconds-Time # 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 +# monitor = +## text = cmd[update:1000] echo "$(date +"%S")" + text = cmd[update:1000] echo "$(date +"%S %p")" #AM/PM +# color = $color11 +# font_size = 32 +# font_family = JetBrainsMono Nerd Font ExtraBold +# position = 0, -350 +# 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 +# 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 +# position = 0, 280 # halign = center # valign = bottom # } @@ -103,9 +103,9 @@ label { monitor = text = $USER color = $color9 - font_size = 48 + font_size = 36 font_family = Victor Mono Bold Oblique - position = 0, 300 + position = 0, 275 halign = center valign = bottom } @@ -113,7 +113,7 @@ label { # INPUT FIELD input-field { monitor = - size = 306, 93 + size = 230, 70 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 @@ -136,9 +136,9 @@ label { monitor = text = $LAYOUT color = $color8 - font_size = 19 + font_size = 14 font_family = Victor Mono Bold Oblique - position = 0, 53 + position = 0, 70 halign = center valign = bottom } @@ -148,7 +148,7 @@ label { monitor = text = cmd[update:60000] echo "<b> "$(uptime -p || $Scripts/UptimeNixOS.sh)" </b>" color = $color8 - font_size = 32 + font_size = 24 font_family = Victor Mono Bold Oblique position = 0, 0 halign = right @@ -160,9 +160,9 @@ label { monitor = text = cmd[update:1000] echo "<b> "$($Scripts/Battery.sh)" </b>" color = $color8 - font_size = 21 + font_size = 16 font_family = Victor Mono Bold Oblique - position = 0, 40 + position = 0, 30 halign = right valign = bottom } @@ -172,9 +172,9 @@ label { # 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" + text = cmd[update:3600000] [ -f "$HOME/.cache/.weather_cache" ] && cat "$HOME/.cache/.weather_cache" color = $color8 - font_size = 19 + font_size = 14 font_family = Victor Mono Bold Oblique position = 50, 0 halign = left diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf deleted file mode 100644 index 8c357d90..00000000 --- a/config/hypr/hyprlock.conf +++ /dev/null @@ -1,182 +0,0 @@ -# /* ---- 💫 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 "<b> "$(date +'%A, %-d %B')" </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 = <i><span foreground="##ffffff99">🔒 Type Password</span></i> - 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 "<b> "$(uptime -p || $Scripts/UptimeNixOS.sh)" </b>" - 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 "<b> "$($Scripts/Battery.sh)" </b>" - 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/initial-boot.sh b/config/hypr/initial-boot.sh index 8ccda640..b45c31aa 100755 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -16,6 +16,32 @@ color_scheme="prefer-dark" gtk_theme="Flat-Remix-GTK-Blue-Dark" icon_theme="Flat-Remix-Blue-Dark" cursor_theme="Bibata-Modern-Ice" +wallust_args=() +# shellcheck source=/dev/null +if [ -f "$scriptsDir/WallustConfig.sh" ]; then + . "$scriptsDir/WallustConfig.sh" +fi + +set_interface_pref_with_retry() { + local key="$1" + local value="$2" + local expected="$3" + local current="" + local attempt=0 + local max_attempts=6 + + while [ "$attempt" -lt "$max_attempts" ]; do + gsettings set org.gnome.desktop.interface "$key" "$value" > /dev/null 2>&1 || true + current="$(gsettings get org.gnome.desktop.interface "$key" 2>/dev/null || true)" + if [ "$current" = "$expected" ]; then + return 0 + fi + attempt=$((attempt + 1)) + sleep 0.25 + done + + return 1 +} if command -v awww >/dev/null 2>&1; then WWW="awww" @@ -29,28 +55,27 @@ effect="--transition-bezier .43,1.19,1,.4 --transition-fps 30 --transition-type # Check if a marker file exists. if [ ! -f "$HOME/.config/hypr/.initial_startup_done" ]; then - sleep 1 + # Apply appearance preferences early and synchronously to avoid startup races + # where Flatpak/libadwaita apps can default to light mode. + set_interface_pref_with_retry color-scheme "'$color_scheme'" "'$color_scheme'" || true + set_interface_pref_with_retry gtk-theme "'$gtk_theme'" "'$gtk_theme'" || true + set_interface_pref_with_retry icon-theme "'$icon_theme'" "'$icon_theme'" || true + set_interface_pref_with_retry cursor-theme "'$cursor_theme'" "'$cursor_theme'" || true + gsettings set org.gnome.desktop.interface cursor-size 24 > /dev/null 2>&1 || true # Initialize wallust and wallpaper if [ -f "$wallpaper" ]; then - wallust run -s $wallpaper > /dev/null + wallust "${wallust_args[@]}" run -s "$wallpaper" > /dev/null $WWW query || $DAEMON && $swww $wallpaper $effect "$scriptsDir/WallustSwww.sh" > /dev/null 2>&1 & fi - - # initiate GTK dark mode and apply icon and cursor theme - gsettings set org.gnome.desktop.interface color-scheme $color_scheme > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface gtk-theme $gtk_theme > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface icon-theme $icon_theme > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface cursor-theme $cursor_theme > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface cursor-size 24 > /dev/null 2>&1 & # NIXOS initiate GTK dark mode and apply icon and cursor theme - if [ -n "$(grep -i nixos < /etc/os-release)" ]; then - gsettings set org.gnome.desktop.interface color-scheme "'$color_scheme'" > /dev/null 2>&1 & - dconf write /org/gnome/desktop/interface/gtk-theme "'$gtk_theme'" > /dev/null 2>&1 & - dconf write /org/gnome/desktop/interface/icon-theme "'$icon_theme'" > /dev/null 2>&1 & - dconf write /org/gnome/desktop/interface/cursor-theme "'$cursor_theme'" > /dev/null 2>&1 & - dconf write /org/gnome/desktop/interface/cursor-size "24" > /dev/null 2>&1 & + if grep -qi nixos /etc/os-release; then + dconf write /org/gnome/desktop/interface/color-scheme "'$color_scheme'" > /dev/null 2>&1 || true + dconf write /org/gnome/desktop/interface/gtk-theme "'$gtk_theme'" > /dev/null 2>&1 || true + dconf write /org/gnome/desktop/interface/icon-theme "'$icon_theme'" > /dev/null 2>&1 || true + dconf write /org/gnome/desktop/interface/cursor-theme "'$cursor_theme'" > /dev/null 2>&1 || true + dconf write /org/gnome/desktop/interface/cursor-size "24" > /dev/null 2>&1 || true fi # initiate kvantum theme diff --git a/config/hypr/lua/animations.lua b/config/hypr/lua/animations.lua new file mode 100644 index 00000000..9ba7d709 --- /dev/null +++ b/config/hypr/lua/animations.lua @@ -0,0 +1,33 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from config/hypr/UserConfigs/UserAnimations.conf. + +hl.config({ + animations = { + enabled = true, + }, +}) + +hl.curve("wind", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } }) +hl.curve("winIn", { type = "bezier", points = { { 0.1, 1.1 }, { 0.1, 1.1 } } }) +hl.curve("winOut", { type = "bezier", points = { { 0.3, -0.3 }, { 0, 1 } } }) +hl.curve("liner", { type = "bezier", points = { { 1, 1 }, { 1, 1 } } }) +hl.curve("overshot", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } }) +hl.curve("smoothOut", { type = "bezier", points = { { 0.5, 0 }, { 0.99, 0.99 } } }) +hl.curve("smoothIn", { type = "bezier", points = { { 0.5, -0.5 }, { 0.68, 1.5 } } }) + +hl.animation({ leaf = "windows", enabled = true, speed = 6, bezier = "wind", style = "slide" }) +hl.animation({ leaf = "windowsIn", enabled = true, speed = 5, bezier = "winIn", style = "slide" }) +hl.animation({ leaf = "windowsOut", enabled = true, speed = 3, bezier = "smoothOut", style = "slide" }) +hl.animation({ leaf = "windowsMove", enabled = true, speed = 5, bezier = "wind", style = "slide" }) +hl.animation({ leaf = "border", enabled = true, speed = 1, bezier = "liner" }) +hl.animation({ leaf = "borderangle", enabled = true, speed = 100, bezier = "liner", style = "loop" }) +hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "smoothOut" }) +hl.animation({ leaf = "workspaces", enabled = true, speed = 5, bezier = "overshot" }) +hl.animation({ leaf = "workspacesIn", enabled = true, speed = 5, bezier = "winIn", style = "slide" }) +hl.animation({ leaf = "workspacesOut", enabled = true, speed = 5, bezier = "winOut", style = "slide" }) diff --git a/config/hypr/lua/decorations.lua b/config/hypr/lua/decorations.lua new file mode 100644 index 00000000..1fe25fd7 --- /dev/null +++ b/config/hypr/lua/decorations.lua @@ -0,0 +1,64 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from config/hypr/UserConfigs/UserDecorations.conf. +-- NOTE: wallust-hyprland.conf is hyprlang-sourced in the original config. +-- Lua parity for importing that file is still evolving; using static color fallbacks here. + +hl.config({ + general = { + border_size = 2, + gaps_in = 2, + gaps_out = 4, + col = { + active_border = "rgba(8db4ffff)", + inactive_border = "rgba(5f6578ff)", + }, + }, +}) + +hl.config({ + decoration = { + rounding = 10, + active_opacity = 1.0, + inactive_opacity = 0.9, + fullscreen_opacity = 1.0, + dim_inactive = true, + dim_strength = 0.1, + dim_special = 0.8, + shadow = { + enabled = true, + range = 3, + render_power = 1, + color = "rgba(8db4ffff)", + color_inactive = "rgba(5f6578ff)", + }, + blur = { + enabled = true, + size = 6, + passes = 3, + new_optimizations = true, + xray = true, + ignore_opacity = true, + special = true, + popups = true, + }, + }, +}) + +hl.config({ + group = { + col = { + border_active = "rgba(ffffffff)", + }, + groupbar = { + col = { + active = "rgba(0f111aff)", + }, + }, + }, +}) diff --git a/config/hypr/lua/env.lua b/config/hypr/lua/env.lua new file mode 100644 index 00000000..f4e6c9e6 --- /dev/null +++ b/config/hypr/lua/env.lua @@ -0,0 +1,37 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from: +-- - config/hypr/configs/ENVariables.conf +-- - config/hypr/UserConfigs/ENVariables.conf (active values only) + +hl.env("DOTS_VERSION", "2.3.23") +hl.env("GDK_BACKEND", "wayland,x11,*") +hl.env("QT_QPA_PLATFORM", "wayland;xcb") +hl.env("CLUTTER_BACKEND", "wayland") +hl.env("XDG_CURRENT_DESKTOP", "Hyprland") +hl.env("XDG_SESSION_DESKTOP", "Hyprland") +hl.env("XDG_SESSION_TYPE", "wayland") +hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1") +hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1") +hl.env("QT_QPA_PLATFORMTHEME", "qt6ct") +hl.env("QT_STYLE_OVERRIDE", "kvantum") +hl.env("QT_QUICK_CONTROLS_STYLE", "org.hyprland.style") +hl.env("GDK_SCALE", "1") +hl.env("QT_SCALE_FACTOR", "1") +hl.env("MOZ_ENABLE_WAYLAND", "1") +hl.env("ELECTRON_OZONE_PLATFORM_HINT", "auto") + +-- Fix for missing mime-info database error +local current_data_dirs = os.getenv("XDG_DATA_DIRS") or "" +if not current_data_dirs:find("/usr/share") then + local new_data_dirs = "/usr/local/share:/usr/share" + if current_data_dirs ~= "" then + new_data_dirs = new_data_dirs .. ":" .. current_data_dirs + end + hl.env("XDG_DATA_DIRS", new_data_dirs) +end diff --git a/config/hypr/lua/keybind_helpers.lua b/config/hypr/lua/keybind_helpers.lua new file mode 100644 index 00000000..92dc952b --- /dev/null +++ b/config/hypr/lua/keybind_helpers.lua @@ -0,0 +1,355 @@ +local M = {} + +local function trim(value) + return (value or ""):gsub("^%s+", ""):gsub("%s+$", "") +end +local dsp = hl.dsp or hl +local window_api = (dsp and dsp.window) or hl.window or {} +local workspace_api = (dsp and dsp.workspace) or {} +local group_api = (dsp and dsp.group) or {} + +local function exec_cmd(cmd) + if dsp and dsp.exec_cmd then + return dsp.exec_cmd(cmd) + end + return function() + hl.exec_cmd(cmd) + end +end + +local function shell_quote(value) + return "'" .. tostring(value):gsub("'", "'\\''") .. "'" +end + +local function raw_dispatch_cmd(command) + if dsp and dsp.exec_raw then + return dsp.exec_raw(tostring(command)) + end + local expression = "hl.dsp.exec_raw(" .. string.format("%q", tostring(command)) .. ")" + return exec_cmd("hyprctl dispatch " .. shell_quote(expression)) +end + +local function workspace_dispatch(value) + if dsp and dsp.focus then + return function() + hl.dispatch(dsp.focus({ workspace = value })) + end + end + return raw_dispatch_cmd("workspace " .. tostring(value)) +end + +local known_dispatchers = { + bringactivetotop = true, + changegroupactive = true, + cyclenext = true, + fullscreen = true, + killactive = true, + layoutmsg = true, + movefocus = true, + moveintogroup = true, + moveoutofgroup = true, + movecurrentworkspacetomonitor = true, + movetoworkspace = true, + movetoworkspacesilent = true, + movewindow = true, + pseudo = true, + resizeactive = true, + setprop = true, + swapwindow = true, + togglegroup = true, + togglefloating = true, + togglespecialworkspace = true, + workspace = true, +} + +local function direction(value) + local directions = { + l = "left", + r = "right", + u = "up", + d = "down", + left = "left", + right = "right", + up = "up", + down = "down", + } + return directions[trim(value)] or trim(value) +end + +local function workspace_value(value) + value = trim(value) + return tonumber(value) or value +end + +local function dispatch_factory_safely(factory) + pcall(function() + local dispatcher = factory() + if dispatcher then + hl.dispatch(dispatcher) + end + end) +end + +local function dispatch(name, args) + name = trim(name) + args = trim(args) + + if args:match("^exec%s*,") then + return exec_cmd(trim(args:gsub("^exec%s*,", "", 1))) + end + + if name == "exec" then + return exec_cmd(args) + end + + if known_dispatchers[args] and not known_dispatchers[name] then + if args == "movewindow" and window_api.drag then + return window_api.drag() + end + if args == "resizewindow" and window_api.resize then + return window_api.resize() + end + return raw_dispatch_cmd(args) + end + + if name == "killactive" and window_api.close then + return window_api.close() + end + if name == "togglefloating" and window_api.float then + return window_api.float({ action = "toggle" }) + end + if name == "fullscreen" and window_api.fullscreen then + if args == "1" then + return window_api.fullscreen({ mode = "maximized" }) + end + return window_api.fullscreen({ mode = "fullscreen" }) + end + if name == "pseudo" and window_api.pseudo then + return window_api.pseudo() + end + if name == "workspace" then + return workspace_dispatch(workspace_value(args)) + end + if name == "movetoworkspace" then + if window_api.move then + return function() + hl.dispatch(window_api.move({ workspace = workspace_value(args) })) + end + end + return raw_dispatch_cmd("movetoworkspace " .. args) + end + if name == "movetoworkspacesilent" then + if window_api.move then + return function() + hl.dispatch(window_api.move({ workspace = workspace_value(args), follow = false })) + end + end + return raw_dispatch_cmd("movetoworkspacesilent " .. args) + end + if name == "resizeactive" then + return raw_dispatch_cmd("resizeactive " .. args) + end + if name == "movecurrentworkspacetomonitor" then + return raw_dispatch_cmd("movecurrentworkspacetomonitor " .. args) + end + if name == "movefocus" then + if dsp and dsp.focus then + return function() + dispatch_factory_safely(function() + return dsp.focus({ direction = direction(args) }) + end) + end + end + return raw_dispatch_cmd("movefocus " .. args) + end + if name == "movewindow" then + if window_api.move then + return function() + dispatch_factory_safely(function() + return window_api.move({ direction = direction(args) }) + end) + end + end + return raw_dispatch_cmd("movewindow " .. args) + end + if name == "swapwindow" then + local swap_direction = trim(args) + if swap_direction == "" then + return nil + end + return exec_cmd("$HOME/.config/hypr/scripts/LuaSwapWindow.sh " .. swap_direction) + end + if name == "togglegroup" and group_api.toggle then + return group_api.toggle() + end + if name == "changegroupactive" and group_api.next and group_api.prev then + if args == "b" or args == "prev" or args == "-1" then + return group_api.prev() + end + return group_api.next() + end + if name == "moveintogroup" and window_api.move then + return window_api.move({ into_group = direction(args) }) + end + if name == "moveoutofgroup" and window_api.move then + return window_api.move({ out_of_group = true }) + end + if name == "layoutmsg" and dsp and dsp.layout then + return dsp.layout(args) + end + if name == "bringactivetotop" and window_api.bring_to_top then + return window_api.bring_to_top() + end + if name == "setprop" and window_api.set_prop then + local prop, value = args:match("^(%S+)%s+(.+)$") + if prop and value then + return window_api.set_prop({ prop = prop, value = value }) + end + end + + if args ~= "" then + return raw_dispatch_cmd(name .. " " .. args) + end + return raw_dispatch_cmd(name) +end + +local function chord(mods, key) + mods = trim(mods):gsub("%s+", " + ") + key = trim(key) + key = key:gsub("^xf86", "XF86") + local key_aliases = { + XF86AudioPlayPause = "XF86AudioPlay", + XF86audiolowervolume = "XF86AudioLowerVolume", + XF86audiomute = "XF86AudioMute", + XF86audioraisevolume = "XF86AudioRaiseVolume", + XF86audiostop = "XF86AudioStop", + } + key = key_aliases[key] or key + local shifted_number_keys = { + ["code:10"] = "exclam", + ["code:11"] = "at", + ["code:12"] = "numbersign", + ["code:13"] = "dollar", + ["code:14"] = "percent", + ["code:15"] = "asciicircum", + ["code:16"] = "ampersand", + ["code:17"] = "asterisk", + ["code:18"] = "parenleft", + ["code:19"] = "parenright", + } + local number_keys = { + ["code:10"] = "1", + ["code:11"] = "2", + ["code:12"] = "3", + ["code:13"] = "4", + ["code:14"] = "5", + ["code:15"] = "6", + ["code:16"] = "7", + ["code:17"] = "8", + ["code:18"] = "9", + ["code:19"] = "0", + } + if mods:match("SHIFT") and shifted_number_keys[key] then + key = shifted_number_keys[key] + else + key = number_keys[key] or key + end + if mods == "" then + return key + end + return mods .. " + " .. key +end + +local function bind(mods, key, fn, opts) + if opts then + hl.bind(chord(mods, key), fn, opts) + else + hl.bind(chord(mods, key), fn) + end + if mods:match("SHIFT") then + local number_key = ({ + ["code:10"] = "1", + ["code:11"] = "2", + ["code:12"] = "3", + ["code:13"] = "4", + ["code:14"] = "5", + ["code:15"] = "6", + ["code:16"] = "7", + ["code:17"] = "8", + ["code:18"] = "9", + ["code:19"] = "0", + })[key] + if number_key then + if opts then + hl.bind(chord(mods, number_key), fn, opts) + else + hl.bind(chord(mods, number_key), fn) + end + end + end +end + +local function unbind_chord(key_chord) + if hl.unbind then + pcall(hl.unbind, key_chord) + end +end + +local function bindm(mods, key, dispatcher, description) + local action = nil + if dispatcher == "movewindow" and window_api.drag then + action = window_api.drag() + elseif dispatcher == "resizewindow" then + if window_api.resize then + action = window_api.resize() + else + action = raw_dispatch_cmd("resizewindow") + end + else + action = raw_dispatch_cmd(dispatcher) + end + bind(mods, key, action, { description = description, mouse = true }) +end + +local keys_to_unbind = { + "SUPER + V", + "SUPER + W", + "SUPER + P", + "SUPER + N", + "SUPER + T", + "SUPER + X", + "SUPER + CTRL + S", + "SUPER + G", + "SUPER + ALT + S", + "SUPER + F", + "SUPER + ALT + F", + "SUPER + CTRL + F", + "SUPER + CTRL + A", + "SUPER + CTRL + B", + "SUPER + CTRL + W", + "SUPER + CTRL + T", + "ALT + TAB", + "SUPER + mouse_down", + "SUPER + mouse_up", + "SUPER + SLASH", + "SUPER + code:61", + "SUPER + ALT + code:61", +} + +local function unbind_default_keys() + for _, key in ipairs(keys_to_unbind) do + unbind_chord(key) + end +end + +M.window_api = window_api +M.workspace_api = workspace_api +M.group_api = group_api +M.exec_cmd = exec_cmd +M.raw_dispatch_cmd = raw_dispatch_cmd +M.dispatch = dispatch +M.bind = bind +M.bindm = bindm +M.unbind_default_keys = unbind_default_keys + +return M diff --git a/config/hypr/lua/keybinds.lua b/config/hypr/lua/keybinds.lua new file mode 100644 index 00000000..6bf71e47 --- /dev/null +++ b/config/hypr/lua/keybinds.lua @@ -0,0 +1,648 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Auto-generated from Keybinds.conf/UserKeybinds.conf for Lua testing +-- Helper internals live in keybind_helpers.lua so this file stays focused on bindings you may edit. +-- To add a binding, copy an existing bind(...) line and change: +-- 1) modifiers (e.g. "SUPER SHIFT") +-- 2) key (e.g. "Return", "code:10", "mouse_down") +-- 3) action (exec_cmd(...) or dispatch(...)) +-- 4) description text +local keybind_helpers = nil +do + local source = (debug.getinfo(1, "S") or {}).source or "" + local source_path = source:match("^@(.+)$") + local source_dir = source_path and source_path:match("^(.*)/[^/]+$") or nil + local home = os.getenv("HOME") or "" + local candidate_paths = { + source_dir and (source_dir .. "/keybind_helpers.lua") or nil, + home ~= "" and (home .. "/.config/hypr/lua/keybind_helpers.lua") or nil, + home ~= "" and (home .. "/.config/hypr/keybind_helpers.lua") or nil, + } + + local tried_paths = {} + for _, helper_path in ipairs(candidate_paths) do + if helper_path then + table.insert(tried_paths, helper_path) + local f = io.open(helper_path, "r") + if f then + f:close() + local loaded_ok, loaded_helpers = pcall(dofile, helper_path) + if loaded_ok and type(loaded_helpers) == "table" and loaded_helpers.unbind_default_keys then + keybind_helpers = loaded_helpers + break + end + end + end + end + + if not keybind_helpers then + error("Failed to load keybind_helpers.lua from: " .. table.concat(tried_paths, ", ")) + end +end +local window_api = keybind_helpers.window_api +local exec_cmd = keybind_helpers.exec_cmd +local raw_dispatch_cmd = keybind_helpers.raw_dispatch_cmd +local dispatch = keybind_helpers.dispatch +local bind = keybind_helpers.bind +local bindm = keybind_helpers.bindm + +-- Mass unbind defaults before rebuilding the Lua keymap. +keybind_helpers.unbind_default_keys() + +-- ================================================== +-- User-editable bindings +-- ================================================== +-- Section: Application launchers and utility scripts +local app_binds = { + { "SUPER", "D", "pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window", "app launcher" }, + { "SUPER", "B", 'xdg-open "https://"', "open default browser" }, + { "SUPER", "A", "$HOME/.config/hypr/scripts/OverviewToggle.sh", "desktop overview" }, + { "SUPER", "Return", "kitty", "Open terminal" }, + { "SUPER", "E", "thunar", "file manager" }, + { "SUPER", "C", "$HOME/.config/hypr/scripts/rofi-ssh-menu.sh", "SSH session manager" }, + { "SUPER", "T", "$HOME/.config/hypr/scripts/ThemeChanger.sh", "Global theme switcher using Wallust" }, + { "SUPER", "H", "$HOME/.config/hypr/scripts/KeyHints.sh", "help / cheat sheet" }, + { "SUPER ALT", "R", "$HOME/.config/hypr/scripts/Refresh.sh", "refresh bar and menus" }, + { "SUPER ALT", "E", "$HOME/.config/hypr/scripts/RofiEmoji.sh", "emoji menu" }, + { "SUPER", "S", "$HOME/.config/hypr/scripts/RofiSearch.sh", "web search" }, + { "SUPER CTRL", "S", "rofi -show window", "window switcher" }, + { "SUPER ALT", "O", "$HOME/.config/hypr/scripts/ChangeBlur.sh", "toggle blur" }, + { "SUPER SHIFT", "G", "$HOME/.config/hypr/scripts/GameMode.sh", "toggle game mode" }, + { "SUPER ALT", "L", "$HOME/.config/hypr/scripts/ChangeLayout.sh toggle", "toggle layouts" }, + { "SUPER ALT", "V", "$HOME/.config/hypr/scripts/ClipManager.sh", "clipboard manager" }, + { "SUPER CTRL", "R", "$HOME/.config/hypr/scripts/RofiThemeSelector.sh", "rofi theme selector" }, + { + "SUPER CTRL SHIFT", + "R", + "pkill rofi || true && $HOME/.config/hypr/scripts/RofiThemeSelector-modified.sh", + "rofi theme selector (modified)", + }, + { "SUPER CTRL", "K", "$HOME/.config/hypr/scripts/Kitty_themes.sh", "Kitty theme selector" }, + { "SUPER CTRL", "G", "$HOME/.config/hypr/scripts/Ghostty_themes.sh", "Ghostty theme selector" }, + { + "SUPER SHIFT", + "B", + "$HOME/.config/hypr/UserScripts/RainbowBorders-low-cpu.sh --run-once", + "Set static Rainbow Border", + }, + { + "SUPER SHIFT", + "H", + "$HOME/.config/hypr/scripts/Toggle-Active-Window-Audio.sh", + "Toggle Mute/Unmute for Active-Window", + }, + { + "ALT SHIFT", + "S", + "$HOME/.config/hypr/scripts/hyprshot.sh -m region -o $HOME/Pictures/Screenshots", + "Hyprshot Screen Capture", + }, + { "SUPER ALT", "SPACE", "$HOME/.config/hypr/scripts/Float-all-Windows.sh", "Float all windows" }, + -- NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. + { "SUPER SHIFT", "Return", "$HOME/.config/hypr/scripts/Dropterminal.sh kitty", "DropDown terminal" }, + { + "SUPER ALT", + "mouse_down", + "hyprctl keyword cursor:zoom_factor \"$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')\"", + "zoom in", + }, + { + "SUPER ALT", + "mouse_up", + "hyprctl keyword cursor:zoom_factor \"$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')\"", + "zoom out", + }, + { "SUPER CTRL ALT", "B", "pkill -SIGUSR1 waybar", "toggle waybar on/off" }, + { "SUPER CTRL", "B", "$HOME/.config/hypr/scripts/WaybarStyles.sh", "waybar styles menu" }, + { "SUPER ALT", "B", "$HOME/.config/hypr/scripts/WaybarLayout.sh", "waybar layout menu" }, + { "SUPER", "N", "$HOME/.config/hypr/scripts/Hyprsunset.sh toggle", "Toggle Hyprsunset - night light" }, + { "SUPER SHIFT", "M", "$HOME/.config/hypr/UserScripts/RofiBeats.sh", "online music" }, + { "SUPER", "W", "$HOME/.config/hypr/UserScripts/WallpaperSelect.sh", "select wallpaper" }, + { "SUPER SHIFT", "W", "$HOME/.config/hypr/UserScripts/WallpaperEffects.sh", "wallpaper effects" }, + { "CTRL ALT", "W", "$HOME/.config/hypr/UserScripts/WallpaperRandom.sh", "random wallpaper" }, + { "SUPER SHIFT", "K", "$HOME/.config/hypr/scripts/KeyBinds.sh", "search keybinds" }, + { "SUPER SHIFT", "A", "$HOME/.config/hypr/scripts/Animations.sh", "animations menu" }, + { "SUPER SHIFT", "O", "$HOME/.config/hypr/UserScripts/ZshChangeTheme.sh", "change oh-my-zsh theme" }, + { "SUPER ALT", "C", "$HOME/.config/hypr/UserScripts/RofiCalc.sh", "calculator" }, +} +for _, app in ipairs(app_binds) do + bind(app[1], app[2], exec_cmd(app[3]), { description = app[4] }) +end +-- +-- +-- These are examples of how to bind to a TUI/CLI apps +-- The specific keybinds are just examples +-- Do not user as-is as it will break exisitng keybinds +-- +-- +-- TUI Apps Configuration (commented options from LUA-files/hyprland-key-bindings-example.lua). +-- local terminal = "uwsm-app -- " .. (os.getenv("TERMINAL") or "") +-- local browser = "omarchy-launch-browser" +-- local tui_apps = { +-- { "CTRL + ALT + O", "opencode", "a opencode", "OpenCode" }, +-- { "CTRL + ALT + SHIFT + A", "cline", "-e cline", "OpenCode" }, +-- { "CTRL + ALT + B", "btop", "-e btop", "Task Manager" }, +-- { "CTRL + ALT + SHIFT + B", "bluetui", "-e bluetui", "BlueTUI" }, +-- { "CTRL + ALT + E", "spf", "-e spf", "SuperFile Manager" }, +-- { "CTRL + ALT + L", "lazygit", "-e lazygit", "LazyGit" }, +-- { "CTRL + ALT + N", "nvtop", "-e nvtop", "Nvtop" }, +-- { "CTRL + ALT + SHIFT + N", "ncdu", "-e ncdu", "Ncdu" }, +-- { "CTRL + ALT + W", "impala", "-e impala", "Impala Wi-Fi" }, +-- { "CTRL + ALT + P", "pacseek", "-e pacseek", "PacSeek" }, +-- { "CTRL + ALT + SHIFT + P", "pacsea", "-e pacsea", "PacSea" }, +-- { "CTRL + ALT + R", "fzf-uninstall", "-e ~/.config/hypr/fzfpurge", "Fzf Uninstaller" }, +-- { "CTRL + ALT + V", "wiremix", "-e wiremix", "WireMix Volume" }, +-- { "CTRL + ALT + SHIFT + H", "htop", "-e htop", "Htop" }, +-- } +-- for _, app in ipairs(tui_apps) do +-- hl.bind(app[1], hl.dsp.exec_cmd(terminal .. " --title=" .. app[2] .. " " .. app[3]), { description = app[4] }) +-- end + +-- +-- +-- These are examples of how to bind webpages +-- The specific keybinds are just examples +-- Do not user as-is as it will break exisitng keybinds +-- +-- +-- Web Apps Configuration (commented options from LUA-files/hyprland-key-bindings-example.lua). +-- local web_apps = { +-- { "SUPER + A", "https://gemini.google.com", "Gemini AI" }, +-- { "SUPER + Y", "https://youtube.com", "YouTube" }, +-- { "SUPER + T", "https://tiktok.com", "TikTok" }, +-- { "SUPER + X", "https://x.com", "X.com" }, +-- { "SUPER + U", "http://10.24.1.1", "Unifi" }, +-- { "SUPER + I", "https://instagram.com", "Instagram" }, +-- { "SUPER + P", "https://mail.proton.me", "Proton Mail" }, +-- } +-- for _, web in ipairs(web_apps) do +-- hl.bind(web[1], hl.dsp.exec_cmd([[omarchy-launch-webapp "]] .. web[2] .. [["]]), { description = web[3] }) +-- end + +-- Manual example actions not currently active in this config. +-- hl.bind("SUPER + F", hl.dsp.window.fullscreen({ mode = "fullscreen" }), { description = "Fullscreen Window" }) +-- hl.bind("ALT + SPACE", hl.dsp.window.float({ action = "toggle" }), { description = "Toggle floating" }) +-- hl.bind("CTRL + ALT + return", hl.dsp.exec_cmd("uwsm-app -- kitty"), { description = "Kitty terminal" }) +-- hl.bind( +-- "CTRL + ALT + SHIFT + return", +-- hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" tmux new]]), +-- { description = "Tmux" } +-- ) + +-- Section: Window/session controls +bind("SUPER SHIFT", "F", dispatch("fullscreen", ""), { description = "fullscreen" }) +bind("SUPER CTRL", "F", dispatch("fullscreen", "1"), { description = "maximize window" }) +bind("SUPER", "SPACE", dispatch("togglefloating", ""), { description = "Float current window" }) +bind("SUPER CTRL", "O", dispatch("setprop", "active opaque toggle"), { description = "toggle active window opacity" }) +bind( + "ALT_L", + "SHIFT_L", + dispatch("switch keyboard layout globally", "exec, $HOME/.config/hypr/scripts/KeyboardLayout.sh switch"), + { locked = true, description = "switch keyboard layout globally" } +) +bind( + "SHIFT_L", + "ALT_L", + dispatch("switch keyboard layout per-window", "exec, $HOME/.config/hypr/scripts/Tak0-Per-Window-Switch.sh"), + { locked = true, description = "switch keyboard layout per-window" } +) +bind( + "SUPER CTRL", + "F9", + dispatch("movecurrentworkspacetomonitor", "l"), + { description = "move workspace to left monitor" } +) +bind( + "SUPER CTRL", + "F10", + dispatch("movecurrentworkspacetomonitor", "r"), + { description = "move workspace to right monitor" } +) +bind( + "SUPER CTRL", + "F11", + dispatch("movecurrentworkspacetomonitor", "u"), + { description = "move workspace to up monitor" } +) +bind( + "SUPER CTRL", + "F12", + dispatch("movecurrentworkspacetomonitor", "d"), + { description = "move workspace to down monitor" } +) +bind("CTRL ALT", "Delete", exec_cmd("$HOME/.config/hypr/scripts/Logout.sh"), { description = "exit Hyprland" }) +bind("SUPER", "Q", dispatch("killactive", ""), { description = "close active window" }) +bind( + "SUPER SHIFT", + "Q", + exec_cmd("$HOME/.config/hypr/scripts/KillActiveProcess.sh"), + { description = "Terminate active process" } +) +bind("CTRL ALT", "L", exec_cmd("$HOME/.config/hypr/scripts/LockScreen.sh"), { description = "lock screen" }) +bind("CTRL ALT", "P", exec_cmd("$HOME/.config/hypr/scripts/Wlogout.sh"), { description = "powermenu" }) +bind("SUPER SHIFT", "N", exec_cmd("swaync-client -t -sw"), { description = "notification panel" }) +bind( + "SUPER SHIFT", + "E", + exec_cmd("$HOME/.config/hypr/scripts/Kool_Quick_Settings.sh"), + { description = "Quick settings menu" } +) + +-- Section: Layout and tiling controls +bind("SUPER CTRL", "D", dispatch("layoutmsg", "removemaster"), { description = "remove master" }) +bind("SUPER", "I", dispatch("layoutmsg", "addmaster"), { description = "add master" }) +bind("SUPER", "j", exec_cmd("$HOME/.config/hypr/scripts/LuaCycleWindow.sh next"), { description = "cycle next" }) +bind( + "SUPER", + "k", + exec_cmd("$HOME/.config/hypr/scripts/LuaCycleWindow.sh previous"), + { description = "cycle previous" } +) +bind("SUPER CTRL", "Return", dispatch("layoutmsg", "swapwithmaster"), { description = "swap with master" }) +bind("SUPER SHIFT", "I", dispatch("layoutmsg", "togglesplit"), { description = "toggle split (dwindle)" }) +bind("SUPER", "P", dispatch("pseudo", ""), { description = "toggle pseudo (dwindle)" }) +bind("SUPER", "M", raw_dispatch_cmd("splitratio 0.3"), { description = "set split ratio 0.3" }) +bind( + "SUPER ALT", + "1", + exec_cmd("$HOME/.config/hypr/scripts/ChangeLayout.sh dwindle"), + { description = "layout dwindle" } +) +bind("SUPER ALT", "2", exec_cmd("$HOME/.config/hypr/scripts/ChangeLayout.sh master"), { description = "layout master" }) +bind( + "SUPER ALT", + "3", + exec_cmd("$HOME/.config/hypr/scripts/ChangeLayout.sh scrolling"), + { description = "layout scrolling" } +) +bind( + "SUPER ALT", + "4", + exec_cmd("$HOME/.config/hypr/scripts/ChangeLayout.sh monocle"), + { description = "layout monocle" } +) +bind("SUPER SHIFT", "period", dispatch("layoutmsg", "move +col"), { description = "move to right column" }) +bind("SUPER SHIFT", "comma", dispatch("layoutmsg", "move -col"), { description = "move to left column" }) +bind("SUPER ALT", "comma", dispatch("layoutmsg", "swapcol l"), { description = "swap columns left" }) +bind("SUPER ALT", "period", dispatch("layoutmsg", "swapcol r"), { description = "swap columns right" }) +bind( + "SUPER ALT", + "H", + exec_cmd("hyprctl keyword scrolling:direction right"), + { description = "Horizonal scroll right" } +) +bind("SUPER ALT", "V", exec_cmd("hyprctl keyword scrolling:direction down"), { description = "Vertical Scroll down" }) +bind( + "SUPER ALT", + "S", + exec_cmd( + 'bash -c \'[[ $(hyprctl getoption scrolling:direction -j | jq -r ".str") == "right" ]] && hyprctl keyword scrolling:direction down || hyprctl keyword scrolling:direction right\'' + ), + { description = "toggle scrolling V/H" } +) +bind("ALT", "Tab", exec_cmd("$HOME/.config/hypr/scripts/LuaCycleWindow.sh next"), { description = "cycle next window" }) + +-- Section: Audio, media, and hardware keys +bind( + "", + "xf86audioraisevolume", + dispatch("volume up", "exec, $HOME/.config/hypr/scripts/Volume.sh --inc"), + { description = "volume up" } +) +bind( + "", + "xf86audiolowervolume", + dispatch("volume down", "exec, $HOME/.config/hypr/scripts/Volume.sh --dec"), + { description = "volume down" } +) +bind( + "ALT", + "xf86audioraisevolume", + dispatch("volume up precise", "exec, $HOME/.config/hypr/scripts/Volume.sh --inc-precise"), + { description = "volume up precise" } +) +bind( + "ALT", + "xf86audiolowervolume", + dispatch("volume down precise", "exec, $HOME/.config/hypr/scripts/Volume.sh --dec-precise"), + { description = "volume down precise" } +) +bind( + "", + "xf86AudioMicMute", + dispatch("toggle mic mute", "exec, $HOME/.config/hypr/scripts/Volume.sh --toggle-mic"), + { locked = true, description = "toggle mic mute" } +) +bind( + "", + "xf86audiomute", + dispatch("toggle mute", "exec, $HOME/.config/hypr/scripts/Volume.sh --toggle"), + { locked = true, description = "toggle mute" } +) +bind("", "xf86Sleep", dispatch("sleep", "exec, systemctl suspend"), { locked = true, description = "sleep" }) +bind( + "", + "xf86Rfkill", + dispatch("airplane mode", "exec, $HOME/.config/hypr/scripts/AirplaneMode.sh"), + { locked = true, description = "airplane mode" } +) +bind( + "", + "xf86AudioPlayPause", + dispatch("play/pause", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --pause"), + { locked = true, description = "play/pause" } +) +bind( + "", + "xf86AudioPause", + dispatch("pause", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --pause"), + { locked = true, description = "pause" } +) +bind( + "", + "xf86AudioPlay", + dispatch("play", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --pause"), + { locked = true, description = "play" } +) +bind( + "", + "xf86AudioNext", + dispatch("next track", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --nxt"), + { locked = true, description = "next track" } +) +bind( + "", + "xf86AudioPrev", + dispatch("previous track", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --prv"), + { locked = true, description = "previous track" } +) +bind( + "", + "xf86audiostop", + dispatch("stop", "exec, $HOME/.config/hypr/scripts/MediaCtrl.sh --stop"), + { locked = true, description = "stop" } +) + +-- Section: Screenshot bindings +bind("SUPER", "Print", exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --now"), { description = "screenshot now" }) +bind( + "SUPER SHIFT", + "Print", + exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --area"), + { description = "screenshot (area)" } +) +bind( + "SUPER CTRL", + "Print", + exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --in5"), + { description = "screenshot in 5s" } +) +bind( + "SUPER CTRL SHIFT", + "Print", + exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --in10"), + { description = "screenshot in 10s" } +) +bind( + "ALT", + "Print", + exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --active"), + { description = "screenshot active window" } +) +bind( + "SUPER SHIFT", + "S", + exec_cmd("$HOME/.config/hypr/scripts/ScreenShot.sh --swappy"), + { description = "screenshot (swappy)" } +) +-- Keep legacy script-based resize bindings commented for quick rollback during Lua API migration. +-- These call ResizeActive.sh and are preserved in case native hl.dsp/hl.window resize behavior regresses. +-- bind( +-- "SUPER SHIFT", +-- "left", +-- exec_cmd("bash $HOME/.config/hypr/scripts/ResizeActive.sh -50 0"), +-- { description = "resize left (-50)" } +-- ) +-- bind( +-- "SUPER SHIFT", +-- "right", +-- exec_cmd("bash $HOME/.config/hypr/scripts/ResizeActive.sh 50 0"), +-- { description = "resize right (+50)" } +-- ) +-- bind( +-- "SUPER SHIFT", +-- "up", +-- exec_cmd("bash $HOME/.config/hypr/scripts/ResizeActive.sh 0 -50"), +-- { description = "resize up (-50)" } +-- ) +-- bind( +-- "SUPER SHIFT", +-- "down", +-- exec_cmd("bash $HOME/.config/hypr/scripts/ResizeActive.sh 0 50"), +-- { description = "resize down (+50)" } +-- ) +bind( + "SUPER SHIFT", + "left", + dispatch("resizeactive", "-50 0"), + { description = "resize left (-50)" } +) +bind( + "SUPER SHIFT", + "right", + dispatch("resizeactive", "50 0"), + { description = "resize right (+50)" } +) +bind("SUPER SHIFT", "up", dispatch("resizeactive", "0 -50"), { description = "resize up (-50)" }) +bind( + "SUPER SHIFT", + "down", + dispatch("resizeactive", "0 50"), + { description = "resize down (+50)" } +) +-- Keep legacy directional move script binds commented for rollback during Lua API migration. +-- Native movewindow dispatch below replaces LuaMoveWindowDirectional.sh usage. +-- bind( +-- "SUPER CTRL", +-- "left", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowDirectional.sh left"), +-- { description = "move window left" } +-- ) +-- bind( +-- "SUPER CTRL", +-- "right", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowDirectional.sh right"), +-- { description = "move window right" } +-- ) + +-- Section: Window resize, move, swap, and grouping +bind("SUPER CTRL", "left", dispatch("movewindow", "l"), { description = "move window left" }) +bind("SUPER CTRL", "right", dispatch("movewindow", "r"), { description = "move window right" }) +bind("SUPER CTRL", "up", dispatch("movewindow", "u"), { description = "move window up" }) +bind("SUPER CTRL", "down", dispatch("movewindow", "d"), { description = "move window down" }) +bind( + "SUPER ALT", + "left", + exec_cmd("$HOME/.config/hypr/scripts/LuaSwapWindow.sh l"), + { description = "swap window left" } +) +bind( + "SUPER ALT", + "right", + exec_cmd("$HOME/.config/hypr/scripts/LuaSwapWindow.sh r"), + { description = "swap window right" } +) +bind("SUPER ALT", "up", exec_cmd("$HOME/.config/hypr/scripts/LuaSwapWindow.sh u"), { description = "swap window up" }) +bind( + "SUPER ALT", + "down", + exec_cmd("$HOME/.config/hypr/scripts/LuaSwapWindow.sh d"), + { description = "swap window down" } +) +bind("SUPER", "G", dispatch("togglegroup", ""), { description = "toggle group" }) +bind("SUPER", "Tab", dispatch("changegroupactive", "f"), { description = "Change Group Forward" }) +bind("SUPER CTRL", "tab", dispatch("changegroupactive", ""), { description = "change active in group" }) +bind("SUPER SHIFT", "Tab", dispatch("changegroupactive", "b"), { description = "Change Group Back" }) +bind("SUPER CTRL", "K", dispatch("moveintogroup", "l"), { description = "Move left into group" }) +bind("SUPER CTRL", "L", dispatch("moveintogroup", "r"), { description = "Move Right into group" }) +bind("SUPER CTRL", "H", dispatch("moveoutofgroup", ""), { description = "Move active out of group" }) +bind("SUPER", "left", dispatch("movefocus", "l"), { description = "focus left" }) +bind("SUPER", "right", dispatch("movefocus", "r"), { description = "focus right" }) +bind("SUPER", "up", dispatch("movefocus", "u"), { description = "focus up" }) +bind("SUPER", "down", dispatch("movefocus", "d"), { description = "focus down" }) + +-- Section: Workspace navigation and assignment +-- Keep legacy relative workspace focus script binds commented for rollback during Lua API migration. +-- Native workspace dispatch below replaces LuaFocusWorkspaceRelative.sh usage. +-- bind( +-- "SUPER", +-- "tab", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh next"), +-- { description = "next workspace" } +-- ) +-- bind( +-- "SUPER SHIFT", +-- "tab", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh previous"), +-- { description = "previous workspace" } +-- ) +bind("SUPER", "tab", dispatch("workspace", "e+1"), { description = "next workspace" }) +bind("SUPER SHIFT", "tab", dispatch("workspace", "e-1"), { description = "previous workspace" }) +bind("SUPER SHIFT", "U", dispatch("movetoworkspace", "special"), { description = "move to special workspace" }) +bind("SUPER", "U", dispatch("togglespecialworkspace", ""), { description = "toggle special workspace" }) +bind("SUPER", "code:10", dispatch("workspace", "1"), { description = "workspace 1" }) +bind("SUPER", "code:11", dispatch("workspace", "2"), { description = "workspace 2" }) +bind("SUPER", "code:12", dispatch("workspace", "3"), { description = "workspace 3" }) +bind("SUPER", "code:13", dispatch("workspace", "4"), { description = "workspace 4" }) +bind("SUPER", "code:14", dispatch("workspace", "5"), { description = "workspace 5" }) +bind("SUPER", "code:15", dispatch("workspace", "6"), { description = "workspace 6" }) +bind("SUPER", "code:16", dispatch("workspace", "7"), { description = "workspace 7" }) +bind("SUPER", "code:17", dispatch("workspace", "8"), { description = "workspace 8" }) +bind("SUPER", "code:18", dispatch("workspace", "9"), { description = "workspace 9" }) +bind("SUPER", "code:19", dispatch("workspace", "10"), { description = "workspace 10" }) +bind("SUPER SHIFT", "code:10", dispatch("movetoworkspace", "1"), { description = "move to workspace 1" }) +bind("SUPER SHIFT", "code:11", dispatch("movetoworkspace", "2"), { description = "move to workspace 2" }) +bind("SUPER SHIFT", "code:12", dispatch("movetoworkspace", "3"), { description = "move to workspace 3" }) +bind("SUPER SHIFT", "code:13", dispatch("movetoworkspace", "4"), { description = "move to workspace 4" }) +bind("SUPER SHIFT", "code:14", dispatch("movetoworkspace", "5"), { description = "move to workspace 5" }) +bind("SUPER SHIFT", "code:15", dispatch("movetoworkspace", "6"), { description = "move to workspace 6" }) +bind("SUPER SHIFT", "code:16", dispatch("movetoworkspace", "7"), { description = "move to workspace 7" }) +bind("SUPER SHIFT", "code:17", dispatch("movetoworkspace", "8"), { description = "move to workspace 8" }) +bind("SUPER SHIFT", "code:18", dispatch("movetoworkspace", "9"), { description = "move to workspace 9" }) +bind("SUPER SHIFT", "code:19", dispatch("movetoworkspace", "10"), { description = "move to workspace 10" }) +-- Keep legacy relative move-to-workspace script binds commented for rollback during Lua API migration. +-- Native movetoworkspace dispatch below replaces LuaMoveWindowWorkspaceRelative.sh usage. +-- bind( +-- "SUPER SHIFT", +-- "bracketleft", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh previous"), +-- { description = "move to previous workspace" } +-- ) +-- bind( +-- "SUPER SHIFT", +-- "bracketright", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh next"), +-- { description = "move to next workspace" } +-- ) +bind("SUPER SHIFT", "bracketleft", dispatch("movetoworkspace", "-1"), { description = "move to previous workspace" }) +bind("SUPER SHIFT", "bracketright", dispatch("movetoworkspace", "+1"), { description = "move to next workspace" }) +bind("SUPER CTRL", "code:10", dispatch("movetoworkspacesilent", "1"), { description = "move silently to workspace 1" }) +bind("SUPER CTRL", "code:11", dispatch("movetoworkspacesilent", "2"), { description = "move silently to workspace 2" }) +bind("SUPER CTRL", "code:12", dispatch("movetoworkspacesilent", "3"), { description = "move silently to workspace 3" }) +bind("SUPER CTRL", "code:13", dispatch("movetoworkspacesilent", "4"), { description = "move silently to workspace 4" }) +bind("SUPER CTRL", "code:14", dispatch("movetoworkspacesilent", "5"), { description = "move silently to workspace 5" }) +bind("SUPER CTRL", "code:15", dispatch("movetoworkspacesilent", "6"), { description = "move silently to workspace 6" }) +bind("SUPER CTRL", "code:16", dispatch("movetoworkspacesilent", "7"), { description = "move silently to workspace 7" }) +bind("SUPER CTRL", "code:17", dispatch("movetoworkspacesilent", "8"), { description = "move silently to workspace 8" }) +bind("SUPER CTRL", "code:18", dispatch("movetoworkspacesilent", "9"), { description = "move silently to workspace 9" }) +bind( + "SUPER CTRL", + "code:19", + dispatch("movetoworkspacesilent", "10"), + { description = "move silently to workspace 10" } +) +-- Keep legacy silent relative move-to-workspace script binds commented for rollback during Lua API migration. +-- Native movetoworkspacesilent dispatch below replaces LuaMoveWindowWorkspaceRelative.sh usage. +-- bind( +-- "SUPER CTRL", +-- "bracketleft", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh previous"), +-- { description = "move silently to previous workspace" } +-- ) +-- bind( +-- "SUPER CTRL", +-- "bracketright", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh next"), +-- { description = "move silently to next workspace" } +-- ) +bind( + "SUPER CTRL", + "bracketleft", + dispatch("movetoworkspacesilent", "-1"), + { description = "move silently to previous workspace" } +) +bind( + "SUPER CTRL", + "bracketright", + dispatch("movetoworkspacesilent", "+1"), + { description = "move silently to next workspace" } +) +-- Keep legacy scroll/period/comma workspace focus script binds commented for rollback during Lua API migration. +-- Native workspace dispatch below replaces LuaFocusWorkspaceRelative.sh usage. +-- bind( +-- "SUPER", +-- "mouse_down", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh next"), +-- { description = "next workspace" } +-- ) +-- bind( +-- "SUPER", +-- "mouse_up", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh previous"), +-- { description = "previous workspace" } +-- ) +-- bind( +-- "SUPER", +-- "period", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh next"), +-- { description = "next workspace" } +-- ) +-- bind( +-- "SUPER", +-- "comma", +-- exec_cmd("$HOME/.config/hypr/scripts/LuaFocusWorkspaceRelative.sh previous"), +-- { description = "previous workspace" } +-- ) +bind("SUPER", "mouse_down", dispatch("workspace", "e+1"), { description = "next workspace" }) +bind("SUPER", "mouse_up", dispatch("workspace", "e-1"), { description = "previous workspace" }) +bind("SUPER", "period", dispatch("workspace", "e+1"), { description = "next workspace" }) +bind("SUPER", "comma", dispatch("workspace", "e-1"), { description = "previous workspace" }) + +-- Section: Mouse drag/resize bindings +bindm("SUPER", "mouse:272", "movewindow", "move window") +bindm("SUPER", "mouse:273", "resizewindow", "resize window") diff --git a/config/hypr/lua/laptop-lid.lua b/config/hypr/lua/laptop-lid.lua new file mode 100644 index 00000000..5792791f --- /dev/null +++ b/config/hypr/lua/laptop-lid.lua @@ -0,0 +1,22 @@ +-- # ================================================== +-- # KoolDots (2026) +-- # Project URL: https://github.com/LinuxBeginnings +-- # License: GNU GPLv3 +-- # SPDX-License-Identifier: GPL-3.0-or-later +-- # ================================================== +-- +-- Sample code to handle disbling eDP-1 when lid closed +-- Code written by @star on TheBlacDon's discord server +-- Thank you +-- +-- Lid close: remove laptop panel from layout +hl.bind("switch:on:Lid Switch", function() + -- hl.dispatch(hl.dsp.dpms({ action = "disable", monitor = "eDP-1" })) + hl.monitor({ output = "eDP-1", disabled = true }) +end) + +-- Lid open: restore laptop panel +hl.bind("switch:off:Lid Switch", function() + -- hl.dispatch(hl.dsp.dpms({ action = "enable", monitor = "eDP-1" })) + hl.monitor({ output = "eDP-1", disabled = false }) +end) diff --git a/config/hypr/lua/laptops.lua b/config/hypr/lua/laptops.lua new file mode 100644 index 00000000..7da9bdc2 --- /dev/null +++ b/config/hypr/lua/laptops.lua @@ -0,0 +1,14 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from: +-- - config/hypr/configs/Laptops.conf +-- - config/hypr/UserConfigs/Laptops.conf +-- - config/hypr/UserConfigs/LaptopDisplay.conf +-- +-- No active laptop rules are currently enabled in the source files. +-- Add hl.bind(...) and/or hl.monitor(...) entries here when enabling laptop-lid logic. diff --git a/config/hypr/lua/layer_rules.lua b/config/hypr/lua/layer_rules.lua new file mode 100644 index 00000000..c40c3256 --- /dev/null +++ b/config/hypr/lua/layer_rules.lua @@ -0,0 +1,88 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== +-- Auto-generated from config/hypr/configs/LayerRules.conf for Lua testing. +-- Edit the source LayerRules.conf and regenerate this file when vendor rules change. + +local function apply_layer_rule(rule) + if hl.layer_rule then + hl.layer_rule(rule) + end +end + +apply_layer_rule({ + name = "layerrule-001", + match = { + namespace = "rofi", + }, + blur = true, + ignore_alpha = 0, + animation = "slide", +}) + +apply_layer_rule({ + name = "layerrule-002", + match = { + namespace = "notifications", + }, + blur = true, + ignore_alpha = 0, + animation = "slide", +}) + +apply_layer_rule({ + name = "layerrule-003", + match = { + namespace = "quickshell:overview", + }, + blur = true, + ignore_alpha = 0.5, +}) + +apply_layer_rule({ + name = "layerrule-004", + match = { + namespace = "wallpaper", + }, + blur = true, + ignore_alpha = 0, +}) + +apply_layer_rule({ + name = "layerrule-005", + match = { + namespace = "swaync-control-center", + }, + blur = true, + ignore_alpha = 0, +}) + +apply_layer_rule({ + name = "layerrule-006", + match = { + namespace = "swaync-notification-window", + }, + blur = true, + ignore_alpha = 0, +}) + +apply_layer_rule({ + name = "layerrule-007", + match = { + namespace = "com.aurora.keybinds_help", + }, + blur = true, + ignore_alpha = 0, +}) + +apply_layer_rule({ + name = "layerrule-008", + match = { + namespace = "logout_dialog", + }, + blur = true, + ignore_alpha = 0, +}) diff --git a/config/hypr/lua/monitors.lua b/config/hypr/lua/monitors.lua new file mode 100644 index 00000000..c04735d7 --- /dev/null +++ b/config/hypr/lua/monitors.lua @@ -0,0 +1,46 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from config/hypr/monitors.conf (active monitor entries only). + +hl.monitor({ + output = "", + mode = "preferred", + position = "auto", + scale = "1", +}) + +hl.monitor({ + output = "", + mode = "highrr", + position = "auto", + scale = "1", +}) + +hl.monitor({ + output = "", + mode = "highres", + position = "auto", + scale = "1", +}) + +hl.monitor({ + output = "Virtual-1", + mode = "1920x1080@60", + position = "auto", + scale = "1", +}) + +-- Load user monitor overrides from UserConfigs when present. +do + local configHome = os.getenv("XDG_CONFIG_HOME") or ((os.getenv("HOME") or "") .. "/.config") + local userMonitors = configHome .. "/hypr/UserConfigs/monitors.lua" + local ok, err = pcall(dofile, userMonitors) + if not ok and err and tostring(err):find("No such file or directory", 1, true) == nil then + print("[WARN] Unable to load user monitor overrides from " .. userMonitors .. ": " .. tostring(err)) + end +end diff --git a/config/hypr/lua/screenshot-region.lua b/config/hypr/lua/screenshot-region.lua new file mode 100644 index 00000000..6ba83bff --- /dev/null +++ b/config/hypr/lua/screenshot-region.lua @@ -0,0 +1,13 @@ +-- Found on Hyprland discord +-- Possible replacement for screenshot.sh + +function screenshot(file_prefix, region) + local file = "$HOME/Pictures/Screenshots/" + .. file_prefix + .. os.date("-%Y-%m-%d_%Hh-%Mm-%Ss_" .. math.random(100000) .. ".png") + local grim = 'grim -g "' .. region .. '" ' .. file + local message = " && notify-send Screenshot saved" + local copy = " && wl-copy < " .. file + + hl.dispatch(hl.dsp.exec_cmd(grim .. message .. copy)) +end diff --git a/config/hypr/lua/settings.lua b/config/hypr/lua/settings.lua new file mode 100644 index 00000000..78ae61e2 --- /dev/null +++ b/config/hypr/lua/settings.lua @@ -0,0 +1,179 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from: +-- - config/hypr/configs/SystemSettings.conf +-- - config/hypr/UserConfigs/UserSettings.conf (currently empty) + +local scriptsDir = "$HOME/.config/hypr/scripts" + +hl.config({ + dwindle = { + 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, + }, +}) + +hl.config({ + master = { + 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, + }, +}) + +hl.config({ + scrolling = { + column_width = 0.80, + fullscreen_on_one_column = true, + direction = "right", + follow_focus = true, + }, +}) + +hl.config({ + general = { + resize_on_border = true, + layout = "dwindle", + }, +}) + +hl.config({ + input = { + kb_layout = "us", + kb_variant = "", + kb_model = "", + kb_options = "", + kb_rules = "", + repeat_rate = 50, + repeat_delay = 300, + sensitivity = 0, + numlock_by_default = true, + left_handed = false, + follow_mouse = 1, + float_switch_override_focus = false, + touchpad = { + disable_while_typing = true, + natural_scroll = true, + clickfinger_behavior = false, + middle_button_emulation = false, + tap_to_click = true, + drag_lock = false, + }, + touchdevice = { + enabled = true, + }, + tablet = { + transform = 0, + left_handed = 0, + }, + }, +}) + +hl.config({ + gestures = { + 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_direction_lock = true, + workspace_swipe_forever = false, + workspace_swipe_use_r = false, + close_max_timeout = 100, + }, +}) + +hl.gesture({ + fingers = 3, + direction = "horizontal", + action = "workspace", +}) + +-- Complex dispatcher gestures from SystemSettings.conf are pending explicit Lua API parity: +-- gesture = 3, up, dispatcher, exec, hyprctl keyword cursor:zoom_factor ... +-- gesture = 3, down, dispatcher, exec, hyprctl keyword cursor:zoom_factor ... +-- gesture = 4, up, dispatcher, exec, $scriptsDir/OverviewToggle.sh +-- gesture = 4, down, float + +hl.config({ + misc = { + force_default_wallpaper = 0, + disable_hyprland_logo = true, + disable_splash_rendering = true, + -- Setting vrr 0, issues with MPV/VLC at fullscreen + -- vrr 0, disable, vrr 1, always on, vrr 2, on at full screen + vrr = 0, + mouse_move_enables_dpms = true, + enable_swallow = false, + swallow_regex = "^(kitty)$", + focus_on_activate = false, + initial_workspace_tracking = 0, + middle_click_paste = false, + enable_anr_dialog = true, + anr_missed_pings = 15, + allow_session_lock_restore = true, + on_focus_under_fullscreen = 1, + }, +}) + +hl.config({ + binds = { + workspace_back_and_forth = true, + allow_workspace_cycles = true, + pass_mouse_when_bound = false, + }, +}) + +hl.config({ + xwayland = { + enabled = true, + force_zero_scaling = true, + }, +}) + +hl.config({ + render = { + direct_scanout = 0, + }, +}) + +hl.config({ + cursor = { + sync_gsettings_theme = true, + no_hardware_cursors = 2, + 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/lua/startup.lua b/config/hypr/lua/startup.lua new file mode 100644 index 00000000..6c189113 --- /dev/null +++ b/config/hypr/lua/startup.lua @@ -0,0 +1,71 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from: +-- - config/hypr/configs/Startup_Apps.conf +-- - config/hypr/UserConfigs/Startup_Apps.conf + +local scriptsDir = "$HOME/.config/hypr/scripts" +local userScripts = "$HOME/.config/hypr/UserScripts" +local wallDir = "$HOME/Pictures/wallpapers" +local session = os.getenv("HYPRLAND_INSTANCE_SIGNATURE") or "default" +local function shell_quote(value) + return "'" .. tostring(value):gsub("'", "'\\''") .. "'" +end +local function exec_once(cmd) + -- Why this wrapper exists: + -- 1) Enforce once-per-Hypr-session startup behavior using marker files. + -- 2) Avoid startup race conditions by waiting for Wayland/Hypr sockets. + -- 3) Capture per-command logs to simplify troubleshooting in user setups. + + local key = cmd:gsub("[^%w_.-]", "_"):sub(1, 80) + local marker = "/tmp/hypr-lua-exec-once-" .. session .. "-" .. key + local log = "/tmp/hypr-lua-startup-" .. key .. ".log" + local readiness = "runtime=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}; export XDG_RUNTIME_DIR=\"$runtime\"; for _ in $(seq 1 200); do if [ -n \"$WAYLAND_DISPLAY\" ] && [ -S \"$runtime/$WAYLAND_DISPLAY\" ]; then break; fi; for sock in \"$runtime\"/wayland-[0-9]*; do [ -S \"$sock\" ] || continue; case \"$(basename \"$sock\")\" in *awww*) continue ;; esac; export WAYLAND_DISPLAY=\"$(basename \"$sock\")\"; break 2; done; sleep 0.1; done; if [ -n \"$HYPRLAND_INSTANCE_SIGNATURE\" ]; then hypr_sock=\"$runtime/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock\"; for _ in $(seq 1 200); do [ -S \"$hypr_sock\" ] && break; sleep 0.1; done; fi" + local inner = readiness .. "; " .. cmd + local script = "[ -e " .. shell_quote(marker) .. " ] || { touch " .. shell_quote(marker) .. " && sh -lc " .. shell_quote(inner) .. " >>" .. shell_quote(log) .. " 2>&1 & }" + os.execute("sh -lc " .. shell_quote(script)) +end +-- Prefer lifecycle-hook orchestration for clarity while keeping exec_once +-- reliability semantics for real-world startup behavior. +local startup_commands = { + scriptsDir .. "/WallpaperDaemon.sh", + "$HOME/.config/hypr/initial-boot.sh", + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", + scriptsDir .. "/Polkit.sh", + "nm-applet", + "nm-tray", + "swaync", + scriptsDir .. "/PortalHyprland.sh", + "sh " .. scriptsDir .. "/WaybarStartup.sh", + "qs -c overview", + "hypridle", + scriptsDir .. "/Hyprsunset.sh init", + -- NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. + scriptsDir .. "/Dropterminal.sh --startup kitty", + "wl-paste --type text --watch cliphist store", + "wl-paste --type image --watch cliphist store", +} + +local function run_startup_commands() + for _, cmd in ipairs(startup_commands) do + exec_once(cmd) + end +end + +if hl and hl.on then + hl.on("hyprland.start", run_startup_commands) +else + -- Compatibility fallback for older/limited runtimes without hl.on. + run_startup_commands() +end + +-- Optional startup examples retained from the original config: +-- exec_once("mpvpaper '*' -o \"load-scripts=no no-audio --loop\" \"\"") +-- exec_once(userScripts .. "/WallpaperAutoChange.sh " .. wallDir) +-- exec_once(userScripts .. "/RainbowBorders.sh") diff --git a/config/hypr/lua/user_decorations_helper.lua b/config/hypr/lua/user_decorations_helper.lua new file mode 100644 index 00000000..f5e39ea8 --- /dev/null +++ b/config/hypr/lua/user_decorations_helper.lua @@ -0,0 +1,28 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +local function load_wallust_colors(path) + local colors = {} + local handle = io.open(path, "r") + if not handle then + return colors + end + + for line in handle:lines() do + local name, hex = line:match("^%s*%$([%w_]+)%s*=%s*rgb%(([0-9A-Fa-f]+)%)") + if name and hex and hex ~= "" then + colors[string.lower(name)] = "rgb(" .. string.upper(hex) .. ")" + end + end + + handle:close() + return colors +end + +return { + load_wallust_colors = load_wallust_colors, +} diff --git a/config/hypr/lua/user_defaults.lua b/config/hypr/lua/user_defaults.lua new file mode 100644 index 00000000..fb7bb0df --- /dev/null +++ b/config/hypr/lua/user_defaults.lua @@ -0,0 +1,33 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from config/hypr/UserConfigs/01-UserDefaults.conf (active values only). + +KOOLDOTS_DEFAULTS = KOOLDOTS_DEFAULTS or {} +local editor = os.getenv("EDITOR") +if editor == nil or editor == "" then + editor = "nano" +end +local visual = os.getenv("VISUAL") +if visual == nil then + visual = "" +end +KOOLDOTS_DEFAULTS.edit = editor +KOOLDOTS_DEFAULTS.visual = visual +KOOLDOTS_DEFAULTS.term = "kitty" +KOOLDOTS_DEFAULTS.files = "thunar" +KOOLDOTS_DEFAULTS.search_engine = "https://www.google.com/search?q={}" + +-- Optional user overrides live outside the pristine lua/ source tree. +do + local configHome = os.getenv("XDG_CONFIG_HOME") or ((os.getenv("HOME") or "") .. "/.config") + local userDefaults = configHome .. "/hypr/UserConfigs/user_defaults.lua" + local ok, err = pcall(dofile, userDefaults) + if not ok and err and tostring(err):find("No such file or directory", 1, true) == nil then + print("[WARN] Unable to load user defaults file " .. userDefaults .. ": " .. tostring(err)) + end +end diff --git a/config/hypr/lua/user_keybinds_helper.lua b/config/hypr/lua/user_keybinds_helper.lua new file mode 100644 index 00000000..f9d4aa0c --- /dev/null +++ b/config/hypr/lua/user_keybinds_helper.lua @@ -0,0 +1,217 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +local dsp = hl.dsp or hl + +local function exec_cmd(cmd) + if dsp and dsp.exec_cmd then + return dsp.exec_cmd(cmd) + end + return function() hl.exec_cmd(cmd) end +end + +local function shell_quote(value) + return "'" .. tostring(value):gsub("'", "'\\''") .. "'" +end + +local function raw_dispatch_cmd(command) + if dsp and dsp.exec_raw then + return dsp.exec_raw(tostring(command)) + end + local expression = "hl.dsp.exec_raw(" .. string.format("%q", tostring(command)) .. ")" + return exec_cmd("hyprctl dispatch " .. shell_quote(expression)) +end + +local function trim(value) + return (value or ""):gsub("^%s+", ""):gsub("%s+$", "") +end + +local function chord(mods, key) + mods = trim(mods):gsub("%s+", " + ") + key = trim(key) + if mods == "" then + return key + end + return mods .. " + " .. key +end + +local function key_variants(key, mods) + key = trim(key):gsub("^xf86", "XF86") + local key_aliases = { + XF86AudioPlayPause = "XF86AudioPlay", + XF86audiolowervolume = "XF86AudioLowerVolume", + XF86audiomute = "XF86AudioMute", + XF86audioraisevolume = "XF86AudioRaiseVolume", + XF86audiostop = "XF86AudioStop", + } + key = key_aliases[key] or key + local shifted_number_keys = { + ["code:10"] = "exclam", + ["code:11"] = "at", + ["code:12"] = "numbersign", + ["code:13"] = "dollar", + ["code:14"] = "percent", + ["code:15"] = "asciicircum", + ["code:16"] = "ampersand", + ["code:17"] = "asterisk", + ["code:18"] = "parenleft", + ["code:19"] = "parenright", + } + local number_keys = { + ["code:10"] = "1", + ["code:11"] = "2", + ["code:12"] = "3", + ["code:13"] = "4", + ["code:14"] = "5", + ["code:15"] = "6", + ["code:16"] = "7", + ["code:17"] = "8", + ["code:18"] = "9", + ["code:19"] = "0", + } + if mods and mods:match("SHIFT") and shifted_number_keys[key] then + local number_key = number_keys[key] + if number_key then + return { shifted_number_keys[key], number_key } + end + return { shifted_number_keys[key] } + end + if number_keys[key] then + return { number_keys[key] } + end + return { key } +end + +local function workspace_value(value) + value = trim(value) + return tonumber(value) or value +end + +local function direction(value) + local directions = { + l = "left", + r = "right", + u = "up", + d = "down", + left = "left", + right = "right", + up = "up", + down = "down", + } + return directions[trim(value)] or trim(value) +end + +local function dispatch_factory_safely(factory) + pcall(function() + local dispatcher = factory() + if dispatcher then + hl.dispatch(dispatcher) + end + end) +end + +local function dispatch(name, args) + local window_api = (dsp and dsp.window) or hl.window or {} + name = trim(name) + args = trim(args) + + if args:match("^exec%s*,") then + return exec_cmd(trim(args:gsub("^exec%s*,", "", 1))) + end + if name == "exec" then + return exec_cmd(args) + end + if name == "killactive" and window_api.close then + return window_api.close() + end + if name == "fullscreen" and window_api.fullscreen then + if args == "1" then + return window_api.fullscreen({ mode = "maximized" }) + end + return window_api.fullscreen({ mode = "fullscreen" }) + end + if name == "movefocus" and dsp and dsp.focus then + return function() + dispatch_factory_safely(function() + return dsp.focus({ direction = direction(args) }) + end) + end + end + if name == "movewindow" and window_api.move then + return function() + dispatch_factory_safely(function() + return window_api.move({ direction = direction(args) }) + end) + end + end + if name == "workspace" and dsp and dsp.focus then + return function() hl.dispatch(dsp.focus({ workspace = workspace_value(args) })) end + end + if name == "movetoworkspace" and window_api.move then + return function() hl.dispatch(window_api.move({ workspace = workspace_value(args) })) end + end + if name == "movetoworkspacesilent" and window_api.move then + return function() hl.dispatch(window_api.move({ workspace = workspace_value(args), follow = false })) end + end + if name == "togglefloating" and window_api.float then + return function() hl.dispatch(window_api.float({ action = "toggle" })) end + end + if name == "resizewindow" and window_api.resize then + return window_api.resize() + end + if name == "resizeactive" then + return raw_dispatch_cmd("resizeactive " .. args) + end + if args ~= "" then + return raw_dispatch_cmd(name .. " " .. args) + end + return raw_dispatch_cmd(name) +end + +local function bind(mods, key, fn, opts) + local seen = {} + for _, key_variant in ipairs(key_variants(key, mods)) do + local key_chord = chord(mods, key_variant) + if not seen[key_chord] then + seen[key_chord] = true + if opts then + hl.bind(key_chord, fn, opts) + else + hl.bind(key_chord, fn) + end + end + end +end + +local function unbind(mods, key) + if hl.unbind then + local seen = {} + for _, key_variant in ipairs(key_variants(key, mods)) do + local key_chord = chord(mods, key_variant) + if not seen[key_chord] then + seen[key_chord] = true + -- Hyprland Lua APIs vary by build: some accept unbind("MOD + KEY"), + -- others unbind("MOD", "KEY"), and some no-op one form silently. + -- Call both forms to make unbind behavior deterministic. + pcall(hl.unbind, key_chord) + pcall(hl.unbind, mods, key_variant) + end + end + end +end + +return { + exec_cmd = exec_cmd, + trim = trim, + chord = chord, + key_variants = key_variants, + workspace_value = workspace_value, + raw_dispatch_cmd = raw_dispatch_cmd, + dispatch = dispatch, + bind = bind, + unbind = unbind, +} diff --git a/config/hypr/lua/user_layer_rules_helper.lua b/config/hypr/lua/user_layer_rules_helper.lua new file mode 100644 index 00000000..d54b97c6 --- /dev/null +++ b/config/hypr/lua/user_layer_rules_helper.lua @@ -0,0 +1,16 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +local function apply_layer_rule(rule) + if hl.layer_rule then + hl.layer_rule(rule) + end +end + +return { + apply_layer_rule = apply_layer_rule, +} diff --git a/config/hypr/lua/user_overrides.lua b/config/hypr/lua/user_overrides.lua new file mode 100644 index 00000000..42502315 --- /dev/null +++ b/config/hypr/lua/user_overrides.lua @@ -0,0 +1,156 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Loads split system/user-editable Lua override files. +-- System files are loaded from ~/.config/hypr/configs (with UserConfigs fallback for legacy setups). +local configHome = os.getenv("XDG_CONFIG_HOME") or ((os.getenv("HOME") or "") .. "/.config") +local hyprDir = configHome .. "/hypr" +local systemDir = hyprDir .. "/configs" +local userDir = configHome .. "/hypr/UserConfigs" + +local function load_optional(path) + local ok, err = pcall(dofile, path) + if ok then + return true + end + if err and tostring(err):find("No such file or directory", 1, true) == nil then + print("[WARN] Unable to load user override file " .. path .. ": " .. tostring(err)) + end + return false +end +local loaded_user_split = false + +local system_files = { + "system_env.lua", + "system_startup.lua", + "system_window_rules.lua", + "system_layer_rules.lua", + "system_keybinds.lua", + "system_settings.lua", + "system_laptops.lua", +} +for _, file in ipairs(system_files) do + local primary = systemDir .. "/" .. file + local legacy = userDir .. "/" .. file + if not load_optional(primary) then + load_optional(legacy) + end +end + +local user_files = { + "user_env.lua", + "user_startup.lua", + "user_window_rules.lua", + "user_layer_rules.lua", + "user_keybinds.lua", + "user_settings.lua", + "user_decorations.lua", + "user_animations.lua", + "user_laptops.lua", +} +for _, file in ipairs(user_files) do + local path = userDir .. "/" .. file + if load_optional(path) then + loaded_user_split = true + end +end +if not loaded_user_split then + load_optional(userDir .. "/user_overrides.lua") -- legacy single-file support +end + +-- Legacy compatibility: import UserKeybinds.conf when user_keybinds.lua is missing. +do + local userKeybindsLua = userDir .. "/user_keybinds.lua" + local legacyUserKeybinds = userDir .. "/UserKeybinds.conf" + + local hasUserLua = io.open(userKeybindsLua, "r") + if hasUserLua then + hasUserLua:close() + else + local legacy = io.open(legacyUserKeybinds, "r") + if legacy then + local function trim(value) + return (value or ""):gsub("^%s+", ""):gsub("%s+$", "") + end + local function strip_inline_comment(value) + return trim((value or ""):gsub("%s+#.*$", "")) + end + local function load_vars_from_file(path, vars) + local handle = io.open(path, "r") + if not handle then + return + end + for raw in handle:lines() do + local line = trim(raw) + if line ~= "" and not line:match("^#") then + local name, val = line:match("^%$([%w_]+)%s*=%s*(.+)$") + if name and val then + vars[name] = strip_inline_comment(val) + end + end + end + handle:close() + end + local vars = {} + local raw_lines = {} + local configDir = configHome .. "/hypr/configs" + local defaultsFile = userDir .. "/01-UserDefaults.conf" + local keybindsFile = configDir .. "/Keybinds.conf" + local systemSettingsFile = configDir .. "/SystemSettings.conf" + + load_vars_from_file(systemSettingsFile, vars) + load_vars_from_file(keybindsFile, vars) + load_vars_from_file(defaultsFile, vars) + + for line in legacy:lines() do + table.insert(raw_lines, line) + local trimmed = trim(line) + if trimmed ~= "" and not trimmed:match("^#") then + local var_name, var_value = trimmed:match("^%$([%w_]+)%s*=%s*(.+)$") + if var_name and var_value then + vars[var_name] = strip_inline_comment(var_value) + end + end + end + legacy:close() + + local function expand_vars(value) + value = tostring(value or "") + for _ = 1, 8 do + local changed = false + value = value:gsub("%$([%w_]+)", function(name) + local replacement = vars[name] + if replacement ~= nil then + changed = true + return replacement + end + return "$" .. name + end) + if not changed then + break + end + end + return value + end + + for _, line in ipairs(raw_lines) do + local trimmed = trim(line) + if trimmed ~= "" and not trimmed:match("^#") then + local keyword, value = trimmed:match("^([%w_]+)%s*=%s*(.+)$") + if keyword and value and (keyword:match("^bind") or keyword == "unbind") then + local expanded = expand_vars(value) + local cmd = "hyprctl keyword " .. keyword .. " " .. string.format("%q", expanded) + local ok = os.execute(cmd) + if not ok then + print("[WARN] Failed to apply legacy keybind via: " .. cmd) + end + end + end + end + end + end +end diff --git a/config/hypr/lua/user_startup_helper.lua b/config/hypr/lua/user_startup_helper.lua new file mode 100644 index 00000000..2cc050b9 --- /dev/null +++ b/config/hypr/lua/user_startup_helper.lua @@ -0,0 +1,34 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +local function shell_quote(value) + return "'" .. tostring(value):gsub("'", "'\\''") .. "'" +end + +local function exec_once(cmd, opts) + -- Why this wrapper exists: + -- 1) Enforce once-per-Hypr-session startup behavior using marker files. + -- 2) Avoid startup race conditions by waiting for Wayland/Hypr sockets. + -- 3) Capture per-command logs to simplify troubleshooting in user setups. + + opts = opts or {} + local session = opts.session or os.getenv("HYPRLAND_INSTANCE_SIGNATURE") or "default" + local marker_prefix = opts.marker_prefix or "/tmp/hypr-lua-user-exec-once-" + local log_prefix = opts.log_prefix or "/tmp/hypr-lua-user-startup-" + + local key = cmd:gsub("[^%w_.-]", "_"):sub(1, 80) + local marker = marker_prefix .. session .. "-" .. key + local log = log_prefix .. key .. ".log" + local readiness = [[runtime=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}; export XDG_RUNTIME_DIR="$runtime"; for _ in $(seq 1 200); do if [ -n "$WAYLAND_DISPLAY" ] && [ -S "$runtime/$WAYLAND_DISPLAY" ]; then break; fi; for sock in "$runtime"/wayland-[0-9]*; do [ -S "$sock" ] || continue; case "$(basename "$sock")" in *awww*) continue ;; esac; export WAYLAND_DISPLAY="$(basename "$sock")"; break 2; done; sleep 0.1; done; if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then hypr_sock="$runtime/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock"; for _ in $(seq 1 200); do [ -S "$hypr_sock" ] && break; sleep 0.1; done; fi]] + local inner = readiness .. "; " .. cmd + local script = "[ -e " .. shell_quote(marker) .. " ] || { touch " .. shell_quote(marker) .. " && sh -lc " .. shell_quote(inner) .. " >>" .. shell_quote(log) .. " 2>&1 & }" + os.execute("sh -lc " .. shell_quote(script)) +end + +return { + exec_once = exec_once, +} diff --git a/config/hypr/lua/user_window_rules_helper.lua b/config/hypr/lua/user_window_rules_helper.lua new file mode 100644 index 00000000..5ef17ef6 --- /dev/null +++ b/config/hypr/lua/user_window_rules_helper.lua @@ -0,0 +1,16 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +local function apply_window_rule(rule) + if hl.window_rule then + hl.window_rule(rule) + end +end + +return { + apply_window_rule = apply_window_rule, +} diff --git a/config/hypr/lua/window_rules.lua b/config/hypr/lua/window_rules.lua new file mode 100644 index 00000000..1a43acd3 --- /dev/null +++ b/config/hypr/lua/window_rules.lua @@ -0,0 +1,1110 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Auto-generated from config/hypr/configs/WindowRules.conf for Lua testing. +-- Edit the source WindowRules.conf and regenerate this file when vendor rules change. + +local function apply_window_rule(rule) + if hl.window_rule then + hl.window_rule(rule) + end +end + + +apply_window_rule({ + name = "tag-browser-firefox", + match = { + class = "^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-google-chrome", + match = { + class = "^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-chrome-default-profile", + match = { + class = "^(chrome-.+-Default)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-chromium", + match = { + class = "^([Cc]hromium)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-microsoft-edge", + match = { + class = "^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-brave", + match = { + class = "^([Bb]rave-browser(-beta|-dev|-unstable)?)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-thorium-cachy", + match = { + class = "^([Tt]horium-browser|[Cc]achy-browser)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-browser-zen", + match = { + class = "^(zen-alpha|zen)$", + }, + tag = "+browser", +}) + +apply_window_rule({ + name = "tag-notifications-swaync", + match = { + class = "^(swaync-control-center|swaync-notification-window|swaync-client|class)$", + }, + tag = "+notif", +}) + +apply_window_rule({ + name = "tag-kool-cheat-sheet", + match = { + title = "^(KooL Quick Cheat Sheet)$", + }, + tag = "+KooL_Cheat", +}) + +apply_window_rule({ + name = "tag-kool-hyprland-settings", + match = { + title = "^(KooL Hyprland Settings)$", + }, + tag = "+KooL_Settings", +}) + +apply_window_rule({ + name = "tag-kool-settings-nwg-tools", + match = { + class = "^(nwg-displays|nwg-look)$", + }, + tag = "+KooL-Settings", +}) + +apply_window_rule({ + name = "tag-terminal-emulators", + match = { + class = "^(ghostty|wezterm|Alacritty|kitty|kitty-dropterm)$", + }, + tag = "+terminal", +}) + +apply_window_rule({ + name = "tag-email-thunderbird", + match = { + class = "^([Tt]hunderbird|org.mozilla.Thunderbird)$", + }, + tag = "+email", +}) + +apply_window_rule({ + name = "tag-email-betterbird", + match = { + class = "^(eu.betterbird.Betterbird)$", + }, + tag = "+email", +}) + +apply_window_rule({ + name = "tag-email-evolution", + match = { + class = "^(org.gnome.Evolution)$", + }, + tag = "+email", +}) + +apply_window_rule({ + name = "tag-projects-vscodium", + match = { + class = "^(codium|codium-url-handler|VSCodium)$", + }, + tag = "+projects", +}) + +apply_window_rule({ + name = "tag-projects-vscode", + match = { + class = "^(VSCode|code|code-url-handler)$", + }, + tag = "+projects", +}) + +apply_window_rule({ + name = "tag-projects-jetbrains", + match = { + class = "^(jetbrains-.+)$", + }, + tag = "+projects", +}) + +apply_window_rule({ + name = "tag-projects-zed", + match = { + class = "^(dev.zed.Zed|antigravity)$", + }, + tag = "+projects", +}) + +apply_window_rule({ + name = "tag-screenshare-obs", + match = { + class = "^(com.obsproject.Studio)$", + }, + tag = "+screenshare", +}) + +apply_window_rule({ + name = "tag-im-discord-family", + match = { + class = "^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-im-ferdium", + match = { + class = "^([Ff]erdium)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-im-whatsapp", + match = { + class = "^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-im-telegram", + match = { + class = "^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-im-teams", + match = { + class = "^(teams-for-linux)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-im-element", + match = { + class = "^(im.riot.Riot|Element)$", + }, + tag = "+im", +}) + +apply_window_rule({ + name = "tag-games-gamescope", + match = { + class = "^(gamescope)$", + }, + tag = "+games", +}) + +apply_window_rule({ + name = "tag-games-steam-app", + match = { + class = "^(steam_app_\\\\d+)$", + }, + tag = "+games", +}) + +apply_window_rule({ + name = "tag-games-proton", + match = { + xdg_tag = "^(proton-game)$", + }, + tag = "+games", +}) + +apply_window_rule({ + name = "tag-gamestore-steam", + match = { + class = "^([Ss]team)$", + }, + tag = "+gamestore", +}) + +apply_window_rule({ + name = "tag-gamestore-lutris", + match = { + title = "^([Ll]utris)$", + }, + tag = "+gamestore", +}) + +apply_window_rule({ + name = "tag-gamestore-heroic", + match = { + class = "^(com.heroicgameslauncher.hgl)$", + }, + tag = "+gamestore", +}) + +apply_window_rule({ + name = "tag-file-manager-common", + match = { + class = "^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$", + }, + tag = "+file-manager", +}) + +apply_window_rule({ + name = "tag-file-manager-warp", + match = { + class = "^(app.drey.Warp)$", + }, + tag = "+file-manager", +}) + +apply_window_rule({ + name = "tag-wallpaper-waytrogen", + match = { + class = "^([Ww]aytrogen)$", + }, + tag = "+wallpaper", +}) + +apply_window_rule({ + name = "tag-multimedia-audacious", + match = { + class = "^([Aa]udacious)$", + }, + tag = "+multimedia", +}) + +apply_window_rule({ + name = "tag-multimedia-video-players", + match = { + class = "^([Mm]pv|vlc)$", + }, + tag = "+multimedia_video", +}) + +apply_window_rule({ + name = "tag-settings-rog-control", + match = { + title = "^(ROG Control)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-wihotspot", + match = { + class = "^(wihotspot(-gui)?)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-baobab", + match = { + class = "^([Bb]aobab|org.gnome.[Bb]aobab)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-disks-and-hotspot", + match = { + class = "^(gnome-disks|wihotspot(-gui)?)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-kvantum", + match = { + title = "(Kvantum Manager)", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-file-roller", + match = { + class = "^(file-roller|org.gnome.FileRoller)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-network-blueman", + match = { + class = "^(nm-applet|nm-connection-editor|blueman-manager)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-pavucontrol", + match = { + class = "^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-qtct", + match = { + class = "^(qt5ct|qt6ct)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-xdg-portal-gtk", + match = { + class = "(xdg-desktop-portal-gtk)", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-polkit-kde", + match = { + class = "^(org.kde.polkit-kde-authentication-agent-1)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-rofi", + match = { + class = "^([Rr]ofi)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-btrfs-assistant", + match = { + class = "^(btrfs-assistant)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-settings-timeshift", + match = { + class = "^(timeshift-gtk)$", + }, + tag = "+settings", +}) + +apply_window_rule({ + name = "tag-viewer-system-monitor", + match = { + class = "^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$", + }, + tag = "+viewer", +}) + +apply_window_rule({ + name = "tag-viewer-evince", + match = { + class = "^(evince)$", + }, + tag = "+viewer", +}) + +apply_window_rule({ + name = "tag-viewer-image-viewers", + match = { + class = "^(eog|org.gnome.Loupe)$", + }, + tag = "+viewer", +}) + +apply_window_rule({ + name = "multimedia-disable-blur", + match = { + tag = "multimedia", + }, + no_blur = true, +}) + +apply_window_rule({ + name = "multimedia-force-opacity", + match = { + tag = "multimedia", + }, + opacity = 1.0, +}) + +apply_window_rule({ + name = "float-zoom-onedriver", + match = { + class = "([Zz]oom|onedriver|onedriver-launcher)", + }, + float = true, +}) + +apply_window_rule({ + name = "float-video-players", + match = { + class = "^(mpv|com.github.rafostar.Clapper)$", + }, + float = true, +}) + +apply_window_rule({ + name = "float-qalculate", + match = { + class = "^([Qq]alculate-gtk)$", + }, + float = true, +}) + +apply_window_rule({ + name = "float-center-auth-required-title", + match = { + title = "^(Authentication Required)$", + }, + float = true, + center = true, +}) + +apply_window_rule({ + name = "float-center-polkit-auth-dialog", + match = { + class = "^(xfce-polkit|mate-polkit|polkit-mate-authentication-agent-1)$", + title = "^(Authentication required|Authentication Required)$", + }, + float = true, + center = true, + size = "(monitor_w*0.35) (monitor_h*0.35)", +}) + +apply_window_rule({ + name = "float-vscodium-secondary-window", + match = { + class = "(codium|codium-url-handler|VSCodium)", + title = "negative:(.*codium.*|.*VSCodium.*)", + }, + float = true, +}) + +apply_window_rule({ + name = "float-heroic-secondary-window", + match = { + class = "^(com.heroicgameslauncher.hgl)$", + title = "negative:(Heroic Games Launcher)", + }, + float = true, +}) + +apply_window_rule({ + name = "float-steam-secondary-window", + match = { + class = "^([Ss]team)$", + title = "negative:^([Ss]team)$", + }, + float = true, +}) + +apply_window_rule({ + name = "float-center-add-folder-dialog", + match = { + title = "^(Add Folder to Workspace)$", + }, + float = true, + size = "(monitor_w*0.7) (monitor_h*0.6)", + center = true, +}) + +apply_window_rule({ + name = "float-center-save-as-dialog", + match = { + title = "^(Save As)$", + }, + float = true, + size = "(monitor_w*0.7) (monitor_h*0.6)", + center = true, +}) + +apply_window_rule({ + name = "float-open-files-dialog", + match = { + initial_title = "(Open Files)", + }, + float = true, + size = "(monitor_w*0.7) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "float-center-sddm-background", + match = { + title = "^(SDDM Background)$", + }, + float = true, + center = true, + size = "(monitor_w*0.16) (monitor_h*0.12)", +}) + +apply_window_rule({ + name = "float-center-yad-dialog", + match = { + class = "^(yad)$", + }, + float = true, + center = true, + size = "(monitor_w*0.2) (monitor_h*0.2)", +}) + +apply_window_rule({ + name = "float-center-hyprland-donate", + match = { + class = "^(hyprland-donate-screen)$", + }, + float = true, + center = true, +}) + +apply_window_rule({ + name = "center-rog-control", + match = { + title = "^(ROG Control)$", + }, + center = true, +}) + +apply_window_rule({ + name = "center-keybindings", + match = { + title = "^(Keybindings)$", + }, + center = true, +}) + +apply_window_rule({ + name = "center-pavucontrol", + match = { + class = "^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$", + }, + center = true, +}) + +apply_window_rule({ + name = "center-whatsapp", + match = { + class = "^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$", + }, + center = true, +}) + +apply_window_rule({ + name = "center-network-editor", + match = { + class = "^(nm-connection-editor)$", + }, + center = true, +}) + +apply_window_rule({ + name = "center-nm-auth-dialog", + match = { + class = "^(nm-applet)$", + title = "^(Wi-Fi Network Authentication Required)$", + }, + center = true, +}) + +apply_window_rule({ + name = "idle-inhibit-fullscreen-bool", + match = { + fullscreen = true, + }, + idle_inhibit = "fullscreen", +}) + +apply_window_rule({ + name = "idle-inhibit-fullscreen-int", + match = { + fullscreen = 1, + }, + idle_inhibit = "fullscreen", +}) + +apply_window_rule({ + name = "idle-inhibit-any-class", + match = { + class = ".*", + }, + idle_inhibit = "fullscreen", +}) + +apply_window_rule({ + name = "idle-inhibit-any-title", + match = { + title = ".*", + }, + idle_inhibit = "fullscreen", +}) + +apply_window_rule({ + name = "opacity-browser-tag", + match = { + tag = "browser", + }, + opacity = "0.99 0.8", +}) + +apply_window_rule({ + name = "opacity-projects-tag", + match = { + tag = "projects", + }, + opacity = "0.9 0.8", +}) + +apply_window_rule({ + name = "opacity-im-tag", + match = { + tag = "im", + }, + opacity = "0.94 0.86", +}) + +apply_window_rule({ + name = "opacity-multimedia-tag", + match = { + tag = "multimedia", + }, + opacity = "0.94 0.86", +}) + +apply_window_rule({ + name = "opacity-file-manager-tag", + match = { + tag = "file-manager", + }, + opacity = "0.9 0.8", +}) + +apply_window_rule({ + name = "opacity-terminal-tag", + match = { + tag = "terminal", + }, + opacity = "0.9 0.7", +}) + +apply_window_rule({ + name = "opacity-text-editors", + match = { + class = "^(gedit|org.gnome.TextEditor|mousepad)$", + }, + opacity = "0.8 0.7", +}) + +apply_window_rule({ + name = "opacity-deluge", + match = { + class = "^(deluge)$", + }, + opacity = "0.9 0.8", +}) + +apply_window_rule({ + name = "opacity-seahorse", + match = { + class = "^(seahorse)$", + }, + opacity = "0.9 0.8", +}) + +apply_window_rule({ + name = "no-initial-focus-jetbrains", + match = { + class = "^(jetbrains-.*)$", + }, + no_initial_focus = true, +}) + +apply_window_rule({ + name = "no-initial-focus-wind-title", + match = { + title = "^(wind.*)$", + }, + no_initial_focus = true, +}) + + +apply_window_rule({ + name = "Picture-in-Picture", + match = { + title = "^[Pp]icture-in-[Pp]icture$", + }, + float = true, + move = "72% 7%", + opacity = "0.95 0.75", + pin = true, + keep_aspect_ratio = true, + size = "(monitor_w*0.3) (monitor_h*0.3)", +}) + +apply_window_rule({ + name = "CachyOS Kernel Manager", + match = { + class = "^(org.cachyos.KernelManager)$", + title = "^(CachyOS Kernel Manager)$", + initial_class = "^(org.cachyos.KernelManager)$", + initial_title = "^(CachyOS Kernel Manager)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Mainline Kernels", + match = { + class = "^(mainline-gtk)$", + title = "^(Mainline Kernels)$", + initial_class = "^(mainline-gtk)$", + initial_title = "^(Mainline Kernels)$", + }, + float = true, + center = true, + size = "(monitor_w*0.45) (monitor_h*0.55)", +}) + +apply_window_rule({ + name = "Kwallet", + match = { + class = "^(org.kde.kwalletmanager)$", + title = "^(Wallet Manager)$", + initial_class = "^(org.kde.kwalletmanager)$", + initial_title = "^(Wallet Manager)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "NVIDIA Settings", + match = { + class = "^(nvidia-settings)$", + title = "^(NVIDIA Settings)$", + initial_class = "^(nvidia-settings)$", + initial_title = "^(NVIDIA Settings)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "CachyOS Package Installer", + match = { + class = "^(org.cachyos.cachyos-pi)$", + title = "^(CachyOS Package Installer)$", + initial_class = "^(org.cachyos.cachyos-pi)$", + initial_title = "^(CachyOS Package Installer)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Shelly", + match = { + class = "^(com.shellyorg.shelly)$", + title = "^(Shelly)$", + initial_class = "^(com.shellyorg.shelly)$", + initial_title = "^(Shelly)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "CachyOS Hello", + match = { + class = "^(CachyOSHello)$", + title = "^(CachyOS Hello)$", + initial_class = "^(CachyOSHello)$", + initial_title = "^(CachyOS Hello)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Cache Cleaner - Octopi", + match = { + class = "^(octopi-cachecleaner)$", + title = "^(Cache Cleaner - Octopi)$", + initial_class = "^(octopi-cachecleaner)$", + initial_title = "^(Cache Cleaner - Octopi)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Octopi Package Manager", + match = { + class = "^(octopi)$", + title = "^(Octopi)$", + initial_class = "^(octopi)$", + initial_title = "^(Octopi)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Repository Editor - Octopi", + match = { + class = "^(octopi-repoeditor)$", + title = "^(Repository Editor - Octopi)$", + initial_class = "^(octopi-repoeditor)$", + initial_title = "^(Repository Editor - Octop)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "KooL Cheat (tag)", + match = { + tag = "KooL_Cheat", + }, + float = true, + center = true, + size = "(monitor_w*0.65) (monitor_h*0.9)", +}) + +apply_window_rule({ + name = "Wallpaper (tag)", + match = { + tag = "wallpaper", + }, + float = true, + center = true, + size = "(monitor_w*0.7) (monitor_h*0.7)", + opacity = "0.9 0.7", +}) + +apply_window_rule({ + name = "Settings (tag)", + match = { + tag = "settings", + }, + float = true, + center = true, + size = "(monitor_w*0.7) (monitor_h*0.7)", + opacity = "0.8 0.7", +}) + +apply_window_rule({ + name = "Viewer (tag)", + match = { + tag = "viewer", + }, + float = true, + center = true, + opacity = "0.82 0.75", +}) + +apply_window_rule({ + name = "KooL Settings (tag)", + match = { + tag = "KooL-Settings", + }, + float = true, + center = true, +}) + +apply_window_rule({ + name = "Multimedia Video (tag)", + match = { + tag = "multimedia_video", + }, + no_blur = true, + opacity = 1.0, +}) + +apply_window_rule({ + name = "Games (tag)", + match = { + tag = "games", + }, + no_blur = true, + fullscreen = 0, +}) + +apply_window_rule({ + name = "Ferdium", + match = { + class = "^([Ff]erdium)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.7)", +}) + +apply_window_rule({ + name = "Calculators", + match = { + class = "(org.gnome.Calculator|qalculate-gtk)", + }, + float = true, + center = true, + size = "(monitor_w*0.55) (monitor_h*0.45)", +}) + +apply_window_rule({ + name = "Thunar Dialogs", + match = { + class = "([Tt]hunar)", + title = "negative:(.*[Tt]hunar.*)", + }, + float = true, + center = true, +}) + +apply_window_rule({ + name = "Bitwarden", + match = { + class = "^(Bitwarden)$", + title = "^(Bitwarden)$", + initial_class = "^(Bitwarden)$", + initial_title = "^(Bitwarden)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "hyprland audio panel", + match = { + class = "^(hyprpwcenter)$", + title = "^(Pipewire Control Center)$", + initial_class = "^(hyprpwcenter)$", + initial_title = "^(Pipewire Control Center)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "Garuda Assistant", + match = { + class = "^(garuda-assistant)$", + title = "^(Garuda Assistant)$", + initial_class = "^(garuda-assistant)$", + initial_title = "^(Garuda Assistant)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.6)", +}) + +apply_window_rule({ + name = "HyprMod GUI", + match = { + class = "^(com.github.hyprmod)$", + title = "^(HyprMod)$", + initial_class = "^(com.github.hyprmod)$", + initial_title = "^(HyprMod)$", + }, + float = true, + center = true, + size = "(monitor_w*0.7) (monitor_h*0.75)", +}) + +apply_window_rule({ + name = "EasyEffects", + match = { + class = "^(com.github.wwmm.easyeffects)$", + title = "^(Easy Effects)$", + initial_class = "^(com.github.wwmm.easyeffects)$", + initial_title = "^(Easy Effects)$", + }, + float = true, + center = true, + size = "(monitor_w*0.6) (monitor_h*0.65)", +}) +apply_window_rule({ + name = "Megasync", + match = { + class = "^(nz\\.co\\.mega\\.megasync)$", + initial_class = "^(nz\\.co\\.mega\\.megasync)$", + }, + float = true, + center = true, + size = "(monitor_w*0.1) (monitor_h*0.2)", +}) + +apply_window_rule({ + name = "Mousam Weather", + match = { + class = "^(io.github.amit9838.mousam)$", + title = "^(Mousam)$", + initial_class = "^(io.github.amit9838.mousam)$", + initial_title = "^(Mousam)$", + }, + float = true, + center = true, + size = "(monitor_w*0.7) (monitor_h*0.75)", +}) + +-- Lua-only rule: keep the dropterminal positioned when toggled by keybind. +apply_window_rule({ + name = "dropterminal", + match = { + class = "kitty-dropterm", + }, + float = true, +}) diff --git a/config/hypr/lua/workspaces.lua b/config/hypr/lua/workspaces.lua new file mode 100644 index 00000000..287326ca --- /dev/null +++ b/config/hypr/lua/workspaces.lua @@ -0,0 +1,12 @@ +-- ================================================== +-- KoolDots (2026) +-- Project URL: https://github.com/LinuxBeginnings +-- License: GNU GPLv3 +-- SPDX-License-Identifier: GPL-3.0-or-later +-- ================================================== + +-- Converted from config/hypr/workspaces.conf. +-- No active workspace rules are currently enabled in the source file. + +-- Example: +-- hl.workspace_rule({ workspace = "1", monitor = "eDP-1" }) diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index f9f6b52b..3c81bcbe 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -10,11 +10,31 @@ notif="$HOME/.config/swaync/images/ja.png" layouts=(master dwindle scrolling monocle) +quiet_mode=0 get_layout() { hyprctl -j getoption general:layout | jq -r '.str' } +set_hypr_layout() { + local target="$1" + local output + + output="$(hyprctl keyword general:layout "$target" 2>&1)" + if grep -q "keyword can't work with non-legacy parsers" <<<"$output"; then + output="$(hyprctl eval "hl.config({ general = { layout = \"${target}\" } })" 2>&1)" + fi + + if ! grep -q "^ok$" <<<"$output"; then + echo "$output" >&2 + return 1 + fi +} + +hypr_keyword() { + hyprctl keyword "$@" >/dev/null 2>&1 || true +} + next_layout() { local current="$1" local i @@ -30,66 +50,78 @@ next_layout() { 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 + if ! set_hypr_layout "$target"; then + if [[ "$quiet_mode" -eq 0 ]]; then + notify-send -e -u critical -i "$notif" " Layout switch failed: $target" + fi + return 1 + fi + + hypr_keyword unbind SUPER,j + hypr_keyword unbind SUPER,k + hypr_keyword bind SUPER,j,cyclenext + hypr_keyword bind SUPER,k,cyclenext,prev + hypr_keyword unbind SUPER,left + hypr_keyword unbind SUPER,right + hypr_keyword unbind SUPER,up + hypr_keyword unbind SUPER,down + hypr_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" + hypr_keyword bind SUPER,left,cyclenext,prev + hypr_keyword bind SUPER,up,cyclenext,prev + hypr_keyword bind SUPER,right,cyclenext + hypr_keyword bind SUPER,down,cyclenext + hypr_keyword bind SUPER,O,layoutmsg,togglesplit ;; "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" + hypr_keyword bind SUPER,left,cyclenext,prev + hypr_keyword bind SUPER,up,cyclenext,prev + hypr_keyword bind SUPER,right,cyclenext + hypr_keyword bind SUPER,down,cyclenext ;; "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" + hypr_keyword bind SUPER,left,layoutmsg,cycleprev + hypr_keyword bind SUPER,up,layoutmsg,cycleprev + hypr_keyword bind SUPER,right,layoutmsg,cyclenext + hypr_keyword bind SUPER,down,layoutmsg,cyclenext ;; "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" + hypr_keyword bind SUPER,left,movefocus,l + hypr_keyword bind SUPER,right,movefocus,r + hypr_keyword bind SUPER,up,movefocus,u + hypr_keyword bind SUPER,down,movefocus,d ;; *) - 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 + hypr_keyword bind SUPER,left,movefocus,l + hypr_keyword bind SUPER,right,movefocus,r + hypr_keyword bind SUPER,up,movefocus,u + hypr_keyword bind SUPER,down,movefocus,d echo "Unknown layout: $target" >&2 return 1 ;; esac + + local actual + actual="$(get_layout)" + if [[ "$actual" == "$target" ]]; then + if [[ "$quiet_mode" -eq 0 ]]; then + notify-send -e -u low -i "$notif" " ${actual^} Layout" + fi + else + if [[ "$quiet_mode" -eq 0 ]]; then + notify-send -e -u critical -i "$notif" " Layout switch failed: still ${actual}" + fi + return 1 + fi } +if [[ "${1:-}" == "--quiet" || "${1:-}" == "--no-notify" ]]; then + quiet_mode=1 + shift +fi + current="$(get_layout)" arg="${1:-toggle}" @@ -104,7 +136,7 @@ master|dwindle|scrolling|monocle) set_layout "$arg" ;; *) - echo "Usage: $(basename "$0") [toggle|next|init|master|dwindle|scrolling|monocle]" >&2 + echo "Usage: $(basename "$0") [--quiet|--no-notify] [toggle|next|init|master|dwindle|scrolling|monocle]" >&2 exit 1 ;; esac diff --git a/config/hypr/scripts/DisableWaybarService.sh b/config/hypr/scripts/DisableWaybarService.sh new file mode 100755 index 00000000..7750fe4a --- /dev/null +++ b/config/hypr/scripts/DisableWaybarService.sh @@ -0,0 +1,265 @@ +#!/usr/bin/env bash +set -u +set -o pipefail + +SERVICE_NAME="waybar.service" +ACTION="" +DRY_RUN=false +OPERATION_RESULT="not-run" + +RED="\033[0;31m" +GREEN="\033[0;32m" +YELLOW="\033[1;33m" +BLUE="\033[0;34m" +NC="\033[0m" + +ICON_OK="✅" +ICON_WARN="⚠️" +ICON_ERR="❌" +ICON_INFO="ℹ️" + +usage() { + cat <<EOF +Usage: $(basename "$0") [OPTIONS] + +Disable --user ${SERVICE_NAME} (default action), revert it, or check status. + +Options: + -h, --help Show this help message and exit + -r, --revert Revert by enabling + starting --user ${SERVICE_NAME} + -d, --dry-run Print actions without changing anything + -s, --status Show current status of --user ${SERVICE_NAME} +EOF +} + +info() { + printf "${BLUE}${ICON_INFO} %s${NC}\n" "$1" +} + +ok() { + printf "${GREEN}${ICON_OK} %s${NC}\n" "$1" +} + +warn() { + printf "${YELLOW}${ICON_WARN} %s${NC}\n" "$1" +} + +error() { + printf "${RED}${ICON_ERR} %s${NC}\n" "$1" >&2 +} + +fail() { + error "$1" + exit 1 +} + +format_command() { + printf "%q " "$@" +} + +run_cmd() { + if $DRY_RUN; then + info "[dry-run] $(format_command "$@")" + return 0 + fi + "$@" +} + +set_action() { + local new_action="$1" + if [[ -n "$ACTION" && "$ACTION" != "$new_action" ]]; then + fail "Conflicting options: cannot combine '${ACTION}' with '${new_action}'." + fi + ACTION="$new_action" +} + +require_systemctl() { + command -v systemctl >/dev/null 2>&1 || fail "systemctl is required but was not found." +} + +require_user_manager() { + if ! systemctl --user show-environment >/dev/null 2>&1; then + fail "Cannot contact systemd user manager. Ensure your user systemd session is running." + fi +} + +service_load_state() { + systemctl --user show --property=LoadState --value "${SERVICE_NAME}" 2>/dev/null || true +} + +service_exists() { + local load_state + load_state="$(service_load_state)" + [[ -n "${load_state}" && "${load_state}" != "not-found" ]] +} + +require_service_exists() { + if ! service_exists; then + fail "--user ${SERVICE_NAME} was not found. Exiting." + fi +} + +get_enabled_state() { + local state + state="$(systemctl --user is-enabled "${SERVICE_NAME}" 2>/dev/null || true)" + [[ -n "${state}" ]] || state="unknown" + printf "%s" "${state}" +} + +get_active_state() { + local state + state="$(systemctl --user is-active "${SERVICE_NAME}" 2>/dev/null || true)" + [[ -n "${state}" ]] || state="unknown" + printf "%s" "${state}" +} + +print_state_line() { + local label="$1" + local state="$2" + local color="${BLUE}" + local icon="${ICON_INFO}" + + case "${state}" in + loaded|enabled|active) + color="${GREEN}" + icon="${ICON_OK}" + ;; + activating|deactivating|reloading|inactive|disabled|static|indirect|masked) + color="${YELLOW}" + icon="${ICON_WARN}" + ;; + failed|not-found|unknown) + color="${RED}" + icon="${ICON_ERR}" + ;; + esac + + printf " %-9s: %b%s %s%b\n" "${label}" "${color}" "${icon}" "${state}" "${NC}" +} + +print_report() { + local load_state enabled_state active_state dry_run_state result_color result_icon result_text + + load_state="$(service_load_state)" + [[ -n "${load_state}" ]] || load_state="unknown" + enabled_state="$(get_enabled_state)" + active_state="$(get_active_state)" + dry_run_state="no" + $DRY_RUN && dry_run_state="yes" + + case "${OPERATION_RESULT}" in + success) + result_color="${GREEN}" + result_icon="${ICON_OK}" + result_text="success" + ;; + dry-run) + result_color="${YELLOW}" + result_icon="${ICON_WARN}" + result_text="dry-run" + ;; + failed) + result_color="${RED}" + result_icon="${ICON_ERR}" + result_text="failed" + ;; + *) + result_color="${BLUE}" + result_icon="${ICON_INFO}" + result_text="not-run" + ;; + esac + + printf "\n${BLUE}${ICON_INFO} Report for --user %s${NC}\n" "${SERVICE_NAME}" + print_state_line "LoadState" "${load_state}" + print_state_line "Enabled" "${enabled_state}" + print_state_line "Active" "${active_state}" + printf " %-9s: %s\n" "Dry-run" "${dry_run_state}" + printf " %-9s: %b%s %s%b\n" "Result" "${result_color}" "${result_icon}" "${result_text}" "${NC}" +} + +perform_disable() { + info "Disabling and stopping --user ${SERVICE_NAME}..." + if run_cmd systemctl --user disable --now "${SERVICE_NAME}"; then + if $DRY_RUN; then + OPERATION_RESULT="dry-run" + warn "Dry-run complete. No changes were made." + else + OPERATION_RESULT="success" + ok "Disabled and stopped --user ${SERVICE_NAME}." + fi + return 0 + fi + + OPERATION_RESULT="failed" + error "Failed to disable --user ${SERVICE_NAME}." + return 1 +} + +perform_revert() { + info "Reverting --user ${SERVICE_NAME} (unmask + enable + start)..." + if ! run_cmd systemctl --user unmask "${SERVICE_NAME}"; then + OPERATION_RESULT="failed" + error "Failed to unmask --user ${SERVICE_NAME}." + return 1 + fi + if ! run_cmd systemctl --user enable --now "${SERVICE_NAME}"; then + OPERATION_RESULT="failed" + error "Failed to enable/start --user ${SERVICE_NAME}." + return 1 + fi + + if $DRY_RUN; then + OPERATION_RESULT="dry-run" + warn "Dry-run complete. No changes were made." + else + OPERATION_RESULT="success" + ok "Reverted successfully. --user ${SERVICE_NAME} is enabled and started." + fi + return 0 +} + +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -r|--revert) + set_action "revert" + ;; + -d|--dry-run) + DRY_RUN=true + ;; + -s|--status) + set_action "status" + ;; + *) + fail "Unknown option: $1 (use -h or --help)" + ;; + esac + shift +done + +[[ -n "${ACTION}" ]] || ACTION="disable" + +require_systemctl +require_user_manager +require_service_exists + +exit_code=0 +case "${ACTION}" in + disable) + perform_disable || exit_code=1 + ;; + revert) + perform_revert || exit_code=1 + ;; + status) + OPERATION_RESULT="success" + info "Status requested for --user ${SERVICE_NAME}." + ;; +esac + +print_report +exit "${exit_code}"
\ No newline at end of file diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 81c0f157..21349d4a 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -24,6 +24,106 @@ LOCK_FILE="/tmp/dropdown_terminal_lock" LAST_TOGGLE_FILE="/tmp/dropdown_terminal_last_toggle" MIN_TOGGLE_INTERVAL_MS=250 DROPDOWN_KITTY_CLASS="kitty-dropterm" +CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +HYPR_DIR="$CONFIG_HOME/hypr" +LUA_ENTRY="$HYPR_DIR/hyprland.lua" +LEGACY_LUA_ENTRY="$CONFIG_HOME/hyprland.lua" + +if [[ -f "$LUA_ENTRY" || -f "$LEGACY_LUA_ENTRY" ]]; then + HYPR_CONFIG_MODE="lua" +else + HYPR_CONFIG_MODE="conf" +fi +lua_escape() { + local value="$1" + value=${value//\\/\\\\} + value=${value//\"/\\\"} + value=${value//$'\n'/\\n} + printf '%s' "$value" +} + + +hypr_dispatch() { + local dispatcher="$1" + shift + local payload="$*" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + local command="$dispatcher" + if [ -n "$payload" ]; then + command="$dispatcher $payload" + fi + local escaped + escaped="$(lua_escape "$command")" + hyprctl dispatch "hl.dsp.exec_raw(\"$escaped\")" + else + hyprctl dispatch "$dispatcher" "$payload" + fi +} + +hypr_exec_cmd() { + local command="$*" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + local escaped + escaped="$(lua_escape "$command")" + hyprctl dispatch "hl.dsp.exec_cmd(\"$escaped\")" + else + hyprctl dispatch exec "$command" + fi +} + +lua_workspace_expr() { + local workspace="$1" + if [[ "$workspace" =~ ^-?[0-9]+$ ]]; then + printf '%s' "$workspace" + else + local escaped + escaped="$(lua_escape "$workspace")" + printf '"%s"' "$escaped" + fi +} + +focus_window() { + local addr="$1" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + local selector escaped + selector="address:$addr" + escaped="$(lua_escape "$selector")" + hyprctl dispatch "hl.dsp.focus({ window = \"$escaped\" })" + else + hypr_dispatch focuswindow "address:$addr" + fi +} + +set_window_floating() { + local addr="$1" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + hyprctl dispatch "hl.dsp.window.float({ window = 'address:$addr', action = 'on' })" + else + hypr_dispatch setfloating "address:$addr" + fi +} + +resize_window_exact() { + local addr="$1" + local width="$2" + local height="$3" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + hyprctl dispatch "hl.dsp.window.resize({ window = 'address:$addr', x = $width, y = $height, exact = true })" + else + hypr_dispatch resizewindowpixel "exact $width $height,address:$addr" + fi +} + +move_window_exact() { + local addr="$1" + local x="$2" + local y="$3" + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + hyprctl dispatch "hl.dsp.window.move({ window = 'address:$addr', x = $x, y = $y, exact = true })" + else + hypr_dispatch movewindowpixel "exact $x $y,address:$addr" + fi +} # Dropdown size and position configuration (percentages) WIDTH_PERCENT=65 # Width as percentage of screen width @@ -31,19 +131,42 @@ HEIGHT_PERCENT=65 # Height as percentage of screen height Y_PERCENT=10 # Y position as percentage from top (X is auto-centered) # Animation settings -ANIMATION_DURATION=100 # milliseconds -SLIDE_STEPS=5 -SLIDE_DELAY=5 # milliseconds between steps +ANIMATION_DURATION=220 # total animation time in milliseconds +SLIDE_STEPS=12 +SLIDE_DELAY=$((ANIMATION_DURATION / SLIDE_STEPS)) +if [ "$SLIDE_DELAY" -lt 8 ]; then + SLIDE_DELAY=8 +fi # Parse arguments -if [ "$1" = "-d" ]; then - DEBUG=true - shift -fi +STARTUP_MODE=false +while [ $# -gt 0 ]; do + case "$1" in + -d | --debug) + DEBUG=true + shift + ;; + --startup | --init) + STARTUP_MODE=true + shift + ;; + -h | --help) + echo "Usage: $0 [-d|--debug] [--startup|--init] <terminal_command>" + echo "Examples:" + echo " $0 kitty" + echo " $0 --startup kitty" + echo " $0 -d \"kitty -e zsh\"" + exit 0 + ;; + *) + break + ;; + esac +done -TERMINAL_CMD="$1" +TERMINAL_CMD="$*" if [[ "$TERMINAL_CMD" == kitty* ]] && [[ "$TERMINAL_CMD" != *"--class"* ]] && [[ "$TERMINAL_CMD" != *"--name"* ]] && [[ "$TERMINAL_CMD" != *"--app-id"* ]]; then - TERMINAL_CMD="$TERMINAL_CMD --class $DROPDOWN_KITTY_CLASS" + TERMINAL_CMD="$TERMINAL_CMD --class $DROPDOWN_KITTY_CLASS --app-id $DROPDOWN_KITTY_CLASS" fi # Ensure only one instance runs at a time (prevents overlapping animations) @@ -51,25 +174,27 @@ 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 +if [ "$STARTUP_MODE" != true ]; then + 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 - exit 0 fi fi + echo "$now_ms" >"$LAST_TOGGLE_FILE" fi -echo "$now_ms" >"$LAST_TOGGLE_FILE" # Debug echo function debug_echo() { @@ -103,10 +228,11 @@ resolve_terminal_address() { # Validate input if [ -z "$TERMINAL_CMD" ]; then - echo "Missing terminal command. Usage: $0 [-d] <terminal_command>" + echo "Missing terminal command. Usage: $0 [-d|--debug] [--startup|--init] <terminal_command>" echo "Examples:" - echo " $0 foot" - echo " $0 -d foot (with debug output)" + echo " $0 kitty" + echo " $0 --startup kitty" + echo " $0 -d kitty (with debug output)" echo " $0 'kitty -e zsh'" echo " $0 'alacritty --working-directory /home/user'" echo "" @@ -127,14 +253,57 @@ get_window_geometry() { # 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 + local geometry y height monitor_id monitor_y + geometry=$(hyprctl clients -j 2>/dev/null | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | "\(.at[1]) \(.size[1]) \(.monitor)"' 2>/dev/null) + y=$(echo "$geometry" | awk '{print $1}') + height=$(echo "$geometry" | awk '{print $2}') + monitor_id=$(echo "$geometry" | awk '{print $3}') + + if ! [[ "$y" =~ ^-?[0-9]+$ && "$height" =~ ^[0-9]+$ ]]; then + return 1 + fi + + if [[ "$monitor_id" =~ ^-?[0-9]+$ ]]; then + monitor_y=$(hyprctl monitors -j 2>/dev/null | jq -r --argjson MID "$monitor_id" '.[] | select(.id == $MID) | .y' 2>/dev/null | head -1) + fi + if ! [[ "$monitor_y" =~ ^-?[0-9]+$ ]]; then + monitor_y=0 + fi + + if [ $((y + height)) -le "$monitor_y" ]; then return 0 fi return 1 } +get_window_monitor_top() { + local addr="$1" + local monitor_id monitor_y + monitor_id=$(hyprctl clients -j 2>/dev/null | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | .monitor' 2>/dev/null | head -1) + if [[ "$monitor_id" =~ ^-?[0-9]+$ ]]; then + monitor_y=$(hyprctl monitors -j 2>/dev/null | jq -r --argjson MID "$monitor_id" '.[] | select(.id == $MID) | .y' 2>/dev/null | head -1) + if [[ "$monitor_y" =~ ^-?[0-9]+$ ]]; then + echo "$monitor_y" + return 0 + fi + fi + echo 0 +} + +get_hidden_y_for_window() { + local addr="$1" + local height="$2" + local monitor_top + if ! [[ "$height" =~ ^[0-9]+$ ]]; then + height=702 + fi + monitor_top=$(get_window_monitor_top "$addr") + if ! [[ "$monitor_top" =~ ^-?[0-9]+$ ]]; then + monitor_top=0 + fi + echo $((monitor_top - height - 80)) +} + # State helpers get_hidden_state() { if [ -f "$STATE_FILE" ]; then @@ -146,6 +315,15 @@ set_hidden_state() { echo "$1" >"$STATE_FILE" } +sleep_ms() { + local ms="$1" + if command -v awk >/dev/null 2>&1; then + sleep "$(awk -v value="$ms" 'BEGIN { printf "%.3f", value / 1000 }')" + else + sleep 0.01 + fi +} + # Function to animate window slide down (show) animate_slide_down() { local addr="$1" @@ -153,28 +331,28 @@ animate_slide_down() { local target_y="$3" local width="$4" local height="$5" + local start_y="$6" debug_echo "Animating slide down for window $addr to position $target_x,$target_y" - # Start position (above screen) - local start_y=$((target_y - height - 50)) - - # Calculate step size - local step_y=$(((target_y - start_y) / SLIDE_STEPS)) + if ! [[ "$start_y" =~ ^-?[0-9]+$ ]]; then + start_y=$((target_y - height - 50)) + fi + local total_delta=$((target_y - start_y)) # Move window to start position instantly (off-screen) - hyprctl dispatch movewindowpixel "exact $target_x $start_y,address:$addr" >/dev/null 2>&1 - sleep 0.05 + move_window_exact "$addr" "$target_x" "$start_y" >/dev/null 2>&1 || return 1 + sleep_ms "$SLIDE_DELAY" # Animate slide down for i in $(seq 1 $SLIDE_STEPS); do - local current_y=$((start_y + (step_y * i))) - hyprctl dispatch movewindowpixel "exact $target_x $current_y,address:$addr" >/dev/null 2>&1 - sleep 0.03 + local current_y=$((start_y + (total_delta * i / SLIDE_STEPS))) + move_window_exact "$addr" "$target_x" "$current_y" >/dev/null 2>&1 || return 1 + sleep_ms "$SLIDE_DELAY" done # Ensure final position is exact - hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$addr" >/dev/null 2>&1 + move_window_exact "$addr" "$target_x" "$target_y" >/dev/null 2>&1 } # Function to animate window slide up (hide) @@ -184,21 +362,22 @@ animate_slide_up() { local start_y="$3" local width="$4" local height="$5" + local end_y="$6" debug_echo "Animating slide up for window $addr from position $start_x,$start_y" - # End position (above screen) - local end_y=$((start_y - height - 50)) - - # Calculate step size - local step_y=$(((start_y - end_y) / SLIDE_STEPS)) + if ! [[ "$end_y" =~ ^-?[0-9]+$ ]]; then + end_y=$((start_y - height - 50)) + fi + local total_delta=$((start_y - end_y)) # Animate slide up for i in $(seq 1 $SLIDE_STEPS); do - local current_y=$((start_y - (step_y * i))) - hyprctl dispatch movewindowpixel "exact $start_x $current_y,address:$addr" >/dev/null 2>&1 - sleep 0.03 + local current_y=$((start_y - (total_delta * i / SLIDE_STEPS))) + move_window_exact "$addr" "$start_x" "$current_y" >/dev/null 2>&1 || return 1 + sleep_ms "$SLIDE_DELAY" done + move_window_exact "$addr" "$start_x" "$end_y" >/dev/null 2>&1 debug_echo "Slide up animation completed" } @@ -312,8 +491,9 @@ calculate_dropdown_position() { echo "$final_x $final_y $width $height $mon_name" } -# Get the current workspace -CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id') +get_current_workspace() { + hyprctl activeworkspace -j 2>/dev/null | jq -r '.id // empty' +} # Function to get stored terminal address get_terminal_address() { @@ -325,7 +505,7 @@ get_terminal_address() { # 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 + '.[] | select((.class == $CLASS) or (.initialClass == $CLASS)) | .address' | head -1 } # Function to get stored monitor name @@ -356,29 +536,197 @@ window_exists() { } -# Function to check if window is pinned -window_is_pinned() { +window_workspace_name() { 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 + hyprctl clients -j 2>/dev/null | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | .workspace.name // empty' +} + +window_is_on_special_workspace() { + local addr="$1" + local workspace_name + workspace_name=$(window_workspace_name "$addr") + [ "$workspace_name" = "$SPECIAL_WS" ] || [ "$workspace_name" = "$SPECIAL_NAME" ] +} + +workspace_matches_target() { + local target_ws="$1" + local current_ws="$2" + if [ "$target_ws" = "$SPECIAL_WS" ] || [ "$target_ws" = "$SPECIAL_NAME" ]; then + [ "$current_ws" = "$SPECIAL_WS" ] || [ "$current_ws" = "$SPECIAL_NAME" ] else + [ "$current_ws" = "$target_ws" ] + fi +} + +move_window_to_workspace_silent() { + local target_ws="$1" + local addr="$2" + local post_ws="" + + if [[ "$HYPR_CONFIG_MODE" == "lua" ]]; then + local ws_expr + ws_expr=$(lua_workspace_expr "$target_ws") + hyprctl dispatch "hl.dsp.window.move({ window = 'address:$addr', workspace = $ws_expr, follow = false })" >/dev/null 2>&1 || return 1 + sleep 0.03 + post_ws=$(window_workspace_name "$addr") + workspace_matches_target "$target_ws" "$post_ws" + return $? + fi + + # Preferred syntax on newer Hyprland builds (target a specific window by selector). + if hypr_dispatch movetoworkspacesilent "$target_ws,address:$addr" >/dev/null 2>&1; then + sleep 0.03 + post_ws=$(window_workspace_name "$addr") + if workspace_matches_target "$target_ws" "$post_ws"; then + return 0 + fi + fi + + # Compatibility fallback for builds where selector syntax is ignored. + hypr_dispatch focuswindow "address:$addr" >/dev/null 2>&1 || return 1 + hypr_dispatch movetoworkspacesilent "$target_ws" >/dev/null 2>&1 || return 1 + sleep 0.03 + post_ws=$(window_workspace_name "$addr") + workspace_matches_target "$target_ws" "$post_ws" +} + +infer_hidden_state() { + local addr="$1" + if window_is_hidden "$addr"; then + echo "hidden" + elif window_is_on_special_workspace "$addr"; then + echo "hidden" + else + echo "shown" + fi +} + +apply_dropdown_layout() { + local addr="$1" + local pos_info + pos_info=$(calculate_dropdown_position) + if [ $? -ne 0 ]; then + debug_echo "Warning: Failed to calculate dropdown position, layout update skipped" return 1 fi + + local target_x=$(echo "$pos_info" | cut -d' ' -f1) + local target_y=$(echo "$pos_info" | cut -d' ' -f2) + local width=$(echo "$pos_info" | cut -d' ' -f3) + local height=$(echo "$pos_info" | cut -d' ' -f4) + set_window_floating "$addr" >/dev/null 2>&1 + resize_window_exact "$addr" "$width" "$height" >/dev/null 2>&1 + move_window_exact "$addr" "$target_x" "$target_y" >/dev/null 2>&1 + return 0 } -# Ensure pin state without toggling unexpectedly -ensure_pinned() { +show_terminal() { local addr="$1" - if ! window_is_pinned "$addr"; then - hyprctl dispatch pin "address:$addr" >/dev/null 2>&1 + local current_ws + local pos_info target_x target_y width height hidden_y + current_ws=$(get_current_workspace) + if ! [[ "$current_ws" =~ ^-?[0-9]+$ ]]; then + current_ws=1 + fi + pos_info=$(calculate_dropdown_position) + if [ $? -ne 0 ] || [ -z "$pos_info" ]; then + debug_echo "Failed to calculate dropdown position for show; falling back to direct layout" + move_window_to_workspace_silent "$current_ws" "$addr" >/dev/null 2>&1 || debug_echo "Failed to move dropdown terminal to workspace $current_ws" + apply_dropdown_layout "$addr" || debug_echo "Dropdown layout update returned non-zero" + focus_window "$addr" >/dev/null 2>&1 || true + set_hidden_state "shown" + debug_echo "Dropdown terminal shown" + return 0 + fi + + target_x=$(echo "$pos_info" | cut -d' ' -f1) + target_y=$(echo "$pos_info" | cut -d' ' -f2) + width=$(echo "$pos_info" | cut -d' ' -f3) + height=$(echo "$pos_info" | cut -d' ' -f4) + hidden_y=$(get_hidden_y_for_window "$addr" "$height") + if window_is_on_special_workspace "$addr"; then + move_window_to_workspace_silent "$current_ws" "$addr" >/dev/null 2>&1 || debug_echo "Failed to move dropdown terminal to workspace $current_ws" + fi + set_window_floating "$addr" >/dev/null 2>&1 || true + resize_window_exact "$addr" "$width" "$height" >/dev/null 2>&1 || true + animate_slide_down "$addr" "$target_x" "$target_y" "$width" "$height" "$hidden_y" || move_window_exact "$addr" "$target_x" "$target_y" >/dev/null 2>&1 + focus_window "$addr" >/dev/null 2>&1 || true + set_hidden_state "shown" + debug_echo "Dropdown terminal shown" + return 0 +} + +hide_terminal() { + local addr="$1" + local geometry start_x start_y width height hidden_y + if window_is_hidden "$addr" || window_is_on_special_workspace "$addr"; then + set_hidden_state "hidden" + debug_echo "Dropdown terminal already hidden" + return 0 + fi + + geometry=$(get_window_geometry "$addr") + if [ -n "$geometry" ]; then + start_x=$(echo "$geometry" | awk '{print $1}') + start_y=$(echo "$geometry" | awk '{print $2}') + width=$(echo "$geometry" | awk '{print $3}') + height=$(echo "$geometry" | awk '{print $4}') + else + local pos_info + pos_info=$(calculate_dropdown_position) + start_x=$(echo "$pos_info" | cut -d' ' -f1) + start_y=$(echo "$pos_info" | cut -d' ' -f2) + width=$(echo "$pos_info" | cut -d' ' -f3) + height=$(echo "$pos_info" | cut -d' ' -f4) + fi + + if ! [[ "$height" =~ ^[0-9]+$ ]]; then + height=702 + fi + hidden_y=$(get_hidden_y_for_window "$addr" "$height") + if ! [[ "$start_x" =~ ^-?[0-9]+$ && "$start_y" =~ ^-?[0-9]+$ ]]; then + debug_echo "Missing geometry for slide-up animation; moving off-screen directly" + move_window_exact "$addr" "$start_x" "$hidden_y" >/dev/null 2>&1 || true + else + animate_slide_up "$addr" "$start_x" "$start_y" "$width" "$height" "$hidden_y" || true + fi + + if ! window_is_hidden "$addr"; then + debug_echo "Dropdown not off-screen after slide; trying direct off-screen move" + move_window_exact "$addr" "$start_x" "$hidden_y" >/dev/null 2>&1 || true + fi + if ! window_is_hidden "$addr"; then + debug_echo "Off-screen hide failed, falling back to $SPECIAL_WS" + if ! move_window_to_workspace_silent "$SPECIAL_WS" "$addr"; then + debug_echo "Failed to move dropdown terminal to $SPECIAL_WS" + return 1 + fi fi + set_hidden_state "hidden" + debug_echo "Dropdown terminal hidden" + return 0 } -ensure_unpinned() { +hide_terminal_silent() { local addr="$1" - if window_is_pinned "$addr"; then - hyprctl dispatch pin "address:$addr" >/dev/null 2>&1 + local geometry start_x height hidden_y + geometry=$(get_window_geometry "$addr") + if [ -n "$geometry" ]; then + start_x=$(echo "$geometry" | awk '{print $1}') + height=$(echo "$geometry" | awk '{print $4}') fi + if ! [[ "$height" =~ ^[0-9]+$ ]]; then + height=702 + fi + hidden_y=$(get_hidden_y_for_window "$addr" "$height") + if ! [[ "$start_x" =~ ^-?[0-9]+$ ]]; then + start_x=0 + fi + move_window_exact "$addr" "$start_x" "$hidden_y" >/dev/null 2>&1 || true + move_window_to_workspace_silent "$SPECIAL_WS" "$addr" >/dev/null 2>&1 || true + set_hidden_state "hidden" + debug_echo "Dropdown terminal hidden (silent)" + return 0 } # Function to spawn terminal and capture its address @@ -403,45 +751,48 @@ spawn_terminal() { local windows_before=$(hyprctl clients -j) local count_before=$(echo "$windows_before" | jq 'length') - # Launch terminal directly in special workspace to avoid visible spawn - hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD" - - # Wait for window to appear - sleep 0.1 - - # Get windows after spawning - local windows_after=$(hyprctl clients -j) - local count_after=$(echo "$windows_after" | jq 'length') + # Launch terminal with pre-applied workspace/geometry hints to avoid visible zigzag. + local launch_cmd="[workspace $SPECIAL_WS silent;float;size $width $height;move $target_x $target_y] $TERMINAL_CMD" + hypr_exec_cmd "$launch_cmd" local new_addr="" + for _ in $(seq 1 20); do + local windows_after=$(hyprctl clients -j) + local recovered + recovered=$(echo "$windows_after" | jq -r --arg CLASS "$DROPDOWN_KITTY_CLASS" \ + '.[] | select((.class == $CLASS) or (.initialClass == $CLASS)) | .address' | head -1) + if [ -n "$recovered" ] && [ "$recovered" != "null" ]; then + new_addr="$recovered" + break + fi - if [ "$count_after" -gt "$count_before" ]; then - # Find the new window by comparing before/after lists - new_addr=$(comm -13 \ - <(echo "$windows_before" | jq -r '.[].address' | sort) \ - <(echo "$windows_after" | jq -r '.[].address' | sort) | - head -1) - fi - - # Fallback: try to find by the most recently mapped window - if [ -z "$new_addr" ] || [ "$new_addr" = "null" ]; then - new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address') - fi + local count_after=$(echo "$windows_after" | jq 'length') + if [ "$count_after" -gt "$count_before" ]; then + new_addr=$(comm -13 \ + <(echo "$windows_before" | jq -r '.[].address' | sort) \ + <(echo "$windows_after" | jq -r '.[].address' | sort) | + head -1) + if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then + break + fi + fi + sleep 0.1 + done if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then # Store the address and monitor name echo "$new_addr $monitor_name" >"$ADDR_FILE" debug_echo "Terminal created with address: $new_addr in special workspace on monitor $monitor_name" - # Small delay to ensure it's properly in special workspace - sleep 0.2 - # Move to current workspace but start hidden off-screen - hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$new_addr" - 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" + # Configure in special workspace and keep hidden until explicitly toggled. + set_window_floating "$new_addr" >/dev/null 2>&1 + resize_window_exact "$new_addr" "$width" "$height" >/dev/null 2>&1 + move_window_exact "$new_addr" "$target_x" "$target_y" >/dev/null 2>&1 + if [ "$STARTUP_MODE" = true ]; then + hide_terminal_silent "$new_addr" || debug_echo "Failed to hide new dropdown terminal after spawn (silent)" + else + hide_terminal "$new_addr" || debug_echo "Failed to hide new dropdown terminal after spawn" + fi return 0 fi @@ -452,80 +803,31 @@ spawn_terminal() { # Main logic 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) - if [ "$focused_monitor" != "$dropdown_monitor" ]; then - debug_echo "Monitor focus changed: moving dropdown to $focused_monitor" - # Calculate new position for focused monitor - pos_info=$(calculate_dropdown_position) - target_x=$(echo $pos_info | cut -d' ' -f1) - target_y=$(echo $pos_info | cut -d' ' -f2) - width=$(echo $pos_info | cut -d' ' -f3) - height=$(echo $pos_info | cut -d' ' -f4) - monitor_name=$(echo $pos_info | cut -d' ' -f5) - # Move and resize window - hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$TERMINAL_ADDR" - hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" - # Update ADDR_FILE - echo "$TERMINAL_ADDR $monitor_name" >"$ADDR_FILE" +if [ -z "$TERMINAL_ADDR" ]; then + debug_echo "No existing terminal found, creating new one" + if spawn_terminal; then + TERMINAL_ADDR=$(get_terminal_address) fi +fi - 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) - target_x=$(echo $pos_info | cut -d' ' -f1) - target_y=$(echo $pos_info | cut -d' ' -f2) - width=$(echo $pos_info | cut -d' ' -f3) - height=$(echo $pos_info | cut -d' ' -f4) - - 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 off-screen with slide up animation" - - # Get current geometry for animation - geometry=$(get_window_geometry "$TERMINAL_ADDR") - if [ -n "$geometry" ]; then - curr_x=$(echo $geometry | cut -d' ' -f1) - curr_y=$(echo $geometry | cut -d' ' -f2) - curr_width=$(echo $geometry | cut -d' ' -f3) - curr_height=$(echo $geometry | cut -d' ' -f4) - - debug_echo "Current geometry: ${curr_x},${curr_y} ${curr_width}x${curr_height}" +if [ -z "$TERMINAL_ADDR" ]; then + debug_echo "No dropdown terminal instance is available" + exit 1 +fi - # Animate slide up first - animate_slide_up "$TERMINAL_ADDR" "$curr_x" "$curr_y" "$curr_width" "$curr_height" +if [ "$STARTUP_MODE" = true ]; then + debug_echo "Startup mode requested: ensuring dropdown terminal exists and stays hidden" + hide_terminal_silent "$TERMINAL_ADDR" + exit 0 +fi +HIDDEN_STATE=$(get_hidden_state) +if [ "$HIDDEN_STATE" != "hidden" ] && [ "$HIDDEN_STATE" != "shown" ]; then + HIDDEN_STATE=$(infer_hidden_state "$TERMINAL_ADDR") + set_hidden_state "$HIDDEN_STATE" +fi - # 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 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 +if [ "$HIDDEN_STATE" = "hidden" ]; then + show_terminal "$TERMINAL_ADDR" else - debug_echo "No existing terminal found, creating new one" - if spawn_terminal; then - TERMINAL_ADDR=$(get_terminal_address) - if [ -n "$TERMINAL_ADDR" ]; then - hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" - fi - fi + hide_terminal "$TERMINAL_ADDR" fi diff --git a/config/hypr/scripts/ExternalBrightness.sh b/config/hypr/scripts/ExternalBrightness.sh index 29c1b238..59081e1d 100755 --- a/config/hypr/scripts/ExternalBrightness.sh +++ b/config/hypr/scripts/ExternalBrightness.sh @@ -5,99 +5,253 @@ # License: GNU GPLv3 # SPDX-License-Identifier: GPL-3.0-or-later # ================================================== -# External monitor brightness via ddcutil +# External monitor brightness via ddcutil with dynamic monitor detection set -u +# Configuration step=10 -vcp_code=10 +min=5 +vcp_code=10 # MCCS VCP feature 0x10: Luminance (brightness) +state_file="/tmp/external_brightness_bus" +cache_file="/tmp/external_brightness_displays.cache" +cache_ttl=300 # 5 minutes -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 +# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" + +if [[ -n "${HYPR_CONFIG_MODE:-}" ]]; then + case "${HYPR_CONFIG_MODE,,}" in + lua) hypr_config_mode="lua" ;; + conf|hyprlang) hypr_config_mode="conf" ;; + auto) hypr_config_mode="" ;; + *) hypr_config_mode="" ;; + esac +fi + +if [[ -z "${hypr_config_mode:-}" ]]; then + if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" + else + hypr_config_mode="conf" + fi +fi + +# Get list of displays: bus model index +# Format: BUS|MODEL|INDEX +get_displays() { + if [[ -f "$cache_file" ]]; then + local now mtime + now=$(date +%s) + mtime=$(stat -c %Y "$cache_file") + if (( now - mtime < cache_ttl )); then + cat "$cache_file" + return + fi + fi + + local res + res=$(ddcutil detect --terse 2>/dev/null | awk ' + /^Display/ { + if (bus) { + count[model]++ + print bus "|" model "|" count[model] + } + bus=""; model="Unknown" + } + /I2C bus:/ { bus=$0; sub(/.*\/dev\/i2c-/, "", bus) } + /Model:/ { model=$0; sub(/.*Model:[[:space:]]*/, "", model) } + END { + if (bus) { + count[model]++ + print bus "|" model "|" count[model] + } + } + ') + + if [[ -n "$res" ]]; then + echo "$res" > "$cache_file" + echo "$res" + fi +} + +get_active_bus() { + local displays + displays=$(get_displays) + if [[ -z "$displays" ]]; then + return 1 + fi + + local saved + if [[ -f "$state_file" ]]; then + saved=$(cat "$state_file") + # Check if saved bus still exists in current displays + if echo "$displays" | grep -q "^$saved|"; then + echo "$saved" + return 0 + fi + fi + + # Default to first display's bus + echo "$displays" | head -n 1 | cut -d'|' -f1 +} + +set_active_bus() { + echo "$1" > "$state_file" +} + +cycle_display() { + local displays + displays=$(get_displays) + [[ -z "$displays" ]] && return 1 + + local current + current=$(get_active_bus) || return 1 + + local next + next=$(echo "$displays" | awk -v current="$current" -F'|' ' + { + a[n++] = $1 + } + END { + for (i=0; i<n; i++) { + if (a[i] == current) { + print a[(i+1)%n] + exit + } + } + print a[0] + } + ') + set_active_bus "$next" } ddcutil_cmd() { - local display_arg=() - local display="${DDCUTIL_DISPLAY:-}" - if [[ -n "${display}" ]]; then - display_arg+=(--display "${display}") - fi - ddcutil ${DDCUTIL_OPTS:-} "${display_arg[@]}" "$@" + local bus="$1" + shift + ddcutil --bus "$bus" ${DDCUTIL_OPTS:-} "$@" } 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}" + local bus="$1" + local line + if ! line="$(ddcutil_cmd "$bus" getvcp "$vcp_code" 2>/dev/null | tail -n 1)"; then + return 1 + fi + + local current max + current="$(sed -n 's/.*current value = *\([0-9]\+\).*/\1/p' <<< "$line")" + max="$(sed -n 's/.*max value = *\([0-9]\+\).*/\1/p' <<< "$line")" + + [[ -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 + local bus="$1" + local value="$2" + ddcutil_cmd "$bus" 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}" + local displays + displays=$(get_displays) + if [[ -z "$displays" ]]; then + printf '{"text":" N/A","tooltip":"No DDC/CI displays detected","class":"brightness-external-off"}\n' + return 0 + fi + + local active_bus + active_bus=$(get_active_bus) || return 1 + + local current max percent + if ! read -r current max < <(get_brightness "$active_bus"); then + current="N/A" + percent="N/A" + else + percent=$(( current * 100 / max )) + fi + + # Build tooltip + local tooltip="" + local active_name="Unknown" + + while IFS='|' read -r bus model index; do + local name="${model}" + [[ $index -gt 1 ]] && name="${name} #${index}" + + if [[ "$bus" == "$active_bus" ]]; then + tooltip="${tooltip}[ ${name} ]\\n" + active_name="$name" + else + tooltip="${tooltip}${name}\\n" + fi + done <<< "$displays" + + tooltip="${tooltip}\\nBrightness: ${percent}%\\nClick to switch display" + + local icon="" + if [[ "$percent" != "N/A" ]]; then + 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":"%s","class":"brightness-external"}\n' "$icon" "$percent" "$tooltip" + else + printf '{"text":" %s","tooltip":"%s","class":"brightness-external-off"}\n' "$current" "$tooltip" + fi } 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 - ;; + --get|"") + json_output + ;; + --inc|--dec) + bus=$(get_active_bus) || exit 0 + read -r current max < <(get_brightness "$bus") || { json_output; exit 0; } + delta=$step + [[ "$1" == "--dec" ]] && delta=$(( -step )) + new=$(( current + delta )) + (( new < min )) && new=$min + (( new > max )) && new="$max" + set_brightness "$bus" "$new" + json_output + ;; + --set) + [[ -n "${2:-}" ]] || exit 1 + bus=$(get_active_bus) || exit 1 + set_brightness "$bus" "$2" + json_output + ;; + --cycle) + cycle_display + json_output + ;; + --bus) + [[ -n "${2:-}" ]] || exit 1 + set_active_bus "$2" + shift 2 + "${0}" "${@:-"--get"}" + ;; + --display) + # Compatibility with old --display N but now it expects a bus number + # Or we could map display number to bus number + [[ -n "${2:-}" ]] || exit 1 + bus_target=$(get_displays | awk -v target="$2" -F'|' 'NR==target {print $1}') + if [[ -n "$bus_target" ]]; then + set_active_bus "$bus_target" + fi + shift 2 + "${0}" "${@:-"--get"}" + ;; + -h|--help) + echo "Usage: $0 [--get|--inc|--dec|--set N|--cycle|--bus N|--display N]" + ;; + *) + exit 1 + ;; esac diff --git a/config/hypr/scripts/Float-all-Windows.sh b/config/hypr/scripts/Float-all-Windows.sh index e658cabb..25fdc465 100755 --- a/config/hypr/scripts/Float-all-Windows.sh +++ b/config/hypr/scripts/Float-all-Windows.sh @@ -6,5 +6,28 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ================================================== +# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" + +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi + +# Get current workspace ID 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:{} + +# Process all windows on the current workspace +if [[ "$hypr_config_mode" == "lua" ]]; then + # In Lua mode, use the native Lua API via hl.dispatch to ensure compatibility + hyprctl clients -j | jq -r --arg ws "$ws" '.[] | select(.workspace.id == ($ws|tonumber)) | .address' | while read -r addr; do + hyprctl dispatch "hl.dispatch(hl.dsp.window.float({ window = \"address:${addr}\", action = \"toggle\" }))" >/dev/null 2>&1 + done +else + # Legacy Hyprlang mode + hyprctl clients -j | jq -r --arg ws "$ws" '.[] | select(.workspace.id == ($ws|tonumber)) | .address' | xargs -r -I {} hyprctl dispatch togglefloating address:{} +fi diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh index 9c5b8264..b104179e 100755 --- a/config/hypr/scripts/GameMode.sh +++ b/config/hypr/scripts/GameMode.sh @@ -12,31 +12,89 @@ SCRIPTSDIR="$HOME/.config/hypr/scripts" # shellcheck source=/dev/null . "$SCRIPTSDIR/WallpaperCmd.sh" +# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" -HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') -if [ "$HYPRGAMEMODE" = 1 ] ; then - hyprctl --batch "\ - keyword animations:enabled 0;\ - keyword decoration:shadow:enabled 0;\ - keyword decoration:blur:enabled 0;\ - keyword general:gaps_in 0;\ - keyword general:gaps_out 0;\ - keyword general:border_size 1;\ - keyword decoration:rounding 0" - -\thyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$" +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi + +# Check if animations are currently enabled +HYPRGAMEMODE=$(hyprctl getoption animations:enabled -j | jq -r '.bool' 2>/dev/null) +if [[ "$HYPRGAMEMODE" == "null" || -z "$HYPRGAMEMODE" ]]; then + HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') +fi + +if [ "$HYPRGAMEMODE" = "true" ] || [ "$HYPRGAMEMODE" = "1" ] ; then + # ENABLE Game Mode (Disable animations/decorations) + if [[ "$hypr_config_mode" == "lua" ]]; then + hyprctl eval "hl.config({ + animations = { enabled = false }, + decoration = { shadow = { enabled = false }, blur = { enabled = false }, rounding = 0 }, + general = { gaps_in = 0, gaps_out = 0, border_size = 1 } + })" + hyprctl eval "hl.window_rule({ name = 'gamemode-opacity', match = { class = '.*' }, opacity = 1.0 })" + else + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:shadow:enabled 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$" + fi + "$WWW_CMD" kill notify-send -e -u low -i "$notif" " Gamemode:" " enabled" sleep 0.1 exit else -\t"$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" && "$WWW_CMD" img "$HOME/.config/rofi/.current_wallpaper" & - sleep 0.1 - ${SCRIPTSDIR}/WallustSwww.sh - sleep 0.5 - hyprctl reload - ${SCRIPTSDIR}/Refresh.sh + # DISABLE Game Mode (Restore animations/decorations) + if [[ "$hypr_config_mode" == "lua" ]]; then + # Explicitly restore to defaults (matching settings.lua where possible) + hyprctl eval "hl.config({ + animations = { enabled = true }, + decoration = { shadow = { enabled = true }, blur = { enabled = true }, rounding = 10 }, + general = { gaps_in = 2, gaps_out = 4, border_size = 2 } + })" + # Removing rule in Lua mode might require a different approach if no 'remove' exists + # We'll reload the config as a fallback or try to nullify it + hyprctl eval "hl.window_rule({ name = 'gamemode-opacity', match = { class = 'NONE' }, opacity = 1.0 })" + else + hyprctl --batch "\ + keyword animations:enabled 1;\ + keyword decoration:shadow:enabled 1;\ + keyword decoration:blur:enabled 1;\ + keyword general:gaps_in 2;\ + keyword general:gaps_out 4;\ + keyword general:border_size 2;\ + keyword decoration:rounding 10" + hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(NONE)$" + fi + + # Restore wallpaper using the official daemon script + if [[ -x "${SCRIPTSDIR}/WallpaperDaemon.sh" ]]; then + "${SCRIPTSDIR}/WallpaperDaemon.sh" & + fi + + sleep 0.1 + ${SCRIPTSDIR}/WallustSwww.sh + sleep 0.5 + + # Refresh UI components + if [[ -x "${SCRIPTSDIR}/Refresh.sh" ]]; then + "${SCRIPTSDIR}/Refresh.sh" + else + hyprctl reload + fi + notify-send -e -u normal -i "$notif" " Gamemode:" " disabled" exit fi -hyprctl reload diff --git a/config/hypr/scripts/Ghostty_themes.sh b/config/hypr/scripts/Ghostty_themes.sh index a69f246e..c3fcd792 100755 --- a/config/hypr/scripts/Ghostty_themes.sh +++ b/config/hypr/scripts/Ghostty_themes.sh @@ -11,6 +11,10 @@ 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" +wallust_include_path="$HOME/.config/ghostty/wallust.conf" +wallust_option_label="Set by wallpaper" +default_option_label="Default - no color" +wallust_refresh_script="$HOME/.config/hypr/scripts/WallustSwww.sh" notify_user() { local icon="$1" @@ -23,6 +27,13 @@ notify_user() { fi } +refresh_wallpaper_theme() { + if [[ -x "$wallust_refresh_script" ]]; then + "$wallust_refresh_script" >/dev/null 2>&1 || true + fi + pkill -SIGUSR2 ghostty >/dev/null 2>&1 || true +} + if [[ ! -f "$config_file" ]]; then notify_user "$iDIR/error.png" "Ghostty Theme" "Config not found: $config_file" exit 1 @@ -46,6 +57,11 @@ current_theme=$( }' "$config_file" ) +wallust_enabled=$( + awk '/^[[:space:]]*config-file[[:space:]]*=/ && $0 !~ /^[[:space:]]*#/ && /wallust\.conf/ {print "1"; exit}' "$config_file" +) +[[ "$wallust_enabled" != "1" ]] && wallust_enabled="0" + mapfile -t available_theme_names < <( awk -F'=' '/^[[:space:]]*#[[:space:]]*theme[[:space:]]*=/ { val=$2 @@ -60,29 +76,103 @@ 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 +menu_entries=("$wallust_option_label" "$default_option_label") for t in "${available_theme_names[@]}"; do menu_entries+=("$t") done +current_selection_index=0 +if [[ "$wallust_enabled" == "1" ]]; then + current_selection_index=0 +elif [[ -z "$current_theme" ]]; then + current_selection_index=1 +else + current_selection_index=1 + for i in "${!available_theme_names[@]}"; do + if [[ "${available_theme_names[$i]}" == "$current_theme" ]]; then + current_selection_index=$((i + 2)) + break + fi + done +fi choice=$( printf "%s\n" "${menu_entries[@]}" | - rofi -i -dmenu -p "Ghostty Theme" "${rofi_config_args[@]}" -mesg "Select a theme to apply" + rofi -i -dmenu -p "Ghostty Theme" "${rofi_config_args[@]}" -mesg "Select a theme to apply" -selected-row "$current_selection_index" ) [[ -z "$choice" ]] && exit 0 -if [[ "$choice" == "Current: "* ]]; then + +selected_theme="$choice" + +if [[ "$selected_theme" == "$wallust_option_label" ]]; then + if [[ "$wallust_enabled" == "1" ]]; then + exit 0 + fi + + tmp_file=$(mktemp) + awk -v wallust_include_path="$wallust_include_path" ' +function trim(s) { sub(/^[[:space:]]+/, "", s); sub(/[[:space:]]+$/, "", s); return s } +{ + line=$0 + if ($0 ~ /^[[:space:]]*theme[[:space:]]*=/) { + sub(/^[[:space:]]*theme[[:space:]]*=/, "#theme =", line) + print line + next + } + if ($0 ~ /^[[:space:]]*#?[[:space:]]*config-file[[:space:]]*=/ && $0 ~ /wallust\.conf/) { + print "config-file = " wallust_include_path + wallust_set=1 + next + } + print $0 +} +END { + if (!wallust_set) { + print "config-file = " wallust_include_path + } +} +' "$config_file" > "$tmp_file" + mv "$tmp_file" "$config_file" + refresh_wallpaper_theme + notify_user "$iDIR/ja.png" "Ghostty Theme Applied" "$wallust_option_label" exit 0 fi +if [[ "$selected_theme" == "$default_option_label" ]]; then + if [[ "$wallust_enabled" != "1" && -z "$current_theme" ]]; then + exit 0 + fi -selected_theme="$choice" + tmp_file=$(mktemp) + awk -v wallust_include_path="$wallust_include_path" ' +{ + line=$0 + if ($0 ~ /^[[:space:]]*theme[[:space:]]*=/) { + sub(/^[[:space:]]*theme[[:space:]]*=/, "#theme =", line) + print line + next + } + if ($0 ~ /^[[:space:]]*#?[[:space:]]*config-file[[:space:]]*=/ && $0 ~ /wallust\.conf/) { + print "#config-file = " wallust_include_path + wallust_seen=1 + next + } + print $0 +} +END { + if (!wallust_seen) { + print "#config-file = " wallust_include_path + } +} +' "$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" "$default_option_label" + exit 0 +fi -if [[ -n "$current_theme" && "$selected_theme" == "$current_theme" ]]; then +if [[ "$wallust_enabled" != "1" && -n "$current_theme" && "$selected_theme" == "$current_theme" ]]; then exit 0 fi @@ -97,11 +187,16 @@ format_theme_value() { selected_formatted=$(format_theme_value "$selected_theme") tmp_file=$(mktemp) -awk -v selected="$selected_theme" -v selected_formatted="$selected_formatted" ' +awk -v selected="$selected_theme" -v selected_formatted="$selected_formatted" -v wallust_include_path="$wallust_include_path" ' function trim(s) { sub(/^[[:space:]]+/, "", s); sub(/[[:space:]]+$/, "", s); return s } function strip_quotes(s) { gsub(/^"|"$/, "", s); return s } { line=$0 + if ($0 ~ /^[[:space:]]*#?[[:space:]]*config-file[[:space:]]*=/ && $0 ~ /wallust\.conf/) { + print "#config-file = " wallust_include_path + wallust_seen=1 + next + } if ($0 ~ /^[[:space:]]*theme[[:space:]]*=/) { sub(/^[[:space:]]*theme[[:space:]]*=/, "#theme =", line) print line @@ -118,6 +213,11 @@ function strip_quotes(s) { gsub(/^"|"$/, "", s); return s } } } print $0 +} +END { + if (!wallust_seen) { + print "#config-file = " wallust_include_path + } }' "$config_file" > "$tmp_file" mv "$tmp_file" "$config_file" diff --git a/config/hypr/scripts/HyprLayoutModule.sh b/config/hypr/scripts/HyprLayoutModule.sh new file mode 100755 index 00000000..22f12920 --- /dev/null +++ b/config/hypr/scripts/HyprLayoutModule.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Waybar module for Hyprland layouts + +IFS=$'\n\t' + +SCRIPTSDIR="$HOME/.config/hypr/scripts" +rofi_config="$HOME/.config/rofi/config-waybar-layout.rasi" +change_layout="${SCRIPTSDIR}/ChangeLayout.sh" +layouts=(dwindle scrolling monocle master) + +layout_icon() { + case "$1" in + dwindle) echo "🄳" ;; + scrolling) echo "🅂" ;; + monocle) echo "🄼" ;; + master) echo "ⓜ" ;; + *) echo "" ;; + esac +} + +layout_name() { + case "$1" in + dwindle) echo "Dwindle" ;; + scrolling) echo "Scrolling" ;; + monocle) echo "Monocle" ;; + master) echo "Master" ;; + *) echo "Unknown" ;; + esac +} + +get_layout() { + hyprctl -j getoption general:layout 2>/dev/null | jq -r '.str // "unknown"' 2>/dev/null +} + +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]}" +} + +refresh_waybar() { + pkill -RTMIN+8 waybar 2>/dev/null || true +} + +set_layout() { + local target="$1" + + "$change_layout" "$target" && refresh_waybar +} + +show_status() { + local current icon name tooltip + + current="$(get_layout)" + icon="$(layout_icon "$current")" + name="$(layout_name "$current")" + tooltip="Hyprland layout: ${name} (${icon})\n\nLeft click: Select layout\nRight click: Cycle layout\n\nOptions:\n🄳 Dwindle\n🅂 Scrolling\n🄼 Monocle\nⓜ Master" + + printf '{"text":"%s","tooltip":"%s","class":"%s"}\n' "$icon" "$tooltip" "$current" +} + +show_menu() { + local current default_row choice target i + local options=() + + current="$(get_layout)" + default_row=0 + + for i in "${!layouts[@]}"; do + local layout="${layouts[i]}" + local prefix=" " + + if [[ "$layout" == "$current" ]]; then + prefix="● " + default_row="$i" + fi + + options+=("${prefix}$(layout_icon "$layout") $(layout_name "$layout")") + done + + if pgrep -x rofi >/dev/null; then + pkill rofi + return 0 + fi + + choice="$(printf '%s\n' "${options[@]}" | rofi -i -dmenu -p "Layout" -mesg "Left click selects • Right click cycles" -selected-row "$default_row" -config "$rofi_config")" + [[ -z "$choice" ]] && exit 0 + + case "$choice" in + *Dwindle*) target="dwindle" ;; + *Scrolling*) target="scrolling" ;; + *Monocle*) target="monocle" ;; + *Master*) target="master" ;; + *) exit 1 ;; + esac + + set_layout "$target" +} + +case "${1:-status}" in +status) + show_status + ;; +menu) + show_menu + ;; +next|toggle) + set_layout "$(next_layout "$(get_layout)")" + ;; +dwindle|scrolling|monocle|master) + set_layout "$1" + ;; +*) + echo "Usage: $(basename "$0") [status|menu|next|dwindle|scrolling|monocle|master]" >&2 + exit 1 + ;; +esac diff --git a/config/hypr/scripts/JavaManager.sh b/config/hypr/scripts/JavaManager.sh new file mode 100755 index 00000000..728c69a3 --- /dev/null +++ b/config/hypr/scripts/JavaManager.sh @@ -0,0 +1,245 @@ +#!/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 manage Java runtimes +# Based on script from https://github.com/jmhorcas +# Submitted to KoolDots >https://github.com/LinuxBeginnings/Hyprland-Dots/issues/49 + +# --- 1. Icons (Nerd Fonts) --- +ICON_JAVA="" +ICON_ACTIVE="" +ICON_INSTALLED="" +ICON_REMOTE=" " + +# --- 2. Distro detection --- +if [ -r /etc/os-release ]; then + . /etc/os-release +fi + +DISTRO="unknown" +case "${ID:-}" in +arch) DISTRO="arch" ;; +debian | ubuntu | linuxmint) DISTRO="debian" ;; +fedora) DISTRO="fedora" ;; +opensuse* | sles) DISTRO="opensuse" ;; +esac + +if [ "$DISTRO" = "unknown" ] && [ -n "${ID_LIKE:-}" ]; then + case "$ID_LIKE" in + *arch*) DISTRO="arch" ;; + *debian* | *ubuntu*) DISTRO="debian" ;; + *fedora*) DISTRO="fedora" ;; + *suse*) DISTRO="opensuse" ;; + esac +fi + +if [ "$DISTRO" = "unknown" ]; then + notify-send "Error" "Unsupported distro for now." + exit 1 +fi + +# --- 3. Package helpers --- +list_installed_pkgs() { + case "$DISTRO" in + arch) pacman -Qq | grep -E '^jdk.*-openjdk$' ;; + debian) dpkg -l 'openjdk-*-jdk' 2>/dev/null | awk '/^ii/ {print $2}' ;; + fedora | opensuse) rpm -qa | grep -E '^java-[0-9]+-openjdk' ;; + esac +} + +list_available_pkgs() { + case "$DISTRO" in + arch) pacman -Ssq '^jdk.*-openjdk$' | sort -u ;; + debian) apt-cache search openjdk- | awk '{print $1}' | grep -E '^openjdk-[0-9]+-jdk$' | sort -u ;; + fedora) dnf -q repoquery --qf '%{name}' 'java-*-openjdk' 2>/dev/null | grep -E '^java-[0-9]+-openjdk' | sort -u ;; + opensuse) zypper -n search -s 'java-*-openjdk' 2>/dev/null | awk -F'|' '{print $2}' | xargs -n1 | grep -E '^java-[0-9]+-openjdk' | sort -u ;; + esac +} + +pkg_description() { + local pkg="$1" + case "$DISTRO" in + arch) pacman -Si "$pkg" | grep "Description" | cut -d ':' -f2- | head -n 1 | xargs ;; + debian) apt-cache show "$pkg" 2>/dev/null | awk -F': ' '/^Description/ {print $2; exit}' ;; + fedora) dnf info -q "$pkg" 2>/dev/null | awk -F': ' '/^Summary/ {print $2; exit}' ;; + opensuse) zypper -n info "$pkg" 2>/dev/null | awk -F': ' '/^Summary/ {print $2; exit}' ;; + esac +} + +get_active_version_raw() { + case "$DISTRO" in + arch) archlinux-java get ;; + *) java -version 2>&1 | awk -F\" '/version/ {print $2; exit}' ;; + esac +} + +get_active_version_num() { + local raw="$1" + echo "$raw" | grep -oE '[0-9]+' | head -n1 +} + +list_java_alternatives() { + case "$DISTRO" in + debian) update-alternatives --list java 2>/dev/null ;; + fedora | opensuse) alternatives --list java 2>/dev/null ;; + *) echo "" ;; + esac +} + +set_default_java() { + local sel_num="$1" + case "$DISTRO" in + arch) + local java_env + java_env=$(archlinux-java status | grep "java-$sel_num" | awk '{print $1}' | head -n 1) + if [ -n "$java_env" ]; then + notify-send "Java" "Setting $java_env as default..." + pkexec archlinux-java set "$java_env" + else + notify-send "Error" "Version $sel_num is not installed. Install it first." + fi + ;; + debian | fedora | opensuse) + local alt_path + alt_path=$(list_java_alternatives | grep -E "java-$sel_num|jdk-$sel_num|openjdk-$sel_num" | head -n1) + if [ -n "$alt_path" ]; then + notify-send "Java" "Setting Java $sel_num as default..." + if [ "$DISTRO" = "debian" ]; then + pkexec update-alternatives --set java "$alt_path" + else + pkexec alternatives --set java "$alt_path" + fi + else + notify-send "Error" "Version $sel_num is not installed. Install it first." + fi + ;; + esac +} + +install_pkg() { + local pkg="$1" + case "$DISTRO" in + arch) kitty -e sudo pacman -S "$pkg" ;; + debian) kitty -e sudo apt install "$pkg" ;; + fedora) kitty -e sudo dnf install "$pkg" ;; + opensuse) kitty -e sudo zypper install "$pkg" ;; + esac +} + +remove_pkg() { + local pkg="$1" + case "$DISTRO" in + arch) kitty -e sudo pacman -Rs "$pkg" ;; + debian) kitty -e sudo apt remove "$pkg" ;; + fedora) kitty -e sudo dnf remove "$pkg" ;; + opensuse) kitty -e sudo zypper remove "$pkg" ;; + esac +} + +# --- 4. Initial data --- +INSTALLED_PKGS=$(list_installed_pkgs) +TEMP_ALL=$(list_available_pkgs) + +ACTIVE_VERSION_RAW=$(get_active_version_raw) +ACTIVE_VERSION_NUM=$(get_active_version_num "$ACTIVE_VERSION_RAW") + +if [ "$DISTRO" = "arch" ]; then + TEMP_ALL_SYSTEM=$(archlinux-java status) + LATEST_VERSION=$(echo "$TEMP_ALL" "$TEMP_ALL_SYSTEM" | grep -oE '[0-9]+' | sort -nr | head -n1) +else + LATEST_VERSION=$(echo "$TEMP_ALL" | grep -oE '[0-9]+' | sort -nr | head -n1) +fi + +ALL_AVAILABLE=$(echo "$TEMP_ALL" | awk -v lv="$LATEST_VERSION" '{ + v=$0; gsub(/[^0-9]/,"",v); + if(v=="") v=lv+1; + print v " " $0 +}' | sort -nr | cut -d' ' -f2-) + +# --- 5. Functions --- +get_version_num() { + local pkg="$1" + local v=$(echo "$pkg" | grep -oE '[0-9]+') + # If there is not a number, it is the "latest" + if [ -z "$v" ]; then + echo "$LATEST_VERSION" + else + echo "$v" + fi +} + +generate_list() { + for pkg in $ALL_AVAILABLE; do + DESC=$(pkg_description "$pkg") + + VERSION=$(get_version_num "$pkg") + ICON="$ICON_REMOTE" + # We use a temporary variable for the icon to avoid overwriting ICON_REMOTE + DISPLAY_ICON="$ICON_REMOTE" + + # 1. Is it installed? + if echo "$INSTALLED_PKGS" | grep -q "^$pkg$"; then + DISPLAY_ICON="$ICON_INSTALLED" + fi + + # 2. Is it the active one? + # We compare if the number matches OR if the raw name matches + if [[ "$VERSION" == "$ACTIVE_VERSION_NUM" ]] || [[ "$pkg" == "$ACTIVE_VERSION_RAW" ]]; then + DISPLAY_ICON="$ICON_ACTIVE" + fi + + # Ensure that if the icon is empty (remote) it maintains the space + [ -z "$DISPLAY_ICON" ] && DISPLAY_ICON=" " + + printf "%s %s %s │ %s\n" "$ICON_JAVA" "$DISPLAY_ICON" "$DESC" "$pkg" + done +} + +# --- 6. rofi --- +THEME="$HOME/.config/rofi/config.rasi" + +SELECTION=$(generate_list | rofi -dmenu -i \ + -p " Java" \ + -config "$THEME" \ + -theme-str ' + window { width: 1400px; } + listview { scrollbar: true; } + inputbar { children: [ "prompt", "textbox-prompt-colon", "entry" ]; } + prompt { background-color: @selected; text-color: @background; padding: 4px 8px; border-radius: 4px; } + ' \ + -kb-custom-1 "Alt+i" \ + -kb-custom-2 "Alt+r" \ + -mesg "<b>$ICON_ACTIVE</b> Default | <b>$ICON_INSTALLED</b> Installed | <b>Enter:</b> Set default | <b>Alt+I:</b> Install | <b>Alt+R:</b> Remove") + +EXIT_CODE=$? +[ -z "$SELECTION" ] && exit 0 + +# --- 7. Clean selection --- +# 1. Extract the package name from the right side of the │ separator +PKG_NAME=$(echo "$SELECTION" | awk -F'│' '{print $2}' | xargs | awk '{print $1}') + +# 2. Get the real number contained in the name (if it exists) +SEL_RAW_NUM=$(echo "$PKG_NAME" | grep -oE '[0-9]+') + +# If it doesn't have a value (it's the latest package), assign LATEST_VERSION +if [ -z "$SEL_RAW_NUM" ]; then + SEL_RAW_NUM="$LATEST_VERSION" +fi + +# --- 8. Actions --- +case $EXIT_CODE in +0) # SET DEFAULT + set_default_java "$SEL_RAW_NUM" + ;; +10) # INSTALL + install_pkg "$PKG_NAME" + ;; +11) # REMOVE + remove_pkg "$PKG_NAME" + ;; +esac diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index 69111047..1005e797 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -16,15 +16,42 @@ if pidof rofi > /dev/null; then fi # define the config files -keybinds_conf="$HOME/.config/hypr/configs/Keybinds.conf" -user_keybinds_conf="$HOME/.config/hypr/UserConfigs/UserKeybinds.conf" -laptop_conf="$HOME/.config/hypr/UserConfigs/Laptops.conf" +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +keybinds_conf="$hypr_dir/configs/Keybinds.conf" +user_keybinds_conf="$hypr_dir/UserConfigs/UserKeybinds.conf" +laptop_conf="$hypr_dir/UserConfigs/Laptops.conf" +lua_keybinds_conf="$hypr_dir/lua/keybinds.lua" +lua_user_keybinds="$hypr_dir/UserConfigs/user_keybinds.lua" +lua_system_keybinds="$hypr_dir/configs/system_keybinds.lua" +lua_legacy_system_keybinds="$hypr_dir/UserConfigs/system_keybinds.lua" +lua_overrides="$hypr_dir/UserConfigs/user_overrides.lua" rofi_theme="$HOME/.config/rofi/config-keybinds.rasi" msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function' -# collect raw bind lines (strip end-of-line comments) from available files -files=("$keybinds_conf" "$user_keybinds_conf") -[[ -f "$laptop_conf" ]] && files+=("$laptop_conf") +# detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi + +# collect raw bind lines from available files +if [[ "$hypr_config_mode" == "lua" ]]; then + files=("$lua_keybinds_conf") + if [[ -f "$lua_system_keybinds" ]]; then + files+=("$lua_system_keybinds") + elif [[ -f "$lua_legacy_system_keybinds" ]]; then + files+=("$lua_legacy_system_keybinds") + fi + [[ -f "$lua_user_keybinds" ]] && files+=("$lua_user_keybinds") + [[ -f "$lua_overrides" ]] && files+=("$lua_overrides") +else + files=("$keybinds_conf" "$user_keybinds_conf") + [[ -f "$laptop_conf" ]] && files+=("$laptop_conf") +fi # Parse binds using the python script for speed # The last argument must be the user config for override logic to work correctly diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh index f47197af..280e381b 100755 --- a/config/hypr/scripts/KeybindsLayoutInit.sh +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -5,8 +5,7 @@ # 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. +# Initialize J/K keybinds so they always cycle windows globally (no layout-specific behavior). set -euo pipefail @@ -15,5 +14,5 @@ hyprctl keyword unbind SUPER,j || true hyprctl keyword unbind SUPER,k || true # Cycle windows globally -hyprctl keyword bind SUPER,j,layoutmsg,cyclenext -hyprctl keyword bind SUPER,k,layoutmsg,cycleprev +hyprctl keyword bind SUPER,j,cyclenext +hyprctl keyword bind SUPER,k,cyclenext,prev diff --git a/config/hypr/scripts/Kitty_themes.sh b/config/hypr/scripts/Kitty_themes.sh index 3183b20b..24a4ae11 100755 --- a/config/hypr/scripts/Kitty_themes.sh +++ b/config/hypr/scripts/Kitty_themes.sh @@ -12,22 +12,55 @@ kitty_themes_DiR="$HOME/.config/kitty/kitty-themes" # Kitty Themes Directory kitty_config="$HOME/.config/kitty/kitty.conf" iDIR="$HOME/.config/swaync/images" # For notifications rofi_theme_for_this_script="$HOME/.config/rofi/config-kitty-theme.rasi" +wallust_refresh_script="$HOME/.config/hypr/scripts/WallustSwww.sh" +debug_log="${XDG_CACHE_HOME:-$HOME/.cache}/kooldots-kitty-themes.log" # --- Helper Functions --- notify_user() { notify-send -u low -i "$1" "$2" "$3" } +log_debug() { + mkdir -p "$(dirname "$debug_log")" 2>/dev/null || true + printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*" >>"$debug_log" 2>/dev/null || true +} + +resolve_theme_selection() { + local rofi_output="$1" + local idx + + rofi_output="${rofi_output//$'\r'/}" + rofi_output="${rofi_output//$'\n'/}" + + if [[ "$rofi_output" =~ ^[0-9]+$ ]] && [ "$rofi_output" -lt "${#available_theme_names[@]}" ]; then + current_selection_index="$rofi_output" + theme_to_preview_now="${available_theme_names[$current_selection_index]}" + return 0 + fi + + for idx in "${!available_theme_names[@]}"; do + if [[ "${available_theme_names[$idx]}" == "$rofi_output" ]]; then + current_selection_index="$idx" + theme_to_preview_now="${available_theme_names[$current_selection_index]}" + return 0 + fi + done + + return 1 +} + # Function to apply the selected kitty theme apply_kitty_theme_to_config() { local theme_name_to_apply="$1" local apply_mode="${2:-preview}" + local is_wallpaper_mode=0 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 + is_wallpaper_mode=1 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" @@ -58,10 +91,20 @@ apply_kitty_theme_to_config() { cp "$temp_kitty_config_file" "$kitty_config" rm "$temp_kitty_config_file" + local trigger_wallust_refresh=0 + if [ "$theme_name_to_apply" = "Set by wallpaper" ] && [ -x "$wallust_refresh_script" ]; then + trigger_wallust_refresh=1 + fi + if [ "$trigger_wallust_refresh" -eq 1 ]; then + "$wallust_refresh_script" >/dev/null 2>&1 & + log_debug "wallust_refresh_background_started" + fi 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 + if [ "$apply_mode" = "apply" ] && [ "$is_wallpaper_mode" -eq 0 ] && command -v kitty >/dev/null 2>&1; then + ( + kitty @ load-config >/dev/null 2>&1 || true + kitty @ set-colors --all --configured "$theme_file_path_to_apply" >/dev/null 2>&1 || true + ) & fi for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then @@ -110,6 +153,7 @@ if [ -n "$current_active_theme_name" ]; then fi done fi +theme_to_preview_now="${available_theme_names[$current_selection_index]}" while true; do @@ -119,21 +163,22 @@ while true; do done rofi_input_list_trimmed="${rofi_input_list%\\n}" - chosen_index_from_rofi=$(echo -e "$rofi_input_list_trimmed" | + chosen_selection_from_rofi=$(echo -e "$rofi_input_list_trimmed" | rofi -dmenu -i \ + -no-custom \ -format 'i' \ -p "Kitty Theme" \ - -mesg "Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -mesg "Enter: Preview | Ctrl+S (or Alt+1): Apply & Exit | Esc: Cancel" \ -config "$rofi_theme_for_this_script" \ -selected-row "$current_selection_index" \ - -kb-custom-1 "Control+s") + -kb-custom-1 "Control+s,Control+S,Alt+1") rofi_exit_code=$? + log_debug "rofi_exit=$rofi_exit_code rofi_output='${chosen_selection_from_rofi}' current_index=$current_selection_index current_theme='${available_theme_names[$current_selection_index]}'" 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 resolve_theme_selection "$chosen_selection_from_rofi"; then + log_debug "resolved_enter index=$current_selection_index theme='${theme_to_preview_now}'" 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 @@ -149,7 +194,9 @@ while true; do 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 break - elif [ $rofi_exit_code -eq 10 ]; then # This is the exit code for -kb-custom-1 + elif [ $rofi_exit_code -ge 10 ] && [ $rofi_exit_code -le 28 ]; then # custom keybindings + resolve_theme_selection "$chosen_selection_from_rofi" || true + log_debug "resolved_custom index=$current_selection_index theme='${theme_to_preview_now}' exit=$rofi_exit_code" apply_kitty_theme_to_config "$theme_to_preview_now" "apply" notify_user "$iDIR/ja.png" "Kitty Theme Applied" "$theme_to_preview_now" break diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index fcd04998..6ec02bb8 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -8,22 +8,52 @@ # Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E) # Updated for UserConfigs/configs separation -# Modify this config file for default terminal and EDITOR -config_file="$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf" +# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi + +# Resolve defaults file used to get terminal/editor values +config_file="$hypr_dir/UserConfigs/01-UserDefaults.conf" +lua_defaults_file="$hypr_dir/UserConfigs/user_defaults.lua" +term="${term:-${TERM:-kitty}}" +edit="${edit:-${EDITOR:-nano}}" +visual="${visual:-${VISUAL:-}}" -tmp_config_file=$(mktemp) -sed 's/^\$//g; s/ = /=/g' "$config_file" > "$tmp_config_file" -source "$tmp_config_file" +if [[ "$hypr_config_mode" == "conf" && -f "$config_file" ]]; then + tmp_config_file=$(mktemp) + sed 's/^\$//g; s/ = /=/g' "$config_file" > "$tmp_config_file" + source "$tmp_config_file" +elif [[ "$hypr_config_mode" == "lua" ]]; then + defaults_source="" + if [[ -f "$lua_defaults_file" ]]; then + defaults_source="$lua_defaults_file" + fi + if [[ -n "$defaults_source" ]]; then + lua_term=$(sed -n 's/^[[:space:]]*KOOLDOTS_DEFAULTS\.term[[:space:]]*=[[:space:]]*"\(.*\)"[[:space:]]*$/\1/p' "$defaults_source" | tail -n1) + lua_edit=$(sed -n 's/^[[:space:]]*KOOLDOTS_DEFAULTS\.edit[[:space:]]*=[[:space:]]*"\(.*\)"[[:space:]]*$/\1/p' "$defaults_source" | tail -n1) + lua_visual=$(sed -n 's/^[[:space:]]*KOOLDOTS_DEFAULTS\.visual[[:space:]]*=[[:space:]]*"\(.*\)"[[:space:]]*$/\1/p' "$defaults_source" | tail -n1) + [[ -n "$lua_term" ]] && term="$lua_term" + [[ -n "$lua_edit" ]] && edit="$lua_edit" + [[ -n "$lua_visual" ]] && visual="$lua_visual" + fi +fi # ##################################### # # variables -configs="$HOME/.config/hypr/configs" -UserConfigs="$HOME/.config/hypr/UserConfigs" +configs="$hypr_dir/configs" +UserConfigs="$hypr_dir/UserConfigs" rofi_theme="$HOME/.config/rofi/config-edit.rasi" msg=' ⁉️ Choose what to do ⁉️' iDIR="$HOME/.config/swaync/images" -scriptsDir="$HOME/.config/hypr/scripts" -UserScripts="$HOME/.config/hypr/UserScripts" +scriptsDir="$hypr_dir/scripts" +UserScripts="$hypr_dir/UserScripts" # Function to show info notification show_info() { @@ -33,6 +63,50 @@ show_info() { notify-send "Info" "$1" fi } + +# Determine whether an editor command is terminal-based (TUI) +is_tui_editor() { + local -a cmd=("$@") + local bin base arg + [[ ${#cmd[@]} -eq 0 ]] && return 1 + + bin="${cmd[0]}" + base="$(basename "$bin")" + + case "$base" in + vi|vim|nvim|nano|hx|helix|kak|micro|emacs-nox) + return 0 + ;; + emacs|emacsclient) + for arg in "${cmd[@]:1}"; do + case "$arg" in + -nw|--no-window-system|-t|--tty) + return 0 + ;; + esac + done + return 1 + ;; + esac + + return 1 +} + +resolve_system_lua_file() { + local file_name="$1" + local preferred="$configs/$file_name" + local legacy="$UserConfigs/$file_name" + if [[ -f "$preferred" || ! -f "$legacy" ]]; then + printf '%s' "$preferred" + else + printf '%s' "$legacy" + fi +} + +resolve_user_defaults_lua_file() { + local preferred="$UserConfigs/user_defaults.lua" + printf '%s' "$preferred" +} # Function to toggle Rainbow Borders script availability and refresh UI components toggle_rainbow_borders() { local rainbow_script="$UserScripts/RainbowBorders.sh" @@ -186,6 +260,7 @@ Edit User Keybinds Edit User ENV variables Edit User Startup Apps (overlay) Edit User Window Rules (overlay) +Edit User Layer Rules (overlay) Edit User Settings Edit User Decorations Edit User Animations @@ -194,6 +269,7 @@ Edit User Laptop Settings Edit System Default Keybinds Edit System Default Startup Apps Edit System Default Window Rules +Edit System Default Layer Rules Edit System Default Settings --- UTILITIES --- Set SDDM Wallpaper @@ -221,19 +297,42 @@ main() { # Map choices to corresponding files case "$choice" in - "Edit User Defaults") file="$UserConfigs/01-UserDefaults.conf" ;; - "Edit User ENV variables") file="$UserConfigs/ENVariables.conf" ;; - "Edit User Keybinds") file="$UserConfigs/UserKeybinds.conf" ;; - "Edit User Startup Apps (overlay)") file="$UserConfigs/Startup_Apps.conf" ;; - "Edit User Window Rules (overlay)") file="$UserConfigs/WindowRules.conf" ;; - "Edit User Settings") file="$configs/SystemSettings.conf"; show_info "Editing default settings. Copy to UserConfigs/UserSettings.conf to override." ;; - "Edit User Decorations") file="$UserConfigs/UserDecorations.conf" ;; - "Edit User Animations") file="$UserConfigs/UserAnimations.conf" ;; - "Edit User Laptop Settings") file="$UserConfigs/Laptops.conf" ;; - "Edit System Default Keybinds") file="$configs/Keybinds.conf" ;; - "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" ;; + "Edit User Defaults") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_user_defaults_lua_file)"; else file="$UserConfigs/01-UserDefaults.conf"; fi ;; + "Edit User ENV variables") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_env.lua"; else file="$UserConfigs/ENVariables.conf"; fi ;; + "Edit User Keybinds") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_keybinds.lua"; else file="$UserConfigs/UserKeybinds.conf"; fi ;; + "Edit User Startup Apps (overlay)") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_startup.lua"; else file="$UserConfigs/Startup_Apps.conf"; fi ;; + "Edit User Window Rules (overlay)") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_window_rules.lua"; else file="$UserConfigs/WindowRules.conf"; fi ;; + "Edit User Layer Rules (overlay)") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_layer_rules.lua"; else file="$UserConfigs/LayerRules.conf"; fi ;; + "Edit User Settings") + if [[ "$hypr_config_mode" == "lua" ]]; then + file="$UserConfigs/user_settings.lua" + show_info "Lua mode detected. Edit UserConfigs/user_settings.lua for user settings." + else + file="$configs/SystemSettings.conf" + show_info "Editing default settings. Copy to UserConfigs/UserSettings.conf to override." + fi ;; + "Edit User Decorations") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_decorations.lua"; else file="$UserConfigs/UserDecorations.conf"; fi ;; + "Edit User Animations") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_animations.lua"; else file="$UserConfigs/UserAnimations.conf"; fi ;; + "Edit User Laptop Settings") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$UserConfigs/user_laptops.lua"; else file="$UserConfigs/Laptops.conf"; fi ;; + "Edit System Default Keybinds") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_system_lua_file system_keybinds.lua)"; else file="$configs/Keybinds.conf"; fi ;; + "Edit System Default Startup Apps") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_system_lua_file system_startup.lua)"; else file="$configs/Startup_Apps.conf"; fi ;; + "Edit System Default Window Rules") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_system_lua_file system_window_rules.lua)"; else file="$configs/WindowRules.conf"; fi ;; + "Edit System Default Layer Rules") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_system_lua_file system_layer_rules.lua)"; else file="$configs/LayerRules.conf"; fi ;; + "Edit System Default Settings") + if [[ "$hypr_config_mode" == "lua" ]]; then file="$(resolve_system_lua_file system_settings.lua)"; else file="$configs/SystemSettings.conf"; fi ;; "Set SDDM Wallpaper") $scriptsDir/sddm_wallpaper.sh --normal ;; "Choose Kitty Terminal Theme") $scriptsDir/Kitty_themes.sh ;; "Choose Ghostty Terminal Theme") $scriptsDir/Ghostty_themes.sh ;; @@ -278,9 +377,20 @@ main() { *) return ;; # Do nothing for invalid choices esac - # Open the selected file in the terminal with the text editor + # Open selected file using configured editor if [ -n "$file" ]; then - $term -e $edit "$file" + local -a edit_cmd term_cmd visual_cmd selected_cmd + read -r -a edit_cmd <<< "$edit" + read -r -a term_cmd <<< "$term" + [[ -n "$visual" ]] && read -r -a visual_cmd <<< "$visual" + selected_cmd=("${edit_cmd[@]}") + [[ ${#visual_cmd[@]} -gt 0 ]] && selected_cmd=("${visual_cmd[@]}") + + if is_tui_editor "${selected_cmd[@]}"; then + "${term_cmd[@]}" -e "${selected_cmd[@]}" "$file" + else + "${selected_cmd[@]}" "$file" >/dev/null 2>&1 & + fi fi } diff --git a/config/hypr/scripts/Logout.sh b/config/hypr/scripts/Logout.sh new file mode 100755 index 00000000..2f173ffe --- /dev/null +++ b/config/hypr/scripts/Logout.sh @@ -0,0 +1,180 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Logout helper for wlogout and keybind callers. +LOG_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/hypr" +LOG_FILE="${LOG_DIR}/hypr-logout.log" +if ! mkdir -p "$LOG_DIR" >/dev/null 2>&1; then + LOG_FILE="${XDG_RUNTIME_DIR:-/tmp}/hypr-logout.log" +fi + +log_msg() { + printf "[%s] %s\n" "$(date +"%F %T")" "$1" >>"$LOG_FILE" +} + +run_logged() { + local label="$1" + shift + log_msg "RUN ${label}: $*" + "$@" >>"$LOG_FILE" 2>&1 + local rc=$? + log_msg "RC ${label}: ${rc}" + return "$rc" +} +SESSION_USER="${USER:-$(id -un)}" +SESSION_HYPRLAND_PIDS="$(pgrep -xu "$SESSION_USER" -x Hyprland || true)" +SESSION_DM_SERVICE="" +IS_SDDM_SESSION=0 + +session_hyprland_running() { + local pid + if [ -n "$SESSION_HYPRLAND_PIDS" ]; then + for pid in $SESSION_HYPRLAND_PIDS; do + if kill -0 "$pid" >/dev/null 2>&1; then + return 0 + fi + done + return 1 + fi + pgrep -xu "$SESSION_USER" -x Hyprland >/dev/null 2>&1 +} +logout_completed() { + # Give the session up to 2 seconds to terminate after a successful command. + for _ in {1..20}; do + session_hyprland_running || return 0 + sleep 0.1 + done + return 1 +} +stop_proc() { + local name="$1" + pkill -u "$SESSION_USER" -x -TERM "$name" >/dev/null 2>&1 || true + + # Wait up to 1 second for graceful shutdown. + for _ in {1..10}; do + pgrep -xu "$SESSION_USER" -x "$name" >/dev/null 2>&1 || return 0 + sleep 0.1 + done + pkill -u "$SESSION_USER" -x -KILL "$name" >/dev/null 2>&1 || true +} + +# Close wlogout if it is still visible. +stop_proc "wlogout" +HYPRCTL_BIN="$(command -v hyprctl || true)" +HYPRSHUTDOWN_BIN="$(command -v hyprshutdown || true)" +UWSM_BIN="$(command -v uwsm || true)" +LOGINCTL_BIN="$(command -v loginctl || true)" +if [ -n "$LOGINCTL_BIN" ] && [ -n "${XDG_SESSION_ID:-}" ]; then + SESSION_DM_SERVICE="$("$LOGINCTL_BIN" show-session "$XDG_SESSION_ID" -p Service --value 2>/dev/null || true)" + if [ "$SESSION_DM_SERVICE" = "sddm" ] || [ "$SESSION_DM_SERVICE" = "sddm-autologin" ]; then + IS_SDDM_SESSION=1 + fi +fi + +# Preferred path: synchronous hyprshutdown, so script does not silently succeed. +if [ -n "$HYPRSHUTDOWN_BIN" ]; then + if run_logged "hyprshutdown-no-fork" "$HYPRSHUTDOWN_BIN" --no-fork; then + if logout_completed; then + exit 0 + fi + log_msg "hyprshutdown returned success but Hyprland is still running" + fi +fi +# systemd session fallback. +if [ -n "$LOGINCTL_BIN" ] && [ -n "${XDG_SESSION_ID:-}" ]; then + if [ "$IS_SDDM_SESSION" -eq 1 ]; then + log_msg "Skipping loginctl terminate-session for SDDM-managed session (${SESSION_DM_SERVICE})" + elif run_logged "loginctl-terminate-session" "$LOGINCTL_BIN" terminate-session "$XDG_SESSION_ID"; then + if logout_completed; then + exit 0 + fi + log_msg "loginctl terminate-session returned success but Hyprland is still running" + fi +fi + +# Fallback: ask Hyprland to spawn hyprshutdown via a normal dispatch exec call. +if [ -n "$HYPRCTL_BIN" ] && [ -n "$HYPRSHUTDOWN_BIN" ]; then + if run_logged \ + "hyprctl-dispatch-exec-hyprshutdown" \ + "$HYPRCTL_BIN" dispatch exec "hyprshutdown --no-fork"; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatched hyprshutdown but Hyprland is still running" + fi +fi + +# UWSM-managed session fallback (common on NixOS). +if [ -n "$UWSM_BIN" ] && [ "$IS_SDDM_SESSION" -eq 0 ]; then + if run_logged "uwsm-stop" "$UWSM_BIN" stop; then + if logout_completed; then + exit 0 + fi + log_msg "uwsm stop returned success but Hyprland is still running" + fi +elif [ -n "$UWSM_BIN" ] && [ "$IS_SDDM_SESSION" -eq 1 ]; then + log_msg "Skipping uwsm stop on SDDM-managed session to avoid delayed logout" +fi + + +# Last-resort Hyprland exit fallbacks. +if [ -n "$HYPRCTL_BIN" ]; then + if [ "$IS_SDDM_SESSION" -eq 1 ]; then + if run_logged "hyprctl-exit-1-sddm" "$HYPRCTL_BIN" dispatch exit 1; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit 1 (sddm) returned success but Hyprland is still running" + fi + if run_logged "hyprctl-exit-x-sddm" "$HYPRCTL_BIN" dispatch exit x; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit x (sddm) returned success but Hyprland is still running" + fi + else + if run_logged "hyprctl-exit-1" "$HYPRCTL_BIN" dispatch exit 1; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit 1 returned success but Hyprland is still running" + fi + if run_logged "hyprctl-exit-0" "$HYPRCTL_BIN" dispatch exit 0; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit 0 returned success but Hyprland is still running" + fi + if run_logged "hyprctl-exit-x" "$HYPRCTL_BIN" dispatch exit x; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit x returned success but Hyprland is still running" + fi + if run_logged "hyprctl-exit-noarg" "$HYPRCTL_BIN" dispatch exit; then + if logout_completed; then + exit 0 + fi + log_msg "hyprctl dispatch exit (no arg) returned success but Hyprland is still running" + fi + fi +fi + +# Final process-level fallback. +if run_logged "pkill-hyprland-term" pkill -u "$SESSION_USER" -x -TERM Hyprland; then + if logout_completed; then + exit 0 + fi + log_msg "SIGTERM sent to Hyprland but process is still running" +fi +if run_logged "pkill-hyprland-kill" pkill -u "$SESSION_USER" -x -KILL Hyprland; then + exit 0 +fi + +log_msg "Logout failed: no method succeeded" + +exit 1 diff --git a/config/hypr/scripts/LuaAutoReload.sh b/config/hypr/scripts/LuaAutoReload.sh new file mode 100755 index 00000000..4a9d5040 --- /dev/null +++ b/config/hypr/scripts/LuaAutoReload.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Auto-reload Hyprland when Lua config files change. + +set -euo pipefail + +watch_root="$HOME/.config/hypr" +[ -d "$watch_root" ] || exit 0 + +reload_hypr() { + hyprctl reload >/dev/null 2>&1 || true +} + +if command -v inotifywait >/dev/null 2>&1; then + debounce_and_reload() { + sleep 0.2 + while inotifywait -q -t 0.2 -e close_write,create,move,delete -r --include '(^|/)[^/]+\.lua$' "$watch_root" >/dev/null 2>&1; do + : + done + reload_hypr + } + + inotifywait -m -q -r -e close_write,create,move,delete --include '(^|/)[^/]+\.lua$' "$watch_root" | while read -r _; do + debounce_and_reload + done + exit 0 +fi + +# Fallback polling path when inotify-tools isn't installed. +snapshot() { + find "$watch_root" -type f -name '*.lua' -printf '%p:%T@\n' 2>/dev/null | LC_ALL=C sort +} + +previous_state="$(snapshot)" +while true; do + sleep 1 + current_state="$(snapshot)" + if [ "$current_state" != "$previous_state" ]; then + previous_state="$current_state" + reload_hypr + fi +done diff --git a/config/hypr/scripts/LuaCycleWindow.sh b/config/hypr/scripts/LuaCycleWindow.sh new file mode 100755 index 00000000..ee64e67a --- /dev/null +++ b/config/hypr/scripts/LuaCycleWindow.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Cycle focus through visible windows on the active workspace using the +# Hyprland Lua dispatcher API. This avoids cyclenext/focuswindow no-ops on +# Lua config builds. + +set -u + +direction="${1:-next}" +case "$direction" in + next|forward|f) + direction="next" + ;; + previous|prev|back|b) + direction="previous" + ;; + *) + exit 0 + ;; +esac + +active_window="$(hyprctl activewindow -j 2>/dev/null || printf '{}')" +active_address="$(jq -r '.address // empty' <<<"$active_window")" +active_workspace="$(jq -r '.workspace.id // empty' <<<"$active_window")" + +if [[ -z "$active_address" ]] || ! [[ "$active_workspace" =~ ^-?[0-9]+$ ]]; then + exit 0 +fi + +clients="$(hyprctl clients -j 2>/dev/null || printf '[]')" +target_address="$( + jq -r \ + --arg active_address "$active_address" \ + --argjson active_workspace "$active_workspace" \ + --arg direction "$direction" ' + [ + .[] + | select((.mapped // false) == true) + | select((.hidden // false) == false) + | select(.workspace.id == $active_workspace) + | { + address, + x: (.at[0] // 0), + y: (.at[1] // 0) + } + ] + | sort_by(.y, .x, .address) + | if length < 2 then + empty + else + . as $windows + | ($windows | map(.address) | index($active_address)) as $index + | if $index == null then + empty + elif $direction == "previous" then + $windows[(($index - 1 + length) % length)].address + else + $windows[(($index + 1) % length)].address + end + end + ' <<<"$clients" +)" + +if [[ -z "$target_address" ]]; then + exit 0 +fi + +hyprctl dispatch "hl.dsp.focus({ window = \"address:${target_address}\" })" >/dev/null 2>&1 || true diff --git a/config/hypr/scripts/LuaFocusWorkspaceRelative.sh b/config/hypr/scripts/LuaFocusWorkspaceRelative.sh new file mode 100755 index 00000000..20668110 --- /dev/null +++ b/config/hypr/scripts/LuaFocusWorkspaceRelative.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Focus the previous/next numeric workspace through the Lua dispatcher. +# This allows moving into empty workspaces while avoiding invalid workspace 0. + +set -u + +direction="${1:-}" +case "$direction" in + next|right|m+1|+1) + direction="next" + ;; + previous|prev|left|m-1|-1) + direction="previous" + ;; + *) + exit 0 + ;; +esac + +active_workspace="$(hyprctl activeworkspace -j 2>/dev/null || printf '{}')" +active_id="$(jq -r '.id // empty' <<<"$active_workspace")" +if ! [[ "$active_id" =~ ^-?[0-9]+$ ]]; then + exit 0 +fi + +case "$direction" in + next) + target_id=$((active_id + 1)) + ;; + previous) + target_id=$((active_id - 1)) + ;; +esac +if ! [[ "${target_id:-}" =~ ^-?[0-9]+$ ]] || [ "$target_id" -lt 1 ]; then + exit 0 +fi + +hyprctl dispatch "hl.dispatch(hl.dsp.focus({ workspace = ${target_id} }))" >/dev/null 2>&1 || true diff --git a/config/hypr/scripts/LuaFullscreenMaximized.sh b/config/hypr/scripts/LuaFullscreenMaximized.sh new file mode 100755 index 00000000..fccc577b --- /dev/null +++ b/config/hypr/scripts/LuaFullscreenMaximized.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Helper for Lua-config sessions where legacy `hyprctl dispatch fullscreen 1` +# is parsed as Lua and fails. + +setsid -f sh -c 'sleep 0.2; hyprctl dispatch "hl.dsp.window.fullscreen({ mode = 1 })"' >/dev/null 2>&1 diff --git a/config/hypr/scripts/LuaMoveWindowDirectional.sh b/config/hypr/scripts/LuaMoveWindowDirectional.sh new file mode 100755 index 00000000..ea21196e --- /dev/null +++ b/config/hypr/scripts/LuaMoveWindowDirectional.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Guard directional Lua window movement against Hyprland Lua's no-target +# "invalid workspace" runtime error. + +set -u + +direction="${1:-}" +case "$direction" in + l|left) + direction="left" + ;; + r|right) + direction="right" + ;; + *) + exit 0 + ;; +esac + +active_window="$(hyprctl activewindow -j 2>/dev/null || printf '{}')" +if ! jq -e '.address? and .address != ""' >/dev/null 2>&1 <<<"$active_window"; then + exit 0 +fi + +active_workspace="$(hyprctl activeworkspace -j 2>/dev/null || printf '{}')" +active_id="$(jq -r '.id // empty' <<<"$active_workspace")" +if ! [[ "$active_id" =~ ^-?[0-9]+$ ]]; then + exit 0 +fi + +workspaces="$(hyprctl workspaces -j 2>/dev/null || printf '[]')" +case "$direction" in + left) + target_id="$(jq -r --argjson active "$active_id" '[.[] | select((.id < $active) and ((.windows // 0) > 0)) | .id] | max // empty' <<<"$workspaces")" + ;; + right) + target_id="$(jq -r --argjson active "$active_id" '[.[] | select((.id > $active) and ((.windows // 0) > 0)) | .id] | min // empty' <<<"$workspaces")" + ;; +esac + +if ! [[ "${target_id:-}" =~ ^-?[0-9]+$ ]]; then + exit 0 +fi + +hyprctl dispatch "hl.dispatch(hl.dsp.window.move({ direction = \"${direction}\" }))" >/dev/null 2>&1 || true diff --git a/config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh b/config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh new file mode 100755 index 00000000..f225d4a2 --- /dev/null +++ b/config/hypr/scripts/LuaMoveWindowWorkspaceRelative.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Move the active window to the previous/next numeric workspace through +# the Lua dispatcher. This allows moving into empty workspaces while +# avoiding invalid workspace 0. + +set -u + +direction="${1:-}" +case "$direction" in + next|right|+1) + direction="next" + ;; + previous|prev|left|-1) + direction="previous" + ;; + *) + exit 0 + ;; +esac + +active_window="$(hyprctl activewindow -j 2>/dev/null || printf '{}')" +if ! jq -e '.address? and .address != ""' >/dev/null 2>&1 <<<"$active_window"; then + exit 0 +fi + +active_workspace="$(hyprctl activeworkspace -j 2>/dev/null || printf '{}')" +active_id="$(jq -r '.id // empty' <<<"$active_workspace")" +if ! [[ "$active_id" =~ ^-?[0-9]+$ ]]; then + exit 0 +fi + +case "$direction" in + next) + target_id=$((active_id + 1)) + ;; + previous) + target_id=$((active_id - 1)) + ;; +esac + +if ! [[ "${target_id:-}" =~ ^-?[0-9]+$ ]] || [ "$target_id" -lt 1 ]; then + exit 0 +fi + +hyprctl dispatch "hl.dispatch(hl.dsp.window.move({ workspace = ${target_id} }))" >/dev/null 2>&1 || true diff --git a/config/hypr/scripts/LuaSwapWindow.sh b/config/hypr/scripts/LuaSwapWindow.sh new file mode 100755 index 00000000..a1ec38fd --- /dev/null +++ b/config/hypr/scripts/LuaSwapWindow.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Safely swap the active window in a direction from Lua keybinds. + +arg="${1:-}" +arg="${arg//\'/}" +arg="${arg//\"/}" + +case "$arg" in +left|l) direction="left" ;; +right|r) direction="right" ;; +up|u) direction="up" ;; +down|d) direction="down" ;; +*) exit 0 ;; +esac + +active="$(hyprctl -j activewindow 2>/dev/null)" +clients="$(hyprctl -j clients 2>/dev/null)" + +has_target="$( + jq -en --argjson active "$active" --argjson clients "$clients" --arg direction "$direction" ' + def overlaps(a1; a2; b1; b2): (a1 < b2 and b1 < a2); + ($active.address // "") as $active_address + | ($active.workspace.id // null) as $workspace_id + | ($active.at[0] // 0) as $ax + | ($active.at[1] // 0) as $ay + | ($active.size[0] // 0) as $aw + | ($active.size[1] // 0) as $ah + | any($clients[]; + (.address != $active_address) + and ((.workspace.id // null) == $workspace_id) + and ( + if $direction == "left" then + ((.at[0] + .size[0]) <= $ax) and overlaps(.at[1]; (.at[1] + .size[1]); $ay; ($ay + $ah)) + elif $direction == "right" then + (.at[0] >= ($ax + $aw)) and overlaps(.at[1]; (.at[1] + .size[1]); $ay; ($ay + $ah)) + elif $direction == "up" then + ((.at[1] + .size[1]) <= $ay) and overlaps(.at[0]; (.at[0] + .size[0]); $ax; ($ax + $aw)) + elif $direction == "down" then + (.at[1] >= ($ay + $ah)) and overlaps(.at[0]; (.at[0] + .size[0]); $ax; ($ax + $aw)) + else + false + end + ) + ) + ' 2>/dev/null +)" + +[[ "$has_target" == "true" ]] || exit 0 + +hyprctl dispatch "hl.dsp.window.swap({ direction = \"${direction}\" })" >/dev/null 2>&1 || true diff --git a/config/hypr/scripts/MonitorProfiles.sh b/config/hypr/scripts/MonitorProfiles.sh index 78825986..6330d45c 100755 --- a/config/hypr/scripts/MonitorProfiles.sh +++ b/config/hypr/scripts/MonitorProfiles.sh @@ -12,13 +12,46 @@ if pidof rofi > /dev/null; then pkill rofi fi +# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes) +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" +if [[ -n "$HYPR_CONFIG_MODE" ]]; then + case "${HYPR_CONFIG_MODE,,}" in + lua) hypr_config_mode="lua" ;; + conf|hyprlang) hypr_config_mode="conf" ;; + auto) hypr_config_mode="" ;; + *) hypr_config_mode="" ;; + esac +fi + +if [[ -z "$hypr_config_mode" ]]; then + if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" + else + hypr_config_mode="conf" + fi +fi + # Variables iDIR="$HOME/.config/swaync/images" SCRIPTSDIR="$HOME/.config/hypr/scripts" monitor_dir="$HOME/.config/hypr/Monitor_Profiles" -target="$HOME/.config/hypr/monitors.conf" +target_conf="$HOME/.config/hypr/monitors.conf" +target_lua_user="$HOME/.config/hypr/UserConfigs/monitors.lua" +target_lua_legacy="$HOME/.config/hypr/lua/monitors.lua" rofi_theme="$HOME/.config/rofi/config-Monitors.rasi" -msg='❗NOTE:❗ This will overwrite $HOME/.config/hypr/monitors.conf' + +if [[ "$hypr_config_mode" == "lua" ]]; then + profile_ext="lua" + target="$target_lua_user" + msg="❗NOTE:❗ This will overwrite $HOME/.config/hypr/UserConfigs/monitors.lua" +else + profile_ext="conf" + target="$target_conf" + msg="❗NOTE:❗ This will overwrite $HOME/.config/hypr/monitors.conf" +fi # Define the list of files to ignore ignore_files=( @@ -26,22 +59,30 @@ ignore_files=( ) # list of Monitor Profiles, sorted alphabetically with numbers first -mon_profiles_list=$(find -L "$monitor_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V) +mon_profiles_list=$(find -L "$monitor_dir" -maxdepth 1 -type f -name "*.${profile_ext}" | sed 's/.*\///' | sed "s/\.${profile_ext}$//" | sort -V) # Remove ignored files from the list for ignored_file in "${ignore_files[@]}"; do mon_profiles_list=$(echo "$mon_profiles_list" | grep -v -E "^$ignored_file$") done +if [[ -z "$mon_profiles_list" ]]; then + notify-send -u low -i "$iDIR/ja.png" "Monitor Profiles" "No .${profile_ext} profiles found in $monitor_dir" + exit 1 +fi # Rofi Menu -chosen_file=$(echo "$mon_profiles_list" | rofi -i -dmenu -config $rofi_theme -mesg "$msg") +chosen_file=$(echo "$mon_profiles_list" | rofi -i -dmenu -config "$rofi_theme" -mesg "$msg") if [[ -n "$chosen_file" ]]; then - full_path="$monitor_dir/$chosen_file.conf" + full_path="$monitor_dir/$chosen_file.$profile_ext" + mkdir -p "$(dirname "$target")" cp "$full_path" "$target" + if [[ "$hypr_config_mode" == "lua" && -f "$target_lua_legacy" ]]; then + cp "$full_path" "$target_lua_legacy" + fi notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Monitor Profile Loaded" fi sleep 1 -${SCRIPTSDIR}/RefreshNoWaybar.sh &
\ No newline at end of file +"${SCRIPTSDIR}/RefreshNoWaybar.sh" & diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh index 14470eb0..456ccef1 100755 --- a/config/hypr/scripts/OverviewToggle.sh +++ b/config/hypr/scripts/OverviewToggle.sh @@ -9,15 +9,18 @@ set -euo pipefail -# 1) Try Quickshell via IPC (works if QS is running and listening) -if pgrep -x qs >/dev/null 2>&1; then - if qs ipc -c overview call overview toggle >/dev/null 2>&1; then - exit 0 +QS_OVERVIEW_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/overview" + +# 1) Prefer Quickshell when installed and configured +if command -v qs >/dev/null 2>&1 && [ -d "$QS_OVERVIEW_DIR" ]; then + # Try Quickshell via IPC (works if QS is running and listening) + 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 fi -fi -# If QS isn't running, but the CLI exists, try starting it and retry once -if command -v qs >/dev/null 2>&1; then + # If QS isn't running, try starting it and retry once qs -c overview >/dev/null 2>&1 & sleep 0.6 if qs ipc -c overview call overview toggle >/dev/null 2>&1; then diff --git a/config/hypr/scripts/Polkit-Diag.sh b/config/hypr/scripts/Polkit-Diag.sh index 0f32b640..aa4e69a8 100755 --- a/config/hypr/scripts/Polkit-Diag.sh +++ b/config/hypr/scripts/Polkit-Diag.sh @@ -50,20 +50,20 @@ setup_output() { 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 @@ -74,7 +74,7 @@ apply_override() { 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." @@ -94,10 +94,10 @@ apply_override() { 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 @@ -106,7 +106,7 @@ apply_override() { 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." @@ -114,7 +114,7 @@ apply_override() { 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." @@ -122,12 +122,12 @@ apply_override() { 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 @@ -153,31 +153,31 @@ gather_general_info() { 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 @@ -187,7 +187,7 @@ gather_general_info() { 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 @@ -205,14 +205,14 @@ gather_general_info() { 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 } @@ -223,7 +223,7 @@ check_packages() { local install_msg="$2" shift 2 local pkgs=("$@") - + local missing_pkgs=() for pkg in "${pkgs[@]}"; do local out @@ -235,7 +235,7 @@ check_packages() { 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 @@ -251,7 +251,7 @@ check_source_binaries() { 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 @@ -261,7 +261,7 @@ check_source_binaries() { echo "[MISSING] ${bin_dir}/${bin}" >&3 fi done - + return $found_any } @@ -269,7 +269,7 @@ 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" @@ -278,19 +278,19 @@ gather_arch_info() { "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 @@ -299,7 +299,7 @@ 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" @@ -313,22 +313,22 @@ gather_ubuntu_info() { "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 @@ -337,16 +337,16 @@ 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" @@ -359,16 +359,16 @@ gather_debian_info() { "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") @@ -376,10 +376,10 @@ gather_debian_info() { 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 @@ -389,7 +389,7 @@ 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" @@ -398,19 +398,19 @@ gather_fedora_info() { "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 diff --git a/config/hypr/scripts/PortalHyprland.sh b/config/hypr/scripts/PortalHyprland.sh index 243ee2e8..3d3dc410 100755 --- a/config/hypr/scripts/PortalHyprland.sh +++ b/config/hypr/scripts/PortalHyprland.sh @@ -8,6 +8,19 @@ # For manually starting xdg-desktop-portal-hyprland set -euo pipefail +is_ubuntu_family() { + if [[ ! -r /etc/os-release ]]; then + return 1 + fi + + # shellcheck disable=SC1091 + . /etc/os-release + [[ "${ID:-}" == "ubuntu" \ + || "${ID:-}" == "linuxmint" \ + || "${ID:-}" == "zorin" \ + || "${ID:-}" == "rhino" \ + || "${ID_LIKE:-}" == *ubuntu* ]] +} kill_quietly() { killall -q "$1" 2>/dev/null || true @@ -25,11 +38,15 @@ start_portal_binary() { echo "Warning: no $description binary found (checked: $*)" >&2 return 1 } +if ! is_ubuntu_family; then + exit 0 +fi 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-gtk kill_quietly xdg-desktop-portal sleep 1 @@ -39,6 +56,10 @@ start_portal_binary "xdg-desktop-portal-hyprland" \ sleep 2 +start_portal_binary "xdg-desktop-portal-gtk" \ + /usr/lib/xdg-desktop-portal-gtk \ + /usr/libexec/xdg-desktop-portal-gtk + start_portal_binary "xdg-desktop-portal" \ /usr/lib/xdg-desktop-portal \ /usr/libexec/xdg-desktop-portal diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 03f55fa0..947b6bfc 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -43,16 +43,39 @@ for pid in $(pidof rofi swaync ags swaybg); do sleep 0.1 done -# 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 +# Restart waybar once (works with systemd user unit or manual launch setups) +restart_waybar() { + local manage_with_systemd=0 + + if command -v systemctl >/dev/null 2>&1; then + if systemctl --user --quiet is-active waybar.service 2>/dev/null || systemctl --user --quiet is-enabled waybar.service 2>/dev/null; then + manage_with_systemd=1 + fi + fi + + if [ "$manage_with_systemd" -eq 1 ]; then + systemctl --user stop waybar.service >/dev/null 2>&1 || true + fi + + pkill -x waybar >/dev/null 2>&1 || true + pkill -x '.waybar-wrapped' >/dev/null 2>&1 || true + sleep 0.2 + if pgrep -x waybar >/dev/null 2>&1 || pgrep -x '.waybar-wrapped' >/dev/null 2>&1; then + pkill -9 -x waybar >/dev/null 2>&1 || true + pkill -9 -x '.waybar-wrapped' >/dev/null 2>&1 || true + fi + sleep 0.2 + + if [ "$manage_with_systemd" -eq 1 ]; then + if ! systemctl --user start waybar.service >/dev/null 2>&1; then + waybar >/dev/null 2>&1 & + fi else - killall -SIGUSR2 waybar 2>/dev/null || true + waybar >/dev/null 2>&1 & fi -else - waybar & -fi +} + +restart_waybar # relaunch swaync sleep 0.3 diff --git a/config/hypr/scripts/ResizeActive.sh b/config/hypr/scripts/ResizeActive.sh new file mode 100755 index 00000000..afcdeb85 --- /dev/null +++ b/config/hypr/scripts/ResizeActive.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Resize the active window by delta values (dx, dy) using Lua dispatch. + +dx="${1:-0}" +dy="${2:-0}" + +window_json="$(hyprctl activewindow -j)" +width="$(jq -r '.size[0]' <<<"$window_json")" +height="$(jq -r '.size[1]' <<<"$window_json")" + +new_width=$((width + dx)) +new_height=$((height + dy)) + +if ((new_width < 100)); then + new_width=100 +fi +if ((new_height < 100)); then + new_height=100 +fi + +hyprctl dispatch "hl.dsp.window.resize({ x = ${new_width}, y = ${new_height} })" diff --git a/config/hypr/scripts/Tak0-Autodispatch.sh b/config/hypr/scripts/Tak0-Autodispatch.sh index 034a6402..cabe1672 100755 --- a/config/hypr/scripts/Tak0-Autodispatch.sh +++ b/config/hypr/scripts/Tak0-Autodispatch.sh @@ -71,6 +71,18 @@ fi echo "=== Deploy '$CMD' → WS $TARGET_WS @ $(date) ===" >>"$LOGFILE" +# Detect active Hyprland config mode +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" + +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi + # ───────────────────────────────────────────────────────────────────────────── # 1️⃣ HYPRLAND READINESS GATE # ───────────────────────────────────────────────────────────────────────────── @@ -91,11 +103,17 @@ done 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 + if [[ "$hypr_config_mode" == "lua" ]]; then + # In Lua mode, we try to nullify the temporary rules or trigger a reload + # Since we don't have a reliable 'unset' API via eval yet, we reload + hyprctl reload >>"$LOGFILE" 2>&1 || true + else + 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 + fi } trap cleanup EXIT INT TERM ERR @@ -105,28 +123,35 @@ trap cleanup EXIT INT TERM ERR # ───────────────────────────────────────────────────────────────────────────── # 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 +if [[ "$hypr_config_mode" == "lua" ]]; then + # Note: Using workspace property in hl.window_rule as a best-effort equivalent + hyprctl eval "hl.window_rule({ name = 'autodispatch-nuclear', match = { class = '.*' }, workspace = '$TARGET_WS' })" >>"$LOGFILE" 2>&1 || true +else + hyprctl keyword windowrulev2 \ + "initialWorkspace $TARGET_WS silent, initialClass:.*" \ + >>"$LOGFILE" 2>&1 || true +fi # ───────────────────────────────────────────────────────────────────────────── # 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 + if [[ "$hypr_config_mode" == "lua" ]]; then + # Attempt to parse rule string into Lua table if it matches class:pattern + if [[ "$RULE" =~ class:\^\((.*)\)\$ ]]; then + local class_pat="${BASH_REMATCH[1]}" + hyprctl eval "hl.window_rule({ name = 'autodispatch-$class_pat', match = { class = '$class_pat' }, workspace = '$TARGET_WS' })" >>"$LOGFILE" 2>&1 || true + fi + else + hyprctl keyword windowrulev2 \ + "initialWorkspace $TARGET_WS silent, $RULE" \ + >>"$LOGFILE" 2>&1 || true + fi done # ───────────────────────────────────────────────────────────────────────────── @@ -158,9 +183,14 @@ 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 +if [[ "$hypr_config_mode" == "lua" ]]; then + # In Lua mode, we rely on the supervision loop for precision after launch + # and cleanup will handle the rest. + : +else + hyprctl keyword windowrulev2 "unset, initialClass:.*" >>"$LOGFILE" 2>&1 || true +fi # ───────────────────────────────────────────────────────────────────────────── # 5️⃣ SUPERVISION LOOP (AUTHORITATIVE PHASE) @@ -221,6 +251,7 @@ while ((SECONDS < END_TIME)); do if ((MATCH)) && [[ -z "${SEEN[$ADDR]-}" ]]; then echo "Placing window $ADDR (pid $PID, class $CLASS) → WS $TARGET_WS" >>"$LOGFILE" + # Dispatch works the same in both modes hyprctl dispatch movetoworkspacesilent \ "$TARGET_WS,address:$ADDR" >>"$LOGFILE" 2>&1 || true SEEN[$ADDR]=1 diff --git a/config/hypr/scripts/Tak0-Per-Window-Switch.sh b/config/hypr/scripts/Tak0-Per-Window-Switch.sh index 04baebe0..eba3b380 100755 --- a/config/hypr/scripts/Tak0-Per-Window-Switch.sh +++ b/config/hypr/scripts/Tak0-Per-Window-Switch.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # ================================================== # KoolDots (2026) # Project URL: https://github.com/LinuxBeginnings @@ -16,28 +17,65 @@ # smooth and comfortable workflow. # # # ################################################################## -# This is for changing kb_layouts. Set kb_layouts in MAP_FILE="$HOME/.cache/kb_layout_per_window" -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")" +SCRIPT_PATH="$(readlink -f "$0")" + +# Detect active Hyprland config mode +config_home="${XDG_CONFIG_HOME:-$HOME/.config}" +hypr_dir="$config_home/hypr" +lua_entry="$hypr_dir/hyprland.lua" +legacy_lua_entry="$config_home/hyprland.lua" + +if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then + hypr_config_mode="lua" +else + hypr_config_mode="conf" +fi # Ensure map file exists touch "$MAP_FILE" -# Read layouts from config -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 +# Function to get layouts from config files +get_layouts() { + local layouts="" + if [[ "$hypr_config_mode" == "lua" ]]; then + local lua_user="$hypr_dir/UserConfigs/user_settings.lua" + local lua_sys="$hypr_dir/configs/system_settings.lua" + local lua_legacy_sys="$hypr_dir/UserConfigs/system_settings.lua" + local lua_pristine_sys="$hypr_dir/lua/settings.lua" + if [[ -f "$lua_user" ]] && grep -q 'kb_layout' "$lua_user" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$lua_user" | sed -n 's/.*kb_layout\s*=\s*"\([^"]*\)".*/\1/p' | head -n1) + elif [[ -f "$lua_sys" ]] && grep -q 'kb_layout' "$lua_sys" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$lua_sys" | sed -n 's/.*kb_layout\s*=\s*"\([^"]*\)".*/\1/p' | head -n1) + elif [[ -f "$lua_legacy_sys" ]] && grep -q 'kb_layout' "$lua_legacy_sys" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$lua_legacy_sys" | sed -n 's/.*kb_layout\s*=\s*"\([^"]*\)".*/\1/p' | head -n1) + elif [[ -f "$lua_pristine_sys" ]] && grep -q 'kb_layout' "$lua_pristine_sys" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$lua_pristine_sys" | sed -n 's/.*kb_layout\s*=\s*"\([^"]*\)".*/\1/p' | head -n1) + fi + else + local conf_user="$hypr_dir/UserConfigs/UserSettings.conf" + local conf_sys="$hypr_dir/configs/SystemSettings.conf" + if [[ -f "$conf_user" ]] && grep -q 'kb_layout' "$conf_user" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$conf_user" | cut -d '=' -f2 | tr -d '[:space:]' | head -n1) + elif [[ -f "$conf_sys" ]] && grep -q 'kb_layout' "$conf_sys" 2>/dev/null; then + layouts=$(grep 'kb_layout' "$conf_sys" | cut -d '=' -f2 | tr -d '[:space:]' | head -n1) + fi + fi + echo "$layouts" | tr ',' ' ' +} + +raw_layouts=$(get_layouts) +if [[ -z "$raw_layouts" ]]; then + echo "Error: cannot find kb_layout in configuration files." >&2 + exit 1 fi -kb_layouts=($(grep 'kb_layout' "$CFG_FILE" | cut -d '=' -f2 | tr -d '[:space:]' | tr ',' ' ')) + +kb_layouts=($raw_layouts) count=${#kb_layouts[@]} + # Get current active window ID get_win() { hyprctl activewindow -j | jq -r '.address // .id' @@ -51,7 +89,7 @@ get_keyboards() { # Save window-specific layout save_map() { local W=$1 L=$2 - grep -v "^${W}:" "$MAP_FILE" > "$MAP_FILE.tmp" + grep -v "^${W}:" "$MAP_FILE" > "$MAP_FILE.tmp" 2>/dev/null echo "${W}:${L}" >> "$MAP_FILE.tmp" mv "$MAP_FILE.tmp" "$MAP_FILE" } @@ -60,7 +98,7 @@ save_map() { load_map() { local W=$1 local E - E=$(grep "^${W}:" "$MAP_FILE") + E=$(grep "^${W}:" "$MAP_FILE" 2>/dev/null) [[ -n "$E" ]] && echo "${E#*:}" || echo "${kb_layouts[0]}" } @@ -68,16 +106,17 @@ load_map() { do_switch() { local IDX=$1 for kb in $(get_keyboards); do - hyprctl switchxkblayout "$kb" "$IDX" 2>/dev/null + hyprctl switchxkblayout "$kb" "$IDX" >/dev/null 2>&1 done } # Toggle layout for current window only cmd_toggle() { local W=$(get_win) - [[ -z "$W" ]] && return + [[ -z "$W" || "$W" == "null" ]] && return local CUR=$(load_map "$W") - local i NEXT + local i=0 + local NEXT for idx in "${!kb_layouts[@]}"; do if [[ "${kb_layouts[idx]}" == "$CUR" ]]; then i=$idx @@ -93,7 +132,7 @@ cmd_toggle() { # Restore layout on focus cmd_restore() { local W=$(get_win) - [[ -z "$W" ]] && return + [[ -z "$W" || "$W" == "null" ]] && return local LAY=$(load_map "$W") for idx in "${!kb_layouts[@]}"; do if [[ "${kb_layouts[idx]}" == "$LAY" ]]; then @@ -106,23 +145,37 @@ cmd_restore() { # Listen to focus events and restore window-specific layouts subscribe() { local SOCKET2="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" + if [[ ! -S "$SOCKET2" ]]; then + # Fallback if HYPRLAND_INSTANCE_SIGNATURE is not set correctly in this subshell + local sig=$(hyprctl instances -j | jq -r '.[0].instance' 2>/dev/null) + SOCKET2="$XDG_RUNTIME_DIR/hypr/$sig/.socket2.sock" + fi + [[ -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 + if [[ "$line" =~ ^activewindow ]]; then + cmd_restore + fi done } -# Ensure only one listener -if ! pgrep -f "$SCRIPT_NAME.*--listener" >/dev/null; then - subscribe --listener & -fi - # CLI case "$1" in - toggle|"") cmd_toggle ;; - *) echo "Usage: $SCRIPT_NAME [toggle]" >&2; exit 1 ;; + --listener) + subscribe + ;; + toggle|"") + # Ensure only one listener + if ! pgrep -f "$SCRIPT_NAME.*--listener" >/dev/null; then + "$SCRIPT_PATH" --listener & + fi + cmd_toggle + ;; + *) + echo "Usage: $SCRIPT_NAME [toggle]" >&2; exit 1 + ;; esac diff --git a/config/hypr/scripts/ThemeChanger.sh b/config/hypr/scripts/ThemeChanger.sh index b41738f6..c19908e4 100755 --- a/config/hypr/scripts/ThemeChanger.sh +++ b/config/hypr/scripts/ThemeChanger.sh @@ -6,6 +6,12 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ================================================== set -euo pipefail +# Wallust v3/v4 compatibility +wallust_args=() +# shellcheck source=/dev/null +if [ -f "$HOME/.config/hypr/scripts/WallustConfig.sh" ]; then + . "$HOME/.config/hypr/scripts/WallustConfig.sh" +fi # SPDX-FileCopyrightText: 2025-present Ahum Maitra theahummaitra@gmail.com # @@ -25,12 +31,130 @@ require rofi # notify-send is optional have_notify() { command -v notify-send >/dev/null 2>&1; } +capture_current_layout() { + if command -v jq >/dev/null 2>&1; then + hyprctl -j getoption general:layout 2>/dev/null | jq -r '.str // empty' + else + hyprctl getoption general:layout 2>/dev/null | awk 'NR==1 {print $2}' + fi +} +restore_layout_after_reload() { + local layout="$1" + [ -n "$layout" ] || return 0 + + if [ -x "$HOME/.config/hypr/scripts/ChangeLayout.sh" ]; then + if "$HOME/.config/hypr/scripts/ChangeLayout.sh" --no-notify "$layout" >/dev/null 2>&1; then + return 0 + fi + fi + + hyprctl keyword general:layout "$layout" >/dev/null 2>&1 || true +} +reload_hypr_preserve_layout() { + command -v hyprctl >/dev/null 2>&1 || return 0 + + local active_layout + active_layout="$(capture_current_layout || true)" + + hyprctl reload config-only >/dev/null 2>&1 || true + sleep 0.1 + restore_layout_after_reload "$active_layout" +} +# Cache theme list to avoid slow re-enumeration on every invocation +cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}" +theme_cache="${cache_dir}/wallust_theme_list.txt" +cache_max_age=86400 # seconds + +build_theme_list() { + wallust "${wallust_args[@]}" theme list \ + | awk '/^- /{sub(/^- /,""); sub(/ \(.*/, ""); print}' +} + +update_theme_cache() { + mkdir -p "$cache_dir" + local tmp + tmp="$(mktemp "${cache_dir}/wallust-theme-list.XXXXXX")" + if build_theme_list > "$tmp"; then + if [ -s "$tmp" ]; then + mv "$tmp" "$theme_cache" + return 0 + fi + fi + rm -f "$tmp" + return 1 +} + +cache_mtime=$(stat -c %Y "$theme_cache" 2>/dev/null || echo 0) +cache_age=$(( $(date +%s) - cache_mtime )) +if [ ! -s "$theme_cache" ] || [ "$cache_age" -gt "$cache_max_age" ]; then + update_theme_cache || true +fi + +ensure_wallust_waybar_style() { + local waybar_style="$HOME/.config/waybar/style.css" + local colors_file="$HOME/.config/waybar/wallust/colors-waybar.css" + local styles_dir="$HOME/.config/waybar/style" + [ -f "$colors_file" ] || return 0 + if [ -f "$waybar_style" ] && grep -q 'colors-waybar.css' "$waybar_style"; then + return 0 + fi + local candidates=( + "Wallust-Chroma-Fusion.css" + "Wallust-ML4W-modern.css" + "Wallust-Colored.css" + "Wallust-Box-type.css" + "Wallust-Simple.css" + ) + for candidate in "${candidates[@]}"; do + if [ -f "$styles_dir/$candidate" ]; then + ln -sf "$styles_dir/$candidate" "$waybar_style" + break + fi + done +} +reload_running_cava_colors() { + # CAVA supports SIGUSR2 to reload colors without full audio reinitialization. + if pgrep -x cava >/dev/null 2>&1; then + pkill -USR2 -x cava >/dev/null 2>&1 || true + fi +} + +wallust_hypr_colors="$HOME/.config/hypr/wallust/wallust-hyprland.conf" +extract_wallust_hex() { + local key="$1" + awk -v key="$key" ' + $1 == "$" key && $2 == "=" { + if (match($3, /^rgb\(([0-9A-Fa-f]{6})\)$/, m)) { + print toupper(m[1]) + exit + } + } + ' "$wallust_hypr_colors" +} + +apply_hypr_border_fallback() { + [ -s "$wallust_hypr_colors" ] || return 0 + local color12 color10 color15 color0 + color12="$(extract_wallust_hex color12)" + color10="$(extract_wallust_hex color10)" + color15="$(extract_wallust_hex color15)" + color0="$(extract_wallust_hex color0)" + + [ -n "$color12" ] && hyprctl keyword general:col.active_border "rgb($color12)" >/dev/null 2>&1 || true + [ -n "$color10" ] && hyprctl keyword general:col.inactive_border "rgb($color10)" >/dev/null 2>&1 || true + [ -n "$color12" ] && hyprctl keyword decoration:shadow:color "rgb($color12)" >/dev/null 2>&1 || true + [ -n "$color10" ] && hyprctl keyword decoration:shadow:color_inactive "rgb($color10)" >/dev/null 2>&1 || true + [ -n "$color15" ] && hyprctl keyword group:col.border_active "rgb($color15)" >/dev/null 2>&1 || true + [ -n "$color0" ] && hyprctl keyword group:groupbar:col.active "rgb($color0)" >/dev/null 2>&1 || true +} # 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')" +if [ -s "$theme_cache" ]; then + choice="$(rofi -dmenu -i -p 'Select Global Theme' < "$theme_cache")" +else + choice="$(build_theme_list | rofi -dmenu -i -p 'Select Global Theme')" +fi prompt_status=$? set -e @@ -41,9 +165,15 @@ fi # Record time before applying so we can wait for fresh template outputs start_ts=$(date +%s) +# Notify quickly so users get feedback immediately +have_notify && notify-send -a ThemeChanger \ + -h string:x-dunst-stack-tag:themechanger \ + "Applying theme" "Selected: ${choice}" # Apply the theme and report result -if wallust theme -- "${choice}"; then +wallust_log="${XDG_CACHE_HOME:-$HOME/.cache}/wallust/themechanger.log" +mkdir -p "$(dirname "$wallust_log")" +if wallust "${wallust_args[@]}" theme -- "${choice}" >"$wallust_log" 2>&1; then have_notify && notify-send -a ThemeChanger \ -h string:x-dunst-stack-tag:themechanger \ "Global theme changed" "Selected: ${choice}" @@ -55,9 +185,7 @@ if wallust theme -- "${choice}"; then 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 ':' @@ -101,6 +229,13 @@ if wallust theme -- "${choice}"; then sleep 0.5 fi + if [ "${ok:-0}" -ne 1 ]; then + have_notify && notify-send -u critical -a ThemeChanger \ + -h string:x-dunst-stack-tag:themechanger \ + "Theme files not updated" "See: $wallust_log" + exit 1 + fi + # Small cushion before refresh to mirror wallpaper flow sleep 0.2 # Normalize Rofi selection colors to use the palette's accent (color12) @@ -118,10 +253,9 @@ if wallust theme -- "${choice}"; then 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 + reload_hypr_preserve_layout + ensure_wallust_waybar_style + reload_running_cava_colors # Refresh bars/menus after files are ready if [ -x "$HOME/.config/hypr/scripts/Refresh.sh" ]; then @@ -146,6 +280,6 @@ if wallust theme -- "${choice}"; then else have_notify && notify-send -u critical -a ThemeChanger \ -h string:x-dunst-stack-tag:themechanger \ - "Failed to apply theme" "${choice}" + "Failed to apply theme" "See: $wallust_log" exit 1 fi diff --git a/config/hypr/scripts/Toggle-Active-Window-Audio.sh b/config/hypr/scripts/Toggle-Active-Window-Audio.sh index f32ded0e..c954541f 100755 --- a/config/hypr/scripts/Toggle-Active-Window-Audio.sh +++ b/config/hypr/scripts/Toggle-Active-Window-Audio.sh @@ -54,18 +54,18 @@ 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("[-_~.]+";" ") ; + def norm(x): (x // "" | ascii_downcase | gsub("[-_~.]+";" ") | gsub("[^a-z0-9 ]+";" ") | gsub("[[:space:]]+";" ") | gsub("^ +| +$";"")); + def to_num(x): (try (x | tostring | tonumber) catch null); select( - (.properties["application.process.id"] | tostring | tonumber? as $p | $p != null and ($pids | index($p))) + (to_num(.properties["application.process.id"]) as $p | $p != null and ($pids | index($p))) or - (lc(.properties["application.name"]) | contains(lc($class))) + (norm(.properties["application.name"]) | contains(norm($class))) or - (lc(.properties["application.id"]) | contains(lc($class))) + (norm(.properties["application.id"]) | contains(norm($class))) or - (lc(.properties["application.process.binary"]) | contains(lc($class))) + (norm(.properties["application.process.binary"]) | contains(norm($class))) or - (normalize(lc(.properties["media.name"])) | contains(normalize(lc($title)))) + (norm(.properties["media.name"]) | contains(norm($title))) ) | .index' <<< "${sink_json}" ) @@ -87,8 +87,9 @@ if [[ "${#sink_ids[@]}" -eq 0 ]]; then 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}" ) + mapfile -t sink_ids < <( jq -r --argjson pids "${fallbackJson}" '.[] | + def to_num(x): (try (x | tostring | tonumber) catch null); + select((to_num(.properties["application.process.id"]) as $p | $p != null and ($pids | index($p)))) | .index' <<< "${sink_json}" ) fi fi diff --git a/config/hypr/scripts/WallpaperCmd.sh b/config/hypr/scripts/WallpaperCmd.sh index 0191ee14..90a88fd9 100755 --- a/config/hypr/scripts/WallpaperCmd.sh +++ b/config/hypr/scripts/WallpaperCmd.sh @@ -24,8 +24,99 @@ if [ "$WWW_CMD" = "awww" ]; then mkdir -p "$WWW_CACHE_DIR" if [ ! -f "$WWW_MIGRATION_MARKER" ]; then awww clear-cache >/dev/null 2>&1 || true + mkdir -p "$WWW_CACHE_DIR" touch "$WWW_MIGRATION_MARKER" fi fi +wallpaper_monitor_dimensions() { + local monitor="${1:-}" + local dims="" + + command -v hyprctl >/dev/null 2>&1 || return 1 + + if command -v jq >/dev/null 2>&1; then + if [ -n "$monitor" ]; then + dims="$(hyprctl monitors -j 2>/dev/null | jq -r --arg mon "$monitor" '.[] | select(.name == $mon) | "\(.width) \(.height)"' | awk 'NF == 2 {print; exit}')" + else + dims="$(hyprctl monitors -j 2>/dev/null | jq -r '.[] | select(.focused == true) | "\(.width) \(.height)"' | awk 'NF == 2 {print; exit}')" + if [ -z "$dims" ]; then + dims="$(hyprctl monitors -j 2>/dev/null | jq -r '.[0] | "\(.width) \(.height)"' | awk 'NF == 2 {print; exit}')" + fi + fi + fi + + if [ -z "$dims" ]; then + dims="$(hyprctl monitors 2>/dev/null | awk -v mon="$monitor" ' + $1=="Monitor" {current=$2; target=(mon=="" || current==mon)} + target { + if (match($0, /[0-9]+x[0-9]+@/)) { + res = substr($0, RSTART, RLENGTH) + sub(/@.*/, "", res) + split(res, xy, "x") + print xy[1], xy[2] + exit + } + } + ')" + fi + + [ -n "$dims" ] || return 1 + printf '%s\n' "$dims" +} + +wallpaper_image_dimensions() { + local image_path="$1" + local dims="" + + [ -n "$image_path" ] && [ -f "$image_path" ] || return 1 + + if command -v magick >/dev/null 2>&1; then + dims="$(magick identify -ping -format '%w %h' "${image_path}[0]" 2>/dev/null || true)" + [ -n "$dims" ] || dims="$(magick identify -ping -format '%w %h' "$image_path" 2>/dev/null || true)" + elif command -v identify >/dev/null 2>&1; then + dims="$(identify -ping -format '%w %h' "${image_path}[0]" 2>/dev/null || true)" + [ -n "$dims" ] || dims="$(identify -ping -format '%w %h' "$image_path" 2>/dev/null || true)" + fi + + [ -n "$dims" ] || return 1 + printf '%s\n' "$dims" +} + +wallpaper_resize_mode() { + local image_path="$1" + local monitor="${2:-}" + local mode="${WALLPAPER_RESIZE_MODE:-auto}" + local mon_w mon_h img_w img_h + + mode="${mode,,}" + case "$mode" in + fit|crop) + printf '%s\n' "$mode" + return 0 + ;; + auto|"") + ;; + *) + mode="auto" + ;; + esac + + if ! read -r mon_w mon_h < <(wallpaper_monitor_dimensions "$monitor"); then + printf '%s\n' "crop" + return 0 + fi + if ! read -r img_w img_h < <(wallpaper_image_dimensions "$image_path"); then + printf '%s\n' "crop" + return 0 + fi + + if [ "$img_w" -lt "$mon_w" ] || [ "$img_h" -lt "$mon_h" ]; then + printf '%s\n' "crop" + return 0 + fi + + # Auto mode prefers full-screen fill; set WALLPAPER_RESIZE_MODE=fit to preserve full image. + printf '%s\n' "crop" +} 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 index 4d1c6e86..60c35a6d 100755 --- a/config/hypr/scripts/WallpaperDaemon.sh +++ b/config/hypr/scripts/WallpaperDaemon.sh @@ -11,12 +11,12 @@ 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 +if command -v "$WWW_DAEMON" >/dev/null 2>&1 && command -v "$WWW_CMD" >/dev/null 2>&1 && ! pgrep -x "$WWW_DAEMON" >/dev/null 2>&1; then "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & fi # Give the daemon a moment to become ready -for _ in {1..20}; do +for _ in {1..50}; do "$WWW_CMD" query >/dev/null 2>&1 && break sleep 0.1 done @@ -92,9 +92,11 @@ apply_wallpaper_for_monitor() { fi if [ -n "$wallpaper_path" ] && [ -f "$wallpaper_path" ]; then - if ! "$WWW_CMD" img -o "$monitor" "$wallpaper_path" >/dev/null 2>&1; then + local resize_mode + resize_mode="$(wallpaper_resize_mode "$wallpaper_path" "$monitor")" + if ! "$WWW_CMD" img -o "$monitor" --resize "$resize_mode" "$wallpaper_path" >/dev/null 2>&1; then sleep 0.3 - "$WWW_CMD" img -o "$monitor" "$wallpaper_path" >/dev/null 2>&1 & + "$WWW_CMD" img -o "$monitor" --resize "$resize_mode" "$wallpaper_path" >/dev/null 2>&1 & fi fi } diff --git a/config/hypr/scripts/WallustConfig.sh b/config/hypr/scripts/WallustConfig.sh new file mode 100755 index 00000000..44ddff0b --- /dev/null +++ b/config/hypr/scripts/WallustConfig.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Wallust version compatibility helpers +# +# Purpose: +# - Wallust v3 reads ~/.config/wallust/wallust.toml (this repo ships a v3 config) +# - Wallust v4 alpha uses a different config schema; users frequently install it +# via wallust-git, which will fail to parse the v3 config. +# +# This file detects Wallust major version and sets arrays used by scripts: +# - wallust_args: args to pass to wallust for wallpaper-derived palette generation +# - wallust_kitty_args: args to pass to wallust for kitty-only palette generation + +wallust_args=() +wallust_kitty_args=() + +wallust_prepare_args() { + wallust_args=() + wallust_kitty_args=() + + command -v wallust >/dev/null 2>&1 || return 0 + + local version major + version=$(wallust --version 2>/dev/null | awk '{print $2}') + major=${version%%.*} + + # Wallust v4 supports -C/--config-file. + if [ -n "$major" ] && [ "$major" -ge 4 ]; then + local v4_cfg="$HOME/.config/wallust/wallust-v4.toml" + local v4_kitty_cfg="$HOME/.config/wallust/wallust-kitty-v4.toml" + + if [ -f "$v4_cfg" ]; then + wallust_args=(-C "$v4_cfg") + fi + if [ -f "$v4_kitty_cfg" ]; then + wallust_kitty_args=(-C "$v4_kitty_cfg") + fi + fi +} + +wallust_prepare_args diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh index 9df3ed61..3472d519 100755 --- a/config/hypr/scripts/WallustSwww.sh +++ b/config/hypr/scripts/WallustSwww.sh @@ -9,6 +9,73 @@ # Usage: WallustSwww.sh [absolute_path_to_wallpaper] set -euo pipefail +# Wallust v3/v4 compatibility +wallust_args=() +wallust_kitty_args=() +# shellcheck source=/dev/null +if [ -f "$HOME/.config/hypr/scripts/WallustConfig.sh" ]; then + . "$HOME/.config/hypr/scripts/WallustConfig.sh" +fi +have_notify() { command -v notify-send >/dev/null 2>&1; } +wallust_log="${XDG_CACHE_HOME:-$HOME/.cache}/wallust/wallust-swww.log" +mkdir -p "$(dirname "$wallust_log")" +capture_current_layout() { + if command -v jq >/dev/null 2>&1; then + hyprctl -j getoption general:layout 2>/dev/null | jq -r '.str // empty' + else + hyprctl getoption general:layout 2>/dev/null | awk 'NR==1 {print $2}' + fi +} +restore_layout_after_reload() { + local layout="$1" + [ -n "$layout" ] || return 0 + + if [ -x "$HOME/.config/hypr/scripts/ChangeLayout.sh" ]; then + if "$HOME/.config/hypr/scripts/ChangeLayout.sh" --no-notify "$layout" >/dev/null 2>&1; then + return 0 + fi + fi + + hyprctl keyword general:layout "$layout" >/dev/null 2>&1 || true +} +reload_hypr_preserve_layout() { + command -v hyprctl >/dev/null 2>&1 || return 0 + + local active_layout + active_layout="$(capture_current_layout || true)" + + hyprctl reload config-only >/dev/null 2>&1 || true + sleep 0.1 + restore_layout_after_reload "$active_layout" +} +ensure_wallust_waybar_style() { + local waybar_style="$HOME/.config/waybar/style.css" + local colors_file="$HOME/.config/waybar/wallust/colors-waybar.css" + local styles_dir="$HOME/.config/waybar/style" + [ -f "$colors_file" ] || return 0 + if [ -f "$waybar_style" ] && grep -q 'colors-waybar.css' "$waybar_style"; then + return 0 + fi + local candidates=( + "Wallust-Chroma-Fusion.css" + "Wallust-ML4W-modern.css" + "Wallust-Colored.css" + "Wallust-Box-type.css" + "Wallust-Simple.css" + ) + for candidate in "${candidates[@]}"; do + if [ -f "$styles_dir/$candidate" ]; then + ln -sf "$styles_dir/$candidate" "$waybar_style" + break + fi + done +} +reload_running_cava_colors() { + # CAVA supports SIGUSR2 to reload colors without full audio reinitialization. + if pgrep -x cava >/dev/null 2>&1; then + pkill -USR2 -x cava >/dev/null 2>&1 || true + fi +} # Inputs and paths passed_path="${1:-}" @@ -124,13 +191,23 @@ wait_for_templates() { # 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 +if ! wallust "${wallust_args[@]}" run -s "$wallpaper_path" >"$wallust_log" 2>&1; then + have_notify && notify-send -u critical -a WallustSwww \ + "Wallust failed" "See: $wallust_log" + exit 1 +fi 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 +if ! wait_for_templates "$start_ts" "${wallust_targets[@]}"; then + have_notify && notify-send -u critical -a WallustSwww \ + "Wallust templates not updated" "See: $wallust_log" + exit 1 +fi +ensure_wallust_waybar_style +reload_running_cava_colors # Normalize Rofi selection colors to a brighter accent and readable foreground rofi_colors="$HOME/.config/rofi/wallust/colors-rofi.rasi" @@ -153,28 +230,78 @@ 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 + # Wallust v4: prefer config-file flag via WallustConfig.sh + if [ "${#wallust_kitty_args[@]}" -gt 0 ]; then + wallust "${wallust_kitty_args[@]}" run -s "$wallpaper_path" || true + return fi + # Wallust v3+: prefer config-file flag when available. + # NOTE: Do not use -c here; on wallust 3.x it means colorspace, not config file. + if wallust run --help 2>&1 | grep -q -E -- '(^|[[:space:]])-C([,[:space:]]|$)|--config-file'; then + wallust run -s -C "$cfg" "$wallpaper_path" || true + return + fi + # Legacy fallback for builds that still honor env-based config override. + WALLUST_CONFIG="$cfg" wallust run -s "$wallpaper_path" || true +} +wallust_hypr_colors="$HOME/.config/hypr/wallust/wallust-hyprland.conf" +extract_wallust_hex() { + local key="$1" + awk -v key="$key" ' + $1 == "$" key && $2 == "=" { + if (match($3, /^rgb\(([0-9A-Fa-f]{6})\)$/, m)) { + print toupper(m[1]) + exit + } + } + ' "$wallust_hypr_colors" +} + +apply_hypr_border_fallback() { + [ -s "$wallust_hypr_colors" ] || return 0 + local color12 color10 color15 color0 + color12="$(extract_wallust_hex color12)" + color10="$(extract_wallust_hex color10)" + color15="$(extract_wallust_hex color15)" + color0="$(extract_wallust_hex color0)" + + [ -n "$color12" ] && hyprctl keyword general:col.active_border "rgb($color12)" >/dev/null 2>&1 || true + [ -n "$color10" ] && hyprctl keyword general:col.inactive_border "rgb($color10)" >/dev/null 2>&1 || true + [ -n "$color12" ] && hyprctl keyword decoration:shadow:color "rgb($color12)" >/dev/null 2>&1 || true + [ -n "$color10" ] && hyprctl keyword decoration:shadow:color_inactive "rgb($color10)" >/dev/null 2>&1 || true + [ -n "$color15" ] && hyprctl keyword group:col.border_active "rgb($color15)" >/dev/null 2>&1 || true + [ -n "$color0" ] && hyprctl keyword group:groupbar:col.active "rgb($color0)" >/dev/null 2>&1 || true +} + +apply_hypr_gap_fallback() { + local decorations_lua="$HOME/.config/hypr/UserConfigs/user_decorations.lua" + [ -s "$decorations_lua" ] || return 0 + local gaps_in gaps_out border_size + gaps_in="$(sed -n 's/^[[:space:]]*gaps_in[[:space:]]*=[[:space:]]*\([0-9]\+\).*/\1/p' "$decorations_lua" | head -n1)" + gaps_out="$(sed -n 's/^[[:space:]]*gaps_out[[:space:]]*=[[:space:]]*\([0-9]\+\).*/\1/p' "$decorations_lua" | head -n1)" + border_size="$(sed -n 's/^[[:space:]]*border_size[[:space:]]*=[[:space:]]*\([0-9]\+\).*/\1/p' "$decorations_lua" | head -n1)" + + [ -n "$gaps_in" ] && hyprctl keyword general:gaps_in "$gaps_in" >/dev/null 2>&1 || true + [ -n "$gaps_out" ] && hyprctl keyword general:gaps_out "$gaps_out" >/dev/null 2>&1 || true + [ -n "$border_size" ] && hyprctl keyword general:border_size "$border_size" >/dev/null 2>&1 || true } +# Apply Hyprland updates immediately to avoid delayed border/gap changes. +reload_hypr_preserve_layout + kitty_cfg="$HOME/.config/wallust/wallust-kitty.toml" +if [ "${#wallust_kitty_args[@]}" -gt 0 ]; then + kitty_cfg="$HOME/.config/wallust/wallust-kitty-v4.toml" +fi ( 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 + # Reload kitty colors when wallpaper-based theme is active. + # Use SIGUSR1 directly to avoid extra latency from kitty remote-control calls. 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 @@ -195,8 +322,5 @@ kitty_cfg="$HOME/.config/wallust/wallust-kitty.toml" 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 + # Hyprland reload/keyword updates are applied above to avoid delayed color/gap updates. ) >/dev/null 2>&1 & diff --git a/config/hypr/scripts/WaybarStartup.sh b/config/hypr/scripts/WaybarStartup.sh new file mode 100755 index 00000000..ac269600 --- /dev/null +++ b/config/hypr/scripts/WaybarStartup.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Dedicated startup helper for Waybar. +# Handles both systemd user service setups and direct Waybar launch. + +runtime_dir="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" +export XDG_RUNTIME_DIR="$runtime_dir" + +is_waybar_running() { + pgrep -x "waybar" >/dev/null 2>&1 || pgrep -x '\.waybar-wrapped' >/dev/null 2>&1 +} + +wait_for_wayland() { + # If WAYLAND_DISPLAY is already valid, use it. + if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -S "$runtime_dir/$WAYLAND_DISPLAY" ]; then + return 0 + fi + + # Otherwise wait briefly for an available Wayland socket. + for _ in $(seq 1 120); do + if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -S "$runtime_dir/$WAYLAND_DISPLAY" ]; then + return 0 + fi + + for socket in "$runtime_dir"/wayland-[0-9]*; do + [ -S "$socket" ] || continue + case "$(basename "$socket")" in + *awww*) continue ;; + esac + export WAYLAND_DISPLAY="$(basename "$socket")" + return 0 + done + sleep 0.1 + done + + return 1 +} + +start_waybar_direct() { + if command -v waybar >/dev/null 2>&1; then + waybar >/dev/null 2>&1 & + return 0 + fi + + if command -v .waybar-wrapped >/dev/null 2>&1; then + .waybar-wrapped >/dev/null 2>&1 & + return 0 + fi + + return 1 +} + +start_waybar_via_systemd() { + [ -x "$(command -v systemctl)" ] || return 1 + + local load_state + load_state="$(systemctl --user show waybar.service --property=LoadState --value 2>/dev/null || true)" + [ -n "$load_state" ] && [ "$load_state" != "not-found" ] || return 1 + + systemctl --user start waybar.service >/dev/null 2>&1 || return 1 + sleep 0.4 + is_waybar_running +} + +main() { + # Allow key startup services to settle before launching Waybar. + sleep 1 + wait_for_wayland || true + + is_waybar_running && exit 0 + + if start_waybar_via_systemd; then + exit 0 + fi + + if is_waybar_running; then + exit 0 + fi + + start_waybar_direct || exit 1 +} + +main diff --git a/config/hypr/scripts/keybinds_parser.py b/config/hypr/scripts/keybinds_parser.py index 5b75d81c..bd6142d9 100755 --- a/config/hypr/scripts/keybinds_parser.py +++ b/config/hypr/scripts/keybinds_parser.py @@ -8,10 +8,30 @@ import sys import re import os +CODE_KEY_MAP = { + 10: "1", + 11: "2", + 12: "3", + 13: "4", + 14: "5", + 15: "6", + 16: "7", + 17: "8", + 18: "9", + 19: "0", +} def normalize_combo(combo): return combo.replace(" ", "").replace("\t", "") +def humanize_key_token(mods, key): + key = key.strip() + code_match = re.match(r'(?i)^code:(\d+)$', key) + if code_match: + code_num = int(code_match.group(1)) + return CODE_KEY_MAP.get(code_num, key) + return key + def extract_combo(line): # Remove comments and whitespace line = re.sub(r'\s*#.*$', '', line).strip() @@ -128,6 +148,244 @@ def parse_files(files): missing_unbind_suggestions.append(suggest) return raw_keybinds, missing_unbind_suggestions +def _parse_lua_string(value): + value = value.strip() + if len(value) < 2: + return None + if (value[0] == value[-1]) and value[0] in ("'", '"'): + quote = value[0] + body = value[1:-1] + if quote == '"': + body = body.replace('\\"', '"') + else: + body = body.replace("\\'", "'") + body = body.replace("\\\\", "\\") + return body + return None + +def _split_lua_args(arg_text): + args = [] + current = [] + depth = 0 + in_string = None + escape = False + for ch in arg_text: + if in_string: + current.append(ch) + if escape: + escape = False + elif ch == '\\': + escape = True + elif ch == in_string: + in_string = None + continue + if ch in ("'", '"'): + in_string = ch + current.append(ch) + continue + if ch in "([{": + depth += 1 + current.append(ch) + continue + if ch in ")]}": + depth = max(depth - 1, 0) + current.append(ch) + continue + if ch == ',' and depth == 0: + args.append("".join(current).strip()) + current = [] + continue + current.append(ch) + if current: + args.append("".join(current).strip()) + return args + +def _find_lua_calls(text, function_names): + calls = [] + pattern = re.compile(r'\b(' + "|".join(re.escape(name) for name in function_names) + r')\s*\(') + pos = 0 + while True: + match = pattern.search(text, pos) + if not match: + break + fn = match.group(1) + start = match.end() + idx = start + depth = 1 + in_string = None + escape = False + while idx < len(text): + ch = text[idx] + if in_string: + if escape: + escape = False + elif ch == '\\': + escape = True + elif ch == in_string: + in_string = None + else: + if ch in ("'", '"'): + in_string = ch + elif ch == '(': + depth += 1 + elif ch == ')': + depth -= 1 + if depth == 0: + calls.append((fn, text[start:idx])) + pos = idx + 1 + break + idx += 1 + else: + break + return calls + +def _find_lua_block(text, start_idx, open_char="{", close_char="}"): + depth = 0 + in_string = None + escape = False + for idx in range(start_idx, len(text)): + ch = text[idx] + if in_string: + if escape: + escape = False + elif ch == "\\": + escape = True + elif ch == in_string: + in_string = None + continue + if ch in ("'", '"'): + in_string = ch + continue + if ch == open_char: + depth += 1 + elif ch == close_char: + depth -= 1 + if depth == 0: + return text[start_idx + 1:idx], idx + 1 + return None, None + +def _extract_lua_bind_calls(text): + binds = [] + calls = _find_lua_calls(text, ["bind", "bindm", "hl.bind"]) + for fn, args_text in calls: + args = _split_lua_args(args_text) + if len(args) < 2: + continue + mods = _parse_lua_string(args[0]) + key = _parse_lua_string(args[1]) + if mods is None or key is None: + continue + description = None + desc_match = re.search(r'description\s*=\s*(\"(?:\\.|[^\"])*\"|\'(?:\\.|[^\'])*\')', args_text, re.DOTALL) + if desc_match: + description = _parse_lua_string(desc_match.group(1)) + elif fn == "bindm" and len(args) >= 4: + description = _parse_lua_string(args[3]) + binds.append({ + "mods": mods, + "key": key, + "description": description or "", + }) + return binds + +def _extract_lua_bind_tables(text): + binds = [] + pattern = re.compile(r'\bapp_binds\s*=\s*\{', re.MULTILINE) + for match in pattern.finditer(text): + block, end_idx = _find_lua_block(text, match.end() - 1) + if block is None: + continue + idx = 0 + depth = 0 + in_string = None + escape = False + entry_start = None + while idx < len(block): + ch = block[idx] + if in_string: + if escape: + escape = False + elif ch == "\\": + escape = True + elif ch == in_string: + in_string = None + idx += 1 + continue + if ch in ("'", '"'): + in_string = ch + idx += 1 + continue + if ch == "{": + depth += 1 + if depth == 1: + entry_start = idx + 1 + elif ch == "}": + if depth == 1 and entry_start is not None: + entry_text = block[entry_start:idx] + args = _split_lua_args(entry_text) + if len(args) >= 4: + mods = _parse_lua_string(args[0]) + key = _parse_lua_string(args[1]) + description = _parse_lua_string(args[3]) + if mods is not None and key is not None: + binds.append({ + "mods": mods, + "key": key, + "description": description or "", + }) + entry_start = None + depth = max(depth - 1, 0) + idx += 1 + return binds + +def _extract_lua_binds(text): + binds = [] + binds.extend(_extract_lua_bind_calls(text)) + binds.extend(_extract_lua_bind_tables(text)) + return binds + +def _format_lua_binds(binds): + formatted_lines = [] + for bind in binds: + mods = bind["mods"].replace("$mainMod", "SUPER") + mods = re.sub(r'[ \t]+', '+', mods.strip()) + key = humanize_key_token(mods, bind["key"]) + if mods and key: + combo_str = f"{mods}+{key}" + elif key: + combo_str = key + else: + combo_str = mods + desc = (bind.get("description") or "").strip() + if desc: + formatted_lines.append(f"{combo_str} — {desc}") + else: + formatted_lines.append(combo_str) + return formatted_lines + +def parse_lua_files(files): + order = [] + bind_map = {} + 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: + binds = _extract_lua_binds(f.read()) + except Exception as e: + sys.stderr.write(f"Error reading {file_path}: {e}\n") + continue + for bind in binds: + combo_key = normalize_combo(f"{bind['mods']},{bind['key']}") + if combo_key in bind_map: + try: + order.remove(combo_key) + except ValueError: + pass + bind_map[combo_key] = bind + order.append(combo_key) + effective_binds = [bind_map[key] for key in order if key in bind_map] + return _format_lua_binds(effective_binds) def format_for_rofi(raw_binds): formatted_lines = [] @@ -186,6 +444,7 @@ def format_for_rofi(raw_binds): # Formatting mods mods = mods.replace("$mainMod", "SUPER") mods = re.sub(r'[ \t]+', '+', mods) + key = humanize_key_token(mods, key) # Build combo string if mods and key: @@ -214,7 +473,16 @@ def main(): sys.exit(0) config_files = sys.argv[1:] - + has_lua = any(path.endswith(".lua") for path in config_files) + if has_lua: + formatted = parse_lua_files(config_files) + if not formatted: + print("no keybinds found.") + sys.exit(1) + for line in formatted: + print(line) + return + binds, suggestions = parse_files(config_files) if not binds: diff --git a/config/hypr/scripts/update_WindowRules.sh b/config/hypr/scripts/update_WindowRules.sh index c8d236c4..293b14e9 100755 --- a/config/hypr/scripts/update_WindowRules.sh +++ b/config/hypr/scripts/update_WindowRules.sh @@ -9,12 +9,6 @@ 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" @@ -46,13 +40,11 @@ REQUIRED_VER="0.53" 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" + echo "Version $VERSION >= $REQUIRED_VER. Using WindowRules.conf directly (no -config-v3 migration file)." + else + echo "Warning: WindowRules.conf not found at $TARGET_FILE" fi - cp "$V3_FILE" "$TARGET_FILE" if command -v hyprctl &>/dev/null; then if hyprctl instances &>/dev/null; then diff --git a/config/hypr/v2.3.23 b/config/hypr/v2.3.23 deleted file mode 100644 index 51de9972..00000000 --- a/config/hypr/v2.3.23 +++ /dev/null @@ -1,5 +0,0 @@ -### 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/v2.3.24 b/config/hypr/v2.3.24 new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/config/hypr/v2.3.24 |
