[Conky] Affichage horloge lua (resolu)

Questions et astuces concernant l'installation et la configuration d'archlinux
Avatar de l’utilisateur
banditblue
Elfe
Messages : 556
Inscription : dim. 10 janv. 2010, 10:19

[Conky] Affichage horloge lua (resolu)

Message par banditblue »

bonjour la team
cela fait pas mal de temps que j’essaie de faire fonctionner l'horloge et les bargraphe lua tout comme sur la photo ci dessous
Image
le soucis c'est que depuis peu, la methodologie écrite dans conky a changé et quand j'essais de faire executer les deux ligne de code, ca ne fonctionne pas

voila ce que j'obtient

Code : Tout sélectionner

[moi@ArchLinuxi7 ~]$ conky -c /home/moi/.conky/.conkyrc
conky: Syntax error (/home/moi/.conky/.conkyrc:64: unexpected symbol near '.') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.
conky: [string "..."]:147: attempt to index a nil value (local 'settings')
[moi@ArchLinuxi7 ~]$ 
ce sont ces deux ligne que je souhaite executer dans conkyrc
lua_load /home/moi/.conky/lua/conky_grey.lua
lua_draw_hook_pre main


le conkyrc

Code : Tout sélectionner

--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

conky.config = {
  background = true,
    own_window = false,
    own_window_class = 'Conky',
    own_window_transparent = false,
    own_window_type = 'desktop',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    double_buffer = true,
    no_buffers = true,
    use_spacer = 'none',
    use_xft = true,
    xftalpha = 1,
    font = 'Sans:size=10',
    update_interval = 1,
    uppercase = false,
    override_utf8_locale = true,
    stippled_borders = 1,
    border_width = 5,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    show_graph_scale = true,
    show_graph_range = true,
    alignment = 'top_right',
    gap_x = 10,
    gap_y = 100,
    net_avg_samples = 1,
    cpu_avg_samples = 6,
    short_units = true,
    pad_percents = 2,
    text_buffer_size = 2048,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
}

conky.text = [[
${offset 80}${voffset 105}
${font SF Square Head:size=10}Ordinateur${font} ${hr 2} 
  ${font DejaVu:size=7}${voffset -2}Systeme
  ${offset 60}${voffset -12}:
  ${offset 90}${voffset -12}Archlinux
  ${offset 15}${voffset 1}Kernel
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -11}$kernel}
  ${offset 15}${voffset 3}Temps
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -12}$uptime$
  ${offset 15}${voffset 2}Cpu i7
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -12}${freq_g} GHz${font}
  ${font SF Square Head:size=10}${offset -6}${voffset -5}Intel i7${font}${hr 1}
  ${font DejaVu:size=7}${offset 13}${voffset -2}Core 1
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu1}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 2
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu2}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 3
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu3}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 4
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu4}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 5
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu5}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 6
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu6}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 7
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu7}
  ${offset 90}${voffset -12}%
  ${offset 14}${voffset 3}Core 8
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu8}
  ${offset 90}${voffset -12}%${font}
${font SF Square Head:size=10}${voffset -4}Disque Dur${font} ${hr 2} 
  ${font DejaVu:size=7}${offset 15}${voffset -4}Systeme
  ${offset 120}${voffset -12}Home
  ${offset 10}${voffset 2}${fs_used /} / ${fs_size /}
  ${offset 100}${voffset -12}${fs_used /home} / ${fs_size /home}  
  ${offset 100}${voffset -10}
  ${offset 25}${voffset 10}Antera
  ${offset 10}${fs_free /run/media/moi/Antera} / ${fs_size /run/media/moi/Antera}
  ${offset 120}${voffset -25}Epsilon
  ${offset 100}${fs_free /run/media/moi/Epsilon} / ${fs_size /run/media/moi/Epsilon}s${font}
${font SF Square Head:size=10}${voffset 4}Memoire${font} ${hr 2}
  ${font DejaVu:size=7}${offset 5}${voffset -5}Utilisé
  ${offset 65}${voffset -12}:
  ${offset 100}${voffset -12}${mem} / ${memmax}${font}
${voffset 7}${font SF Square Head:size=10}Resaux par le cable${font} ${hr 2} 
  ${font DejaVu:size=7}${offset 3}${voffset -5}Down
  ${offset 40}${voffset -12}:
  ${offset 50}${voffset -12}${downspeed enp0s31f6}
  ${offset 90}${voffset -12}/s
  ${offset 4}${voffset 2}Upload
  ${offset 40}${voffset -11}:
  ${offset 50}${voffset -12}${upspeed enp0s31f6}
  ${offset 90}${voffset -12}/s${font}
#${voffset -5}${font SF Square Head:size=10}Resaux Wifi${font} ${hr 2} 
#  ${font DejaVu:size=7} Down
#  ${offset 35}${voffset -11}:
#  ${offset 44}${voffset -12}${downspeed wlp0s20f0u2}
#  ${offset 80}${voffset -12}/s
#Upload
#  ${offset 37}${voffset -11}:
#  ${offset 44}${voffset -12}${upspeed wlp0s20f0u2}
#${offset 80}${voffset 4}/s${font}
  ${offset -6}${voffset -5}${font SF Square Head:size=10}Mise a jour${font} ${hr 2}
  ${voffset -6}${offset 30}${font DejaVu:size=7}mise a jour de disponible(s) 
  ${offset 5}${voffset -12}${execpi 600 yaourt -Sya --logfile /dev/null > /dev/null; yaourt -Qu | wc -l}
${hr 2}
]]
Dernière modification par banditblue le ven. 06 nov. 2020, 18:08, modifié 1 fois.
La connaîssance n'a pas de limite.
Mais sa valeur, est d'autant plus grande, une fois partagé


Pc fixe --- Z170A Sli Plus, I7-6700K, GTX980, 24Go DDR4, SSD 860 EVO 500Go, SSD 830 Serie,3HDD 5Tera
Eeepc Asus 1015pem --- Intel Atom N550 Dual-core 1.5Ghz / DD 1Tera 7200rpm / Ram 2Go

Screenshot + Les Conky ===> Clique ICI
Avatar de l’utilisateur
onyx67
Elfe
Messages : 763
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Affichage horloge lua (en cours)

Message par onyx67 »

Salut,
Tu as bien conky-lua d'installé?
En principe un nouveau fichier conf a été généré lors de la mise à jour de conky. Regarde si tu n'as pas un conkyrc.pacnew, sinon réinstalle complètement conky et récupère le fichier de conf par défaut et essaie d'adapter la syntaxe.
Si ça peut aider: wiki d'Arch ou le wiki du site de conky
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
banditblue
Elfe
Messages : 556
Inscription : dim. 10 janv. 2010, 10:19

Re: [Conky] Affichage horloge lua (en cours)

Message par banditblue »

onyx67 a écrit :
ven. 30 oct. 2020, 17:26
Salut,
Tu as bien conky-lua d'installé?
En principe un nouveau fichier conf a été généré lors de la mise à jour de conky. Regarde si tu n'as pas un conkyrc.pacnew, sinon réinstalle complètement conky et récupère le fichier de conf par défaut et essaie d'adapter la syntaxe.
Si ça peut aider: wiki d'Arch ou le wiki du site de conky
meci a toi pour ces indications, j'ai en partie résolu mon problème, en affichant a l'ecran les scriptes lua mais quand je veux les executer ensemble cela me fait clignoter les deux conky, celui de l'horloge et le bargraphe
j'ai beau modifier les valeurs, mais je n'arrive toujours pas a trouver la bonne solution quand a les faire fonctionner ensemble


le conkyrc (avec bargraphe.lua)

Code : Tout sélectionner

--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

conky.config = {
    alignment = 'top_right',
    background = true,
    border_width = 5,
    cpu_avg_samples = 5,
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,   
    font = 'Sans:size=10',
    gap_x = 18,
    gap_y = 100,   
    net_avg_samples = 1,
    no_buffers = true,   
    out_to_console = false,
    out_to_stderr = false,
     own_window = false,
    own_window_class = 'Conky',
    own_window_transparent = true,
    own_window_type = 'override',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_argb_visual = false,
    own_window_argb_value = 0,   
    override_utf8_locale = true,
    pad_percents = 2,
    show_graph_scale = true,
    show_graph_range = true,
    short_units = true,
    stippled_borders = 0,
    text_buffer_size = 2048,
    use_spacer = 'none',
    use_xft = true,
    update_interval = 1,
    uppercase = false,
    xftalpha = 1,
    lua_load  = '/home/moi/.conky/lua/bargraphe.lua',
    lua_draw_hook_pre = 'main_bars',
}

conky.text = [[
${offset 80}${voffset 105}
${font SF Square Head:size=10}Ordinateur${font} ${hr 2} 
  ${font DejaVu:size=7}${voffset -2}    Systeme
  ${offset 60}${voffset -12}:
  ${offset 90}${voffset -12}Archlinux
  ${offset 15}${voffset 1}Kernel
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -11}$kernel}
  ${offset 15}${voffset 3}Temps
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -12}$uptime
  ${offset 15}${voffset 2}Cpu i7
  ${offset 60}${voffset -12}:
  ${offset 87}${voffset -12}Frequence ${freq_g} GHz${font}
  ${font SF Square Head:size=10}${offset -6}${voffset -5}Intel i7${font}${hr 1}
  ${font DejaVu:size=7}${offset 13}${voffset -2}Core 1
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu1}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 2
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu2}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 3
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu3}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 4
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu4}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 5
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu5}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 6
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu6}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 7
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu7}
  ${offset 85}${voffset -12}%
  ${offset 14}${voffset 1}Core 8
  ${offset 58}${voffset -12}:
  ${offset 65}${voffset -12}${cpu cpu8}
  ${offset 85}${voffset -12}%${font}
${font SF Square Head:size=10}${voffset -4}Disque Dur${font} ${hr 2} 
  ${font DejaVu:size=7}${offset 15}${voffset -4}Systeme
  ${offset 120}${voffset -12}Home
  ${offset 10}${voffset 2}${fs_used /} / ${fs_size /}
  ${offset 100}${voffset -12}${fs_used /home} / ${fs_size /home}  
  ${offset 100}${voffset -10}
  ${offset 25}${voffset 10}Antera
  ${offset 10}${fs_free /run/media/moi/Antera} / ${fs_size /run/media/moi/Antera}
  ${offset 120}${voffset -25}Epsilon
  ${offset 100}${fs_free /run/media/moi/Epsilon} / ${fs_size /run/media/moi/Epsilon}s${font}
${font SF Square Head:size=10}${voffset 4}Memoire${font} ${hr 2}
  ${font DejaVu:size=7}${voffset -5}Utilisé
  ${offset 37}${voffset -12}:
  ${offset 50}${voffset -12}${mem} / ${memmax}${font}
${voffset -5}${font SF Square Head:size=10}Resaux par le cable${font} ${hr 2} 
  ${font DejaVu:size=7}${offset 3}${voffset -5}Down
  ${offset 40}${voffset -12}:
  ${offset 50}${voffset -12}${downspeed enp0s31f6}
  ${offset 90}${voffset -12}/s
  ${offset 4}${voffset 2}Upload
  ${offset 40}${voffset -11}:
  ${offset 50}${voffset -12}${upspeed enp0s31f6}
  ${offset 90}${voffset -12}/s${font}
#${voffset -5}${font SF Square Head:size=10}Resaux Wifi${font} ${hr 2} 
#  ${font DejaVu:size=7} Down
#  ${offset 35}${voffset -11}:
#  ${offset 44}${voffset -12}${downspeed wlp0s20f0u2}
#  ${offset 80}${voffset -12}/s
#Upload
#  ${offset 37}${voffset -11}:
#  ${offset 44}${voffset -12}${upspeed wlp0s20f0u2}
#${offset 80}${voffset 4}/s${font}
  ${offset -6}${voffset -5}${font SF Square Head:size=10}Mise a jour${font} ${hr 2}
  ${voffset -6}${offset 30}${font DejaVu:size=7}mise a jour de disponible(s) 
  ${offset 5}${voffset -12}${execpi 600 yaourt -Sya --logfile /dev/null > /dev/null; yaourt -Qu | wc -l}
${hr 2}
]]

et le second avec conky horloge (conky_gray.lua)

Code : Tout sélectionner

--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

conky.config = {
    alignment = 'top_right',
    background = true,
    border_width = 5,
    cpu_avg_samples = 5,
    double_buffer = false,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'Sans:size=10',
    gap_x = 1,
    gap_y = 1,
    net_avg_samples = 1,
    no_buffers = false,
    out_to_console = false,
    out_to_stderr = false,
    own_window = false,
    own_window_class = 'Conky',
    own_window_transparent = true,
    own_window_type = 'override',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    override_utf8_locale = true,
    pad_percents = 2,
    show_graph_scale = true,
    show_graph_range = true,
    short_units = true,
    stippled_borders = 1,
    text_buffer_size = 2048,
    use_spacer = 'none',
    use_xft = true,
    update_interval = 1,
    uppercase = false,
    xftalpha = 1,
    lua_load  = '/home/moi/.conky/lua/conky_gray.lua',
    lua_draw_hook_pre = 'main',
}
conky.text = [[
]]
et mon autostart (/home/moi/.config/openbox)

Code : Tout sélectionner

#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#

# If you want to use GNOME config tools...
#
#if test -x /usr/lib/openbox/gnome-settings-daemon >/dev/null; then
#  /usr/lib/openbox/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null 2>&1; then
#  gnome-settings-daemon &
#fi

# If you want to use XFCE config tools...
#
#xfce-mcs-manager &

fbpanel &
/home/moi/Diapo.sh &
conky -c /home/moi/.conky/.conkyrc &
sleep 2 && conky -c /home/moi/.conky/.conkyrc2 &
La connaîssance n'a pas de limite.
Mais sa valeur, est d'autant plus grande, une fois partagé


Pc fixe --- Z170A Sli Plus, I7-6700K, GTX980, 24Go DDR4, SSD 860 EVO 500Go, SSD 830 Serie,3HDD 5Tera
Eeepc Asus 1015pem --- Intel Atom N550 Dual-core 1.5Ghz / DD 1Tera 7200rpm / Ram 2Go

Screenshot + Les Conky ===> Clique ICI
Avatar de l’utilisateur
banditblue
Elfe
Messages : 556
Inscription : dim. 10 janv. 2010, 10:19

Re: [Conky] Affichage horloge lua (en cours)

Message par banditblue »

apres quelques jours de recherche et d'essais consecutif et perilleux j'ai réussi a faire ce que je voulais ---> executer plusieurs conky sans que ceux-ci ne clignote hasardesement

Image
mon code pour l'horloge.conf

Code : Tout sélectionner

--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 20,
    gap_y = 30,
    minimum_height = 180,
    minimum_width = 180,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_transparent = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
    lua_load = '/home/moi/.conky/lua/conky_gray.lua',
    lua_draw_hook_post = 'main',
}

conky.text = [[
]]
il me reste encore a mettre la météo et ce sera parfait pour moi
La connaîssance n'a pas de limite.
Mais sa valeur, est d'autant plus grande, une fois partagé


Pc fixe --- Z170A Sli Plus, I7-6700K, GTX980, 24Go DDR4, SSD 860 EVO 500Go, SSD 830 Serie,3HDD 5Tera
Eeepc Asus 1015pem --- Intel Atom N550 Dual-core 1.5Ghz / DD 1Tera 7200rpm / Ram 2Go

Screenshot + Les Conky ===> Clique ICI
Répondre