Polaroid Conky

This is eye-candy Conky showing last used wallpapers.
Two files:

  1. Polaroid_mbcolor.conkyrc - save it to ~/.config/conky directory
conky.config = {
-- WINDOW
	own_window = true,
	own_window_type = 'desktop',
	own_window_transparent = true,
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
	own_window_colour = '#020201',
	own_window_class = 'Conky',
	own_window_title = 'Mabox Polaroid Widget',
    
    alignment = 'top_left',
	gap_x = 132,
	gap_y = 817,
	minimum_width = 333,
    minimum_height = 280,

-- FONTS
	use_xft = true,
	xftalpha = 1,
	override_utf8_locale = true,

-- COLORS
	draw_shades = false,
	default_shade_color = '#000000',
	draw_outline = false,
	default_outline_color = '#222222',

	default_color = '#e9e9e8',
	

-- BORDERS
	draw_borders = false,
-- Stippled borders?
	stippled_borders = 1,
-- border margins
	border_inner_margin = 0,
	border_outer_margin = 0,
-- border width
	border_width = 0,

-- MISC
-- Boolean value, if true, Conky will be forked to background when started.
	background = true,

-- Adds spaces around certain objects to stop them from moving other things
-- around, this only helps if you are using a mono font
-- Options: right, left or none
	use_spacer = 'none',

-- Subtract (file system) buffers from used memory?
	no_buffers = true,

-- Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
-- $image lots. Set to 0 to disable the image cache.
	imlib_cache_size = 0,

-- Use the Xdbe extension? (eliminates flicker)
-- It is highly recommended to use own window with this one
-- so double buffer won't be so big.
	double_buffer = true,
	update_interval = 1,
};

conky.text = [[
${execpi 30 ~/.config/conky/menuscripts/polaroid}
]];
  1. and script… save it as polaroid into ~/.config/conky/menuscripts directory
#!/bin/bash
# polaroid  conky script

WHISTORY="$HOME/.cache/colorizer/.wallpaper_history"
THUMBDIR="$HOME/.cache/colorizer/thumbs"
mkdir -p ${THUMBDIR}/polaroid
mapfile -t < <(tail -n 5 "${WHISTORY}"|tac)

for i in ${MAPFILE[@]}; do
    NAME=${i////_}
    if [[ "${NAME}" =~ ^_home_.* ]]; then
        n=${#HOME}
        ((n++))
        NAME=${NAME:${n}}
    fi
    pol+=("${NAME}")
    if [[ ! -f "${THUMBDIR}/polaroid/${NAME}.png" ]]; then
    ##polaroid
    magick ${THUMBDIR}/${NAME}.png -bordercolor white -background black +polaroid /tmp/polaroid.png
    convert /tmp/polaroid.png -gravity center -background transparent -extent 333x240  ${THUMBDIR}/polaroid/${NAME}.png
    rm /tmp/polaroid.png
    fi
done

printf "\${image ${THUMBDIR}/polaroid/${pol[1]}.png -p 0,0 -s 333x240}"
printf "\${image ${THUMBDIR}/polaroid/${pol[2]}.png -p 0,140 -s 166x120}"
printf "\${image ${THUMBDIR}/polaroid/${pol[3]}.png -p 83,160 -s 166x120}"
printf "\${image ${THUMBDIR}/polaroid/${pol[4]}.png -p 166,120 -s 166x120}"


Make script executable:

chmod +x ~/.config/conky/menuscripts/polaroid

And start it from Colorizer → Conky → …click to start

It will be included by default with the upcoming next major Mabox release - Jaskier :wink:

A notes to myself
1.Some right click context menu positions make no sense for such Conky - like Font, Shadow, outline etc. - I have to write some logic to not show them.
2. polaroid script should check if wallapaper was changed and do the work only if changed since last run

1 Like

Nice :slight_smile: …

:bird:

1 Like

polaroid-slideshow-2024-09-26_12.04.55

When using wallpaper slideshow. A square appears from the polaroid conky. Is this normal behavior…

:bird:

I think it is normal, and Conky uses some kind of fake transparency.

Mabox_20240926-12-50-58

1 Like

Little joke … :penguin:

Mabox_20240926-13-35-45

printf "\${image PATH/TO/image.png -p 168,0 -s 133x100}"

:bird:

1 Like

Looks very good :smiley:

1 Like

Got it from here. Free of use.

The shadow works nice…Position/size change, looks better.

:bird:

1 Like

I did’t know the position of the polaroids are random.

After a view new images…

The punaise is now out of range…

Some where in the middle… saver place.

Mabox_20240926-18-33-07

Mabox_20240926-18-40-46

:bird:

1 Like

Yes, I use:

${image ~/.config/conky/images/pin.png -p 103,0 -s 96x96}

1 Like

I just discoverd transparency issue, because i mainly use png images i did’t notice.

Polaroid Conky → Jpg files have no transparincy.

I am now converting the jpg’s to png’s,
but maybe i can do something else to let jpg images work too.

This folder containes jpg files.


This folder with png file.

Is this common or just me.

:bird:

Not just you, as JPEGs don’t support transparent backgrounds :wink:

1 Like

I installed the latest release on a USB stick and noticed this new conky and wondered why I didn’t have it on my daily driver that I installed 763 days ago. I have it now. TY

I tried this as was suggested on my X page, and the pushpin doesn’t show.
What did I screw up?

I’m adding a screenshot so that other forum users have a chance to know what we’re talking about here…

Red pin on Conky Polaroid with wallpaper thumbnails.

Check that you have downloaded the correct file and that you have provided the correct path in the conky config.

Direct link to file: https://clipground.com/images/punaise-png-3.png

Weird. Now why would the same file with a different name NOT work?

File names in Linux are case sensitive. pushpin.png is not the same file as Pushpin.png.
So the file path in your conky config was wrong.

1 Like

Don’t worry, I sometimes make similar oversights too.
When writing scripts, it can be painful and time-consuming. :wink:

Question?
Wouldn’t something like this be more realistic? (edited in GIMP)

That is easy to achieve.
Just duplicate image lines and edit positions ( -p 103,0 )

Personally, I like only one.

${image ~/.config/conky/images/punaise.png -p 103,0 -s 96x96}
${image ~/.config/conky/images/punaise.png -p 3,120 -s 96x96}
${image ~/.config/conky/images/punaise.png -p 93,135 -s 96x96}
${image ~/.config/conky/images/punaise.png -p 240,110 -s 96x96}