Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable swaynag after exiting Suspend #4554

Open
Khomyak-sibiryak opened this issue Sep 8, 2019 · 2 comments
Open

Disable swaynag after exiting Suspend #4554

Khomyak-sibiryak opened this issue Sep 8, 2019 · 2 comments

Comments

@Khomyak-sibiryak
Copy link

Khomyak-sibiryak commented Sep 8, 2019

I use this power button in my waybar. But after leaving Suspend Swaynag does not hide anywhere, it remains visible on the screen. It would be nice to be able to hide it after exiting Suspend.

What do you think about this?

swaymsg -t get_version
sway version 1.2-rc1-29-g1a8b9fda (Aug 28 2019, branch 'master')

Topic on reddit: https://old.reddit.com/r/swaywm/comments/d0uo7g/disable_swaynag_window_after_exiting_suspend/

@piu130
Copy link

piu130 commented Sep 17, 2019

You can do it this way:

swaynag -t warning -m 'Power Menu Options' -b ' Suspend' 'systemctl suspend; killall swaynag'

Not the best solution but it works.

@LordRishav
Copy link
Contributor

Sorry for digging up this old issue, but isn't that what the -Z flag is for? For example for my power menu I use:

swaynag -t warning -m 'Power Menu Options' -Z 'Logout' 'loginctl terminate-user $USER' -Z 'Suspend' 'swaymsg exec systemctl suspend' -Z 'Restart' 'systemctl reboot' -Z 'Shutdown' 'systemctl shutdown' -Z 'Exit Sway' 'swaymsg exit'

and it exits swaynag after performing an action.

Also in swaynag(1) man page:

       -Z, --button-dismiss-no-terminal <text> <action>
           Create a button with the text text that executes action when
           pressed, and dismisses swaynag. action will be run directly instead
           of in a terminal. Multiple buttons can be defined by providing the
           flag multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants