mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-24 11:55:43 +00:00
on_bottom option added
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@78 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
8f5640a611
commit
5edfd58e18
11
AUTHORS
11
AUTHORS
@ -39,12 +39,22 @@ Gwenhael LE MOINE <cycojesus at yahoo dot fr>
|
||||
Hannu Saransaari <hipo at users dot sourceforge dot net>
|
||||
Main code
|
||||
|
||||
<<<<<<< AUTHORS
|
||||
<<<<<<< AUTHORS
|
||||
Jason Mitchell <jason.mitchell03 at saintleo dot edu>
|
||||
UTF8 fix
|
||||
Source clean up
|
||||
|
||||
=======
|
||||
=======
|
||||
j-rock - #otw on freenode
|
||||
small fix for XFT
|
||||
|
||||
>>>>>>> 1.4
|
||||
jack_mort - gentoo forums
|
||||
$tab patch
|
||||
|
||||
>>>>>>> 1.3
|
||||
Jarmo Hekkanen
|
||||
SETI stuff
|
||||
|
||||
@ -101,3 +111,4 @@ Walt Nelson <wnelsonjr at comcast dot net>
|
||||
William DiPlacido <bimbasaari at yahoo dot com>
|
||||
Frequency from /proc/cpuinfo
|
||||
Some other SETI stuff
|
||||
|
||||
|
12
conky.c
12
conky.c
@ -197,6 +197,9 @@ static unsigned int stuff_in_upper_case;
|
||||
static int text_alignment;
|
||||
static int gap_x, gap_y;
|
||||
|
||||
/* Always on bottom */
|
||||
static int on_bottom;
|
||||
|
||||
/* Update interval */
|
||||
static double update_interval;
|
||||
|
||||
@ -3566,6 +3569,7 @@ static enum alignment string_to_alignment(const char *s)
|
||||
static void set_default_configurations(void)
|
||||
{
|
||||
text_alignment = BOTTOM_LEFT;
|
||||
on_bottom = 1;
|
||||
fork_to_background = 0;
|
||||
border_margin = 3;
|
||||
border_width = 1;
|
||||
@ -3701,6 +3705,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, a) == 0)
|
||||
} else
|
||||
CONF_ERR;
|
||||
}
|
||||
CONF("on_bottom") {
|
||||
if(value)
|
||||
on_bottom = string_to_bool(value);
|
||||
else
|
||||
CONF_ERR;
|
||||
}
|
||||
CONF("background") {
|
||||
fork_to_background = string_to_bool(value);
|
||||
}
|
||||
@ -4234,7 +4244,7 @@ int main(int argc, char **argv)
|
||||
init_window
|
||||
(own_window,
|
||||
text_width
|
||||
+ border_margin * 2 + 1, text_height + border_margin * 2 + 1);
|
||||
+ border_margin * 2 + 1, text_height + border_margin * 2 + 1, on_bottom);
|
||||
|
||||
update_text_area(); /* to position text/window on screen */
|
||||
|
||||
|
2
conky.h
2
conky.h
@ -225,7 +225,7 @@ extern int workarea[4];
|
||||
extern struct conky_window window;
|
||||
|
||||
void init_X11();
|
||||
void init_window(int use_own_window, int width, int height);
|
||||
void init_window(int use_own_window, int width, int height, int on_bottom);
|
||||
void create_gc();
|
||||
void set_transparent_background(Window win);
|
||||
long get_x11_color(const char *);
|
||||
|
@ -167,11 +167,17 @@ void update_metar()
|
||||
if (!status) {
|
||||
status = 2;
|
||||
iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
|
||||
<<<<<<< metarinfo.c
|
||||
} else if (status == 2) { /* thread is still running. what else can we do? */
|
||||
return;
|
||||
} else { /* status must be 1 */
|
||||
=======
|
||||
} else if (status == 2) { /* thread is still running. let's kill it and start again */
|
||||
pthread_cancel(thread1);
|
||||
status = 2;
|
||||
iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
|
||||
} else { /* status must be 1 */
|
||||
>>>>>>> 1.9
|
||||
pthread_join(thread1, NULL);
|
||||
status = 2;
|
||||
iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);
|
||||
|
16
x11.c
16
x11.c
@ -160,7 +160,7 @@ void set_transparent_background(Window win)
|
||||
XClearWindow(display, win);
|
||||
}
|
||||
|
||||
void init_window(int own_window, int w, int h)
|
||||
void init_window(int own_window, int w, int h, int l)
|
||||
{
|
||||
/* There seems to be some problems with setting transparent background (on
|
||||
* fluxbox this time). It doesn't happen always and I don't know why it
|
||||
@ -172,8 +172,9 @@ void init_window(int own_window, int w, int h)
|
||||
XSetWindowAttributes attrs;
|
||||
XClassHint class_hints;
|
||||
|
||||
/* just test color */
|
||||
/* just test color
|
||||
attrs.background_pixel = get_x11_color("green");
|
||||
*/
|
||||
|
||||
window.window = XCreateWindow(display, RootWindow(display, screen), window.x, window.y, w, h, 0, CopyFromParent, /* depth */
|
||||
CopyFromParent, /* class */
|
||||
@ -216,6 +217,17 @@ void init_window(int own_window, int w, int h)
|
||||
(unsigned char *) &prop,
|
||||
1);
|
||||
}
|
||||
if(l) {
|
||||
/* make sure the layer is on the bottom */
|
||||
a = XInternAtom(display, "_WIN_LAYER", True);
|
||||
if (a != None) {
|
||||
long prop = 0;
|
||||
XChangeProperty(display, window.window, a,
|
||||
XA_CARDINAL, 32,
|
||||
PropModeReplace,
|
||||
(unsigned char *) &prop, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XMapWindow(display, window.window);
|
||||
|
Loading…
Reference in New Issue
Block a user