on some distros, you can install additional package managers, for example on my Void Linux i have pacman for managing a very specific project, but not as the main package manager (that's done by xbps-install). it's also relatively common to install e.g. apt or dpkg on non-debian-based distros to be able to work with things that were e.g. packaged for ubuntu.
when your script asks to install wmctrl and dialog, it will use the first available package manager it finds (which happens to be pacman in this situation), which then fails.
my suggestion instead would be to:
either ask which distro first
or actually check if wmctrl and dialog are already installed, in case the user does it manually, currently you just always ask and exit on "no"
or ask which package manager to use if multiple are found
on some distros, you can install additional package managers, for example on my Void Linux i have pacman for managing a very specific project, but not as the main package manager (that's done by xbps-install). it's also relatively common to install e.g. apt or dpkg on non-debian-based distros to be able to work with things that were e.g. packaged for ubuntu.
when your script asks to install wmctrl and dialog, it will use the first available package manager it finds (which happens to be pacman in this situation), which then fails.
my suggestion instead would be to: