mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 20:44:56 +00:00
batt fixed? x11 stuff
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@552 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
4df5f91016
commit
4f5d0da56f
12
src/conky.c
12
src/conky.c
@ -4430,11 +4430,6 @@ static void main_loop()
|
|||||||
update_text();
|
update_text();
|
||||||
#ifdef X11
|
#ifdef X11
|
||||||
}
|
}
|
||||||
#ifdef OWN_WINDOW
|
|
||||||
if (own_window) {
|
|
||||||
set_transparent_background(window.window);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_to_update) {
|
if (need_to_update) {
|
||||||
@ -4449,9 +4444,9 @@ static void main_loop()
|
|||||||
if (own_window) {
|
if (own_window) {
|
||||||
/* resize window if it isn't right size */
|
/* resize window if it isn't right size */
|
||||||
if (!fixed_size &&
|
if (!fixed_size &&
|
||||||
(text_width + border_margin * 2 !=
|
(text_width + border_margin * 2 + 1 !=
|
||||||
window.width
|
window.width
|
||||||
|| text_height + border_margin * 2 !=
|
|| text_height + border_margin * 2 + 1 !=
|
||||||
window.height)) {
|
window.height)) {
|
||||||
window.width =
|
window.width =
|
||||||
text_width +
|
text_width +
|
||||||
@ -4463,6 +4458,9 @@ static void main_loop()
|
|||||||
window.window,
|
window.window,
|
||||||
window.width,
|
window.width,
|
||||||
window.height);
|
window.height);
|
||||||
|
if (own_window) {
|
||||||
|
set_transparent_background(window.window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move window if it isn't in right position */
|
/* move window if it isn't in right position */
|
||||||
|
@ -1087,7 +1087,6 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat)
|
|||||||
{
|
{
|
||||||
static int rep, rep2;
|
static int rep, rep2;
|
||||||
char acpi_path[128];
|
char acpi_path[128];
|
||||||
int design_capacity;
|
|
||||||
snprintf(acpi_path, 127, ACPI_BATTERY_BASE_PATH "/%s/state", bat);
|
snprintf(acpi_path, 127, ACPI_BATTERY_BASE_PATH "/%s/state", bat);
|
||||||
|
|
||||||
/* don't update battery too often */
|
/* don't update battery too often */
|
||||||
@ -1120,9 +1119,6 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat)
|
|||||||
char b[256];
|
char b[256];
|
||||||
if (fgets(b, 256, fp) == NULL)
|
if (fgets(b, 256, fp) == NULL)
|
||||||
break;
|
break;
|
||||||
if (sscanf(b, "design capacity: %d", &design_capacity) != 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (sscanf(b, "last full capacity: %d", &acpi_last_full) != 0) {
|
if (sscanf(b, "last full capacity: %d", &acpi_last_full) != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1187,7 +1183,7 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat)
|
|||||||
/* thanks to Lukas Zapletal <lzap@seznam.cz> */
|
/* thanks to Lukas Zapletal <lzap@seznam.cz> */
|
||||||
else if (strcmp(charging_state, "charged") == 0) {
|
else if (strcmp(charging_state, "charged") == 0) {
|
||||||
if (acpi_last_full != 0 && remaining_capacity != acpi_last_full) {
|
if (acpi_last_full != 0 && remaining_capacity != acpi_last_full) {
|
||||||
sprintf(last_battery_str, "charged %d%%", remaining_capacity * 100 / design_capacity);
|
sprintf(last_battery_str, "charged 100%");
|
||||||
} else {
|
} else {
|
||||||
strcpy(last_battery_str, "charged");
|
strcpy(last_battery_str, "charged");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user