rename statusbar uicb and add uicb_statusbar_set_position
This commit is contained in:
parent
14809f80e4
commit
84bb954004
|
@ -151,7 +151,7 @@ keys
|
|||
{
|
||||
modkey = {"Mod4"}
|
||||
key = "b"
|
||||
command = "togglebar"
|
||||
command = "statusbar_toggle"
|
||||
}
|
||||
key
|
||||
{
|
||||
|
|
17
config.c
17
config.c
|
@ -463,20 +463,9 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
awesomeconf->screens[screen].colors_selected[ColFG] = initxcolor(awesomeconf->display, get_phys_screen(awesomeconf->display, screen), cfg_getstr(cfg_colors, "focus_fg"));
|
||||
|
||||
/* Statusbar */
|
||||
tmp = cfg_getstr(cfg_statusbar, "position");
|
||||
|
||||
if(tmp && !a_strncmp(tmp, "off", 6))
|
||||
awesomeconf->screens[screen].statusbar.dposition = BarOff;
|
||||
else if(tmp && !a_strncmp(tmp, "bottom", 6))
|
||||
awesomeconf->screens[screen].statusbar.dposition = BarBot;
|
||||
else if(tmp && !a_strncmp(tmp, "right", 5))
|
||||
awesomeconf->screens[screen].statusbar.dposition = BarRight;
|
||||
else if(tmp && !a_strncmp(tmp, "left", 4))
|
||||
awesomeconf->screens[screen].statusbar.dposition = BarLeft;
|
||||
else
|
||||
awesomeconf->screens[screen].statusbar.dposition = BarTop;
|
||||
|
||||
awesomeconf->screens[screen].statusbar.position = awesomeconf->screens[screen].statusbar.dposition;
|
||||
awesomeconf->screens[screen].statusbar.position =
|
||||
awesomeconf->screens[screen].statusbar.dposition =
|
||||
get_statusbar_position_from_str(cfg_getstr(cfg_statusbar, "position"));
|
||||
|
||||
/* Layouts */
|
||||
awesomeconf->screens[screen].nlayouts = cfg_size(cfg_layouts, "layout");
|
||||
|
|
28
statusbar.c
28
statusbar.c
|
@ -276,8 +276,22 @@ updatebarpos(Display *disp, Statusbar statusbar, Padding *padding)
|
|||
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
|
||||
}
|
||||
|
||||
int
|
||||
get_statusbar_position_from_str(const char * pos)
|
||||
{
|
||||
if(!a_strncmp(pos, "off", 3))
|
||||
return BarOff;
|
||||
else if(!a_strncmp(pos, "bottom", 6))
|
||||
return BarBot;
|
||||
else if(!a_strncmp(pos, "right", 5))
|
||||
return BarRight;
|
||||
else if(!a_strncmp(pos, "left", 4))
|
||||
return BarLeft;
|
||||
return BarTop;
|
||||
}
|
||||
|
||||
void
|
||||
uicb_togglebar(awesome_config *awesomeconf,
|
||||
uicb_statusbar_toggle(awesome_config *awesomeconf,
|
||||
int screen,
|
||||
const char *arg __attribute__ ((unused)))
|
||||
{
|
||||
|
@ -289,9 +303,19 @@ uicb_togglebar(awesome_config *awesomeconf,
|
|||
arrange(awesomeconf, screen);
|
||||
}
|
||||
|
||||
void
|
||||
uicb_statusbar_set_position(awesome_config *awesomeconf,
|
||||
int screen,
|
||||
const char *arg)
|
||||
{
|
||||
awesomeconf->screens[screen].statusbar.dposition =
|
||||
awesomeconf->screens[screen].statusbar.position =
|
||||
get_statusbar_position_from_str(arg);
|
||||
updatebarpos(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
|
||||
}
|
||||
|
||||
void
|
||||
uicb_setstatustext(awesome_config *awesomeconf, int screen, const char *arg)
|
||||
uicb_statusbar_set_text(awesome_config *awesomeconf, int screen, const char *arg)
|
||||
{
|
||||
if(!arg)
|
||||
return;
|
||||
|
|
|
@ -26,10 +26,12 @@
|
|||
|
||||
void initstatusbar(Display *, int, Statusbar *, Cursor, XftFont *, Layout *, int, Padding *);
|
||||
void drawstatusbar(awesome_config *, int);
|
||||
int get_statusbar_position_from_str(const char *);
|
||||
void updatebarpos(Display *, Statusbar, Padding *);
|
||||
|
||||
UICB_PROTO(uicb_togglebar);
|
||||
UICB_PROTO(uicb_setstatustext);
|
||||
UICB_PROTO(uicb_statusbar_toggle);
|
||||
UICB_PROTO(uicb_statusbar_set_position);
|
||||
UICB_PROTO(uicb_statusbar_set_text);
|
||||
|
||||
#endif
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99
|
||||
|
|
6
uicb.c
6
uicb.c
|
@ -67,9 +67,9 @@ const NameFuncLink UicbList[] = {
|
|||
/* awesome.c */
|
||||
{"quit", uicb_quit},
|
||||
/* statusbar.c */
|
||||
{"togglebar", uicb_togglebar},
|
||||
/* config.c */
|
||||
{"setstatustext", uicb_setstatustext},
|
||||
{"statusbar_toggle", uicb_statusbar_toggle},
|
||||
{"statusbar_set_position", uicb_statusbar_set_position},
|
||||
{"statusbar_set_text", uicb_statusbar_set_text},
|
||||
/* mouse.c */
|
||||
{"client_movemouse", uicb_client_movemouse},
|
||||
{"client_resizemouse", uicb_client_resizemouse},
|
||||
|
|
Loading…
Reference in New Issue