Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
5.99k stars 673 forks source link

[feature] power management button #202

Open piu130 opened 5 years ago

piu130 commented 5 years ago

Cool project :) Would be nice to have a power management button.

On click the button would change to more buttons like  power off,  suspend,  back, etc. (like clock button changes from time to date).

On click any of this buttons the corresponding action is be executed systemctl poweroff, systemctl suspend, etc.

hoellen commented 5 years ago

As an additional idea, there could be an option to hide the idle_inhibitor module in the power management module. It is a very useful module, but I don't use it that often.

dlasky commented 5 years ago

in the interim this is what i've been using:

"custom/power":{ "format":"", "on-click":"swaynag -t warning -m 'Power Menu Options' -b 'Logout' 'swaymsg exit' -b 'Suspend' 'swaymsg exec systemctl suspend' -b 'shutdown' 'systemctl shutdown'" },

updated to reflect some feedback from this post: https://old.reddit.com/r/swaywm/comments/d0uo7g/disable_swaynag_window_after_exiting_suspend/

Arnaudv6 commented 4 years ago

I see an opportunity to have something more generic: a button that when clicked gets replaced by multiple buttons (in a vertical menu?). This way, user can customize power-off command (we don't hardcode the logic for systemd or else)

This gets even better if buttons and their actions can be generated by a script: we then get easy-to-build wifi-managers, clipboard-managers, application-launchers-menus (and powerbuttons). I know I'm not entitled to a gift-wish-list to santa though...

Arnaudv6 commented 4 years ago

keyboard layout also* #66 ... and I just saw #676 : is it what you're building, @Alexays?

chron-isch commented 3 years ago

You can easily do those things yourself, either use wlogout and

    "custom/wlogout": {
        "format": "",
        "interval": "once",
        "on-click": "wlogout -c 5 -r 5 -p layer-shell",
    }

or simply use wofi in dmenu mode and create a small script.

ignamartinoli commented 2 years ago

It would be cool if added

criptixo commented 9 months ago

A much needed module that should be fairly easy to implement.

TNTRedstone commented 8 months ago

@chron-isch just wandering I tried adding that to my config and nothing shows, I added white text color and all. here is my dot files: https://github.com/TNTRedstone/waybar-dots

Syndelis commented 4 months ago

As of #2574, group drawers have been implemented and one of the demos on my video available on that PR is a power management menu. Although it works by mouse hover rather than clicking, I believe it resolves this issue without the need of implementing a new module.

What do y'all think?

CC: @Alexays