#!/bin/bash WALLPAPERS_DIR="$HOME/Pictures/wallpapers/" # find image size to display (very slow) #echo $(identify -format '%[fx:w]x%[fx:h]\' $HOME/Pictures/wallpapers/$A 2>/dev/null) build_theme() { rows=$1 cols=$2 icon_size=$3 echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:$icon_size.0000em;}listview{lines:$rows;columns:$cols;}" } theme="$HOME/.config/rofi/config-wallpaper.rasi" ROFI_CMD="rofi -dmenu -i -show-icons -theme-str $(build_theme 3 5 6) -theme ${theme}" choice=$(ls --escape "$WALLPAPERS_DIR" | xargs -I {} printf "{}\x00icon\x1f$WALLPAPERS_DIR/{}\n" | $ROFI_CMD -p "󰸉 Wallpaper") wallpaper="$WALLPAPERS_DIR/$choice" set_wallpaper_kde() { qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript \ "var allDesktops = desktops(); for (i=0;i