Skip to content

⭐ 4. Provider Scripting

SmileLulz edited this page Sep 1, 2026 · 1 revision

🧩 --provider <script/path>

A provider script is just a script. It can be a shell script or can be written in any language.

It has two actions: list and run.

list outputs the contents to stdout and SmileMenu reads from it; to display the contents.

run executes the command for the selected content/item.

It also supports tab-separated columns for listing, and for customized fields.

💡 Example 1 (Simple)

#!/usr/bin/env bash

case "$1" in

list)
    echo "Firefox"
    echo "Steam"
    echo "Vesktop"
;;

run)
    case "$2" in

    Firefox)
        firefox
    ;;
    
    Steam)
        steam
    ;;
    
    Vesktop)
        vesktop
    ;;
    
    esac
;;

esac

Run:

smilemenu --provider /path/to/your/apps-provider.sh

It displays:

Firefox
Steam
Vesktop

Then suppose you selected Steam, it will execute the command for it (launch Steam).

💡 Example 2 (Wallpaper menu)

#!/usr/bin/env bash

WALLPAPER_DIR="$HOME/.wallpapers"

case "$1" in

list)
    find "$WALLPAPER_DIR" \
        -maxdepth 1 \
        -type f \
        \( -iname "*.png" -o -iname "*.jpg" \) \
        -printf "%p\n"
;;

run)
    awww img "$2" --transition-type any --transition-step 128 --transition-fps 75

    matugen image "$2" --source-color-index 1 || matugen image "$2" --source-color-index 0

    notify-send -h boolean:transient:true "Theme applied" "Wallpaper and theme updated successfully!"

    echo "Selected: $2"
;;

esac

Run:

smilemenu --provider /path/to/your/wallpaper-provider.sh -p "Wallpapers"

Clone this wiki locally