diff --git a/.github/README.md b/.github/README.md index b0ad4b9c4..02e9e7f36 100644 --- a/.github/README.md +++ b/.github/README.md @@ -35,7 +35,7 @@ - **Default keybinds**: Should be somewhat familiar to Windows or GNOME users. Important ones: - `Super`+`/` = keybind list - `Super`+`Enter` = terminal - - If for whatever reason the keybind list widget does not work, here's an image: + - Should look something like this: image @@ -50,7 +50,7 @@ | [Quickshell](https://quickshell.outfoxxed.me/) | A QtQuick-based widget system, used for the status bar, sidebars, etc. | | Others | See [deps-info.md](https://github.com/end-4/dots-hyprland/blob/main/sdata/deps-info.md) | - _THERE IS NO WAYBAR STOP FUCKING CALLING EVERY BAR WAYBAR_ + [not every bar is waybar] [not every bar is waybar] [not every bar is waybar] [not every bar is waybar] [not every bar is waybar] @@ -83,7 +83,7 @@ Widget system: Quickshell | Support: Yes | Window management | Built with love | | image | image | -### Other styles: Available at the end of the readme. +#### Other older styles are available at the end of the readme

• thank you •

@@ -102,22 +102,12 @@ Widget system: Quickshell | Support: Yes

-- If you would like to give me some milk😳 (i dont drink coffee): https://github.com/sponsors/end-4 -- Virtual tentacle cat website points chart +- I promise not to attempt an +ULTRARICOSHOT irl... Coins can go here: https://github.com/sponsors/end-4 +- Tentacle cat hub twinkle internet points [![Stargazers over time](https://starchart.cc/end-4/dots-hyprland.svg?variant=adaptive)](https://starchart.cc/end-4/dots-hyprland) -
-

• inspirations/copying •

-

-
- - - Inspiration: osu!lazer, Windows 11, Material Design 3, AvdanOS (concept) - - Copying: The license allows you to. Personally I have absolutely no problem with others redistributing/recreating my work. There's no "stealing" (maybe unless you loudly do weird stuff and violate the license) (some people actually had to ask smh) - ---- - ---
@@ -125,9 +115,9 @@ Widget system: Quickshell | Support: Yes

-- Source for illogical-impulse AGS available in the `ii-ags` branch, others in the `archive` branch. -- The list goes from newest to the oldest, and the code quality is worse the older a style is -- No bug fix or official support will be provided. +- **Source**: illogical-impulse AGS in `ii-ags` branch, others in `archive` branch. +- **No support** will be provided +- **Reverse chronological order** list. Older = more naive & spaghetti code ### illogical-impulseAGS @@ -141,33 +131,43 @@ Widget system: AGS | Support: No #### m3ww - Widget system: EWW | Support: No, dead +Widget system: EWW | Support: No, dead - - Material Eww! - + +Material Eww! + #### NovelKnock - Widget system: EWW | Support: No +Widget system: EWW | Support: No - - Desktop Preview - + +Desktop Preview + #### Hybrid - Widget system: EWW | Support: No - - - click the circles! - +Widget system: EWW | Support: No + + +click the circles! + #### Windoes - Widget system: EWW | Support: No - - - Desktop Preview - +Widget system: EWW | Support: No + +Desktop Preview + + + + +
+

• inspirations/copying •

+

+
+ + - Inspiration: osu!lazer (Hybrid), Windows 11 (Windoes), AvdanOS (NovelKnock), Material Design 3 (m3ww & later) + - Copying: Absolutely, feel free. Just follow the license and it's all good + diff --git a/dots/.config/hypr/hyprland.conf b/dots/.config/hypr/hyprland.conf index 632d3700c..f51e0fbcc 100644 --- a/dots/.config/hypr/hyprland.conf +++ b/dots/.config/hypr/hyprland.conf @@ -25,3 +25,6 @@ source=custom/keybinds.conf # nwg-displays support source=workspaces.conf source=monitors.conf + +# Shell overrides +source=hyprland/shellOverrides/main.conf diff --git a/dots/.config/hypr/hyprland/shellOverrides/main.conf b/dots/.config/hypr/hyprland/shellOverrides/main.conf new file mode 100644 index 000000000..e69de29bb diff --git a/dots/.config/quickshell/ii/modules/common/models/quickToggles/GameModeToggle.qml b/dots/.config/quickshell/ii/modules/common/models/quickToggles/GameModeToggle.qml index d8ba7402b..a1d6db88e 100644 --- a/dots/.config/quickshell/ii/modules/common/models/quickToggles/GameModeToggle.qml +++ b/dots/.config/quickshell/ii/modules/common/models/quickToggles/GameModeToggle.qml @@ -1,11 +1,6 @@ import QtQuick -import Quickshell import Quickshell.Io -import qs import qs.services -import qs.modules.common -import qs.modules.common.functions -import qs.modules.common.widgets QuickToggleModel { id: root @@ -14,11 +9,29 @@ QuickToggleModel { icon: "gamepad" mainAction: () => { - root.toggled = !root.toggled + root.toggled = !root.toggled; if (root.toggled) { - Quickshell.execDetached(["bash", "-c", `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; keyword general:allow_tearing 1"`]) + HyprlandConfig.setMany({ + "animations:enabled": 0, + "decoration:shadow:enabled": 0, + "decoration:blur:enabled": 0, + "general:gaps_in": 0, + "general:gaps_out": 0, + "general:border_size": 1, + "decoration:rounding": 0, + "general:allow_tearing": 1 + }); } else { - Quickshell.execDetached(["hyprctl", "reload"]) + HyprlandConfig.resetMany([ // + "animations:enabled", // + "decoration:shadow:enabled", // + "decoration:blur:enabled", // + "general:gaps_in", // + "general:gaps_out", // + "general:border_size", // + "decoration:rounding", // + "general:allow_tearing", // + ]); } } Process { @@ -26,7 +39,7 @@ QuickToggleModel { running: true command: ["bash", "-c", `test "$(hyprctl getoption animations:enabled -j | jq ".int")" -ne 0`] onExited: (exitCode, exitStatus) => { - root.toggled = exitCode !== 0 // Inverted because enabled = nonzero exit + root.toggled = exitCode !== 0; // Inverted because enabled = nonzero exit } } tooltipText: Translation.tr("Game mode") diff --git a/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py b/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py new file mode 100755 index 000000000..7d582a821 --- /dev/null +++ b/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py @@ -0,0 +1,90 @@ +#!/usr/bin/env -S\_/bin/sh\_-c\_"source\_\$(eval\_echo\_\$ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate&&exec\_python\_-E\_"\$0"\_"\$@"" +import argparse +import re +import os + +def edit_hyprland_config(file_path, set_args, reset_args): + try: + with open(file_path, 'r') as file: + lines = file.readlines() + except FileNotFoundError: + print(f"Error: File '{file_path}' not found.") + return + + set_dict = {k: v for k, v in set_args} if set_args else {} + reset_set = set(reset_args) if reset_args else set() + + new_lines = [] + found_keys = set() + + patterns = {} + for k in list(set_dict.keys()) + list(reset_set): + patterns[k] = re.compile(rf'^\s*{re.escape(k)}\s*=') + + for line in lines: + matched = False + + # Check if line matches a key to be reset + for key in reset_set: + if patterns[key].match(line): + matched = True + break + + if matched: + continue + + # Check if line matches a key to be set + for key, value in set_dict.items(): + if patterns[key].match(line): + new_line = f"{key} = {value}\n" + new_lines.append(new_line) + found_keys.add(key) + matched = True + break + + if matched: + continue + + new_lines.append(line) + + if set_dict: + for key, value in set_dict.items(): + if key not in found_keys: + if new_lines and not new_lines[-1].endswith('\n'): + new_lines[-1] += '\n' + new_lines.append(f"{key} = {value}\n") + + with open(file_path, 'w') as file: + file.writelines(new_lines) + + for key in reset_set: + print(f"Removed '{key}' from '{file_path}'") + for key, value in set_dict.items(): + print(f"Updated '{file_path}' with {key} = {value}") + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Edit a Hyprland config file.") + parser.add_argument("--file", default="~/.config/hypr/hyprland.conf", help="Path to the Hyprland config file (default: ~/.config/hypr/hyprland.conf).") + + parser.add_argument("--set", nargs=2, action="append", metavar=("KEY", "VALUE"), help="Set a configuration key to a value.") + parser.add_argument("--reset", action="append", metavar="KEY", help="Remove a configuration key.") + + args = parser.parse_args() + + file_path = os.path.expanduser(args.file) + + raw_set_args = args.set or [] + reset_args = args.reset or [] + + set_args = [] + for key, value in raw_set_args: + if value == "[[EMPTY]]": + reset_args.append(key) + else: + set_args.append((key, value)) + + if not set_args and not reset_args: + print("Error: Must specify at least one key to set or reset.") + else: + edit_hyprland_config(file_path, set_args, reset_args) + \ No newline at end of file diff --git a/dots/.config/quickshell/ii/services/HyprlandConfig.qml b/dots/.config/quickshell/ii/services/HyprlandConfig.qml new file mode 100644 index 000000000..50cbe9d9b --- /dev/null +++ b/dots/.config/quickshell/ii/services/HyprlandConfig.qml @@ -0,0 +1,51 @@ +pragma Singleton +pragma ComponentBehavior: Bound + +import QtQuick +import Quickshell +import Quickshell.Io + +import qs.modules.common +import qs.modules.common.functions + +/** + * Configs Hyprland + */ +Singleton { + id: root + + readonly property string configuratorScriptPath: Quickshell.shellPath("scripts/hyprland/hyprconfigurator.py") + readonly property string shellOverridesPath: FileUtils.trimFileProtocol(`${Directories.config}/hypr/hyprland/shellOverrides/main.conf`) + + function set(key: string, value: var) { + Quickshell.execDetached(["bash", "-c", // + `${root.configuratorScriptPath} --file ${root.shellOverridesPath} --set "${key}" "${value}"` // + ]) + } + + function setMany(entries: var) { + let args = "" + for (let key in entries) { + args += `--set "${key}" "${entries[key]}" ` + } + Quickshell.execDetached(["bash", "-c", // + `${root.configuratorScriptPath} --file ${root.shellOverridesPath} ${args}` // + ]) + } + + function reset(key: string) { + Quickshell.execDetached(["bash", "-c", // + `${root.configuratorScriptPath} --file ${root.shellOverridesPath} --reset "${key}"` // + ]) + } + + function resetMany(keys: var) { + let args = "" + for (let i = 0; i < keys.length; i++) { + args += `--reset "${keys[i]}" ` + } + Quickshell.execDetached(["bash", "-c", // + `${root.configuratorScriptPath} --file ${root.shellOverridesPath} ${args}` // + ]) + } +} diff --git a/dots/.config/quickshell/ii/services/SessionWarnings.qml b/dots/.config/quickshell/ii/services/SessionWarnings.qml index c698d28c7..5a9e796a3 100644 --- a/dots/.config/quickshell/ii/services/SessionWarnings.qml +++ b/dots/.config/quickshell/ii/services/SessionWarnings.qml @@ -23,7 +23,7 @@ Singleton { Process { id: detectPackageManagerProc - command: ["bash", "-c", "pidof pacman yay paru dnf zypper apt apx xbps snap apk yum epsi pikman"] + command: ["bash", "-c", "pidof yay paru dnf zypper apt apx xbps snap apk yum epsi pikman || ls /var/lib/pacman/db.lck"] onExited: (exitCode, exitStatus) => { root.packageManagerRunning = (exitCode === 0); }