How to align text in the middle of two ${hr}s?












1















I wanted to have two horizontal green lines on either side of the label for the sections of my conky, but when I try and do that, I get the green line taking up the entire horizontal space and no space for the text. Here's what I'm talking about:



enter image description here



The conky is in very early stages of development, and I just ran into this problem, so there isn't much there. Here's the .conkyrc:



alignment tr
use_xft true
xftfont Droid Serif Bold:size=9
double_buffer true
gap_x 10
gap_y 10

color1 afafaf
color2 00ff00
color3 0a0a0a

TEXT
${color2}${hr}${color1}.: INFO :.${color2}${hr}
${color2}${kernel} ${color1}${machine}


Also, just while we're at it, i've been getting a syntax error from conky at the alignment tr line. It says this:



conky: Syntax error (/home/ricky/.conkyrc:1: syntax error near 'tr') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.


It doesn't seem to make a difference, but it's odd that it would do that.










share|improve this question


















  • 1





    you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

    – Jonas
    Nov 12 '15 at 14:53













  • @clearkimura The version is 1.10.0.

    – MintyChipp
    Nov 12 '15 at 14:54
















1















I wanted to have two horizontal green lines on either side of the label for the sections of my conky, but when I try and do that, I get the green line taking up the entire horizontal space and no space for the text. Here's what I'm talking about:



enter image description here



The conky is in very early stages of development, and I just ran into this problem, so there isn't much there. Here's the .conkyrc:



alignment tr
use_xft true
xftfont Droid Serif Bold:size=9
double_buffer true
gap_x 10
gap_y 10

color1 afafaf
color2 00ff00
color3 0a0a0a

TEXT
${color2}${hr}${color1}.: INFO :.${color2}${hr}
${color2}${kernel} ${color1}${machine}


Also, just while we're at it, i've been getting a syntax error from conky at the alignment tr line. It says this:



conky: Syntax error (/home/ricky/.conkyrc:1: syntax error near 'tr') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.


It doesn't seem to make a difference, but it's odd that it would do that.










share|improve this question


















  • 1





    you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

    – Jonas
    Nov 12 '15 at 14:53













  • @clearkimura The version is 1.10.0.

    – MintyChipp
    Nov 12 '15 at 14:54














1












1








1








I wanted to have two horizontal green lines on either side of the label for the sections of my conky, but when I try and do that, I get the green line taking up the entire horizontal space and no space for the text. Here's what I'm talking about:



enter image description here



The conky is in very early stages of development, and I just ran into this problem, so there isn't much there. Here's the .conkyrc:



alignment tr
use_xft true
xftfont Droid Serif Bold:size=9
double_buffer true
gap_x 10
gap_y 10

color1 afafaf
color2 00ff00
color3 0a0a0a

TEXT
${color2}${hr}${color1}.: INFO :.${color2}${hr}
${color2}${kernel} ${color1}${machine}


Also, just while we're at it, i've been getting a syntax error from conky at the alignment tr line. It says this:



conky: Syntax error (/home/ricky/.conkyrc:1: syntax error near 'tr') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.


It doesn't seem to make a difference, but it's odd that it would do that.










share|improve this question














I wanted to have two horizontal green lines on either side of the label for the sections of my conky, but when I try and do that, I get the green line taking up the entire horizontal space and no space for the text. Here's what I'm talking about:



enter image description here



The conky is in very early stages of development, and I just ran into this problem, so there isn't much there. Here's the .conkyrc:



alignment tr
use_xft true
xftfont Droid Serif Bold:size=9
double_buffer true
gap_x 10
gap_y 10

color1 afafaf
color2 00ff00
color3 0a0a0a

TEXT
${color2}${hr}${color1}.: INFO :.${color2}${hr}
${color2}${kernel} ${color1}${machine}


Also, just while we're at it, i've been getting a syntax error from conky at the alignment tr line. It says this:



conky: Syntax error (/home/ricky/.conkyrc:1: syntax error near 'tr') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.


It doesn't seem to make a difference, but it's odd that it would do that.







conky






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '15 at 13:36









MintyChippMintyChipp

63




63








  • 1





    you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

    – Jonas
    Nov 12 '15 at 14:53













  • @clearkimura The version is 1.10.0.

    – MintyChipp
    Nov 12 '15 at 14:54














  • 1





    you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

    – Jonas
    Nov 12 '15 at 14:53













  • @clearkimura The version is 1.10.0.

    – MintyChipp
    Nov 12 '15 at 14:54








1




1





you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

– Jonas
Nov 12 '15 at 14:53







you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}`

– Jonas
Nov 12 '15 at 14:53















@clearkimura The version is 1.10.0.

– MintyChipp
Nov 12 '15 at 14:54





@clearkimura The version is 1.10.0.

– MintyChipp
Nov 12 '15 at 14:54










2 Answers
2






active

oldest

votes


















0














We have two issues here: using two ${hr} and syntax error near 'tr'.



Using two ${hr}



Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).



I'd suggest to use underscore '_' to draw the two lines instead, like below.



TEXT
${color2}__________${color1}.: INFO :.${color2}__________
${color2}${kernel} ${color1}${machine}


In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.



Syntax error near 'tr'



As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.



This forum thread reveals that Manjaro users had the same issue recently.




After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10
Unfortunately 'man conky' points you to a non-existent directory .
The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf



conky.config = {
alignment = 'top_left',
background = false,
...
}
conky.text = [[
${scroll 16 $nodename - $sysname $kernel on $machine | }
...
]]



Syntax error itself



Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.




conky.config = {
alignment = 'top_right',
use_xft = true,
xftfont = 'Droid Serif Bold:size=9',
double_buffer = true,
gap_x = 10,
gap_y = 10,
color1 = 'afafaf',
color2 = '00ff00',
color3 = '0a0a0a'
}
conky.text = [[
${color2}__________${color1}.: INFO :.${color2}__________
${color2}${kernel} ${color1}${machine}
]]



This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.






share|improve this answer


























  • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

    – MintyChipp
    Nov 12 '15 at 20:29











  • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

    – clearkimura
    Nov 13 '15 at 10:18



















0














You can pull off something close to what you want like this...



${alignc}Some Text
${color green}${voffset -25}____________${alignr}____________


...which results in something like this...

enter image description here






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f242577%2fhow-to-align-text-in-the-middle-of-two-hrs%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    We have two issues here: using two ${hr} and syntax error near 'tr'.



    Using two ${hr}



    Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).



    I'd suggest to use underscore '_' to draw the two lines instead, like below.



    TEXT
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}


    In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.



    Syntax error near 'tr'



    As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.



    This forum thread reveals that Manjaro users had the same issue recently.




    After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10
    Unfortunately 'man conky' points you to a non-existent directory .
    The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf



    conky.config = {
    alignment = 'top_left',
    background = false,
    ...
    }
    conky.text = [[
    ${scroll 16 $nodename - $sysname $kernel on $machine | }
    ...
    ]]



    Syntax error itself



    Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.




    conky.config = {
    alignment = 'top_right',
    use_xft = true,
    xftfont = 'Droid Serif Bold:size=9',
    double_buffer = true,
    gap_x = 10,
    gap_y = 10,
    color1 = 'afafaf',
    color2 = '00ff00',
    color3 = '0a0a0a'
    }
    conky.text = [[
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}
    ]]



    This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.






    share|improve this answer


























    • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

      – MintyChipp
      Nov 12 '15 at 20:29











    • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

      – clearkimura
      Nov 13 '15 at 10:18
















    0














    We have two issues here: using two ${hr} and syntax error near 'tr'.



    Using two ${hr}



    Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).



    I'd suggest to use underscore '_' to draw the two lines instead, like below.



    TEXT
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}


    In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.



    Syntax error near 'tr'



    As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.



    This forum thread reveals that Manjaro users had the same issue recently.




    After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10
    Unfortunately 'man conky' points you to a non-existent directory .
    The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf



    conky.config = {
    alignment = 'top_left',
    background = false,
    ...
    }
    conky.text = [[
    ${scroll 16 $nodename - $sysname $kernel on $machine | }
    ...
    ]]



    Syntax error itself



    Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.




    conky.config = {
    alignment = 'top_right',
    use_xft = true,
    xftfont = 'Droid Serif Bold:size=9',
    double_buffer = true,
    gap_x = 10,
    gap_y = 10,
    color1 = 'afafaf',
    color2 = '00ff00',
    color3 = '0a0a0a'
    }
    conky.text = [[
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}
    ]]



    This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.






    share|improve this answer


























    • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

      – MintyChipp
      Nov 12 '15 at 20:29











    • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

      – clearkimura
      Nov 13 '15 at 10:18














    0












    0








    0







    We have two issues here: using two ${hr} and syntax error near 'tr'.



    Using two ${hr}



    Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).



    I'd suggest to use underscore '_' to draw the two lines instead, like below.



    TEXT
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}


    In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.



    Syntax error near 'tr'



    As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.



    This forum thread reveals that Manjaro users had the same issue recently.




    After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10
    Unfortunately 'man conky' points you to a non-existent directory .
    The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf



    conky.config = {
    alignment = 'top_left',
    background = false,
    ...
    }
    conky.text = [[
    ${scroll 16 $nodename - $sysname $kernel on $machine | }
    ...
    ]]



    Syntax error itself



    Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.




    conky.config = {
    alignment = 'top_right',
    use_xft = true,
    xftfont = 'Droid Serif Bold:size=9',
    double_buffer = true,
    gap_x = 10,
    gap_y = 10,
    color1 = 'afafaf',
    color2 = '00ff00',
    color3 = '0a0a0a'
    }
    conky.text = [[
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}
    ]]



    This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.






    share|improve this answer















    We have two issues here: using two ${hr} and syntax error near 'tr'.



    Using two ${hr}



    Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).



    I'd suggest to use underscore '_' to draw the two lines instead, like below.



    TEXT
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}


    In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.



    Syntax error near 'tr'



    As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.



    This forum thread reveals that Manjaro users had the same issue recently.




    After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10
    Unfortunately 'man conky' points you to a non-existent directory .
    The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf



    conky.config = {
    alignment = 'top_left',
    background = false,
    ...
    }
    conky.text = [[
    ${scroll 16 $nodename - $sysname $kernel on $machine | }
    ...
    ]]



    Syntax error itself



    Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.




    conky.config = {
    alignment = 'top_right',
    use_xft = true,
    xftfont = 'Droid Serif Bold:size=9',
    double_buffer = true,
    gap_x = 10,
    gap_y = 10,
    color1 = 'afafaf',
    color2 = '00ff00',
    color3 = '0a0a0a'
    }
    conky.text = [[
    ${color2}__________${color1}.: INFO :.${color2}__________
    ${color2}${kernel} ${color1}${machine}
    ]]



    This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 13 '15 at 10:16

























    answered Nov 12 '15 at 17:22









    clearkimuraclearkimura

    1,9531030




    1,9531030













    • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

      – MintyChipp
      Nov 12 '15 at 20:29











    • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

      – clearkimura
      Nov 13 '15 at 10:18



















    • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

      – MintyChipp
      Nov 12 '15 at 20:29











    • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

      – clearkimura
      Nov 13 '15 at 10:18

















    Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

    – MintyChipp
    Nov 12 '15 at 20:29





    Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing.

    – MintyChipp
    Nov 12 '15 at 20:29













    @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

    – clearkimura
    Nov 13 '15 at 10:18





    @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file.

    – clearkimura
    Nov 13 '15 at 10:18













    0














    You can pull off something close to what you want like this...



    ${alignc}Some Text
    ${color green}${voffset -25}____________${alignr}____________


    ...which results in something like this...

    enter image description here






    share|improve this answer




























      0














      You can pull off something close to what you want like this...



      ${alignc}Some Text
      ${color green}${voffset -25}____________${alignr}____________


      ...which results in something like this...

      enter image description here






      share|improve this answer


























        0












        0








        0







        You can pull off something close to what you want like this...



        ${alignc}Some Text
        ${color green}${voffset -25}____________${alignr}____________


        ...which results in something like this...

        enter image description here






        share|improve this answer













        You can pull off something close to what you want like this...



        ${alignc}Some Text
        ${color green}${voffset -25}____________${alignr}____________


        ...which results in something like this...

        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 7 '18 at 13:28









        David YockeyDavid Yockey

        112




        112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f242577%2fhow-to-align-text-in-the-middle-of-two-hrs%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?