Skip to content

fix(noctalia): restore v4 settings via v5 TOML config schema - #1991

Merged
shunkakinoki merged 1 commit into
mainfrom
breezy-humming-lake
Jul 5, 2026
Merged

fix(noctalia): restore v4 settings via v5 TOML config schema#1991
shunkakinoki merged 1 commit into
mainfrom
breezy-humming-lake

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restores legacy v4 noctalia-shell settings (bar layout, Dracula theme, idle timeouts, dconf dark-mode hook, notifications, OSD, dock) using the v5 TOML config schema
  • Maps v4 widget layout to v5 bar.main.start/center/end string arrays with split system monitor widgets
  • Adds hooks.theme_mode_changed using $NOCTALIA_THEME_MODE env var (replaces v4 $1 arg)

Test plan

  • Rebuild matic/viper on-device and verify noctalia config validate passes
  • Confirm bar widget layout matches prior v4 arrangement
  • Verify Dracula theme applies and dark/light auto-switching triggers the dconf hook
  • Check idle lock at 300s timeout works

🤖 Generated with Claude Code


Summary by cubic

Restores v4 noctalia shell behavior in v5 by porting settings to the TOML schema, keeping the prior bar layout, Dracula theme, idle lock, notifications, OSD, dock, and dark-mode hook. Ensures noctalia config validate passes while matching the v4 experience.

  • Bug Fixes
    • Mapped v4 bar widgets to v5 bar.main.start/center/end (with split system monitor widgets).
    • Added hooks.theme_mode_changed using $NOCTALIA_THEME_MODE to update GNOME dconf on theme switches.
    • Set theme to builtin Dracula with auto mode; enabled notifications (top-right, 0.75 opacity), OSD right, dock, and desktop widgets.
    • Configured idle lock at 300s with noctalia:session lock, lockscreen with fingerprint; disabled wallpaper; enabled location.auto_locate.
    • Applied shell defaults (font, clipboard, animations) and ensured system monitor is enabled.

Written for commit ee546c0. Summary will update on new commits.

Review in cubic

@indent-zero

indent-zero Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Re-populates programs.noctalia.settings with the user's full pre-v5 noctalia configuration (bar layout, Dracula theme, clock format, notification/OSD/lockscreen/idle/dock/desktop_widgets settings, and a theme_mode_changed hook that mirrors the theme into GNOME via dconf write) expressed in v5 TOML snake_case keys. This walks back the earlier "minimal, schema-verified only" stance so the shell matches the v4 look without going through the settings UI on-device.

  • Expands shell.* with animation.{enabled, speed} on top of the existing font/clipboard keys
  • Adds theme = { mode = "auto"; source = "builtin"; builtin = "Dracula"; }
  • Adds bar.main with transparent background/capsule and full start/center/end widget lists
  • Adds widget.clock format, vertical_format, tooltip_format overrides
  • Adds notification, osd.position, lockscreen, idle.behavior.lock, system.monitor, dock, and desktop_widgets.enabled sections
  • Adds a hooks.theme_mode_changed shell script that toggles GNOME color-scheme/gtk-theme/icon-theme via dconf write
  • Removes the previous comment block explaining why the config was intentionally minimal

Issues

4 potential issues found:

  • osd.position = "right" is not a valid v5 OSD position — the accepted values (documented in example.toml and enforced by branch-matching in src/shell/osd/osd_overlay.cpp) are top_right | top_left | top_center | bottom_right | bottom_left | bottom_center | center_left | center_right. The schema stores position as a free-form string so validate passes, but at runtime no branch matches and OSD silently falls back to default margins instead of the intended right-edge placement. → Autofix
  • shell.animation.speed = 3 is within the v5 range [0.1, 4.0] but the field is a multiplier (default 1.0, docs say "0.5 = 2× slower, 2.0 = 2× faster"), so 3 produces ~3× faster animations. If this was copied over from a v4 "speed slider" index, the intent is almost certainly 1.0/1 (default) or a smaller number rather than 3. → Autofix
  • dock.launcher_icon = "nix-snowflake" has no visible effect: dock.launcher_position is left at its default "none", and src/shell/dock/dock_items.cpp only constructs the launcher area for Start | End. Even with launcher_position set, launcher_icon expects a Tabler glyph name (e.g. grid-dots) and nix-snowflake is not one, so it would fall back to a placeholder. → Autofix
  • Bar layout references five widget IDs that v5 does not know: memory (should be ram), gpu (needs an explicit [widget.gpu] with type = "sysmon" + stat = "gpu_usage"), notification_history (should be notifications), dark_mode (bar equivalent is theme_modedark_mode is a control-center shortcut, not a bar widget), and control_center (bar widget id is control-center with a hyphen; underscore form is only the config section). noctalia config validate does not check the start/center/end arrays, so the build passes but WidgetFactory logs unknown widget "…" and drops each one, leaving visible gaps in the bar. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@shunkakinoki
shunkakinoki merged commit bed9b23 into main Jul 5, 2026
8 of 27 checks passed
@shunkakinoki
shunkakinoki deleted the breezy-humming-lake branch July 5, 2026 17:05
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c83152df-a8df-4fab-b046-653aaca6c2ca

📥 Commits

Reviewing files that changed from the base of the PR and between 7eea293 and ee546c0.

📒 Files selected for processing (1)
  • config/noctalia/default.nix

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Expanded Noctalia’s default setup with a fuller desktop experience, including updated theme, bar layout, clock display, notifications, lockscreen, idle locking, system monitor, dock, and desktop widgets.
    • Added automatic theme sync so the desktop appearance updates with the selected theme mode.
    • Wallpaper is now disabled by default in favor of the new visual configuration.

Walkthrough

The programs.noctalia.settings block in config/noctalia/default.nix is expanded from a minimal configuration into a comprehensive runtime configuration, adding shell animation, Dracula theme, bar/widget layout, clock formats, notifications/OSD, lockscreen, idle lock behavior, system monitor, dock/desktop widgets, wallpaper disable, and a GNOME theme-mode-change hook script.

Changes

Noctalia settings expansion

Layer / File(s) Summary
Shell animation and theme
config/noctalia/default.nix
Adds animation sub-block to shell settings and a theme block selecting the builtin Dracula theme, replacing the prior minimal shell settings.
Bar layout and clock widget
config/noctalia/default.nix
Configures bar.main opacity/capsule styling and start/center/end widget composition, plus widget.clock format/vertical_format/tooltip_format.
Notifications, OSD, and lockscreen
config/noctalia/default.nix
Enables/configures the notification daemon and OSD position, and enables lockscreen with fingerprint support.
Idle lock, system monitor, dock/desktop
config/noctalia/default.nix
Configures idle.behavior.lock (enabled, timeout, command), enables system.monitor, enables dock with launcher_icon, enables desktop_widgets, disables wallpaper, and sets location.auto_locate.
Theme mode change hook
config/noctalia/default.nix
Adds hooks.theme_mode_changed script that toggles GNOME dconf color-scheme/gtk-theme/icon-theme based on NOCTALIA_THEME_MODE.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: bug

Poem

A rabbit hops through config trees so tall,
Dracula theme now cloaks it all,
Clocks tick, docks show, notifications glow,
Idle timers lock when I'm slow to go,
With one hook script, themes shift with grace —
Hoppy dreams in a dark-mode space! 🐰🌙

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch breezy-humming-lake

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request expands the Noctalia configuration in Nix by adding comprehensive settings for shell animations, themes, status bar widgets, notifications, lockscreen, idle behaviors, system monitor, dock, and a theme change hook. The review feedback suggests using the absolute path to the dconf binary (${pkgs.dconf}/bin/dconf) in the theme_mode_changed hook to ensure hermeticity and prevent runtime failures if dconf is not present in the user's PATH.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +150 to +160
hooks.theme_mode_changed = ''
if [ "$NOCTALIA_THEME_MODE" = "dark" ]; then
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita-dark'"
dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'"
else
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-light'"
dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'"
dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'"
fi
'';

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.

medium

To ensure hermeticity and prevent runtime failures (e.g., if dconf is not present in the user's PATH when the hook is executed by the daemon), use the absolute path to the dconf binary from pkgs.dconf.

      hooks.theme_mode_changed = ''
        if [ "$NOCTALIA_THEME_MODE" = "dark" ]; then
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita-dark'"
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'"
        else
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/color-scheme "'prefer-light'"
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'"
          ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'"
        fi
      '';

capsule_opacity = 0.0;
start = [ "launcher" "clock" "cpu" "memory" "network_rx" "network_tx" "gpu" "active_window" "media" ];
center = [ "workspaces" ];
end = [ "tray" "bluetooth" "network" "notification_history" "battery" "power_profile" "volume" "brightness" "dark_mode" "control_center" ];

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.

Five widget IDs here are not recognized by the v5 widget factory (src/shell/bar/widget_factory.cpp at noctalia-shell rev 10b2007): memory, gpu, notification_history, dark_mode, control_center. They are neither seeded in src/config/widget_config.cpp:seedBuiltinWidgets nor registered as type == "…" branches in the factory, so each falls through to kLog.warn("widget factory: unknown widget …") (line 692) and is silently dropped.

noctalia config validate only walks [widget.<name>] tables (config_validate.cpp:314) — bar start/center/end are typed as bare std::vector<std::string>, so the build never catches this and the failure only shows up as missing widgets at runtime.

Suggested fixes:

  • memoryram (seeded as sysmon / ram_used).
  • gpu → add e.g. widget.gpu = { type = "sysmon"; stat = "gpu_usage"; }; then reference "gpu". Options: gpu_temp, gpu_usage, gpu_vram.
  • notification_historynotifications.
  • dark_modetheme_mode for the bar (use dark_mode only as a control_center.shortcuts type).
  • control_centercontrol-center (hyphen).

background_opacity = 0.75;
};

osd.position = "right";

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.

"right" is not a valid OSD position in v5. src/shell/osd/osd_overlay.cpp (and example.toml) accept only top_right | top_left | top_center | bottom_right | bottom_left | bottom_center | center_left | center_right. The schema stores position as a bare string (config_schema.cpp:62), so noctalia config validate won't flag it — but at runtime "right" matches no branch and margins fall back to defaults.

Use "center_right" for right-edge centered, or "top_right" / "bottom_right".

Suggested change
osd.position = "right";
osd.position = "center_right";


dock = {
enabled = true;
launcher_icon = "nix-snowflake";

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.

This line does nothing as-is. dock.launcher_position defaults to "none" (example.toml line 340), and src/shell/dock/dock_items.cpp only builds the launcher area when position is Start | End. On top of that, launcher_icon expects a Tabler glyph name ("grid-dots" in the example) — nix-snowflake is not in the bundled Tabler set, so even after enabling the launcher position it would fall back.

Either drop launcher_icon, or add dock.launcher_position = "start"; (or "end") and change the icon to a valid Tabler glyph.

clipboard_auto_paste = "auto";
animation = {
enabled = true;
speed = 3;

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.

shell.animation.speed in v5 is a multiplier (schema range [0.1, 4.0] in src/config/schema/ranges.h:18, default 1.0; example.toml: # 0.5 = 2× slower, 2.0 = 2× faster). 3 runs animations ~3× faster than default, which is likely unintended if this was ported from a v4 stepped-slider value. Consider 1.0 (default) or 1.5.

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.

1 participant