You are not logged in.

#2341 2025-08-09 14:52:15

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

Taadaaa

cHNSHASh_t.png


@+

Last edited by loutch (2025-08-09 17:26:04)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2342 2025-08-10 15:14:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Show us your conky

RadioTrayNG  -  Now Playing
https://forums.bunsenlabs.org/viewtopic … 38#p140138

You can now use the radiotray-ng script without conky:
https://forums.bunsenlabs.org/viewtopic … 83#p144983

Install the app and try it but first disable RadioTray-NG conky.

If you want to see both on your desktop, check out my previous posts + @unklar's post here.
Otherwise, we will unnecessarily run similar scripts twice at the same time.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#2343 2025-08-10 19:59:23

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello


Day

99FgYB0w_t.png

Night
VwjczEtT_t.png


It's a shame that conky-clic no longer works; I could have done some interesting things with it..


@+

Last edited by loutch (2025-08-10 20:01:21)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2344 2025-08-11 14:44:55

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

Made conky to change day & night wallpaper between 00:00 & 21:00 ( 9pm )

conky

conky.config = {
    background = true,
	use_xft = true,
	font = 'Bebas Neue Bold:size=12',
	xftalpha = 1,
	update_interval = 3600,
	total_run_times = 0,
	own_window = true,
	own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
	own_window_type = 'normal',
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
	double_buffer = true,
	minimum_width = 200, minimum_height = 200,
        maximum_width = 200,
	text_buffer_size = 2048,
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,
	default_color = 'white',
	default_outline_color = 'white',
	alignment = 'top_left',
	gap_x = 49,
	gap_y = 408,
	no_buffers = true,
	uppercase = false,
	cpu_avg_samples = 2,
	override_utf8_locale = true,
imlib_cache_flush_interval = 60,
	imlib_cache_size = 10000,


-- Taille des pointillés
	stippled_borders = 5,

-- Couleurs
	default_color = '#ffffff',--ffd579
	default_shade_color = '#333333',
	default_outline_color = 'black',
};

conky.text = [[
${execi 3600  ~/.conky/wallpaper/wallpaper.sh}

]];

wallpaper.sh

#!/bin/bash
# Kill if already running
if pidof -o %PPID -x "${0##*/}"; then
  exit 1
fi
# Start loop
while :
do
# What time is it?
  CURRENT_TIME=$(date +%H%M)
  if [ -n "$NEXT_TIME" ] && [ "$CURRENT_TIME" -lt "$NEXT_TIME" ]; then
    sleep 60
    continue
  fi
# Depending on time set WALL_CHOICE & NEXT_TIME
  if [ "$CURRENT_TIME" -ge 0000 ] && [ "$CURRENT_TIME" -lt 2100 ]; then
    WALL_CHOICE=/home/loutch/Images/Tahoe-Light.jpg
    NEXT_TIME=2100
  elif [ "$CURRENT_TIME" -ge 2100 ] && [ "$CURRENT_TIME" -le 2359 ]; then
    WALL_CHOICE=/home/loutch/Images/Tahoe-Dark.jpg
    NEXT_TIME=0000
  fi
# Set the chosen wallpaper
  xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitoreDP1/workspace0/last-image -s "$WALL_CHOICE"
# Sleep
  sleep 60
done

launcher at connection

#!/bin/bash

sleep 7

conky -c ~/.conky/wallpaper/jour_nuit &

exit

for the moment it work.

@+

Last edited by loutch (2025-08-11 14:47:03)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2345 2025-08-11 15:44:21

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Show us your conky

^ I know you've used redshift  before.
If it's installed, things get simpler.

In that case, the script would look like this:

## Day/Night Wallpaper - with RedShift ##

  mode=$(redshift -p | grep 'Period' | awk '{print $2}')

    if [[ "$mode" == "Night" ]]; then
    
         < Command for night wallpaper >
         
      else
         
         < Command for day wallpaper >
         
    fi

Just use the commands for the XFCE desktop.
Redshift always knows the exact time when day and night change at your location.  smile

My weather Conky (local source) doesn't have night icons, but I created a similar script to make the existing ones gray:
https://postimg.cc/d755JHs0

Last edited by marens (2025-08-11 15:52:40)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#2346 2025-08-11 18:28:05

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

Sorry don't work , problem with geoclue

redshift -p | grep 'Period' | awk '{print $2}'
Essai du fournisseur de localisation « geoclue2 »...
En attente de localisation...
Unable to obtain GeoClue client path: Le délai d’attente est dépassé.
Impossible d'obtenir une localisation du fournisseur.

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2347 2025-08-11 23:14:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Show us your conky

^ OK.

You can manually set the redshift  config file for your location.

This is what ~/.config/redshift.conf  should look like for Paris (France), and you just replace the latitude (lat=...)  and  longitude (lon=...)  for your location: 

; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5840
temp-night=4480

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1

; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
gamma=0.88
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6

; Set the location-provider: 'geoclue', 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values.
; 'randr' is the preferred method, 'vidmode' is an older API.
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=vidmode

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=48.864716
lon=2.349014

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
screen=1

Note *

The values at the beginning of the conf file are set for my eyes:

temp-day=5840
temp-night=4480

If you check from the terminal:

$ man redshift
...
Default temperature values:

              Daytime: 6500K, night: 4500K
...              

Once you set up the redshift  configuration file, you can forget about it.
I usually just copy it from one OS to another.


EDIT
Check if this works in the terminal:

$ notify-send "Redshift" "Eyes protection changed" --icon=redshift

If it works, I will post a script that notifies you when it is Day / Transition / Night.
The Transition usually takes about 55 minutes because the redshift  protects the eyes and gradually adjusts the desktop.

Last edited by marens (2025-08-12 00:44:50)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#2348 2025-08-12 12:15:07

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

loutch wrote:

Hello


Day

https://thumbs2.imgbox.com/de/f2/99FgYB0w_t.png

Night
https://thumbs2.imgbox.com/2a/87/VwjczEtT_t.png


It's a shame that conky-clic no longer works; I could have done some interesting things with it..


@+

Avez-vous un exemple de clic conky? Je voudrais le tester.
---
Do you have an example of Conky-Click? I would like to test it.

Offline

#2349 2025-08-12 13:05:55

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

I have a CONKY from April 2010, creator is @olgmen.

Time; Calendar day; Temperature of the first two CPU;
Process relief; Frequency, as well as down and up.
Red flashes the 'request to take a break because I have been sitting on the computer for over 2 hours.  tongue

The proportions no longer matched the original. That's why I have this
in the configuration files 'somewhat shifted'.  big_smile
Compare the original image. Am, I blind?

@S11, can you help? (Of course, everyone else is also welcome  wink  )

2025-08-12-14-53-58-scrot.png

config 1.9

# main conkyrc by Boris Krinkel <olgmen>
# krinkel@rambler.ru
# --- параметры окна ---
# эти строки необходимы для нормальной работы лучше не изменять
own_window		yes
# для вывода фона раскомментировать следующую строку, установить цвет, в данный момент красный и в строке own_window_transparent прописать no
#own_window_colour ff0000
own_window_class	Conky 
own_window_transparent	yes 
own_window_type		override 
own_window_hints	undecorated,below,sticky,skip_taskbar,skip_pager 
# следующие параметры можно изменять
# минимальный размер
minimum_size 410 0 
# минимальная ширина
maximum_width 350 
# --- расположение окна
# левый верхний угол экрана 
#alignment top_left 
# левый нижний угол экрана
#alignment bottom_left 
# правый верхний угол экрана
alignment top_right 
# правый нижний угол экрана
#alignment bottom_right 
# расстояние между кромкой экрана и окном
# по горизонтали
gap_x 5 
# по вертикали
gap_y 30 

# --- графика окна --- 
# если желаете выводить conky на другом фоне напишите yes
background no
# окантовка окна, бордюр
draw_borders no
# если бордюр yes
# длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
stippled_borders 1
# толщина линий бордюра 
border_width 1
# бордюр вокруг выводимых графиков
draw_graph_borders no
# включить тень?
draw_shades no
# окантовка вокруг текста и выводимых объектов
draw_outline no 
# Добавить пробел?  Только для встраиваемых объектов 
use_spacer right 

# --- цвет ---
# основной цвет по умолчанию 
default_color DeepSkyBlue
# цвет тени
default_shade_color black 
# цвет окантовки
default_outline_color black
# дополнительные
color1 white
color2 yellow 
color3 red 

# --- шрифты ---
# используемые шрифты X когда Xft не используется, можно выбрать один из следующих 
#font 5x7 
#font 6x10 
#font 7x13 
#font 8x13 
#font 9x15 
#font *mintsmild.se* 
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-* 

# Используется ли Xft? 
use_xft yes 

# Шриф Xft когда Xft доступен, здесь можно ввести название и размер любого шрифта 
xftfont PT Sans:size=9 

# яркость шрифта при испоьзовании шрифтов Xft 
xftalpha 0.5 
# выводить весь текст прописными буквами 
uppercase no 
# использовать кодировку UTF8? ПРИМЕЧАНИЕ: требуется Xft 
override_utf8_locale yes 

# --- следующие данные необходимы для работы
# обновление в секундах не имеет смысла ставить больше 2
# при выводе времени в секундах необходимо значение 1 и менее
update_interval 0.5 
# время работы программы до её выключения
# установите 0 для работы программы без остановки
total_run_times 0
# двойная буфферизация (требуется для flicker, может не работать) 
double_buffer yes 
# вычитать буферизацию файловой системы из используемой памяти? 
no_buffers yes 
# количество cpu
cpu_avg_samples 2
# number of net samples to average 
net_avg_samples 2 
imlib_cache_size 0 
short_units yes 
pad_percents 2 
text_buffer_size 2048 
imlib_cache_size 0 


#--- LUA ---
lua_load ~/scripts/olgmen_scale.lua
lua_draw_hook_pre widgets

# ----------------------- ПРИМЕЧАНИЯ --------------------------------
#
# Первая строка после TEXT выводит время работы после включения компьютера. После двух часов работы
# надпись "Работаю: 2h 00m 00s" заменяется на мигающую надпись "ПОРА ОТДОХНУТЬ".
# Время можно установит изменив "2h 00m 00s" на любое другое, но в том же формате.
# Если такой "сервис" не нужен то первую строку приведите к такому виду
#
# ${goto 100}${voffset 40}${font PT Sans:Bold:size=12}Работаю: $uptime
#


TEXT
${voffset -20}${cpu cpu}
${voffset 20}${color ffffff}${font PT Sans:Bold:size=27}${time %H}${voffset -8}${font PT Sans:Bold:size=20}${time :%M}${voffset -6}${font PT Sans:Bold:size=12}${time :%S}${goto 180}${voffset -2}${font PT Sans:Bold:size=10}${if_match "${uptime}" > "2h 00m 00s"}${color ff0000}${goto 200}${blink ПОРА ОТДОХНУТЬ}${else}Работаю: $uptime${endif}
${goto 105}${voffset 10}${execpi 3600 ~/scripts/week1.sh}
${voffset 200}

config1.10

conky.config = {
-- main conkyrc by Boris Krinkel <olgmen>
-- krinkel@rambler.ru
-- --- параметры окна ---
-- эти строки необходимы для нормальной работы лучше не изменять
	own_window = true,
-- для вывода фона раскомментировать следующую строку, установить цвет, в данный момент красный и в строке own_window_transparent прописать no
--own_window_colour ff0000
	own_window_class = 'Conky',
	own_window_transparent = true,
	own_window_type = 'normal',--override',
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
-- следующие параметры можно изменять
-- минимальный размер
	minimum_width = 410, minimum_height = 0,
-- минимальная ширина
	maximum_width = 360,
-- --- расположение окна
-- левый верхний угол экрана 
--alignment top_left 
-- левый нижний угол экрана
--alignment bottom_left 
-- правый верхний угол экрана
	alignment = 'top_right',
-- правый нижний угол экрана
--alignment bottom_right 
-- расстояние между кромкой экрана и окном
-- по горизонтали
	gap_x = 30,
-- по вертикали
	gap_y = 30,

-- --- графика окна --- 
-- если желаете выводить conky на другом фоне напишите yes
	background = false,
-- окантовка окна, бордюр
	draw_borders = false,
-- если бордюр yes
-- длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
	stippled_borders = 1,
-- толщина линий бордюра 
	border_width = 1,
-- бордюр вокруг выводимых графиков
	draw_graph_borders = false,
-- включить тень?
	draw_shades = false,
-- окантовка вокруг текста и выводимых объектов
	draw_outline = false,
-- Добавить пробел?  Только для встраиваемых объектов 
	use_spacer = 'right',

-- --- цвет ---
-- основной цвет по умолчанию 
	default_color = 'DeepSkyBlue',
-- цвет тени
	default_shade_color = 'black',
-- цвет окантовки
	default_outline_color = 'black',
-- дополнительные
	color1 = 'white',
	color2 = 'yellow',
	color3 = 'red',

-- --- шрифты ---
-- используемые шрифты X когда Xft не используется, можно выбрать один из следующих 
--font 5x7 
--font 6x10 
--font 7x13 
--font 8x13 
--font 9x15 
--font *mintsmild.se* 
--font -*-*-*-*-*-*-34-*-*-*-*-*-*-* 

-- Используется ли Xft? 
	use_xft = true,

-- Шриф Xft когда Xft доступен, здесь можно ввести название и размер любого шрифта 
	font = 'PT Sans:size=9',

-- яркость шрифта при испоьзовании шрифтов Xft 
	xftalpha = 0.5,
-- выводить весь текст прописными буквами 
	uppercase = false,
-- использовать кодировку UTF8? ПРИМЕЧАНИЕ: требуется Xft 
	override_utf8_locale = true,

-- --- следующие данные необходимы для работы
-- обновление в секундах не имеет смысла ставить больше 2
-- при выводе времени в секундах необходимо значение 1 и менее
	update_interval = 0.5,
-- время работы программы до её выключения
-- установите 0 для работы программы без остановки
	total_run_times = 0,
-- двойная буфферизация (требуется для flicker, может не работать) 
	double_buffer = true,
-- вычитать буферизацию файловой системы из используемой памяти? 
	no_buffers = true,
-- количество cpu
	cpu_avg_samples = 2,
-- number of net samples to average 
	net_avg_samples = 2,
	imlib_cache_size = 0,
	short_units = true,
	pad_percents = 2,
	text_buffer_size = 2048,
	imlib_cache_size = 0,


----- LUA ---
	lua_load = '~/.conky/olgmen_scale/olgmen_scale.lua',
	lua_draw_hook_pre = 'widgets',

-- ----------------------- ПРИМЕЧАНИЯ --------------------------------

-- Первая строка после TEXT выводит время работы после включения компьютера. После двух часов работы
-- надпись "Работаю: 2h 00m 00s" заменяется на мигающую надпись "ПОРА ОТДОХНУТЬ".
-- Время можно установит изменив "2h 00m 00s" на любое другое, но в том же формате.
-- Если такой "сервис" не нужен то первую строку приведите к такому виду

-- ${goto 100}${voffset 40}${font PT Sans:Bold:size=12}Работаю: $uptime



};

conky.text = [[
${voffset -20}${cpu cpu}
${voffset 20}${color ffffff}${font PT Sans:Bold:size=27}${time %H}${voffset -4}${font PT Sans:Bold:size=20}${time :%M}${voffset -2}${font PT Sans:Bold:size=12}${time :%S}${goto 180}${voffset -0}${font PT Sans:Bold:size=10}${if_match "${uptime}" > "2h 00m 00s"}${color ff0000}${goto 200}${blink ПОРА ОТДОХНУТЬ}${else}Работаю: $uptime${endif}
${goto 100}${voffset -0}${execpi 3600 ~/.conky/olgmen_scale/week1.sh}
${voffset 200}
]];

olgmen_scale.lua

--[[
Conky Widgets by olgmen (04.2010)

для запуска необходимо ввести до TEXT сдедующие строки

#--- LUA ---
lua_load ~/scripts/olgmen_scale.lua
lua_draw_hook_pre widgets

при условии, что скрипт olgmen_scale.lua сохранен в папке ~/scripts
]]

require 'cairo'
require 'cairo_xlib'

-- ------------------------------------------------------------------------

--[[ DISK ]]

function scale (cr, x, y, radius, stat, max, element, width, gap, cap, start_angle, end_angle, bgc, bga, fgc, fga)

-- функция перекодировки цвета

		function rgb_to_r_g_b(colour,alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
		end

-- забираем данные из ОС


		local value = tonumber(conky_parse(stat))
		if value == nil then value = 0 end
		local pct = value/max

-- назначаем толщину выводимых линий

		local s_th = 2

-- основные данные

--[[
	переводим значение углов в радиальную меру start_angle * (math.pi / 180)

	точка начала вывода окруности, в lua+cairo расположена на координате Х, переводим на Y

	start_angle * (math.pi/180) - math.pi / 2 -- поворот влево на 90 градусов или на 1/4 круга
]]

-- начало дуги
		local sa = start_angle * (math.pi / 180) - math.pi / 2
-- конец дуги
		local ea =   end_angle * (math.pi / 180) - math.pi / 2

-- расчитываем длину дуги end_angle должен всегда быть больше start_angle

		local angle = ea - sa	-- центральный угол дуги

-- количество зазоров между элементами

		amount_gap = element - 1

-- общая ширина зазоров

		place_of_amount_gap = amount_gap * gap

-- место занимаемое элементами

		place_of_amount_element = end_angle - start_angle - place_of_amount_gap

-- ширина одного элемента

		width_of_element = place_of_amount_element / element

-- выводим дугу для фона
		local i = 0
-- деления выводим через расстояние равное ширине элемента+зазора между элементами
		local winkel = math.rad(width_of_element+gap)
-- выводим element делений для фона
		for i=0,element-1,1 do
-- устанавливаем толщину делений 
		cairo_set_line_width(cr,width_of_element)
-- вид делений
		cairo_set_line_cap  (cr, cap)
-- задаем цвет для фона
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
-- координаты начальных точек
		cairo_move_to(cr, x+math.cos(sa+winkel*i)*radius, y+math.sin(sa+winkel*i)*radius)
-- выводим деления
		cairo_line_to(cr, x+math.cos(sa+winkel*i)*(radius+width), y+math.sin(sa+winkel*i)*(radius+width))
		cairo_stroke(cr)
		end

		local proc = value / (max/element)

-- выводим дугу индикатора
		for i=0,proc,1 do
-- задаем цвет для element
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc, fga))
-- координаты начальных точек
		cairo_move_to(cr, x+math.cos(sa+winkel*i)*radius, y+math.sin(sa+winkel*i)*radius)
-- выводим деления
		cairo_line_to(cr, x+math.cos(sa+winkel*i)*(radius+width), y+math.sin(sa+winkel*i)*(radius+width))
		cairo_stroke(cr)
		end
-- стрелка --------------------------------------

		function hand(a_trame,arc,arc0,arc1,lg,r,border,rgb)

		xx = xc + radius*math.sin(arc)*lg
		yy = yc - radius*math.cos(arc)*lg
		x0 = xc + r*math.sin(arc0)
		y0 = yc - r*math.cos(arc0)
		x1 = xc + r*math.sin(arc1)
		y1 = yc - r*math.cos(arc1)

		cairo_set_line_width(cr,1)
		cairo_set_source_rgba(cr,border[1],border[2],border[3],0.5)
		cairo_move_to (cr, x0, y0)
		cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
		cairo_arc(cr,xc,yc,r,arc1-math.pi,arc0-math.pi)
		cairo_stroke(cr)

-- рисуем стрелку

		cairo_move_to (cr, x0, y0)
		cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
		cairo_arc(cr,xc,yc,r,arc1-math.pi,arc0-math.pi)
		pat = cairo_pattern_create_radial (xc, yc, radius/10, xc, yc, radius*lg)
		cairo_pattern_add_color_stop_rgba (pat,0, rgb[1], rgb[2], rgb[3], 1)
		cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1)
		cairo_set_source (cr, pat)
		cairo_fill (cr)
		cairo_pattern_destroy (pat)
		end

-- Здесь вводятся основные данные

-- координаты оси стрелки

		xc = x
		yc = y

-- размеры стрелки, первая цифра ширина, вторая - длина

		rs, lgs=2, 2.2	-- стрелка

-- расчет угла движения стрелки

		gamma = math.pi/2-math.atan(rs/(radius*lgs))
		secs_arc = ((ea - sa)/max)* value-math.pi/2
		secs_arc0=secs_arc-gamma
		secs_arc1=secs_arc+gamma

-- вывод стрелки

		hand(alpha_trame,secs_arc,secs_arc0,secs_arc1,lgs,rs,{0,0,0},{.8,.8,.8})

end
-- -------------------------------------------

--[[ TEXT WIDGET прямой ]]

function text_widget(cr, x, y, prefix, stat, suffix, font, fsize, fgc, fga, rotation)

-- функция перекодировки цвета

 	local function rgb_to_r_g_b(colour, alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end


-- функция добавления незначищих нулей

	function addzero100(num)

		if tonumber(num) < 10 then
			return "00" .. num
		elseif tonumber(num) <100 then
			return "0" .. num
		else
			return num
		end
	end

-- забираем данные из ОС

	local value = tonumber(conky_parse(stat))

	if value == nil then value = 0 end

-- назначаем шрифт

	cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD)


-- назначаем размер шрифта
	cairo_set_font_size (cr, fsize)
-- назначаем точку вывода	
	cairo_move_to(cr, x, y)
-- назначаем цвет шрифта
	cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
-- поворачиваем текст
	cairo_rotate (cr, rotation*math.pi/180)
-- выводим текст
	cairo_show_text(cr, prefix .. (addzero100(value)) .. suffix)
end
--[[ END TEXT WIDGET ]]
-- ----------------------------------------------------------------
--[[ TEXT WIDGET круговой ]]

	function addzero100(num)

	if tonumber(num) == nil then return end

		if tonumber(num) < 10 then
			return "00" .. num
		elseif tonumber(num) <100 then
			return "0" .. num
		else
			return num
		end
	end

	function string:split(delimiter)

		local result = { }
		local from  = 1
		local delim_from, delim_to = string.find( self, delimiter, from  )
		while delim_from do
		table.insert( result, string.sub( self, from , delim_from-1 ) )
		from  = delim_to + 1
		delim_from, delim_to = string.find( self, delimiter, from  )
		end
		table.insert( result, string.sub( self, from  ) )
		return result
	end

	function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)

		local inum=string.len(text)
		range=finish
		deg=(finish-start)/(inum-1)
		degrads=1*(math.pi/180)
		local textcut=string.gsub(text, ".", "%1@@@")
		texttable=string.split(textcut, "@@@")
		for i = 1,inum do
			ival=i
			interval=(degrads*(start+(deg*(i-1))))+var1
			interval2=degrads*(start+(deg*(i-1)))
			txs=0+radi*(math.sin(interval))
			tys=0-radi*(math.cos(interval))
			cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
			cairo_set_font_size (cr, fsize);
			cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
			cairo_move_to (cr, txs+horiz, tys+verti);
			cairo_rotate (cr, interval2)
			cairo_show_text (cr, (texttable[i]))
			cairo_rotate (cr, -interval2)
		end
	end

	function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)

		local inum=string.len(text)
		deg=(start-finish)/(inum-1)
		degrads=1*(math.pi/180)
		local textcut=string.gsub(text, ".", "%1@@@")
		texttable=string.split(textcut, "@@@")
		for i = 1,inum do
			ival=i
			interval=(degrads*(start-(deg*(i-1))))+var1
			interval2=degrads*(start-(deg*(i-1)))
			txs=0+radi*(math.sin(interval))
			tys=0-radi*(math.cos(interval))
			cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
			cairo_set_font_size (cr, fsize);
			cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
			cairo_move_to (cr, txs+horiz, tys+verti);
			cairo_rotate (cr, interval2+(180*math.pi/180))
			cairo_show_text (cr, (texttable[i]))
			cairo_rotate (cr, -interval2-(180*math.pi/180))
		end
	end

	function conky_draw_text()

		local updates=conky_parse('${updates}')
		update_num=tonumber(updates)

--circlewriting variable

cpu=tonumber(conky_parse('${cpu cpu1}'))
if cpu == nil then cpu = 0 end
--text must be in quotes
text=("CPU 1 " .. (addzero100(cpu)) .. " %") 
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=115
positionx=120
positiony=220
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=330
finish=380
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewriting variables
cpu=tonumber(conky_parse('${cpu cpu2}'))
if cpu == nil then cpu = 0 end
--text must be in quotes
text=("CPU 2 " .. (addzero100(cpu)) .. " %") 
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=115
positionx=290
positiony=220
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=330
finish=380
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)


--circlewritingdown variable
down=tonumber(conky_parse('${downspeedf enp2s0}'))
if down == nil then down = 0 end

--text must be in quotes
text=("DOWN " .. (addzero100(down)) .. " kB/s")
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=125
positionx=70
positiony=120
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=180
finish=120
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewriting variables
up=tonumber(conky_parse('${upspeedf enp2s0}'))
--text must be in quotes
text=("UP " .. (addzero100(up)) .. " kB/s") 
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=125
positionx=240
positiony=120
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=180
finish=120
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

	end
--[[ END TEXT WIDGET ]]
--------------------------------
function conky_widgets()
	if conky_window == nil then return end
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

---------------------------------
-- температура cpu1
cr = cairo_create(cs)
	scale (cr, 140, 160, 30, "${exec expr `cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon3/temp1_input` / 1000}", 100, 20, 1, 5, CAIRO_LINE_CAP_BUTT, 270, 390, 0xc0c0c0, 0.5, 0xffffff, 1)
--		       x,  y, radius,    name,  arg,  max,  bgc      bga     fgc  fga
text_widget(cr, 110, 175, "",  "${exec expr `cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon3/temp1_input` / 1000}", " °C", "PT Sans", 10, 0xffffff, 1, 0)
	cairo_destroy(cr)

-- cpu1
cr = cairo_create(cs)
	scale (cr, 120, 200, 100, "${cpu cpu1}", 100, 25, 1, 0.5, CAIRO_LINE_CAP_ROUND, 270, 390, 0xc0c0c0, 0.5, 0xffffff, 1)
--		       x,  y, radius,    name,  arg,  max,  bgc      bga     fgc  fga
	cairo_destroy(cr)

-- температура cpu2
cr = cairo_create(cs)
	scale (cr, 310, 160, 30, "${exec expr `cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon3/temp2_input` / 1000}", 100, 20, 1, 5, CAIRO_LINE_CAP_BUTT, 270, 390, 0xc0c0c0, 0.5, 0xffffff, 1)
--		       x,  y, radius,    name,  arg,  max,  bgc      bga     fgc  fga
text_widget(cr, 280, 175, "",  "${exec expr `cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon3/temp2_input` / 1000}", " °C", "PT Sans", 10, 0xffffff, 1, 0)
	cairo_destroy(cr)

-- cpu2
cr = cairo_create(cs)
	scale (cr, 290, 200, 100, "${cpu cpu2}", 100, 25, 1, 0.5, CAIRO_LINE_CAP_ROUND, 270, 390, 0xc0c0c0, 0.5, 0xffffff, 1)
--		       x,  y, radius,    name,  arg,  max,  bgc      bga     fgc  fga
	cairo_destroy(cr)

-- частота cpu1
cr = cairo_create(cs)
text_widget(cr, 10, 220, "", "${freq cpu1}", " MHz", "PT Sans", 10, 0xffffff, 1, 0)
	cairo_destroy(cr)

-- частота cpu2
cr = cairo_create(cs)
text_widget(cr, 180, 220, "", "${freq cpu2}", " MHz", "PT Sans", 10, 0xffffff, 1, 0)
	cairo_destroy(cr)

--[[ Вывод текста по кругу, настройке в скрипте ]]

	cr = cairo_create(cs)
	conky_draw_text()
	cairo_destroy(cr)

end

week1.sh

#!/bin/bash

font=("\${font PT Sans:bold:size=8}\${color cccccc}" "\${font PT Sans:bold:size=12}\${color dddddd}" "\${font PT Sans:bold:size=18}\${color eeeeee}" "\${font PT Sans:bold:size=27}\${color ffffff}" "\${voffset -8}\${font PT Sans:bold:size=18}\${color eeeeee}" "\${voffset -6}\${font PT Sans:bold:size=12}\${color dddddd}" "\${voffset -4}\${font PT Sans:bold:size=8}\${color cccccc}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done

Offline

#2350 2025-08-12 16:18:26

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

unklar wrote:
loutch wrote:

Hello


Day

https://thumbs2.imgbox.com/de/f2/99FgYB0w_t.png

Night
https://thumbs2.imgbox.com/2a/87/VwjczEtT_t.png


It's a shame that conky-clic no longer works; I could have done some interesting things with it..


@+

Avez-vous un exemple de clic conky? Je voudrais le tester.
---
Do you have an example of Conky-Click? I would like to test it.

HHallo

Hier ist mein Freund, mein alter, klickbarer Conky Audacious.

# -- Conky settings -- #
background no                                 
update_interval 0.5                             
cpu_avg_samples 2                             
net_avg_samples 2                             
override_utf8_locale yes                         
double_buffer yes                            
no_buffers yes
text_buffer_size 1024                             
imlib_cache_size 15000
max_specials 10000
max_user_text 15000
diskio_avg_samples 2                             
format_human_readable yes                         
border_inner_margin 0                            
border_outer_margin 0                            
# -- Window specifications -- #
own_window yes                                 
own_window_type normal                             
own_window_transparent no                         
own_window_argb_visual yes                         
own_window_argb_value 0                         
own_window_hints undecorate,skip_taskbar,skip_pager,below      
own_window_title media
minimum_size 412 176                             
maximum_width 412                             
alignment top_right                            
gap_x 40                                 
gap_y 820                                 
# -- Graphics settings -- #
draw_shades no                                
draw_outline no                                
draw_borders yes                                                       
draw_graph_borders no                            
border_width 0                                 
default_bar_size 210 4                            
default_color 000000
# -- Text settings -- #
use_xft yes                                 
xftfont GE Inspira:size=8                        
color1 92deee                                
color2 668c95
color3 d0fefb
color4 2f3d40
color5 ff6c4a
lua_load ~/.conky/audacious/scripts/button_script.lua
lua_draw_hook_pre get_mouse {"media","/tmp/xdo"} 
lua_startup_hook start_xdo /tmp/xdo
#lua_shutdown_hook stop_xdo
lua_load ~/.conky/audacious/scripts/lua_functions.lua
lua_load ~/.conky/lua/image.lua
template1 ${lua rc_button {btype=3,bname="button1",blx_off=278,bly_off=75,bw_off=22,bh_off=12}}
template2 ${lua rc_button {btype=3,bname="button2",blx_off=216,bly_off=75,bw_off=22,bh_off=12}}
template3 ${lua rc_button {btype=3,bname="button3",blx_off=185,bly_off=75,bw_off=22,bh_off=12}}
template4 ${lua rc_button {btype=3,bname="button4",blx_off=247,bly_off=75,bw_off=22,bh_off=12}}
template5 ${lua rc_button {btype=3,bname="button5",blx_off=309,bly_off=75,bw_off=22,bh_off=12}}
TEXT
${execi 3 ~/.conky/audacious/scripts/cover.sh}
${lua fDrawImage ~/.conky/audacious/casee.png 0 0 410 138}${lua fDrawImage ~/.conky/audacious/audacious.png 40 32 70 70}${lua fDrawImage ~/.conky/audacious/album.png 28 20 93 92}${voffset -30}${font GE Inspira :size=14}
${alignc -50}${execi 3 audtool current-song-tuple-data artist}${font}
${alignc -50}${execi 3 audtool current-song-tuple-data title}
${alignc -50}${execi 3 audtool current-song-tuple-data album}
${goto 160}${execi 1 audtool current-song-output-length}  ${goto 348}${execi 1 audtool current-song-length}
${voffset 10}${goto 160}${color 000000}${execbar expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}$color\
${goto 160}${color ffffff}${execbar echo 0}
${if_match ${template1}==0}
${else}${lua fDrawImage ~/.conky/audacious/images/Orange.png 360 5 35 35}${exec audacious --pause}
${endif}
${if_match ${template2}==0}
${else}${lua fDrawImage ~/.conky/audacious/images/Orange.png 360 5 35 35}${exec audacious --stop}
${endif}
${if_match ${template3}==0}
${else}${lua fDrawImage ~/.conky/audacious/images/Orange.png 360 5 35 35}${exec audacious --rew}
${endif}
${if_match ${template4}==0}
${else}${lua fDrawImage ~/.conky/audacious/images/Orange.png 360 5 35 35}${exec audacious --play}
${endif}
${if_match ${template5}==0}
${else}${lua fDrawImage ~/.conky/audacious/images/Orange.png 360 5 35 35}${exec audacious --fwd}
${endif}
${lua fDrawImage ~/.conky/audacious/ppause.png 278 65 30 15}
${lua fDrawImage ~/.conky/audacious/pstop.png 216 65 30 15}
${lua fDrawImage ~/.conky/audacious/pprev.png 185 65 30 15}
${lua fDrawImage ~/.conky/audacious/pplay.png 247 65 30 15}
${lua fDrawImage ~/.conky/audacious/pnext.png 309 65 30 15}
${voffset -350}

buttom_script.lua.

--[[buttons by mrpeachy - thanks to barrybarrykelly for the xdotool method, gmonti for finding the deb files for the xdotool and arclance for xdotool error catching
see here for instructions: [url]http://crunchbanglinux.org/forums/post/245759/#p245759[/url]
]]

conky_name="media"
click_data_file ="/tmp/xdo"

--setup buttons here
function button_settings()


end--function button_settings

require 'cairo'
require 'imlib2'
function conky_start_xdo(rc_info)--######################################################################################################################
click_data_file=rc_info or click_data_file
os.execute("pkill -f 'xdotool search --sync --classname conky behave %@ mouse-click getmouselocation'")
os.execute("xdotool search --sync --classname 'conky' behave %@ mouse-click getmouselocation 2> /dev/null >> "..click_data_file.." &")
rc_info=nil
end--of function ##################################################################################################################################

function conky_stop_xdo()--######################################################################################################################
os.execute("pkill -f 'xdotool search --sync --classname conky behave %@ mouse-click getmouselocation'")
end--of function ##################################################################################################################################

buttons={}--######################################################################################################################################
click_table={}--##################################################################################################################################
start=1
function conky_get_mouse(rc_info)--###############################################################################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
--##########################################################################
if rc_info~=nil then
rc_info=loadstring("return" .. rc_info)()
end
--start click logging and calculations #####################################
--##########################################################################
if start==1 then
current_update=tonumber(conky_parse("${updates}"))
start=0
end
local updates=tonumber(conky_parse("${updates}"))
if updates==(current_update or 0)+5 then
local click_data_file=rc_info[2] or click_data_file
local conky_name=rc_info[1] or conky_name
print ("own_window_title="..conky_name)
local f=io.popen("xwininfo -all -int -tree -name '"..conky_name.."'")
windata = f:read("*a")
f:close()
local windata=string.lower(windata)
local s,f,x=string.find(windata,"absolute%supper%pleft%sx%p%s*(%p*%d*)")
local s,f,y=string.find(windata,"absolute%supper%pleft%sy%p%s*(%p*%d*)")
local s,f,p=string.find(windata,"parent%swindow%sid%p%s(%d*)%s")
local s,f,w=string.find(windata,"xwininfo%p%swindow%sid%p%s(%d*)%s")
xwin={x,y,p,w,click_data_file}--don't blank with nil
print (xwin[1],xwin[2],xwin[3],xwin[4],xwin[5])
elseif updates<(current_update or 0)+5 then
local click_data_file=rc_info[2] or click_data_file
xwin={0,0,0,0,click_data_file}
end--if updates== ###########################################################
--click calculations ########################################################
--get now location and window id ############################################
local f = io.popen("xdotool getmouselocation 2> /dev/null")
mousenow=(f:read())
f:close()
local mousenow=string.lower(mousenow or "x:0 y:0 window:0 ")
local s,f,mousenowx=string.find(mousenow,"x%p(%d*)%s")
local s,f,mousenowy=string.find(mousenow,"y%p(%d*)%s")
local s,f,xwinid=string.find(mousenow,"window%p(%d*)")
local localnowx=(tonumber(mousenowx) or 0)-xwin[1]
local localnowy=(tonumber(mousenowy) or 0)-xwin[2]
--read file if windowid matches
if tonumber(xwin[3])==tonumber(xwinid) or tonumber(xwin[4])==tonumber(xwinid) then
    local f = io.open(xwin[5])
        click = f:read()
        f:close()
    --get click location
    if click==nil then click="x:0 y:0 window:0 " else print (click) end
    local s,f,mousex=string.find(click,"x%p(%d*)%s")
    local s,f,mousey=string.find(click,"y%p(%d*)%s")
    local localx=(tonumber(mousex) or 0)-xwin[1]
    local localy=(tonumber(mousey) or 0)-xwin[2]
    click_table[1]=localx
    click_table[2]=localy
    click_table[3]=localnowx
    click_table[4]=localnowy
    click=nil
    --blank file
    local f = io.open(xwin[5],"w")
    f:write("")
    f:close() 
else
    click_table[1]=0
    click_table[2]=0
    click_table[3]=0
    click_table[4]=0
end--window id matching
button_settings()
mousenow=nil
windata=nil
rc_info=nil
f=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end getmouse function ######################################################################################################################
--################################################################################################################################################

function do_button(bd)
if bd.btype==nil then
bd=loadstring("return" .. bd)()
end
local localx=click_table[1]    or 0
local localy=click_table[2]    or 0
local localnowx=click_table[3]    or 0
local localnowy=click_table[4]    or 0
local button_name=bd.bname
local st_type=bd.st_type    or 0
local btype=bd.btype        or 1
local on_on_on=bd.on_on_on    or {}
local on_on_off=bd.on_on_off    or {}
local off_on_on=bd.off_on_on    or {}
local off_on_off=bd.off_on_off    or {}
local return_co=bd.return_co    or 0
--#####################################
--#####################################
--initialize button
if buttons[tostring(button_name)]==nil then
    if btype~=4 and st_type==0 then --button is off on start
    buttons[tostring(button_name)]=0
    elseif btype~=4 and st_type==1 then --button is on on start
    buttons[tostring(button_name)]=1
    elseif btype==4 then
    buttons[tostring(button_name)]=1
    end
end
--set mouse point type
if btype==1 or btype==3 or btype==4 then
--on off execute or cycle
localx=localx
localy=localy
elseif btype==2 then
--mouse over
localx=localnowx
localy=localnowy
else
print ("button type not set")
end
--set click area if on or off
if btype~=4 and buttons[tostring(button_name)]==0 then
--button is off
blx=bd.blx_off
bly=bd.bly_off
bw=bd.bw_off
bh=bd.bh_off
elseif btype~=4 and buttons[tostring(button_name)]==1 then
--button is on
blx=bd.blx_on or bd.blx_off
bly=bd.bly_on or bd.bly_off
bw=bd.bw_on or bd.bw_off
bh=bd.bh_on or bd.bh_off
elseif btype==4 then
local blxt=bd.blx_cyc
local blyt=bd.bly_cyc
local bwt=bd.bw_cyc
local bht=bd.bh_cyc
local cynum=bd.cynum
local set=tonumber(buttons[tostring(button_name)])
blx=blxt[set] or blxt[#blxt]
bly=blyt[set] or blyt[#blyt]
bw=bwt[set] or bwt[#bwt]
bh=bht[set] or bht[#bht]
end
--set mechanism based on button type
if btype==1 then --on off ##############################################################
--if click is inside box and button is not on - turn on
if localx>=blx and localx<=blx+bw and localy<=bly and localy>=bly-bh and buttons[tostring(button_name)]~=1 then
buttons[tostring(button_name)]=1
--turn on other buttons as set
    for i=1,#on_on_on do
    buttons[tostring(on_on_on[i])]=1
    end
--turn off other buttons as set
    for i=1,#off_on_on do
    buttons[tostring(off_on_on[i])]=0
    end
--if click is inside box and button is on - turn off
elseif localx>=blx and localx<=blx+bw and localy<=bly and localy>=bly-bh and buttons[tostring(button_name)]==1 then
buttons[tostring(button_name)]=0
--turn off other buttons as set
    for i=1,#off_on_off do
    buttons[tostring(off_on_off[i])]=0
    end
--turn on other buttons as set
    for i=1,#on_on_off do
    buttons[tostring(on_on_off[i])]=1
    end
end
end --if btype==1###################################################################
if btype==2 then --mouse over ##############################################################
--if mouse is inside box
if localx>=blx and localx<=blx+bw and localy<=bly and localy>=bly-bh then
buttons[tostring(button_name)]=1
--turn on other buttons as set
    for i=1,#on_on_on do
    buttons[tostring(on_on_on[i])]=1
    end
--turn off other buttons as set
    for i=1,#off_on_on do
    buttons[tostring(off_on_on[i])]=0
    end
--if click is inside box and button is on - turn off
else --mouse is outside
buttons[tostring(button_name)]=0
--turn off other buttons as set
    for i=1,#off_on_off do
    buttons[tostring(off_on_off[i])]=0
    end
--turn on other buttons as set
    for i=1,#on_on_off do
    buttons[tostring(on_on_off[i])]=1
    end
end --if mouse inside
end --if btype==3###################################################################
if btype==3 then --execte ##############################################################
--if mouse click is inside box
if localx>=blx and localx<=blx+bw and localy<=bly and localy>=bly-bh then
buttons[tostring(button_name)]=1
--turn on other buttons as set
    for i=1,#on_on_on do
    buttons[tostring(on_on_on[i])]=1
    end
--turn off other buttons as set
    for i=1,#off_on_on do
    buttons[tostring(off_on_on[i])]=0
    end
--if click is inside box and button is on - turn off
else --mouse click is outside
buttons[tostring(button_name)]=0
--turn off other buttons as set
    for i=1,#off_on_off do
    buttons[tostring(off_on_off[i])]=0
    end
--turn on other buttons as set
    for i=1,#on_on_off do
    buttons[tostring(on_on_off[i])]=1
    end
end--if click inside
end --if btype==3###################################################################
if btype==4 then --cycle ##############################################################
local cynum=bd.cynum
--if mouse click is inside box
    if localx>=blx and localx<=blx+bw and localy<=bly and localy>=bly-bh then
        if buttons[tostring(button_name)]+1>cynum then
        buttons[tostring(button_name)]=1
        else
        buttons[tostring(button_name)]=buttons[tostring(button_name)]+1
        end
    end--if click inside
end --if btype==4###################################################################
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
--draw #############################################################################
local draw=bd.draw or 0
if draw==1 then--#########################################################################################
--set variables if button on or off
if btype~=4 and buttons[tostring(button_name)]==0 then
dtype=bd.dtype_off  or 1
--fill when off
dfblx=bd.dfxadj_off or 0
dfbly=bd.dfyadj_off or 0
dfw=bd.dfw_off      or bw
dfh=bd.dfh_off      or bh
dfcr=bd.dfcr_off    or 0
dfcol=bd.dfcol_off  or 0x2f3d43
dfal=bd.dfal_off    or 1
--outline when off
doblx=bd.doxadj_off or 0
dobly=bd.doyadj_off or 0
dow=bd.dow_off      or bw
doh=bd.doh_off      or bh
docr=bd.docr_off    or 0
docol=bd.docol_off  or 0xffffff
doal=bd.doal_off    or 1
dolw=bd.dolw_off    or 1
elseif btype~=4 and buttons[tostring(button_name)]==1 then--draw on and button on
dtype=bd.dtype_on  or bd.dtype_off or 1
--fill when on
dfblx=bd.dfxadj_on or 0
dfbly=bd.dfyadj_on or 0
dfw=bd.dfw_on      or bw
dfh=bd.dfh_on      or bh
dfcr=bd.dfcr_on    or 0
dfcol=bd.dfcol_on  or 0x92deee
dfal=bd.dfal_on    or 1
--outline when on
doblx=bd.doxadj_on or 0
dobly=bd.doyadj_on or 0
dow=bd.dow_on      or bw
doh=bd.doh_on      or bh
docr=bd.docr_on    or 0 
docol=bd.docol_on  or 0xff0000
doal=bd.doal_on    or 1
dolw=bd.dolw_on    or 1
--###########################################
elseif btype==4 then --#######################
--###########################################
local cynum=bd.cynum
local set=tonumber(buttons[tostring(button_name)])
--set draw type
dtypet=bd.dtype_cyc or {1}
dtype=dtypet[set] or dtypet[#dtypet]
--fill cycle
local dfblxt=bd.dfxadj_cyc or {0}
local dfblyt=bd.dfyadj_cyc or {0}
local dfwt=bd.dfw_cyc      or {bw}
local dfht=bd.dfh_cyc      or {bh}
local dfcrt=bd.dfcr_cyc    or {0}
local dfcolt=bd.dfcol_cyc  or {0xffffff}
local dfalt=bd.dfal_cyc    or {1}
dfblx=dfblxt[set] or dfblxt[#dfblxt] or 0
dfbly=dfblyt[set] or dfblyt[#dfblyt] or 0
dfw=dfwt[set]     or dfwt[#dfwt]     or bw
dfh=dfht[set]     or dfht[#dfht]     or bh
dfcr=dfcrt[set]   or dfcrt[#dfcrt]   or 0
dfcol=dfcolt[set] or dfcolt[#dfcolt] or 0xffffff
dfal=dfalt[set]   or dfalt[#dfalt]   or 1
--outline cycle
local doblxt=bd.doxadj_off or {0}
local doblyt=bd.doyadj_off or {0}
local dowt=bd.dow_off      or {bw}
local doht=bd.doh_off      or {bh}
local docrt=bd.docr_off    or {0}
local docolt=bd.docol_off  or {0xffffff}
local doalt=bd.doal_off    or {1}
local dolwt=bd.dolw_off    or {1}    
doblx=doblxt[set] or doblxt[#doblxt] or 0
dobly=doblyt[set] or doblyt[#doblyt] or 0
dow=dowt[set]     or dowt[#dowt]     or bw
doh=doht[set]     or doht[#doht]     or bh
docr=docrt[set]   or docrt[#docrt]   or 0
docol=docolt[set] or docolt[#docolt] or 0xff0000
doal=doalt[set]   or doalt[#doalt]   or 1
dolw=dolwt[set]   or dolwt[#dolwt]   or 1
else
print ("error4")
end--check btype and button on off
--##########################
--draw based on type
if dtype==1 then
--top left mid circle
local xtl=blx+dfblx+dfcr
local ytl=bly+dfbly-(dfh-dfcr)
--top right mid circle
local xtr=xtl+(dfw-(dfcr*2))
local ytr=ytl
--bottom right mid circle
local xbr=xtr
local ybr=bly+dfbly-dfcr
--bottom left mid circle
local xbl=xtl
local ybl=ybr
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-dfcr)
cairo_line_to (cr,xtr,ytr-dfcr)
cairo_arc(cr,xtr,ytr,dfcr,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+dfcr,ybr)
cairo_arc(cr,xbr,ybr,dfcr,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+dfcr)
cairo_arc(cr,xbl,ybl,dfcr,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-dfcr,ytl)
cairo_arc(cr,xtl,ytl,dfcr,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({dfcol,dfal}))
cairo_fill (cr)
elseif dtype==2 then
--top left mid circle
local xtl=blx+doblx+docr
local ytl=bly+dobly-(doh-docr)
--top right mid circle
local xtr=xtl+(dow-(docr*2))
local ytr=ytl
--bottom right mid circle
local xbr=xtr
local ybr=bly+dobly-docr
--bottom left mid circle
local xbl=xtl
local ybl=ybr
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-docr)
cairo_line_to (cr,xtr,ytr-docr)
cairo_arc(cr,xtr,ytr,docr,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+docr,ybr)
cairo_arc(cr,xbr,ybr,docr,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+docr)
cairo_arc(cr,xbl,ybl,docr,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-docr,ytl)
cairo_arc(cr,xtl,ytl,docr,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({docol,doal}))
cairo_set_line_width (cr,dolw)
cairo_stroke (cr)
elseif dtype==3 then
--top left mid circle
local xtl=blx+dfblx+dfcr
local ytl=bly+dfbly-(dfh-dfcr)
--top right mid circle
local xtr=xtl+(dfw-(dfcr*2))
local ytr=ytl
--bottom right mid circle
local xbr=xtr
local ybr=bly+dfbly-dfcr
--bottom left mid circle
local xbl=xtl
local ybl=ybr
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-dfcr)
cairo_line_to (cr,xtr,ytr-dfcr)
cairo_arc(cr,xtr,ytr,dfcr,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+dfcr,ybr)
cairo_arc(cr,xbr,ybr,dfcr,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+dfcr)
cairo_arc(cr,xbl,ybl,dfcr,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-dfcr,ytl)
cairo_arc(cr,xtl,ytl,dfcr,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({dfcol,dfal}))
cairo_fill (cr)
--top left mid circle
local xtl=blx+doblx+docr
local ytl=bly+dobly-(doh-docr)
--top right mid circle
local xtr=xtl+(dow-(docr*2))
local ytr=ytl
--bottom right mid circle
local xbr=xtr
local ybr=bly+dobly-docr
--bottom left mid circle
local xbl=xtl
local ybl=ybr
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-docr)
cairo_line_to (cr,xtr,ytr-docr)
cairo_arc(cr,xtr,ytr,docr,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+docr,ybr)
cairo_arc(cr,xbr,ybr,docr,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+docr)
cairo_arc(cr,xbl,ybl,docr,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-docr,ytl)
cairo_arc(cr,xtl,ytl,docr,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({docol,doal}))
cairo_set_line_width (cr,dolw)
cairo_stroke (cr)
end
end--if draw=1 #################################################################################
local image=bd.image or 0
if image==1 then--##############################################################################
if btype~=4 and buttons[tostring(button_name)]==0 then
file=tostring(bd.im_file_off)
if file==nil then print("set image file") end
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
    if tonumber(bw)==0 then 
    width=imlib_image_get_width() 
    end
    if tonumber(bh)==0 then 
    height=imlib_image_get_height() 
    end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), bw, bh)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(blx, bly-bh)
imlib_free_image()
show=nil
elseif btype~=4 and buttons[tostring(button_name)]==1 then
file=tostring(bd.im_file_on)
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
    if tonumber(bw)==0 then 
    width=imlib_image_get_width() 
    end
    if tonumber(bh)==0 then 
    height=imlib_image_get_height() 
    end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), bw, bh)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(blx, bly-bh)
imlib_free_image()
show=nil
elseif btype==4 then
local cynum=bd.cynum
local set=tonumber(buttons[tostring(button_name)])
local file=bd.im_file_cyc or {}
file=file[set]
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
    if tonumber(bw)==0 then 
    width=imlib_image_get_width() 
    end
    if tonumber(bh)==0 then 
    height=imlib_image_get_height() 
    end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), bw, bh)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(blx, bly-bh)
imlib_free_image()
show=nil
end--btype test
end--if image ##################################################################################
local text=bd.text
if text==1 then --##############################################################################
--set variables if button on or off
if btype~=4 and buttons[tostring(button_name)]==0 then
local txt=bd.txt_off   or {"text"}
local font=bd.font_off or {"mono"}
local fs=bd.fs_off     or {12}
local fx=bd.fxadj_off  or {0}
local fy=bd.fyadj_off  or {0}
local fcol=bd.fcol_off or {0x000000}
local fal=bd.fal_off   or {1}
    for i=1,#txt do
    cairo_select_font_face (cr, font[i] or font[#font], CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, fs[i] or fs[#fs])
    cairo_set_source_rgba (cr,rgb_to_r_g_b({fcol[i] or fcol[#fcol],fal[i] or fal[#fal]}))
    cairo_move_to (cr,blx+(fx[i] or fx[#fx]),bly+(fy[i] or fy[#fy]))
    cairo_show_text (cr, txt[i] or txt[#txt])
    cairo_stroke (cr)
    end
elseif btype~=4 and buttons[tostring(button_name)]==1 then
local txt=bd.txt_on   or bd.txt_off   or {"text"}
local font=bd.font_on or bd.font_off  or {"mono"}
local fs=bd.fs_on     or bd.fs_off    or {12}
local fx=bd.fxadj_on  or bd.fxadj_off or {0}
local fy=bd.fyadj_on  or bd.fyadj_off or {0}
local fcol=bd.fcol_on or bd.fcol_off  or {0x000000}
local fal=bd.fal_on   or bd.fal_off   or {1}
    for i=1,#txt do
    cairo_select_font_face (cr, font[i] or font[#font], CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, fs[i] or fs[#fs])
    cairo_set_source_rgba (cr,rgb_to_r_g_b({fcol[i] or fcol[#fcol],fal[i] or fal[#fal]}))
    cairo_move_to (cr,blx+(fx[i] or fx[#fx]),bly+(fy[i] or fy[#fy]))
    cairo_show_text (cr, txt[i] or txt[#txt])
    cairo_stroke (cr)
    end
elseif btype==4 then
--text for cycle trype button
--into tables round 1
local cynum=bd.cynum
local set=tonumber(buttons[tostring(button_name)])
local txtt=bd.txt_cyc   or {{"text"}}
local fontt=bd.font_cyc or {{"mono"}}
local fst=bd.fs_cyc     or {{12}}
local fxt=bd.fxadj_cyc  or {{0}}
local fyt=bd.fyadj_cyc  or {{0}}
local fcolt=bd.fcol_cyc or {{0x000000}}
local falt=bd.fal_cyc   or {{1}}
--into tables round 2
local txt=txtt[set]    or txtt[#txtt]
local font=fontt[set]  or fontt[#fontt]
local fs=fst[set]      or fst[#fst]
local fx=fxt[set]      or fxt[#fxt]
local fy=fyt[set]      or fyt[#fyt]
local fcol=fcolt[set]  or fcolt[#fcolt]
local fal=falt[set]    or falt[#falt]
    for i=1,#txt do
    cairo_select_font_face (cr, font[i] or font[#font], CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, fs[i] or fs[#fs])
    cairo_set_source_rgba (cr,rgb_to_r_g_b({fcol[i] or fcol[#fcol],fal[i] or fal[#fal]}))
    cairo_move_to (cr,blx+(fx[i] or fx[#fx]),bly+(fy[i] or fy[#fy]))
    cairo_show_text (cr, txt[i] or txt[#txt])
    cairo_stroke (cr)
    end
else
print ("error with text")
end--if buttons[]==0
end--if text==1 ################################################################################
--##############################################################################################
if return_co==0 then
return tonumber(buttons[tostring(button_name)])
elseif return_co==1 then
return tonumber(buttons[tostring(button_name)]),localnowx,localnowy
end--return settings
end-- end button calculations function #################################
--######################################################################

function conky_rc_button(bd)--function to setup button in conkyrc
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--###################################
send=do_button(bd)
--###################################
end--if updates>3
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return send or 0
end-- end main function

enjoy

@+

@+

Last edited by loutch (2025-08-12 16:51:50)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2351 2025-08-12 18:15:14

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

Ce qui me frappe immédiatement, c'est que dans le fichier « button_script.lua »,
les appels require manquent (également dans « lua_functions.lua », que tu n'as pas fourni).

...
require 'cairo'
require 'imlib2'
require 'cairo_xlib'
...

Je dois d'abord rassembler les images dans mes archives et les nommer correctement, car tu les as modifiées au fil des ans.

J'ai modifié le conky dans la syntaxe 1.10...

conky.config = {
-- -- Conky settings -- #
	background = false,
	update_interval = 0.5,
	cpu_avg_samples = 2,
	net_avg_samples = 2,
	override_utf8_locale = true,
	double_buffer = true,
	no_buffers = true,
	text_buffer_size = 1024,
	imlib_cache_size = 15000,
	max_specials = '10000',
	max_user_text = 15000,
	diskio_avg_samples = 2,
	format_human_readable = true,
	border_inner_margin = 0,
	border_outer_margin = 0,
-- -- Window specifications -- #
	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = false,
	own_window_argb_visual = true,
	own_window_argb_value = 0,
	own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
	own_window_title = 'media',
	minimum_width = 412, minimum_height = 176,
	maximum_width = 412,
	alignment = 'top_left',--right',
	gap_x = 80,
	gap_y = 820,
-- -- Graphics settings -- #
	draw_shades = false,
	draw_outline = false,
	draw_borders = true,
	draw_graph_borders = false,
	border_width = 0,
	default_bar_width = 210, default_bar_height = 4,
	default_color = '#000000',
-- -- Text settings -- #
	use_xft = true,
	font = 'GE Inspira:size=8',
	color1 = '#92deee',
	color2 = '#668c95',
	color3 = '#d0fefb',
	color4 = '#2f3d40',
	color5 = '#ff6c4a',
	lua_load = '~/.conky/Audacious/scripte/button_script.lua',
	lua_draw_hook_pre = 'get_mouse {"media","/tmp/xdo"}',
	lua_startup_hook = 'start_xdo /tmp/xdo',
--lua_shutdown_hook stop_xdo
	lua_load = '~/.conky/Audacious/scripte/lua_functions.lua',
--lua_load = '~/.conky/lua/image.lua',
	template1 = '${lua rc_button {btype=3,bname="button1",blx_off=278,bly_off=75,bw_off=22,bh_off=12}}',
	template2 = '${lua rc_button {btype=3,bname="button2",blx_off=216,bly_off=75,bw_off=22,bh_off=12}}',
	template3 = '${lua rc_button {btype=3,bname="button3",blx_off=185,bly_off=75,bw_off=22,bh_off=12}}',
	template4 = '${lua rc_button {btype=3,bname="button4",blx_off=247,bly_off=75,bw_off=22,bh_off=12}}',
	template5 = '${lua rc_button {btype=3,bname="button5",blx_off=309,bly_off=75,bw_off=22,bh_off=12}}',
};

conky.text = [[
${execi 3 ~/.conky/Audacious/scripte/cover.sh}
${lua fDrawImage ~/.conky/Audacious/casee.png 0 0 410 138}${lua fDrawImage ~/.conky/audacious/audacious.png 40 32 70 70}${lua fDrawImage ~/.conky/audacious/album.png 28 20 93 92}${voffset -30}${font GE Inspira :size=14}
${alignc -50}${execi 3 audtool current-song-tuple-data artist}${font}
${alignc -50}${execi 3 audtool current-song-tuple-data title}
${alignc -50}${execi 3 audtool current-song-tuple-data album}
${goto 160}${execi 1 audtool current-song-output-length}  ${goto 348}${execi 1 audtool current-song-length}
${voffset 10}${goto 160}${color 000000}${execbar expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}$color\
${goto 160}${color ffffff}${execbar echo 0}
${if_match ${template1}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec audacious --pause}
${endif}
${if_match ${template2}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec audacious --stop}
${endif}
${if_match ${template3}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec audacious --rew}
${endif}
${if_match ${template4}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec audacious --play}
${endif}
${if_match ${template5}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec audacious --fwd}
${endif}
${lua fDrawImage ~/.conky/Audacious/ppause.png 278 65 30 15}
${lua fDrawImage ~/.conky/Audacious/pstop.png 216 65 30 15}
${lua fDrawImage ~/.conky/Audacious/pprev.png 185 65 30 15}
${lua fDrawImage ~/.conky/Audacious/pplay.png 247 65 30 15}
${lua fDrawImage ~/.conky/Audacious/pnext.png 309 65 30 15}
${voffset -350}
]];

Essaie d'abord avec « require ».
------------------------------------
What immediately strikes me is that the require calls are missing in ‘button_script.lua’
(also in ‘lua_functions.lua’, which you did not provide).
--
I first have to gather the images in my archive and label them correctly, because you changed that over the years.

I changed the conky to syntax 1.10...


Try it with ‘require’ first.

Offline

#2352 2025-08-13 07:23:56

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

jyCJS3et.png

conky: desktop window (0x49d) is root window
conky: window type - normal
conky: drawing to created window (0x4a00002)
conky: drawing to double buffer
conky: Unknown setting 'max_specials'
conky: FOUND: wayland
conky: FOUND: x11
conky: FOUND: file
conky: FOUND: ncurses
conky: FOUND: console
conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
conky: llua_do_call: function conky_start_xdo execution failed: attempt to call a nil value
conky: 'bunsenlabs' x11 session running 'BunsenLabs' desktop
conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
cp: der Aufruf von stat für '/tmp/audacious-temp*' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
expr: Teilung durch Null
conky: reading exec value failed (perhaps it's not the correct format?)
conky: llua_do_call: function conky_rc_button execution failed: attempt to call a nil value
conky: failed to parse compare string '==0'
conky: compare failed for expression '==0'
conky: llua_do_call: function conky_rc_button execution failed: attempt to call a nil value
conky: failed to parse compare string '==0'
conky: compare failed for expression '==0'
conky: llua_do_call: function conky_rc_button execution failed: attempt to call a nil value
conky: failed to parse compare string '==0'
conky: compare failed for expression '==0'
conky: llua_do_call: function conky_rc_button execution failed: attempt to call a nil value
conky: failed to parse compare string '==0'
conky: compare failed for expression '==0'
conky: llua_do_call: function conky_rc_button execution failed: attempt to call a nil value
conky: failed to parse compare string '==0'
conky: compare failed for expression '==0'
conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
expr: Teilung durch Null
.....

Je ne suis pas sûr d'avoir pris en compte TOUTES les configurations...
-----------
I'm not sure if I've actually taken ALL configurations into account...

Last edited by unklar (2025-08-13 07:25:46)

Offline

#2353 2025-08-13 07:29:05

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hallo

Entschuldigung, aber seit diesem Conky habe ich die Distribution und den Computer gewechselt und finde bestimmte Skripte nicht mehr. Ich durchsuche die Tiefen der Foren, um sie wiederzufinden..


.......................................................................................

Sorry, but since this Conky, I've changed my distribution and computer and can no longer find certain scripts. I'm searching the depths of the forums to find them again.

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2354 2025-08-13 08:03:11

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

Je peux t'aider.  big_smile
Pour cela, je dois savoir ce que tu cherches.

En tout cas, le script qui lance ma station dans Audacity ne fonctionne plus chez moi. Je devrais intégrer ici le nouveau script de @marens...

--------------------
I can help you out.  big_smile
To do that, I need to know what you're looking for.

In any case, the script that calls up my station in Audacity is no longer working for me. I'd have to add the new one from @marens here...

Offline

#2355 2025-08-13 08:19:11

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hallo

Habe defunden

lua_function.lua

--[[ by mrpeachy - 
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function conky_gradbar(bartab) -- {x=,y=,v="",vmax=,dn=,dw=,dh=,dg=,bc=,ba=,sc=,sa=,mc=,ma=,ec=,ea=} ################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then --as this function may use conky_parse("${cpu}")
--#########################################################################################################
--convert to table
if bartab.x==nil then
bartab=loadstring("return" .. bartab)()
end
local bar_startx=bartab.x
local bar_starty=bartab.y
local number=bartab.v		or "${cpu}"
local number=conky_parse(number)
local number_max=bartab.vmax	or 100
local divisions=bartab.dn     	or 50
local div_width=bartab.dw	or 2
local div_height=bartab.dh	or 5
local div_gap=bartab.dg		or 1
local bg_col=bartab.bc		or 0xffffff
local bg_alpha=bartab.ba	or 1
local st_col=bartab.sc		or 0x00ff00
local st_alpha=bartab.sa	or 1
local mid_col=bartab.mc		or 0xffff00
local mid_alpha=bartab.ma	or 1
local end_col=bartab.ec		or 0xff0000
local end_alpha=bartab.ea	or 1
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b(bg_col,bg_alpha)
local sr,sg,sb,sa=rgb_to_r_g_b(st_col,st_alpha)
local mr,mg,mb,ma=rgb_to_r_g_b(mid_col,mid_alpha)
local er,eg,eb,ea=rgb_to_r_g_b(end_col,end_alpha)
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ###################################################################################


function conky_draw_bg(bgtab) -- {r=,x=,y=,w=,h=,dr=,fc=,fa=,lw=,lc=,la=} #################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
if bgtab.x==nil then
bgtab=loadstring("return" .. bgtab)()
end
local r=bgtab.r		or 0
local x=bgtab.x
local y=bgtab.y
local w=bgtab.w
local h=bgtab.h
local draw=bgtab.dr	or 1
local color=bgtab.fc	or 0x000000
local alpha=bgtab.fa	or 1
local lwidth=bgtab.lw	or 1
local olcolor=bgtab.lc	or 0x000000
local olalpha=bgtab.la	or 1
if w==0 then 
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
cairo_fill (cr)
elseif draw==2 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(olcolor,olalpha))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b(olcolor,olalpha))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ##############################################################################


function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf		or "mono"
local tfontsize=caltab.tfs	or 12
local tc=caltab.tc		or 0xffffff
local ta=caltab.ta		or 1
local bfont=caltab.bf		or "mono"
local bfontsize=caltab.bfs	or 12
local bc=caltab.bc		or 0xffffff
local ba=caltab.ba		or 1
local hfont=caltab.hf		or "mono"
local hfontsize=caltab.hfs	or 12
local hc=caltab.hc		or 0xff0000
local ha=caltab.ha		or 1
local spacer=caltab.sp		or " "
local gaph=caltab.gh		or 20
local gapt=caltab.gt		or 15
local gapl=caltab.gv		or 15
local sday=caltab.sd		or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end     
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then 
dlen=35
plen=29 
else 
dlen=42 
plen=36
end
for i=1,dlen do
	if i<=start_day then 
	dnum[i]="  " 
	else 
	dn=i-start_day
		if dn=="nil" then dn=0 end
		if dn<=9 then dn=(spacer .. dn) end
		if i>x then dn="" end
		dnum[i]=dn
		dnumh[i]=dn
		if dn==(spacer .. today) or dn==today then
		dnum[i]=""
		end 
		if dn==(spacer .. today) or dn==today then
		dnumh[i]=dn
		place=i 
		else dnumh[i]="  " 
		end 
	end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
	for i=fn,fn+6 do
	cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
	cairo_show_text (cr, dnum[i])
	cairo_stroke (cr)
	end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
	for i=fn,fn+6 do
	cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
	cairo_show_text (cr, dnumh[i])
	cairo_stroke (cr)
	end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function###################################################################################


function conky_luaimage(imtab)-- {x=,y=,w=,h=,file=""} ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
if imtab.x==nil then
imtab=loadstring("return" .. imtab)()
end
local im_x=imtab.x
local im_y=imtab.y
local im_w=imtab.w
local im_h=imtab.h
local file=imtab.file
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ##################################################################################


function conky_tex_bg(textab)--{r=,x=,y=,w=,h=,file=""} ##################################################
if textab.x==nil then
textab=loadstring("return" .. textab)()
end
local tex_file=textab.file
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab.r or 0
local x=textab.x
local y=textab.y
local w=textab.w
local h=textab.h
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function####################################################################################


function conky_luatext(txttab)--{x=,y=,c=,a=,f="",fs=,txt="",j=""} ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
if txttab.x==nil then
txttab=loadstring("return" .. txttab)()
end
local x=txttab.x
local y=txttab.y
local c=txttab.c	or 0xffffff
local a=txttab.a	or 1
local f=txttab.f	or "mono"
local fs=txttab.fs	or 12
local j=txttab.j	or "l"
local txt=txttab.txt--]]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b(c,a))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#2356 2025-08-13 08:27:59

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

D'après mes archives, il te faut encore :

lua_functions.lua

--[[ by mrpeachy - 
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
require 'cairo_xlib'

function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function conky_gradbar(bartab) -- {x=,y=,v="",vmax=,dn=,dw=,dh=,dg=,bc=,ba=,sc=,sa=,mc=,ma=,ec=,ea=} ################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then --as this function may use conky_parse("${cpu}")
--#########################################################################################################
--convert to table
if bartab.x==nil then
bartab=loadstring("return" .. bartab)()
end
local bar_startx=bartab.x
local bar_starty=bartab.y
local number=bartab.v		or "${cpu}"
local number=conky_parse(number)
local number_max=bartab.vmax	or 100
local divisions=bartab.dn     	or 50
local div_width=bartab.dw	or 2
local div_height=bartab.dh	or 5
local div_gap=bartab.dg		or 1
local bg_col=bartab.bc		or 0xffffff
local bg_alpha=bartab.ba	or 1
local st_col=bartab.sc		or 0x00ff00
local st_alpha=bartab.sa	or 1
local mid_col=bartab.mc		or 0xffff00
local mid_alpha=bartab.ma	or 1
local end_col=bartab.ec		or 0xff0000
local end_alpha=bartab.ea	or 1
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b(bg_col,bg_alpha)
local sr,sg,sb,sa=rgb_to_r_g_b(st_col,st_alpha)
local mr,mg,mb,ma=rgb_to_r_g_b(mid_col,mid_alpha)
local er,eg,eb,ea=rgb_to_r_g_b(end_col,end_alpha)
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ###################################################################################


function conky_draw_bg(bgtab) -- {r=,x=,y=,w=,h=,dr=,fc=,fa=,lw=,lc=,la=} #################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
if bgtab.x==nil then
bgtab=loadstring("return" .. bgtab)()
end
local r=bgtab.r		or 0
local x=bgtab.x
local y=bgtab.y
local w=bgtab.w
local h=bgtab.h
local draw=bgtab.dr	or 1
local color=bgtab.fc	or 0x000000
local alpha=bgtab.fa	or 1
local lwidth=bgtab.lw	or 1
local olcolor=bgtab.lc	or 0x000000
local olalpha=bgtab.la	or 1
if w==0 then 
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
cairo_fill (cr)
elseif draw==2 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(olcolor,olalpha))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b(olcolor,olalpha))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ##############################################################################


function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf		or "mono"
local tfontsize=caltab.tfs	or 12
local tc=caltab.tc		or 0xffffff
local ta=caltab.ta		or 1
local bfont=caltab.bf		or "mono"
local bfontsize=caltab.bfs	or 12
local bc=caltab.bc		or 0xffffff
local ba=caltab.ba		or 1
local hfont=caltab.hf		or "mono"
local hfontsize=caltab.hfs	or 12
local hc=caltab.hc		or 0xff0000
local ha=caltab.ha		or 1
local spacer=caltab.sp		or " "
local gaph=caltab.gh		or 20
local gapt=caltab.gt		or 15
local gapl=caltab.gv		or 15
local sday=caltab.sd		or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end     
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then 
dlen=35
plen=29 
else 
dlen=42 
plen=36
end
for i=1,dlen do
	if i<=start_day then 
	dnum[i]="  " 
	else 
	dn=i-start_day
		if dn=="nil" then dn=0 end
		if dn<=9 then dn=(spacer .. dn) end
		if i>x then dn="" end
		dnum[i]=dn
		dnumh[i]=dn
		if dn==(spacer .. today) or dn==today then
		dnum[i]=""
		end 
		if dn==(spacer .. today) or dn==today then
		dnumh[i]=dn
		place=i 
		else dnumh[i]="  " 
		end 
	end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
	for i=fn,fn+6 do
	cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
	cairo_show_text (cr, dnum[i])
	cairo_stroke (cr)
	end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
	for i=fn,fn+6 do
	cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
	cairo_show_text (cr, dnumh[i])
	cairo_stroke (cr)
	end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function###################################################################################


function conky_luaimage(imtab)-- {x=,y=,w=,h=,file=""} ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
if imtab.x==nil then
imtab=loadstring("return" .. imtab)()
end
local im_x=imtab.x
local im_y=imtab.y
local im_w=imtab.w
local im_h=imtab.h
local file=imtab.file
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function ##################################################################################


function conky_tex_bg(textab)--{r=,x=,y=,w=,h=,file=""} ##################################################
if textab.x==nil then
textab=loadstring("return" .. textab)()
end
local tex_file=textab.file
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab.r or 0
local x=textab.x
local y=textab.y
local w=textab.w
local h=textab.h
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function####################################################################################


function conky_luatext(txttab)--{x=,y=,c=,a=,f="",fs=,txt="",j=""} ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
if txttab.x==nil then
txttab=loadstring("return" .. txttab)()
end
local x=txttab.x
local y=txttab.y
local c=txttab.c	or 0xffffff
local a=txttab.a	or 1
local f=txttab.f	or "mono"
local fs=txttab.fs	or 12
local j=txttab.j	or "l"
local txt=txttab.txt--]]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b(c,a))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function

et puis tu avais encore(même si cela n'est probablement pas nécessaire pour @marens)
cover.sh

 
#!/bin/bash
# créer par Loutch

cp /tmp/audacious-temp* ~/.conky/audacious/audacious.jpg 

convert ~/.conky/audacious/audacious.jpg ~/.conky/audacious/audacious.png

exit

-----------
According to my records, you still need:
...
And then you still had (although that's probably not necessary for @marens)
...

Last edited by unklar (2025-08-13 08:29:30)

Offline

#2357 2025-08-13 08:31:23

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

double  tongue
-------
twice

Offline

#2358 2025-08-13 15:28:17

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

OK, j'ai intégré le script de @maren dans Conky (il y a encore des erreurs avec l'actualité de la chanson, mais cela ne me semble pas important pour l'instant).
Voici maintenant la partie inférieure de mon code :

	lua_load = '~/.conky/Audacious/scripte/button_script.lua',
	lua_draw_hook_pre = 'get_mouse {"media","/tmp/xdo"}',
	lua_startup_hook = 'start_xdo /tmp/xdo',
--lua_shutdown_hook stop_xdo
	lua_load = '~/.conky/Audacious/scripte/lua_functions.lua',
	lua_load = '~/.conky/lua/image.lua',
	template1 = '${lua rc_button {btype=3,bname="button1",blx_off=278,bly_off=75,bw_off=22,bh_off=12}}',
	template2 = '${lua rc_button {btype=3,bname="button2",blx_off=216,bly_off=75,bw_off=22,bh_off=12}}',
	template3 = '${lua rc_button {btype=3,bname="button3",blx_off=185,bly_off=75,bw_off=22,bh_off=12}}',
	template4 = '${lua rc_button {btype=3,bname="button4",blx_off=247,bly_off=75,bw_off=22,bh_off=12}}',
	template5 = '${lua rc_button {btype=3,bname="button5",blx_off=309,bly_off=75,bw_off=22,bh_off=12}}',
};

conky.text = [[
${execi 3 ~/.conky/Audacious/marens.sh}
${lua fDrawImage ~/.conky/Audacious/headphone.png 40 32 70 70}${lua fDrawImage ~/.conky/Audacious/album_art.png 28 20 93 92}${voffset -30}${font GE Inspira :size=14}
${goto 160}${execi 1 audtool current-song-output-length}  ${goto 348}${execi 1 audtool current-song-length}
${voffset 20}${goto 160}${color 000000}${execbar expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}$color\
${goto 160}${color ffffff}${execbar echo 0}
${if_match ${template1}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec ~/.conky/Audacious/images --pause}
${endif}
${if_match ${template2}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec ~/.conky/Audacious/images --stop}
${endif}
${if_match ${template3}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec ~/.conky/Audacious/images --rew}
${endif}
${if_match ${template4}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec ~/.conky/Audacious/images --play}
${endif}
${if_match ${template5}==0}
${else}${lua fDrawImage ~/.conky/Audacious/images/Orange.png 360 5 35 35}${exec ~/.conky/Audacious/images --fwd}
${endif}
${lua fDrawImage ~/.conky/Audacious/images/pause.png 278 65 25 25}
${lua fDrawImage ~/.conky/Audacious/images/stop.png 216 65 25 25}
${lua fDrawImage ~/.conky/Audacious/images/rew.png 185 65 25 25}
${lua fDrawImage ~/.conky/Audacious/images/play.png 247 65 25 25}
${lua fDrawImage ~/.conky/Audacious/images/fwd.png 309 65 25 25}
${voffset -350}
]];

DlMgfhEt.png

Questions :
Je ne comprends pas ces deux-là pour le moment:

conky: llua_do_call: function conky_get_mouse execution failed: attempt to call a nil value
conky: llua_do_call: function conky_start_xdo execution failed: attempt to call a nil value

Il me manque encore quelque chose dans BL-carbon ? Ceux-ci sont là.

apt policy x11-utils xdotool
x11-utils:
  Installiert:           7.7+7
  Installationskandidat: 7.7+7
  Versionstabelle:
 *** 7.7+7 500
        500 https://deb.debian.org/debian trixie/main amd64 Packages
        100 /var/lib/dpkg/status
xdotool:
  Installiert:           1:3.20160805.1-5.1
  Installationskandidat: 1:3.20160805.1-5.1
  Versionstabelle:
 *** 1:3.20160805.1-5.1 500
        500 https://deb.debian.org/debian trixie/main amd64 Packages
        100 /var/lib/dpkg/status

Pourquoi utilises-tu les images orange dans l'« ancien » code ?
Qu'est-ce qu'un lua rc_button ?
-----------------
OK, I integrated @maren's script into Conky (there are still errors with the song updates, but that doesn't seem important to me right now).
This is now the lower part of my code:
--

Questions:
I don't understand these two at the moment:
--
Am I missing something in BL-carbon? These are here.
--

Why are you using the orange images in the ‘old’ code?
What is a lua rc_button ?

Offline

#2359 2025-08-13 15:54:43

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Show us your conky

Le modèle (alias rc_button) doit bien se référer à cela...
https://imgur.com/mYdjD9V
------------
The template (alias rc_button) must refer to that...

Offline

#2360 2025-08-13 16:04:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Show us your conky

loutch wrote:

Sorry, but since this Conky, I've changed my distribution and computer and can no longer find certain scripts. I'm searching the depths of the forums to find them again.

If possible, try to make your search smarter by putting words in double quotes and specifying the location to search (bunsenlabs forums).
Here I am looking for my audacious-stream  script:

Firefox (example):

"audacious-stream" site:forums.bunsenlabs.org

I got only one result:

Firefox wrote:

Show us your conky (Page 116) / Scripts, Tutorials & Tips ...

I clicked on the link, scrolled down, and immediately found my script:
https://forums.bunsenlabs.org/viewtopic … 45#p143245


@unklar

At the end of this post I also found something for you:

marens wrote:

Now you can try Radio Swiss Pop again with the Audacious (and audacious-stream  script).

You probably skipped this part.  smile


If people would know how little brain is ruling the world, they would die of fear.

Offline

Board footer

Powered by FluxBB