1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 11:05:18 +00:00

execbar can now be used in the shell even when compiled with x11 support

This commit is contained in:
Nikolas Garofil 2009-05-17 13:38:51 +02:00
parent 41e46ffe41
commit 914af765e4
3 changed files with 17 additions and 15 deletions

View File

@ -3799,18 +3799,19 @@ static void generate_text_internal(char *p, int p_max_size,
#endif #endif
OBJ(execbar) { OBJ(execbar) {
double barnum; double barnum;
#ifndef X11
int i; int i;
#endif
read_exec(obj->data.s, p, text_buffer_size); read_exec(obj->data.s, p, text_buffer_size);
barnum = get_barnum(p); barnum = get_barnum(p);
if (barnum >= 0.0) { if (barnum >= 0.0) {
#ifdef X11 #ifdef X11
if(output_methods & TO_X) {
barnum /= 100; barnum /= 100;
new_bar(p, obj->a, obj->b, round_to_int(barnum * 255.0)); new_bar(p, obj->a, obj->b, round_to_int(barnum * 255.0));
#else }else{
#endif
if(!obj->a) obj->a = DEFAULT_BAR_WIDTH_NO_X;
barnum = round_to_int( ( barnum * obj->a ) / 100); barnum = round_to_int( ( barnum * obj->a ) / 100);
for(i=0; i<barnum; i++) { for(i=0; i<barnum; i++) {
*(p+i)='#'; *(p+i)='#';
@ -3819,6 +3820,8 @@ static void generate_text_internal(char *p, int p_max_size,
*(p+i)='_'; *(p+i)='_';
} }
*(p+i)=0; *(p+i)=0;
#ifdef X11
}
#endif #endif
} }
} }

View File

@ -43,6 +43,7 @@
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
#define DEFAULT_BAR_WIDTH_NO_X 10
#if !defined(__GNUC__) #if !defined(__GNUC__)
# define __attribute__(x) /* nothing */ # define __attribute__(x) /* nothing */

View File

@ -42,12 +42,10 @@ struct special_t *specials = NULL;
unsigned int special_count; unsigned int special_count;
#ifdef X11
int default_bar_width = 0, default_bar_height = 6; int default_bar_width = 0, default_bar_height = 6;
#ifdef X11
int default_graph_width = 0, default_graph_height = 25; int default_graph_width = 0, default_graph_height = 25;
int default_gauge_width = 50, default_gauge_height = 25; int default_gauge_width = 50, default_gauge_height = 25;
#else
int default_bar_width = 10, default_bar_height = 1;
#endif #endif
/* /*