This is eye-candy Conky showing last used wallpapers.
Two files:
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}
]];
- 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
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