$tab thing, thanks jack_mort
authorBrenden Matthews <brenden1@rty.ca>
Sun, 31 Jul 2005 08:27:03 +0000 (08:27 +0000)
committerBrenden Matthews <brenden1@rty.ca>
Sun, 31 Jul 2005 08:27:03 +0000 (08:27 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@35 7f574dfc-610e-0410-a909-a81674777703

AUTHORS
ChangeLog
README
conky.c
conkyrc.sample
x11.c

diff --git a/AUTHORS b/AUTHORS
index deae7e7..4dc6738 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -39,6 +39,9 @@ Gwenhael LE MOINE <cycojesus at yahoo dot fr>
 Hannu Saransaari <hipo at users dot sourceforge dot net>
   Main code
 
+jack_mort - gentoo forums
+  $tab patch
+
 Jarmo Hekkanen
   SETI stuff
 
index b97659b..8799bd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        $downspeedgraph, and $upspeedgraph
        * added override_utf8_locale option
        * poop
+       * $tab patch from jack_mort on f.g.o
 
 2005-07-28
        * Added new graphing code, such as $cpugraph
diff --git a/README b/README
index 2068c7f..fb5750f 100644 (file)
--- a/README
+++ b/README
   swapmax                           Total amount of swap                     
   swapperc                          Percentage of swap in use                
   sysname                           System name, Linux for example           
+  tab               pixels          Move text over by N pixels
   tail              logfile, lines (interval)
                                     Displays last N lines of supplied text
                                     text file.  If interval is not supplied,
diff --git a/conky.c b/conky.c
index de26c67..f22dad6 100644 (file)
--- a/conky.c
+++ b/conky.c
@@ -216,6 +216,7 @@ enum {
        ALIGNR,
        ALIGNC,
        GRAPH,
+       TAB,
 };
 
 static struct special_t {
@@ -384,6 +385,11 @@ static inline void new_outline(char *buf, long c)
        new_special(buf, OUTLINE)->arg = c;
 }
 
+static inline void new_tab(char *buf, long c)
+{
+       new_special(buf, TAB)->arg = c;
+}
+
 static inline void new_alignr(char *buf, long c)
 {
        new_special(buf, ALIGNR)->arg = c;
@@ -483,6 +489,7 @@ enum text_object_type {
        OBJ_fs_used,
        OBJ_fs_used_perc,
        OBJ_hr,
+       OBJ_tab,
        OBJ_alignr,
        OBJ_alignc,
        OBJ_i2c,
@@ -850,6 +857,7 @@ static void construct_text_object(const char *s, const char *arg)
                 arg = "/";
        obj->data.fs = prepare_fs_stat(arg);
        END OBJ(hr, 0) obj->data.i = arg ? atoi(arg) : 1;
+       END OBJ(tab, 0) obj->data.i = arg ? atoi(arg) : 1;
        END OBJ(i2c, INFO_I2C) char buf1[64], buf2[64];
        int n;
 
@@ -1671,7 +1679,10 @@ static void generate_text()
                        OBJ(hr) {
                                new_hr(p, obj->data.i);
                        }
-                       OBJ(i2c) {
+                        OBJ(tab) {
+                               new_tab(p, obj->data.i);
+                       }
+                        OBJ(i2c) {
                                double r;
 
                                r = get_i2c_info(&obj->data.i2c.fd,
@@ -2808,6 +2819,14 @@ static void draw_line(char *s)
                                                             arg);
                                break;
 
+                       case TAB:
+                               {
+                                       int pos_x = text_start_x + text_width - cur_x - 1;
+                                       if ( pos_x > specials[special_index].arg)
+                                               w = pos_x - specials[special_index].arg;
+                               }
+                       break;
+
                        case ALIGNR:
                                {
                                        int pos_x =
index 4b62974..8a3a14a 100644 (file)
@@ -256,6 +256,7 @@ metar_station  CYBW
 #  swapmax                           Total amount of swap                     
 #  swapperc                          Percentage of swap in use                
 #  sysname                           System name, Linux for example           
+#  tab               pixels          Move text over by N pixels
 #  tail              logfile, lines (interval)
 #                                    Displays last N lines of supplied text
 #                                    text file.  If interval is not supplied,
diff --git a/x11.c b/x11.c
index 30fc5ad..628ad53 100644 (file)
--- a/x11.c
+++ b/x11.c
@@ -139,7 +139,6 @@ void set_transparent_background(Window win)
 {
        Window parent = win;
        unsigned int i;
-
        for (i = 0; i < 16 && parent != RootWindow(display, screen); i++) {
                Window r, *children;
                unsigned int n;
@@ -150,7 +149,6 @@ void set_transparent_background(Window win)
                XQueryTree(display, parent, &r, &parent, &children, &n);
                XFree(children);
        }
-
        XClearWindow(display, win);
 }