#!/bin/bash


main_menu() {
    yad \
        --list \
        --title="Kanshi Manager" \
        --column="Action" \
        --height=250 \
        --width=300 \
        --print-column=1 \
        "Manage Profiles" \
        "Current View" \
        "Reset Config" \
        "Reload kanshi" \
        "Quit"
}

select_profile() {
    list_profiles | yad \
        --list \
        --title="Kanshi Profiles" \
        --column="Profile" \
        --height=300 \
        --width=400 \
        --print-column=1 \
        --separator=""
}

message() {
    yad \
        --info \
        --text="$1"
}

current_view() {
    wlr-randr | awk '
    /^[^ ]/ {output=$1}
    /Enabled:/ {enabled=$0}
    /current/ {current=$0}
    END {
        print "Output:"
        print output
        print enabled
        print current
    }' | yad \
        --text-info \
        --title="Current Display" \
        --width=500 \
        --height=250
}

error() {
    yad \
        --error \
        --text="$1"
}
