Koentje wrote: ⤴Mon Jan 29, 2024 5:33 pm
Why xdotool?? You can start a conky window on the terminal with
conky -c </path/to/conkyscript>
.
And if you add parameter
-i <nr>
then it shows only <nr> of update times. So if you have the conky set to an update interval of 10 seconds and
-i 2
then it shows 2x 10 seconds and then terminates.
What is in your xdotool script?
I use xdotool for several applications of running graphic and sound scripts either daily or on a specific day/time of the week. Here is my garbage night reminder routine:
crontab:
Code: Select all
00 18 * * 1 /home/logansfury/xdotool/activate.sh
activate.sh:
Code: Select all
#!/bin/bash
export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
export XDG_CURRENT_DESKTOP=Cinnamon
export XDG_RUNTIME_DIR=/run/user/$(id -u)
# Launch Conky in the background
conky -c /home/logansfury/.conky/Biohazzard_sm/conkyrc &
# Play the audio file
mpg123 /home/logansfury/Documents/garbage_night.mp3
conkyrc:
Code: Select all
--[[
Bleys 2024
]]
conky.config = {
-- — Conky settings
background = false,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
-- — Window specifications with Background
own_window = true,
own_window_type = desktop,
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
own_window_argb_visual = true,
own_window_argb_value = 0,
own_window_colour = '000000',
double_buffer = true,
minimum_width = 300, minimum_height = 263,
alignment = 'middle_middle',
gap_x = 20,
gap_y = 20,
-- Lua Load
lua_load = '/home/logansfury/.conky/Biohazzard_sm/pic.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];
pic.lua:
Code: Select all
--[[
2024 Bleys
]]
require 'cairo'
require "imlib2"
home_path = os.getenv ('HOME')
function fDrawImage(cr,path,xx,yy,ww,hh,arc)
cairo_save (cr)
local img = cairo_image_surface_create_from_png(path)
local w_img, h_img = cairo_image_surface_get_width(img), cairo_image_surface_get_height(img)
cairo_translate (cr, xx, yy)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, ww/w_img, hh/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_surface_destroy (img)
collectgarbage ()
cairo_restore (cr)
end
function conky_main()
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=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>4 then
fDrawImage(cr,'/home/logansfury/Pictures/bio_sm.png',150,132,300,263)
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end
it's still primed to fire tonight for the first time, but it has worked perfectly in testing by setting a crontab event for 1 minute into the future.