diff --git a/config.c b/config.c index 932b788c..75b20aad 100644 --- a/config.c +++ b/config.c @@ -32,6 +32,7 @@ #include "tag.h" #include "draw.h" #include "util.h" +#include "statusbar.h" #include "layouts/tile.h" #include "layouts/spiral.h" #include "layouts/floating.h" @@ -100,7 +101,6 @@ static const NameFuncLink KeyfuncList[] = { {"viewprevtags", uicb_viewprevtags}, /* layout.c */ {"setlayout", uicb_setlayout}, - {"togglebar", uicb_togglebar}, {"focusnext", uicb_focusnext}, {"focusprev", uicb_focusprev}, {"togglemax", uicb_togglemax}, @@ -113,6 +113,8 @@ static const NameFuncLink KeyfuncList[] = { {"setncols", uicb_setncols}, /* awesome.c */ {"quit", uicb_quit}, + /* statusbar.c */ + {"togglebar", uicb_togglebar}, {NULL, NULL} }; diff --git a/layout.c b/layout.c index 1cc18390..89fc22cf 100644 --- a/layout.c +++ b/layout.c @@ -191,20 +191,6 @@ uicb_setlayout(Display *disp, awesomeconf->tag_layouts[j] = awesomeconf->current_layout; } -void -uicb_togglebar(Display *disp, - DC *drawcontext, - awesome_config *awesomeconf, - const char *arg __attribute__ ((unused))) -{ - if(awesomeconf->statusbar.position == BarOff) - awesomeconf->statusbar.position = (awesomeconf->statusbar.position == BarOff) ? BarTop : awesomeconf->statusbar_default_position; - else - awesomeconf->statusbar.position = BarOff; - updatebarpos(disp, awesomeconf->statusbar); - arrange(disp, drawcontext, awesomeconf); -} - static void maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomeconf) { diff --git a/layout.h b/layout.h index f98b4517..095c9c8e 100644 --- a/layout.h +++ b/layout.h @@ -34,7 +34,6 @@ void restack(Display *, DC *, awesome_config *); /* restores z layers of void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */ void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */ void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */ -void uicb_togglebar(Display *, DC *, awesome_config *, const char *); /* shows/hides the bar */ void uicb_togglemax(Display *, DC *, awesome_config *, const char *); /* toggles maximization of floating client */ void uicb_toggleverticalmax(Display *, DC *, awesome_config *, const char *); void uicb_togglehorizontalmax(Display *, DC *, awesome_config *, const char *); diff --git a/statusbar.c b/statusbar.c index 8e500311..f5a40fa4 100644 --- a/statusbar.c +++ b/statusbar.c @@ -112,3 +112,18 @@ updatebarpos(Display *disp, Statusbar statusbar) XSync(disp, False); while(XCheckMaskEvent(disp, EnterWindowMask, &ev)); } + +void +uicb_togglebar(Display *disp, + DC *drawcontext, + awesome_config *awesomeconf, + const char *arg __attribute__ ((unused))) +{ + if(awesomeconf->statusbar.position == BarOff) + awesomeconf->statusbar.position = (awesomeconf->statusbar.position == BarOff) ? BarTop : awesomeconf->statusbar_default_position; + else + awesomeconf->statusbar.position = BarOff; + updatebarpos(disp, awesomeconf->statusbar); + arrange(disp, drawcontext, awesomeconf); +} + diff --git a/statusbar.h b/statusbar.h index 5cd46910..ae41e2a0 100644 --- a/statusbar.h +++ b/statusbar.h @@ -26,5 +26,6 @@ void drawstatusbar(Display *, DC *, awesome_config *); void updatebarpos(Display *, Statusbar); +void uicb_togglebar(Display *, DC *, awesome_config *, const char *); #endif