diff --git a/src/config.c b/src/config.c index 82e1b56..12a67a5 100644 --- a/src/config.c +++ b/src/config.c @@ -182,8 +182,8 @@ conf_misc_section(void) void conf_bar_section(void) { - struct conf_sec *bar, **mouse, *selbar; - char *barbg; + struct conf_sec *bar, **mouse, *selbar, *systray; + char *barbg, sc = screen_count(); bar = fetch_section_first(NULL, "bar"); @@ -202,6 +202,20 @@ conf_bar_section(void) free(mouse); + if((systray = fetch_section_first(bar, "systray"))) + { + conf.systray.active = fetch_opt_first(systray, "true", "active").bool; + + if((conf.systray.screen = fetch_opt_first(systray, "0", "screen").num) < 0 + || conf.systray.screen >= sc) + conf.systray.screen = 0; + + if((conf.systray.spacing = fetch_opt_first(systray, "3", "spacing").num) < 0) + conf.systray.spacing = 0; + } + else + conf.systray.active = False; + selbar = fetch_section_first(bar, "selbar"); conf.bars.selbar = selbar ? True : False; @@ -719,26 +733,6 @@ conf_keybind_section(void) return; } -void -conf_systray_section(void) -{ - struct conf_sec *systray; - int sc = screen_count(); - - systray = fetch_section_first(NULL, "systray"); - - conf.systray.active = fetch_opt_first(systray, "true", "active").bool; - - if((conf.systray.screen = fetch_opt_first(systray, "0", "screen").num) < 0 - || conf.systray.screen >= sc) - conf.systray.screen = 0; - - if((conf.systray.spacing = fetch_opt_first(systray, "3", "spacing").num) < 0) - conf.systray.spacing = 0; - - return; -} - /** Configuration initialization */ void @@ -767,7 +761,6 @@ init_conf(void) conf_menu_section(); conf_launcher_section(); conf_keybind_section(); - conf_systray_section(); print_unused(NULL); diff --git a/src/systray.c b/src/systray.c index acc6b70..8492361 100644 --- a/src/systray.c +++ b/src/systray.c @@ -216,7 +216,6 @@ systray_find(Window win) if(!conf.systray.active) return NULL; - for(i = trayicons; i; i = i->next) if(i->win == win) return i; diff --git a/wmfsrc.in b/wmfsrc.in index 8b83d72..b58ee46 100644 --- a/wmfsrc.in +++ b/wmfsrc.in @@ -20,6 +20,17 @@ border = true # selbar = false #not worked now, see section [selbar] + [systray] + # Enable/disable systray + active = true + + # Screen of systray + screen = 0 + + # Spacing between tray icons + spacing = 3 + [/systray] + # Remove this section to disable the selbar. [selbar] bg = "#191919" @@ -35,17 +46,6 @@ [/bar] -[systray] - # Enable/disable systray - active = true - - # Screen of systray - screen = 0 - - # Spacing between tray icons - spacing = 3 -[/systray] - [layouts] fg = "#191919" bg = "#7E89A2"