Skip to content

feat: add power menu#24

Merged
andreashgk merged 8 commits intoandreashgk:mainfrom
bricked-contrib:feat/add-power-menu
Sep 5, 2025
Merged

feat: add power menu#24
andreashgk merged 8 commits intoandreashgk:mainfrom
bricked-contrib:feat/add-power-menu

Conversation

@brckd
Copy link
Contributor

@brckd brckd commented Jul 10, 2025

Adds a power menu with configurable entries. Repurposes the previous power button. Lets you reboot and power off by default. Other options are not available by default because they have dependencies like systemctl or uwsm.

The entries are configurable via the settings.json or similarily in Nix:

{
  "powerMenuEntries": [
    {
      "label": "Restart",
      "command": "reboot",
      "confirmation": "Are you sure you want to restart the computer?"
    },
    {
      "label": "Power Off",
      "command": "shutdown now",
      "confirmation":"Are you sure you want to power off the computer?"
    }
  ]
}
image

Here's also a list of useful commands when configuring these entries:

command usecase
systemctl suspend Suspend using SystemD
systemctl reboot Restart using SystemD
systemctl reboot --firmware-setup Restart to UEFI using SystemD
systemctl poweroff Power off using SystemD
uwsm stop Log out using UWSM
hyprctl dispatch exit Log out of Hyprland without UWSM

@andreashgk
Copy link
Owner

Thank you for the PRs! I am currently on vacation and don't have my PC with me, so I won't be able to test this for a week or two. Sorry for the delay.

@brckd
Copy link
Contributor Author

brckd commented Jul 12, 2025

Thank you for the PRs! I am currently on vacation and don't have my PC with me, so I won't be able to test this for a week or two. Sorry for the delay.

I'm on vacation as well, so no pressure. I just use my fork in the meantime.

Copy link
Owner

@andreashgk andreashgk left a comment

Choose a reason for hiding this comment

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

Great work! The code looks good, I just have some minor style nits.

@brckd
Copy link
Contributor Author

brckd commented Jul 31, 2025

Thanks for the review! I'll look at it when I'm home in a week.

Co-authored-by: AndreasHGK <36563463+AndreasHGK@users.noreply.github.com>
@brckd
Copy link
Contributor Author

brckd commented Aug 11, 2025

I noticed some weird layout bugs when trying this on my laptop. I'll take a deeper look at them tomorrow.

@brckd
Copy link
Contributor Author

brckd commented Aug 20, 2025

I noticed some weird layout bugs when trying this on my laptop. I'll take a deeper look at them tomorrow.

That bug was unrelated and I opened #26 for it.

@brckd brckd force-pushed the feat/add-power-menu branch from bb7dfa3 to fa3090b Compare August 20, 2025 16:58
@brckd
Copy link
Contributor Author

brckd commented Aug 20, 2025

The biome configuration doesn't work with the latest version of biome, so I hope manually formatting it worked.

@andreashgk
Copy link
Owner

Looks like mithril-shell.nix is also formatted incorrectly according to the CI

@andreashgk
Copy link
Owner

Hi, any update on this? I can't format the file in this PR as I don't have push permission I believe

@brckd
Copy link
Contributor Author

brckd commented Sep 3, 2025

Sorry for the delay. I hope this fixes it!

@andreashgk
Copy link
Owner

Thank you!

@andreashgk andreashgk merged commit fb2f05b into andreashgk:main Sep 5, 2025
1 check passed
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