mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
execbar can now be used in the shell even when compiled with x11 support
This commit is contained in:
parent
41e46ffe41
commit
914af765e4
27
src/conky.c
27
src/conky.c
@ -3799,26 +3799,29 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
#endif
|
||||
OBJ(execbar) {
|
||||
double barnum;
|
||||
#ifndef X11
|
||||
int i;
|
||||
#endif
|
||||
|
||||
read_exec(obj->data.s, p, text_buffer_size);
|
||||
barnum = get_barnum(p);
|
||||
|
||||
if (barnum >= 0.0) {
|
||||
#ifdef X11
|
||||
barnum /= 100;
|
||||
new_bar(p, obj->a, obj->b, round_to_int(barnum * 255.0));
|
||||
#else
|
||||
barnum = round_to_int( ( barnum * obj->a ) / 100);
|
||||
for(i=0; i<barnum; i++) {
|
||||
*(p+i)='#';
|
||||
if(output_methods & TO_X) {
|
||||
barnum /= 100;
|
||||
new_bar(p, obj->a, obj->b, round_to_int(barnum * 255.0));
|
||||
}else{
|
||||
#endif
|
||||
if(!obj->a) obj->a = DEFAULT_BAR_WIDTH_NO_X;
|
||||
barnum = round_to_int( ( barnum * obj->a ) / 100);
|
||||
for(i=0; i<barnum; i++) {
|
||||
*(p+i)='#';
|
||||
}
|
||||
for(; i < obj->a; i++) {
|
||||
*(p+i)='_';
|
||||
}
|
||||
*(p+i)=0;
|
||||
#ifdef X11
|
||||
}
|
||||
for(; i < obj->a; i++) {
|
||||
*(p+i)='_';
|
||||
}
|
||||
*(p+i)=0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define DEFAULT_BAR_WIDTH_NO_X 10
|
||||
|
||||
#if !defined(__GNUC__)
|
||||
# define __attribute__(x) /* nothing */
|
||||
|
@ -42,12 +42,10 @@ struct special_t *specials = NULL;
|
||||
|
||||
unsigned int special_count;
|
||||
|
||||
#ifdef X11
|
||||
int default_bar_width = 0, default_bar_height = 6;
|
||||
#ifdef X11
|
||||
int default_graph_width = 0, default_graph_height = 25;
|
||||
int default_gauge_width = 50, default_gauge_height = 25;
|
||||
#else
|
||||
int default_bar_width = 10, default_bar_height = 1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user