Skip to content

Add ability to show and hide buttons - #99

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

Add ability to show and hide buttons#99
denqxotl wants to merge 2 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 [ui]:

[ui]
show_session_selector = false
show_theme_selector = false
show_shutdown_button = false
show_reboot_button = false
show_firmware_button = false
All options default to true when omitted. Power button visibility remains additionally dependent on system and Sync availability.

@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

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