#!/bin/bash
# drag and drop rpm-package installer
# RJP 17.4.2024
# easy general rpm package installer 
# yad and xterm must be installed
# it does not install dependecies
# 

TEXTDOMAINDIR=/usr/share/locale
TEXTDOMAIN=rpm-drop-installer
yad --height=100 --width=400 --center --buttons-layout=center --borders=5 --button=$"Ok":1 --center --text-align=center --title=$"INFO" --text=$"This is basic rpm package installer, which does not install dependecies, so you maybe need to install them by hand
" 
yad --dnd --geometry=600x200 --on-top --no-buttons --title=$"rpm-package installer" --text=$"Drag and drop rpm-package for installation into this box " | while read selection
do
FILE=$(echo "$selection" | sed 's/file:\/\///')
FILE2=$(sed 's/ /\\ /g' <<< "$FILE")
xterm -hold -e "su -c 'rpm -ivh $FILE2'" && \
sleep 1
yad --width=400 --center --buttons-layout=center --borders=5 --text-align=center --title=$"INFO" --text=$"READY" --button=$"Ok":1 --center
done

