#!/bin/bash

################################################################################
# GTK-NoCSD                                                                    #
# Copyright (C) 2025-2026 MorsMortium                                          #
#                                                                              #
# This program is free software: you can redistribute it and/or modify         #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# This program is distributed in the hope that it will be useful,              #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
################################################################################

Programs=(
    four-in-a-row lenspect gnome-klotski gnome-tetravex trackma-gtk quadrapassel
    gtk-demo piper gtk4-node-editor gtk4-widget-factory gnome-mahjongg gtk4-demo
    gnome-mines adwaita-1-demo gnome-nibbles gnome-taquin gnome-chess swell-foop
    gnome-robots lightsoff gnome-sudoku tali font-manager hitori gajim bleachbit
    gtk3-icon-browser gtk3-widget-factory missioncenter vipsdisp dino meld iagno
    aether pamac-manager atomix gthumb cambalache five-or-more gnome-2048 lutris
    songrec glade gtk3-demo hardinfo2 pidgin3
)

# Test all available applications with the library, both with wayland and x
for Binary in "${Programs[@]}"; do
    FullPath="/usr/bin/$Binary"
    LD_PRELOAD=$(realpath libgtk-nocsd.so) $FullPath
    WAYLAND_DISPLAY="" LD_PRELOAD=$(realpath libgtk-nocsd.so) $FullPath
done
