Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Configs/.config/hypr/windowrules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ windowrule = float true,match:title ^(Friends List)$ # Steam Friends List
windowrule = float true,match:title ^(Steam Settings)$ # Steam Settings
windowrule = float true,match:initial_title ^(Image Editor)$,match:class ^(blender)$ # Blender Render
windowrule = size (monitor_w*0.5) (monitor_h*0.5),match:initial_title ^(Image Editor)$,match:class ^(blender)$
windowrule = float true, match:initial_title ^(Ghidra: NO ACTIVE PROJECT) #Ghidra Project manager

# workaround for jetbrains IDEs dropdowns/popups cause flickering
windowrule = no_initial_focus true,match:class ^(.*jetbrains.*)$,match:title ^(win[0-9]+)$
Expand Down
21 changes: 9 additions & 12 deletions Configs/.local/lib/hyde/keybinds/hint-hyprland.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python3
import re
import subprocess
import json
import argparse
Expand All @@ -13,16 +14,12 @@ def get_hyprctl_binds():
result = subprocess.run(
["hyprctl", "binds", "-j"], capture_output=True, text=True, check=True
)
while result.returncode != 0:
print("Waiting for hyprctl command to succeed...")
time.sleep(1)
result = subprocess.run(
["hyprctl", "binds", "-j"],
capture_output=True,
text=True,
check=True,
)
binds = json.loads(result.stdout)

clean_json = result.stdout
clean_json = re.sub(r'("keycode":\s*)([^"\s,\}]+)(\s*[,}])', r'\1"\2"\3', clean_json)
clean_json = re.sub(r'("allow_input_capture":\s*)([^"\n]+?)(,\s*\n)', r'\1"\2"\3', clean_json)
Comment on lines +18 to +20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve JSON primitive types during sanitization.

These substitutions convert valid values such as keycode: 87 into "87" and allow_input_capture: false into "false". Consequently, map_codeDisplay cannot match its integer map keys, and boolean checks may treat "false" as truthy. Only quote genuinely malformed string tokens, or normalize types before downstream lookups.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Configs/.local/lib/hyde/keybinds/hint-hyprland.py` around lines 18 - 20,
Update the sanitization substitutions in the JSON cleanup flow to preserve valid
primitive types: do not quote numeric keycode values or boolean
allow_input_capture values. Only quote genuinely malformed string tokens, then
ensure map_codeDisplay integer lookups and boolean checks receive their expected
native types.


binds = json.loads(clean_json)
return binds
except subprocess.CalledProcessError as e:
print(f"Error executing hyprctl: {e}")
Expand Down Expand Up @@ -72,7 +69,7 @@ def map_codeDisplay(keycode, key):
81: "KP_9",
90: "KP_0",
}
return code_map.get(keycode, key)
return code_map.get(keycode, keycode)


def map_modDisplay(modmask):
Expand Down Expand Up @@ -353,7 +350,7 @@ def expand_meta_data(binds_data):
parser.add_argument(
"--format",
choices=["json", "md", "dmenu", "rofi"],
default="json",
default="rofi",
help="Output format",
)
args = parser.parse_args()
Expand Down
Loading