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

swaybar: allow null status_command #2791

Merged
merged 3 commits into from
Oct 8, 2018

Conversation

RyanDwyer
Copy link
Member

Sway sets a default status_command which runs date every second. This patch removes this behaviour so the user can have a NULL status bar if desired.

I had to swap swaybar's event_loop_poll and wl_display_flush so that it would map the initial surface.

@ddevault
Copy link
Contributor

ddevault commented Oct 8, 2018

Can you add the old default status command to the default config?

config.in Show resolved Hide resolved
@ianyfan
Copy link
Contributor

ianyfan commented Oct 8, 2018

Maybe you should add a check in status_line_init for a NULL cmd?

@RyanDwyer
Copy link
Member Author

status_line_init is not called if the status command is NULL.

sway/swaybar/bar.c

Lines 499 to 501 in 89f4ebe

if (bar->config->status_command) {
bar->status = status_line_init(bar->config->status_command);
}

@emersion
Copy link
Member

emersion commented Oct 8, 2018

There should be a way to change status_command to be NULL in the config. Maybe status_command -?

@RyanDwyer
Copy link
Member Author

You can remove or comment the directive.

@emersion
Copy link
Member

emersion commented Oct 8, 2018

I mean, there should be a way to change it via swaymsg. This is related to #2790

Sway sets a default status_command which runs date every second. This
patch removes this behaviour so the user can have a NULL status bar if
desired.

I had to swap swaybar's event_loop_poll and wl_display_flush so that it
would map the initial surface.
@RyanDwyer
Copy link
Member Author

Done. Note that I found and fixed a bug in cmd_bar which prevented the anytime commands from being run at runtime.

@ddevault ddevault merged commit 6cb0e58 into swaywm:master Oct 8, 2018
@ddevault
Copy link
Contributor

ddevault commented Oct 8, 2018

Thanks!

@RyanDwyer RyanDwyer deleted the status-command-optional branch October 8, 2018 12:43
emersion added a commit to emersion/sway that referenced this pull request Oct 8, 2018
Same as swaywm#2791 but for swaybg.

Fixes swaywm#2790
@ianyfan
Copy link
Contributor

ianyfan commented Oct 8, 2018

I found and fixed a bug in cmd_bar which prevented the anytime commands from being run at runtime.

I think this was actually right before. It's just that the array names bar_handlers and bar_config_handlers seem to be the wrong way round for what they denote.

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

Successfully merging this pull request may close these issues.

4 participants