2007-10-03 17:26:14 +02:00
|
|
|
/*
|
2007-10-17 10:53:32 +02:00
|
|
|
* statusbar.c - statusbar functions
|
2007-10-03 17:26:14 +02:00
|
|
|
*
|
|
|
|
* Copyright © 2007 Julien Danjou <julien@danjou.info>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2007-09-15 15:16:53 +02:00
|
|
|
*/
|
|
|
|
|
2007-09-24 17:08:47 +02:00
|
|
|
#include <stdio.h>
|
2007-11-11 18:59:11 +01:00
|
|
|
#include <math.h>
|
2007-09-24 17:08:47 +02:00
|
|
|
|
2007-09-15 15:16:53 +02:00
|
|
|
#include "layout.h"
|
|
|
|
#include "statusbar.h"
|
|
|
|
#include "draw.h"
|
2007-09-15 15:26:51 +02:00
|
|
|
#include "screen.h"
|
|
|
|
#include "util.h"
|
2007-12-14 14:29:32 +01:00
|
|
|
#include "tag.h"
|
2007-09-24 17:08:47 +02:00
|
|
|
#include "layouts/tile.h"
|
2007-09-15 15:16:53 +02:00
|
|
|
|
2007-09-16 16:58:44 +02:00
|
|
|
/** Check if at least a client is tagged with tag number t and is on screen
|
|
|
|
* screen
|
2007-09-15 15:16:53 +02:00
|
|
|
* \param t tag number
|
2007-09-16 16:58:44 +02:00
|
|
|
* \param screen screen number
|
2007-09-15 15:16:53 +02:00
|
|
|
* \return True or False
|
|
|
|
*/
|
|
|
|
static Bool
|
2007-12-14 14:29:32 +01:00
|
|
|
isoccupied(TagClientLink *tc, int screen, Client *head, Tag *t)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
|
|
|
Client *c;
|
|
|
|
|
2007-12-11 20:56:51 +01:00
|
|
|
for(c = head; c; c = c->next)
|
2007-12-14 14:29:32 +01:00
|
|
|
if(c->screen == screen && is_client_tagged(tc, c, t))
|
2007-09-15 15:16:53 +02:00
|
|
|
return True;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_draw(awesome_config *awesomeconf, int screen)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-12-14 19:02:38 +01:00
|
|
|
int z, x = 0, y = 0, w;
|
2007-12-14 21:51:54 +01:00
|
|
|
Client *sel = awesomeconf->focus->client;
|
2007-11-11 22:27:00 +01:00
|
|
|
Drawable drawable;
|
2007-12-11 20:56:51 +01:00
|
|
|
int phys_screen = get_phys_screen(awesomeconf->display, screen);
|
2007-12-14 19:02:38 +01:00
|
|
|
Tag *tag;
|
2007-11-11 22:27:00 +01:00
|
|
|
|
2007-11-11 23:23:38 +01:00
|
|
|
/* don't waste our time */
|
2007-12-11 20:56:51 +01:00
|
|
|
if(awesomeconf->screens[screen].statusbar.position == BarOff)
|
2007-11-11 23:23:38 +01:00
|
|
|
return;
|
|
|
|
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable = XCreatePixmap(awesomeconf->display,
|
2007-12-11 20:56:51 +01:00
|
|
|
RootWindow(awesomeconf->display, phys_screen),
|
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
DefaultDepth(awesomeconf->display, phys_screen));
|
2007-09-24 17:08:47 +02:00
|
|
|
|
2007-12-14 19:02:38 +01:00
|
|
|
for(tag = awesomeconf->screens[screen].tags; tag; tag = tag->next)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-12-14 19:02:38 +01:00
|
|
|
w = textwidth(awesomeconf->display, awesomeconf->screens[screen].font, tag->name);
|
|
|
|
if(tag->selected)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
2007-10-10 19:59:14 +02:00
|
|
|
x, y, w,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
2007-12-14 19:02:38 +01:00
|
|
|
tag->name, awesomeconf->screens[screen].colors_selected);
|
|
|
|
if(isoccupied(awesomeconf->screens[screen].tclink, screen, awesomeconf->clients, tag))
|
2007-12-11 20:56:51 +01:00
|
|
|
drawrectangle(awesomeconf->display, phys_screen,
|
2007-10-11 15:44:30 +02:00
|
|
|
x, y,
|
2007-12-11 20:56:51 +01:00
|
|
|
(awesomeconf->screens[screen].font->height + 2) / 4,
|
|
|
|
(awesomeconf->screens[screen].font->height + 2) / 4,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-12-14 19:02:38 +01:00
|
|
|
sel && is_client_tagged(awesomeconf->screens[screen].tclink, sel, tag),
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].colors_selected[ColFG]);
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
2007-10-10 19:59:14 +02:00
|
|
|
x, y, w,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
2007-12-14 19:02:38 +01:00
|
|
|
tag->name, awesomeconf->screens[screen].colors_normal);
|
|
|
|
if(isoccupied(awesomeconf->screens[screen].tclink, screen, awesomeconf->clients, tag))
|
2007-12-11 20:56:51 +01:00
|
|
|
drawrectangle(awesomeconf->display, phys_screen,
|
2007-10-11 15:44:30 +02:00
|
|
|
x, y,
|
2007-12-11 20:56:51 +01:00
|
|
|
(awesomeconf->screens[screen].font->height + 2) / 4,
|
|
|
|
(awesomeconf->screens[screen].font->height + 2) / 4,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-12-14 19:02:38 +01:00
|
|
|
sel && is_client_tagged(awesomeconf->screens[screen].tclink, sel, tag),
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].colors_normal[ColFG]);
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
2007-10-09 22:35:44 +02:00
|
|
|
x += w;
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
|
|
|
x, y, awesomeconf->screens[screen].statusbar.txtlayoutwidth,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
2007-12-14 02:27:10 +01:00
|
|
|
get_current_layout(awesomeconf->screens[screen])->symbol,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].colors_normal);
|
|
|
|
z = x + awesomeconf->screens[screen].statusbar.txtlayoutwidth;
|
|
|
|
w = textwidth(awesomeconf->display, awesomeconf->screens[screen].font, awesomeconf->screens[screen].statustext);
|
|
|
|
x = awesomeconf->screens[screen].statusbar.width - w;
|
2007-10-09 22:35:44 +02:00
|
|
|
if(x < z)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-10-09 22:35:44 +02:00
|
|
|
x = z;
|
2007-12-11 20:56:51 +01:00
|
|
|
w = awesomeconf->screens[screen].statusbar.width - z;
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
2007-10-10 19:59:14 +02:00
|
|
|
x, y, w,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
|
|
|
awesomeconf->screens[screen].statustext, awesomeconf->screens[screen].colors_normal);
|
|
|
|
if((w = x - z) > awesomeconf->screens[screen].statusbar.height)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-10-09 22:35:44 +02:00
|
|
|
x = z;
|
2007-12-11 20:56:51 +01:00
|
|
|
if(sel && sel->screen == screen)
|
2007-09-15 15:16:53 +02:00
|
|
|
{
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
2007-10-10 19:59:14 +02:00
|
|
|
x, y, w,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
|
|
|
sel->name, awesomeconf->screens[screen].colors_selected);
|
2007-10-26 23:19:13 +02:00
|
|
|
if(sel->isfloating)
|
2007-12-11 20:56:51 +01:00
|
|
|
drawcircle(awesomeconf->display, phys_screen,
|
2007-10-11 17:06:55 +02:00
|
|
|
x, y,
|
2007-12-11 20:56:51 +01:00
|
|
|
(awesomeconf->screens[screen].font->height + 2) / 4,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-10-26 23:19:13 +02:00
|
|
|
sel->ismax,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].colors_selected[ColFG]);
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
|
|
|
else
|
2007-12-11 20:56:51 +01:00
|
|
|
drawtext(awesomeconf->display, phys_screen,
|
2007-10-10 19:59:14 +02:00
|
|
|
x, y, w,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
2007-11-11 22:27:00 +01:00
|
|
|
drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.width,
|
|
|
|
awesomeconf->screens[screen].statusbar.height,
|
|
|
|
awesomeconf->screens[screen].font,
|
|
|
|
NULL, awesomeconf->screens[screen].colors_normal);
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
2007-12-11 20:56:51 +01:00
|
|
|
if(awesomeconf->screens[screen].statusbar.position == BarRight
|
|
|
|
|| awesomeconf->screens[screen].statusbar.position == BarLeft)
|
2007-11-11 18:59:11 +01:00
|
|
|
{
|
2007-11-11 22:27:00 +01:00
|
|
|
Drawable d;
|
2007-12-11 20:56:51 +01:00
|
|
|
if(awesomeconf->screens[screen].statusbar.position == BarRight)
|
|
|
|
d = draw_rotate(awesomeconf->display, phys_screen, drawable,
|
|
|
|
awesomeconf->screens[screen].statusbar.width, awesomeconf->screens[screen].statusbar.height,
|
|
|
|
M_PI_2, awesomeconf->screens[screen].statusbar.height, 0);
|
2007-11-11 19:49:42 +01:00
|
|
|
else
|
2007-12-11 20:56:51 +01:00
|
|
|
d = draw_rotate(awesomeconf->display, phys_screen, drawable,
|
|
|
|
awesomeconf->screens[screen].statusbar.width, awesomeconf->screens[screen].statusbar.height,
|
|
|
|
- M_PI_2, 0, awesomeconf->screens[screen].statusbar.width);
|
2007-11-11 22:27:00 +01:00
|
|
|
XCopyArea(awesomeconf->display, d,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.window,
|
|
|
|
DefaultGC(awesomeconf->display, phys_screen), 0, 0,
|
|
|
|
awesomeconf->screens[screen].statusbar.height, awesomeconf->screens[screen].statusbar.width, 0, 0);
|
2007-11-11 22:27:00 +01:00
|
|
|
XFreePixmap(awesomeconf->display, d);
|
2007-11-11 18:59:11 +01:00
|
|
|
}
|
|
|
|
else
|
2007-11-11 22:27:00 +01:00
|
|
|
XCopyArea(awesomeconf->display, drawable,
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.window,
|
|
|
|
DefaultGC(awesomeconf->display, phys_screen), 0, 0,
|
|
|
|
awesomeconf->screens[screen].statusbar.width, awesomeconf->screens[screen].statusbar.height, 0, 0);
|
2007-11-11 22:27:00 +01:00
|
|
|
XFreePixmap(awesomeconf->display, drawable);
|
2007-10-15 18:19:33 +02:00
|
|
|
XSync(awesomeconf->display, False);
|
2007-09-15 15:16:53 +02:00
|
|
|
}
|
2007-09-15 15:26:51 +02:00
|
|
|
|
2007-09-15 22:25:49 +02:00
|
|
|
void
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_init(Display *disp, int screen, Statusbar *statusbar,
|
|
|
|
Cursor cursor, XftFont *font, Layout *layouts, Padding *padding)
|
2007-09-15 22:25:49 +02:00
|
|
|
{
|
2007-12-14 17:57:05 +01:00
|
|
|
Layout *l;
|
2007-09-15 22:25:49 +02:00
|
|
|
XSetWindowAttributes wa;
|
2007-12-14 17:57:05 +01:00
|
|
|
int phys_screen = get_phys_screen(disp, screen);
|
2007-11-27 23:03:55 +01:00
|
|
|
ScreenInfo *si = get_screen_info(disp, screen, NULL, padding);
|
2007-09-15 22:25:49 +02:00
|
|
|
|
2007-10-16 01:20:03 +02:00
|
|
|
statusbar->height = font->height * 1.5;
|
2007-11-11 18:59:11 +01:00
|
|
|
|
|
|
|
if(statusbar->position == BarRight || statusbar->position == BarLeft)
|
|
|
|
statusbar->width = si[screen].height;
|
|
|
|
else
|
|
|
|
statusbar->width = si[screen].width;
|
|
|
|
|
2007-10-11 19:29:34 +02:00
|
|
|
p_delete(&si);
|
2007-09-27 21:22:35 +02:00
|
|
|
|
2007-10-15 12:06:43 +02:00
|
|
|
statusbar->screen = screen;
|
|
|
|
|
2007-09-15 22:25:49 +02:00
|
|
|
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
|
|
|
|
| EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
|
2007-10-10 13:29:46 +02:00
|
|
|
wa.cursor = cursor;
|
2007-09-15 22:25:49 +02:00
|
|
|
wa.override_redirect = 1;
|
|
|
|
wa.background_pixmap = ParentRelative;
|
|
|
|
wa.event_mask = ButtonPressMask | ExposureMask;
|
2007-11-11 18:59:11 +01:00
|
|
|
if(statusbar->dposition == BarRight || statusbar->dposition == BarLeft)
|
|
|
|
statusbar->window = XCreateWindow(disp, RootWindow(disp, phys_screen), 0, 0,
|
|
|
|
statusbar->height,
|
|
|
|
statusbar->width,
|
|
|
|
0, DefaultDepth(disp, phys_screen), CopyFromParent,
|
|
|
|
DefaultVisual(disp, phys_screen),
|
|
|
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
|
|
|
|
else
|
|
|
|
statusbar->window = XCreateWindow(disp, RootWindow(disp, phys_screen), 0, 0,
|
|
|
|
statusbar->width,
|
|
|
|
statusbar->height,
|
|
|
|
0, DefaultDepth(disp, phys_screen), CopyFromParent,
|
|
|
|
DefaultVisual(disp, phys_screen),
|
|
|
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
|
2007-10-10 13:29:46 +02:00
|
|
|
XDefineCursor(disp, statusbar->window, cursor);
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_update_position(disp, *statusbar, padding);
|
2007-09-15 22:25:49 +02:00
|
|
|
XMapRaised(disp, statusbar->window);
|
2007-10-15 12:06:43 +02:00
|
|
|
|
2007-12-14 17:57:05 +01:00
|
|
|
for(l = layouts ; l; l = l->next)
|
2007-10-15 12:06:43 +02:00
|
|
|
statusbar->txtlayoutwidth = MAX(statusbar->txtlayoutwidth,
|
2007-12-14 17:57:05 +01:00
|
|
|
(textwidth(disp, font, l->symbol)));
|
2007-09-15 22:25:49 +02:00
|
|
|
}
|
2007-09-15 15:26:51 +02:00
|
|
|
|
|
|
|
void
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_update_position(Display *disp, Statusbar statusbar, Padding *padding)
|
2007-09-15 15:26:51 +02:00
|
|
|
{
|
|
|
|
XEvent ev;
|
2007-11-27 23:03:55 +01:00
|
|
|
ScreenInfo *si = get_screen_info(disp, statusbar.screen, NULL, padding);
|
2007-09-15 15:26:51 +02:00
|
|
|
|
2007-11-11 22:47:56 +01:00
|
|
|
XMapRaised(disp, statusbar.window);
|
2007-09-15 15:26:51 +02:00
|
|
|
switch (statusbar.position)
|
|
|
|
{
|
|
|
|
default:
|
2007-09-27 21:22:35 +02:00
|
|
|
XMoveWindow(disp, statusbar.window, si[statusbar.screen].x_org, si[statusbar.screen].y_org);
|
2007-09-15 15:26:51 +02:00
|
|
|
break;
|
2007-11-11 18:59:11 +01:00
|
|
|
case BarRight:
|
2007-11-11 21:13:37 +01:00
|
|
|
XMoveWindow(disp, statusbar.window, si[statusbar.screen].x_org + (si[statusbar.screen].width - statusbar.height), si[statusbar.screen].y_org);
|
2007-11-11 18:59:11 +01:00
|
|
|
break;
|
2007-09-15 15:26:51 +02:00
|
|
|
case BarBot:
|
2007-09-27 21:22:35 +02:00
|
|
|
XMoveWindow(disp, statusbar.window, si[statusbar.screen].x_org, si[statusbar.screen].height - statusbar.height);
|
2007-09-15 15:26:51 +02:00
|
|
|
break;
|
|
|
|
case BarOff:
|
2007-11-11 22:47:56 +01:00
|
|
|
XUnmapWindow(disp, statusbar.window);
|
2007-09-15 15:26:51 +02:00
|
|
|
break;
|
|
|
|
}
|
2007-10-11 23:44:35 +02:00
|
|
|
p_delete(&si);
|
2007-09-15 15:26:51 +02:00
|
|
|
XSync(disp, False);
|
|
|
|
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
|
|
|
|
}
|
2007-09-15 15:34:28 +02:00
|
|
|
|
2007-12-14 15:52:52 +01:00
|
|
|
int
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_get_position_from_str(const char * pos)
|
2007-12-14 15:52:52 +01:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2007-09-15 15:34:28 +02:00
|
|
|
void
|
2007-12-14 15:52:52 +01:00
|
|
|
uicb_statusbar_toggle(awesome_config *awesomeconf,
|
2007-12-11 20:56:51 +01:00
|
|
|
int screen,
|
2007-09-15 15:34:28 +02:00
|
|
|
const char *arg __attribute__ ((unused)))
|
|
|
|
{
|
2007-12-11 20:56:51 +01:00
|
|
|
if(awesomeconf->screens[screen].statusbar.position == BarOff)
|
|
|
|
awesomeconf->screens[screen].statusbar.position = (awesomeconf->screens[screen].statusbar.dposition == BarOff) ? BarTop : awesomeconf->screens[screen].statusbar.dposition;
|
2007-09-15 15:34:28 +02:00
|
|
|
else
|
2007-12-11 20:56:51 +01:00
|
|
|
awesomeconf->screens[screen].statusbar.position = BarOff;
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_update_position(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
|
2007-12-11 20:56:51 +01:00
|
|
|
arrange(awesomeconf, screen);
|
2007-09-15 15:34:28 +02:00
|
|
|
}
|
|
|
|
|
2007-12-14 15:52:52 +01:00
|
|
|
void
|
|
|
|
uicb_statusbar_set_position(awesome_config *awesomeconf,
|
|
|
|
int screen,
|
|
|
|
const char *arg)
|
|
|
|
{
|
|
|
|
awesomeconf->screens[screen].statusbar.dposition =
|
|
|
|
awesomeconf->screens[screen].statusbar.position =
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_get_position_from_str(arg);
|
|
|
|
statusbar_update_position(awesomeconf->display, awesomeconf->screens[screen].statusbar, &awesomeconf->screens[screen].padding);
|
2007-12-14 15:52:52 +01:00
|
|
|
}
|
2007-10-12 17:10:36 +02:00
|
|
|
|
|
|
|
void
|
2007-12-14 15:52:52 +01:00
|
|
|
uicb_statusbar_set_text(awesome_config *awesomeconf, int screen, const char *arg)
|
2007-10-12 17:10:36 +02:00
|
|
|
{
|
|
|
|
if(!arg)
|
|
|
|
return;
|
2007-12-11 20:56:51 +01:00
|
|
|
a_strncpy(awesomeconf->screens[screen].statustext,
|
|
|
|
sizeof(awesomeconf->screens[screen].statustext), arg, a_strlen(arg));
|
2007-10-12 17:10:36 +02:00
|
|
|
|
2007-12-14 20:10:52 +01:00
|
|
|
statusbar_draw(awesomeconf, screen);
|
2007-10-12 17:10:36 +02:00
|
|
|
}
|
2007-10-15 13:56:24 +02:00
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99
|