Skip to content

source single startup file instead of inlining Hyprland config or lua file - #80

Open
notcandy001 wants to merge 4 commits into
Brainitech:devfrom
notcandy001:main
Open

notcandy001 wants to merge 4 commits into
Brainitech:devfrom
notcandy001:main

Conversation

@notcandy001

Copy link
Copy Markdown
Contributor

Overview

Replaces the inline exec-once (hyprland.conf) / hl.on (hyprland.lua) block that
the installer appended into the user's Hyprland config with a single-line
injection instead.

  • Startup commands now live in dots-extra/templates/startup.conf.tpl /
    startup.lua.tpl. The installer renders these (substituting the detected
    keyboard layout) to ~/.config/hypr/brain-shell-startup.conf / .lua,
    and injects just one line into the user's own config:
    • source = $HOME/.config/hypr/brain-shell-startup.conf
    • dofile(os.getenv("HOME") .. "/.config/hypr/brain-shell-startup.lua")
  • The injected line is wrapped in >>>/<<< markers so re-running the
    installer finds and replaces it instead of duplicating it on reinstall.
  • Also detects and strips the old fully-inlined block from pre-existing
    installs, so upgrading from an older Brain Shell leaves a clean config.
  • Added keyboard layout auto-detection (localectl, falling back to the
    live hyprctl device list when run inside an active Hyprland session),
    baked into the generated startup file's input block.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (causes existing functionality to not work as expected)

Testing Checklist

  • I have tested these changes locally and on a fresh VM install.
  • I have tested the QML UI on my primary resolution.
  • (If applicable) I have tested UI changes on secondary monitors or different resolutions.
  • (If applicable) I have verified my bash scripts run cleanly without syntax errors.

Related Issues

(link the issue/discussion this addresses, if any)

@Brainitech Brainitech left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Everything Looks good, but I suggest you retain the comments removed in install-arch.sh

@notcandy001

Copy link
Copy Markdown
Contributor Author

done 👍🏽

@notcandy001
notcandy001 requested a review from Brainitech August 27, 2026 17:12
Comment on lines +8 to +11
input {
kb_layout = __KB_LAYOUT__
kb_variant = __KB_VARIANT__
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
input {
kb_layout = __KB_LAYOUT__
kb_variant = __KB_VARIANT__
}

We don't want to touch the keyboard layout yet. It will mess with users config if it exists.

Comment on lines +9 to +10
hl.exec_cmd("hyprctl keyword input:kb_layout __KB_LAYOUT__")
hl.exec_cmd("hyprctl keyword input:kb_variant __KB_VARIANT__")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
hl.exec_cmd("hyprctl keyword input:kb_layout __KB_LAYOUT__")
hl.exec_cmd("hyprctl keyword input:kb_variant __KB_VARIANT__")

Same thing with the lua template

Comment on lines +320 to +321
STARTUP_CONF="$HOME/.config/hypr/brain-shell-startup.conf"
STARTUP_LUA="$HOME/.config/hypr/brain-shell-startup.lua"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
STARTUP_CONF="$HOME/.config/hypr/brain-shell-startup.conf"
STARTUP_LUA="$HOME/.config/hypr/brain-shell-startup.lua"
STARTUP_CONF="$HOME/.config/Brain_Shell/brain-shell-startup.conf"
STARTUP_LUA="$HOME/.config/Brain_Shell/brain-shell-startup.lua"

We'll keep the startup files in the Brain_Shell dir so the hypr file is touched as less as possible.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Same thing with the newly added Keyboard Layout.
Also I notice that you're using sed to clear the previous lines.
I suggest that you rather restore the hyprland.conf/lua backup file this file makes.

DM or comment here if you want to clarify any doubts.

@Brainitech Brainitech left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I've Suggested some changes and improvements. Do look into it and lmk what you'll do. Feel free to correct me if I made a mistake anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants