exec .sh in Conky

Forum Forums New users New Users and General Questions exec .sh in Conky

  • This topic has 4 replies, 4 voices, and was last updated Aug 3-6:16 am by blur13.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #64092
    Member
    blur13

      Hi everyone!

      This is driving me insane. I want to have the volume displayed in my conky so I wrote a simple bash script:

      #!/bin/bash

      awk -F”[][]” ‘/Left:/ { print $2 }’ <(amixer sget Master)

      named it vol.sh, placed it in $PATH and added it to the .conkyrc by using:

      Vol: ${exec vol.sh}

      That results in just “Vol:” on my display. Running the script in the terminal results in “65%” or whatever the volume happens to be at. What am I doing wrong here?

      Any help appreciated.

      #64111
      Moderator
      christophe
        Helpful
        Up
        0
        ::

        Isn’t it “execi” in conky?
        Try that…

        confirmed antiX frugaler, since 2019

        #64118
        Member
        calciumsodium
          Helpful
          Up
          1
          ::

          Hi @blur13

          I tried the following and it works for me. Just add the following to the end of the .conkryc file, or where ever you choose:

          Volume: ${exec amixer get Master -M | grep -oE -m1 "[[:digit:]]*%"}

          #64134
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            Yes, there were problems with the command…

            
            $ awk -F”[][]” ‘/Left:/ { print $2 }’ <(amixer sget Master)
            awk: cmd. line:1: ‘/Left:/
            awk: cmd. line:1: ^ invalid char '�' in expression
            bobc@XPS15-7559:~
            $ amixer get Master -M | grep -oE -m1 "[[:digit:]]*%"
            88%
            bobc@XPS15-7559:~
            
            
            #64243
            Member
            blur13
              Helpful
              Up
              0
              ::

              Thanks for the help guys!

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.