Having fun with polaroid conky.
For me it is usefull/fun because of many images from a directory. (ripped animations themes)
Polaroid_slideshow :
Random images from mbwallpaper.conf $wallpaper_dir.
easy to change position/layout of polaroids
(workspace/alignment given by conkyrc)
speeded_up gif timelaps

~/.config/conky/menuscripts/polaroid_slideshow
#!/bin/bash
# It uses the wallpaperdir to show random images
CONFIG_DIR="$HOME/.config/mbwallpaper"
CONF_FILE="$CONFIG_DIR/mbwallpaper.conf"
source <(grep = "$CONF_FILE")
temp_dir="/tmp/polaroid_conky"
# Create a temporary directory to store the processed polaroid images
mkdir -p "${temp_dir}"
# Number of images to display
num_images=4
# Get a list of .png images from the wallpaper directory and shuffle to get random images
mapfile -t WALLDIR < <(find "$wallpaper_dir" -type f -name "*.png" | shuf -n "$num_images")
# Initialize an array to hold the paths of the processed images
pol=()
# Process each selected image with ImageMagick to add the polaroid effect
for image in "${WALLDIR[@]}"; do
NAME=$(basename "${image}")
output_file="${temp_dir}/${NAME}"
# Create a resized image for polaroid processing
resized_image="/tmp/resized_${NAME}"
# Resize the image while maintaining aspect ratio
if magick "${image}" -resize 333x245^ -gravity center -extent 333x245 "$resized_image"; then
# Create the polaroid with white border
if magick "$resized_image" -bordercolor white -background none +polaroid "$output_file"; then
# Add the processed polaroid image to the array
pol+=("$output_file")
else
echo "Error processing polaroid for $image" >&2
fi
else
echo "Error resizing image $image" >&2
fi
# Clean up the resized image
rm -f "$resized_image"
done
# Output the Conky image commands in a 2x2 grid with random angles
positions=(
"10,0" # Position for the larger image
"0,140" # Position for the smaller images
"83,160" # Position for the smaller images
"166,120" # Position for the smaller images
)
sizes=(
"300x160" # Larger size for the first image
"166x120" # Standard size for the rest
"166x120" # Standard size for the rest
"166x120" # Standard size for the rest
)
for index in "${!pol[@]}"; do
# Only output valid polaroid images
if [[ -f "${pol[index]}" ]]; then
# Generate a random angle for rotation
angle=$(( RANDOM % 10 - 5 )) # Random angle between -5 and 5 degrees
# Print the image with the angle and size
printf "\${image ${pol[index]} -p ${positions[index]} -s ${sizes[index]} -a ${angle}}\n"
fi
done
Polaroid_mbcolors_slideshow.conkyrc
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 = '#0c0e13',
own_window_class = 'Conky',
own_window_title = 'Mabox Polaroid Widget',
alignment = 'bottom_right',
gap_x = 30,
gap_y = 60,
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 = '#ecedef',
-- 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 350 ~/.config/conky/menuscripts/polaroid_slideshow}
]];
have fun…
![]()


