brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.27k stars 620 forks source link

inserting pywal colors #404

Closed icf20 closed 6 years ago

icf20 commented 7 years ago

i try to put this in conkyrc ${exec tail -n 15 .cache/wal/colors.sh|sed "s/[=\'#]/ /g" }

but i get conky: [string "..."]:151: [string "converted config"]:54: unexpected symbol near '$'

tail -n 15 .cache/wal/colors.sh|sed "s/[=\'#]/ /g" give me

color1   4EB2AF 
color2   5AC2BA 
color3   6DC9B9 
color4   6ECAC6 
color5   99D5B8 
color6   B9CEB5 
color7   E1F2DE 
color8   a1a1a1 
color9   4EB2AF 
color10   5AC2BA 
color11   6DC9B9 
color12   6ECAC6 
color13   99D5B8 
color14   B9CEB5 
color15   E1F2DE 

what i am doing wrong here ?

dbriba commented 7 years ago

Give us the contents of your script colors.sh

icf20 commented 7 years ago

Give us the contents of your script colors.sh

is not a script is just a way to store the information by pywal

# Shell variables
# Generated by 'wal'
wallpaper='.wal/oqDDYrAFwvKSufAHEtKAOQ_1.jpg'

# Special
background='#34301E'
foreground='#BDC2CA'
cursor='#BDC2CA'

# Colors
color0='#34301E'
color1='#7B826E'
color2='#9B8E50'
color3='#968A69'
color4='#627186'
color5='#7B848D'
color6='#9B9FA2'
color7='#BDC2CA'
color8='#999999'
color9='#7B826E'
color10='#9B8E50'
color11='#968A69'
color12='#627186'
color13='#7B848D'
color14='#9B9FA2'
color15='#BDC2CA'
dbriba commented 7 years ago

Ok, I think your issue is in your conkyrc: conky: [string "..."]:151: [string "converted config"]:54: unexpected symbol near '$'

Give us your conky.

icf20 commented 7 years ago

https://github.com/icf20/conkyrc/blob/master/conkyrc i also tested this converted using the lua script

dbriba commented 7 years ago

what is your conky's version? 1.9 or 1.10 ? To know that, in console type conky -v

icf20 commented 7 years ago

1.10

dbriba commented 7 years ago

Ok I think that the problem is here. Your config is for conky 1.9, and you must transform it in the new syntax for 1.10. With conky 1.10 there is a script which transform conky 1.9 syntax to the 1.10, but sometimes the transformation is not complete. And you have this type of error.

icf20 commented 7 years ago

for example if i take this config https://raw.githubusercontent.com/Dobbie03/dobbies-conky/master/s11.conkyrc

and replace the colour part with ${exec tail -n 16 .cache/wal/colors.sh|sed "s/$/,/g", } i get .conky/conkyrc:38: unexpected symbol near '$') while reading config file. conky: Assuming it's in old syntax and attempting conversion. conky: [string "..."]:139: attempt to index a nil value (local 'settings')

it looks to me that conky cant handle exec tail inside the conky.config = { } only in conky.text = [[ ]]

lasers commented 6 years ago

A year and two weeks passed. I suppose you don't need this issue to stay opened. Closing.

Vintodrimmer commented 6 years ago

I have the same question.

I'm trying to run ${exec sed -n 11,19p ~/.cache/wal/colors.sh} inside the concy_config = {} segment and get the following error:

conky: Syntax error (/home/eichhorn/.config/conky/conky.conf:39: unexpected symbol near '$') while reading config file.
conky: Assuming it's in old syntax and attempting conversion.
conky: [string "..."]:139: attempt to index local 'settings' (a nil value)

How do I do that correctly?

gibranlp commented 4 years ago

Is this thing fixed, can anyone show how to import colors from pywal to conky for version 1.11 of conky.

Cheers

AlecsFerra commented 4 years ago

Bump

Nate-Wilkins commented 2 years ago

You can do this by invoking execpi in the conky config file.

conky_config

conky.text = [[
${voffset 10}$font${execpi 15 /usr/bin/conky_echo_color color3}${execi 10000 awk -F= '/TION/ {print $2}' /etc/lsb-release |sed 's/"//g'}
]]

/usr/bin/conky_echo_color

#!/bin/bash

source ~/.cache/wal/colors.sh

echo "\${color $(eval echo \$$1)}"