From 40288559f5ab9a33bdb38a184185e941a42ba828 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sat, 14 May 2022 23:17:53 +0200 Subject: [PATCH] wallthumb --- usr/bin/jgwallpaperchanger | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger index 712dfc9..f59ce68 100755 --- a/usr/bin/jgwallpaperchanger +++ b/usr/bin/jgwallpaperchanger @@ -116,10 +116,24 @@ JGWIDTH=40 menu_margin_x=${submenu_spacing:-0} [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 +JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 158)) + #WALLPAPER + read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) + WALLPAPER=${WALLPATH##*/} + THUMBDIR="$HOME/.config/mabox/wallthumbs" + mkdir -p ${THUMBDIR} + THUMB="${THUMBDIR}/${WALLPAPER}.png" + if [[ ! -f "$THUMB" ]] + then + convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} + fi + mkconfigfile cat < ${MENU_ITEMS} +@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out2[@]}") EOF