Skip to content

Add ability to show and hide buttons - #99

Open
denqxotl wants to merge 5 commits into
noctalia-dev:mainfrom
denqxotl:add_configurable_buttons
Open

Add ability to show and hide buttons#99
denqxotl wants to merge 5 commits into
noctalia-dev:mainfrom
denqxotl:add_configurable_buttons

Conversation

@denqxotl

@denqxotl denqxotl commented Aug 22, 2026

Copy link
Copy Markdown

Summary

Added configurable visibility for the session selector, theme selector, and individual power buttons.

Motivation

Allows users to simplify the greeter UI and hide controls they do not need, while preserving existing defaults and session selection priority.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

None.

Testing

  • meson compile -C build
  • git diff --check
  • meson test -C build reports that no tests are defined.
  • Manual greetd login testing was performed.

Manual Coverage

  • Tested under greetd (real login flow)
  • Tested with just run / just run-local (dev compositor)
  • Tested with multiple monitors
  • Tested appearance sync from Noctalia Shell (Sync Now)
  • Tested on NixOS (programs.noctalia-greeter)
  • Tested with a pinned [output].name
  • Tested with custom [output].layout / [output].transforms

Screenshots / Videos

2026-08-22-233202_hyprshot

Checklist

  • This PR is ready for review
  • I read and followed the relevant guidance in AGENTS.md and README.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation in noctalia-docs after merge, or this PR does not change user-facing configuration or behavior.
  • I used the existing canonical names for config keys, paths, and identifiers.

Additional Notes

New configuration options are located under [appearence]:

[appearance]
hide_session_selector = true
hide_scheme_selector = true
hide_shutdown_button = true
hide_reboot_button = true
hide_firmware_button = true

@denqxotl

Copy link
Copy Markdown
Author

@Ly-sec may I asks for a review, please?

@iwasironman iwasironman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am new to contributing to open source but have been a dev for a long time. There are some changes I would like to see in this project so I am trying to contribute. Since a review was asked for by a maintainer, here is a review that might help the maintainers. I don't know what the community's process is for these things so i am just jumping in. Tell me if I should be doing this differently. Thanks

  1. Two config keys for the same setting. The PR adds both session.show_selector and ui.show_session_selector, both parsed, both written back, with ui.* silently winning:

greeter_preferences.cpp — sessionShowSelector is applied, then uiShowSessionSelector overwrites it four lines later. Undocumented precedence.

And the docs disagree with each other about which one is real:

  • README.md → only documents ui.show_session_selector
  • nix/nixos-module.nix example → only shows session.show_selector = false
  • examples/greeter.toml → ships both, both set to true

Neither key has shipped yet, so there's no compat argument. Drop session.show_selector entirely, keep [ui], fix the nix example.

  1. Unrelated behavior change bundled in

layoutPowerButtons and rebuildFocusRing now gate on power::hasSyncedAction(...). That is not part of "show/hide buttons" — it's a fix for a real pre-existing bug: applySyncedPowerButton sets visibility at construction (greeter_surface.cpp:562), but main's layoutPowerButtons calls btn->setVisible(true) unconditionally on every layout, re-showing buttons that sync said to hide. So the fix is correct and welcome — it just needs to be its own commit and mentioned in the description, because it changes behavior for anyone using synced power actions.

Related: the compound condition m_showShutdownButton && power::hasSyncedAction("shutdown") is now duplicated in two places (layout + focus ring), and a third variant lives in the ctor. The PR already introduced showsSessionSelector() / showsThemeSelector() accessors — do the same for showsShutdownButton() / showsRebootButton() / showsFirmwareButton() instead of repeating the expression. Drift risk otherwise.

  1. [ui] is silently accepted and then destroyed in sync.toml

parseSync delegates to parseConfig (greeter_config_io.cpp:691), so adding "ui" to isKnownTopLevelKey means a [ui] table in sync.toml parses with no warning, is ignored, and gets erased on the next sync write. Low severity, but silent key deletion is unfriendly — either warn on [ui] in sync.toml or say plainly in the docs it's greeter.toml-only.

  1. Naming / placement

Existing config uses appearance.hide_logo — negative, and under [appearance]. The PR uses show_* under a brand-new [ui]. Now visibility toggles live in two sections with opposite polarity. Not fatal, but worth a maintainer decision now rather than after release.

@denqxotl

denqxotl commented Aug 24, 2026

Copy link
Copy Markdown
Author

@iwasironman you comment definitely makes sense. I'll fix those, thanks!

@Ly-sec

Ly-sec commented Aug 30, 2026

Copy link
Copy Markdown
Member

Sadly I totally missed this PR I'm very sorry. I did merge #103 so you will have to fix the conflicts. I do agree with @iwasironman there are some things that need to be solved first before I'd be willing to merge it @denqxotl

@denqxotl
denqxotl force-pushed the add_configurable_buttons branch from d604b02 to bdbdaa3 Compare August 31, 2026 14:23
@denqxotl

Copy link
Copy Markdown
Author

@Ly-sec would u mind to take a look if I haven't forgotten anything, please?

@denqxotl
denqxotl requested a review from iwasironman August 31, 2026 14:38
@Ly-sec

Ly-sec commented Sep 2, 2026

Copy link
Copy Markdown
Member

Thanks, this is close @denqxotl ! A few things remain before merging:

  • just format-check currently fails.
  • Keep the hidden scheme selector out of the keyboard focus ring.
  • Prefer hide_scheme_selector (or existing scheme_selector_position = "hidden") over hide_theme_selector.
  • Restore “Sync + UI mutable” in the docs and update the stale PR description ([ui]/[appearence]).
  • Mention the bundled synced-power visibility fix.

The build and Nix checks otherwise pass.

@denqxotl

denqxotl commented Sep 2, 2026

Copy link
Copy Markdown
Author

@Ly-sec resolved

@denqxotl
denqxotl force-pushed the add_configurable_buttons branch from 6f0d803 to bf0fcd0 Compare September 2, 2026 09:44
@Ly-sec

Ly-sec commented Sep 2, 2026

Copy link
Copy Markdown
Member

One last round @denqxotl :) the implementation looks ready. The remaining work is documentation really.

1. Restore the sync.toml ownership wording

The login UI writes the last selected session and scheme to sync.toml, so it must
continue to be described as Sync + UI mutable.

Update these files in the PR:

  • README.md
  • docs/user/configuration.md
  • examples/greeter.toml

Use this sentence in the TOML examples:

# Mutable Sync/UI data lives in sync.toml (lower priority when both set).

Use this wording in the README paragraph:

`settings` writes `/var/lib/noctalia-greeter/greeter.toml` (full declarative config,
including appearance/palette when you set them). Sync + UI mutable data lives in
`sync.toml` (not managed by Nix).

Also remove the accidental extra leading space before Sync/UI mutable data in the
nix/nixos-module.nix option description.

2. Keep the new greeter.toml keys documented

The following keys belong only in declarative greeter.toml; they are not read from
or written to sync.toml:

[appearance]
hide_session_selector = false
hide_scheme_selector = false
hide_shutdown_button = false
hide_reboot_button = false
hide_firmware_button = false

Omitted values default to false. Keep the rows already added to
docs/user/configuration.md and the entries in examples/greeter.toml.

@denqxotl
denqxotl force-pushed the add_configurable_buttons branch from bf0fcd0 to 809344d Compare September 6, 2026 07:36
@denqxotl

denqxotl commented Sep 6, 2026

Copy link
Copy Markdown
Author

@Ly-sec I hope it's done

@denqxotl
denqxotl force-pushed the add_configurable_buttons branch from 809344d to ecff1a4 Compare September 6, 2026 16:44
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.

3 participants