nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
233 stars 25 forks source link

feature: power options #111

Closed Serpentian closed 6 months ago

Serpentian commented 6 months ago

It would be great, if we had a way to configure power options, similar way it's done in kde's plasma drawer:

image

nwg-piotr commented 6 months ago

Since we don't use a configuration file, the visibility of each button would depend on passing the appropriate command as an argument, e.g.:

nwg-drawer -sleep 'systemctl suspend' -reboot 'systemctl reboot' -poweroff 'systemctl poweroff'

right?

Serpentian commented 6 months ago

Since we don't use a configuration file, the visibility of each button would depend on passing the appropriate command as an argument

Sounds great, I'm ok with such solution

nwg-piotr commented 6 months ago

I will try to add this feature soon.

nwg-piotr commented 6 months ago

They would look something like this (w/ all the power menu commands):

image

❯ go run . -h
Usage of /tmp/go-build946922029/b001/exe/nwg-drawer:
(...)
  -pbexit string
        command for the Exit power bar icon
  -pblock string
        command for the Lock power bar icon
  -pbpoweroff string
        command for the Poweroff power bar icon
  -pbreboot string
        command for the Reboot power bar icon
  -pbsize int
        power bar icon size (default 64)
  -pbsleep string
        command for the sleep power bar icon
(...)
nwg-piotr commented 6 months ago

Improved icons:

image

Serpentian commented 6 months ago

Thank you a lot, this was super fast!

nwg-piotr commented 6 months ago

Thank you for a good idea.