Looking for some comments/feedback - Application Install Selection Tool

This is very much a rough prototype, still evolving.

Hope to add selection of Application Category to load list relevant to each Category.

FUTURES: Checklist of Windows Tools, a selection of "QuarkXPress" would offer a list of alternates for the Linux environment.


Prototype [WindowsApplicationAlternateOffer.sh] :

#!/bin/bash

echo -e "\n
	This script starts a GUI for selecting, and installing,
	Applications that are suitable alternates to applications
	which are currently the User's preferred tools within the
	Windows environment.\n
	The selections are offered in functional or task-oriented groupings."



###
###	Function to present options and capture selected actions
###
selectForInstall()
{
	# Read the output from YAD (selected items only)
	# --print-column=3 ensures only the hidden action command is output
	# --separator='\n' sets a newline separator for multiple selections
	yad --list \
		--title="Choose Applications to install" \
		--text="\n Click on box next to application to select install on your computer ..." \
		--checklist \
		--border=20 \
		--column="Select:CHK" \
		--column="Cost:TEXT" \
		--column="Application Name:TEXT" \
		--column="Command:HD" \
		--height=400 --width=500 \
		--button="OK:0" --button="Cancel:1" \
		--print-column=4 \
		--separator=$'\n' \
		"${yad_list_data[@]}"
}


confirmDataIimport()
{
	echo "Count of items in imported data list = $count"
	indx=0
	while [ ${indx} -lt ${count} ]
	do
		echo ${yad_list_data[${indx}]}
		indx=$(expr ${indx} + 1 )
	done
	exit
}


initDirective_publweb()
{
	###
	###	Directive:  publweb
	###
	defltBrowserRef="$(xdg-settings get default-web-browser)"
	#echo ${defltBrowserRef}

	if [ -n "${defltBrowserRef}" ]
	then
		defltBrowser=$(
		{
		grep '^Exec=' "${HOME}/.local/share/applications/${defltBrowserRef}" ;
		grep '^Exec=' "/usr/local/share/applications/${defltBrowserRef}"
		} 2>>/dev/null | head -1 | cut -f2- -d"=" | sed 's+[%]u$++' )
		#echo ${defltBrowser}
	fi

}


initDirective_repdist()
{
	echo "holding pattern for future logic" >>/dev//null
}


######################################################################################
######################################################################################


appLocn="$(dirname "$0" )"
appBase="$(basename "$0" ".sh" )"

###
###	Function to load attributes applicable to various Application choices offered
###	FUTURES:  load data array for applications specific to an Application Category i.e. Desktop Publishing
###

applGroupingData="${applLocn}/${appBase}.DesktopPublishing.txt"

if [ -s "${applGroupingData}" ]
then
	echo "Building array/list variable from external data file ..."
	yad_list_data=( $(awk '{ printf("%s ", $0 ) ; }' <"${applGroupingData}" ) )
else
	###
	###	Initialize array of list items and their associated actions
	###	Format: CHECK_STATE "COST" "APPLICATION" "ACTION_DIRECTIVE"
	###
	yad_list_data=(
	FALSE "" "Scribus" "repdist|scribus"
	FALSE "" "Inkscape" "repdist|inkscape"
	FALSE "" "Laidout" "publweb|https://github.com/Laidout/laidout/releases"
	FALSE "$" "VivaDesigner" "publweb|https://viva.systems/designer/"
	)
fi

count=${#yad_list_data[@]}

if [ "${count}" -eq 0 ]
then
	echo "\n\t Unable to initialize form to present software options for selection.  Abandoning!\n" ; exit 1
fi


#confirmDataIimport()


###
###	Initialize facilitators for action directives
###


tmp="/tmp/$( basename "$0" ".sh" ).$$"

selectForInstall >"${tmp}.selections" 2>>/dev/null

# Confirm acCheck the exit code of yad
if [ $? -gt 0 ]
then
	echo "Dialog cancelled."
	exit 1
fi

cut -f1 -d"|" "${tmp}.selections" | sort | uniq >"${tmp}.applclasses"

for applClass in $( cat "${tmp}.applclasses" )
do
	initDirective_${applClass}

	case "${applClass}" in
		"repdist" )
			origin="Distro-Originating"
			actionForm="apt-get install"
			actionPrep="apt-cache search APPLN | awk -v appl=\"\${action}\" '{ if( \$1 == appl ){ print \$1 ; } ; }'"
			echo -e "\n INITIALIZED:  For ${origin} packages, '${actionForm}' action to be applied ..."
			#echo "" | awk -v dum="${actionPrep}" '{ print dum ; }'
			;;
		"publweb" )
			origin="Web Self-Published"
			actionForm="${defltBrowser}"
			echo -e "\n INITIALIZED:  For ${origin} packages, browser identified as '${actionForm}' ..."
			;;
		###
		###	FUTURES:  Add logic to handle LaunchPad PPAs
		###	FUTURES:  Add logic to handle Publisher Debian Repositories
		###
		* ) echo -e "\n\t Logic to handle Application Class '${applClass}' has not been coded. Abandoning!\n" ; exit 1 ;;
	esac

	echo -e "\n Processing selected ${origin} Applications [${applClass}] ..."

	# Iterate over each selected action (separated by newline)
	#while IFS= read -r action
	
	grep '^'${applClass} "${tmp}.selections" | cut -f2- -d"|" |
	while IFS="|" read -r action
	do
		if [ -n "${action}" ]
		then
			if [ -n "${actionPrep}" ]
			then
				prepAction=$( echo ${actionPrep} | sed 's+APPLN+'${action}'+' )
				testor=$(eval ${prepAction} )
				if [ -n "${testor}" ]
				then
					#echo -e "Executing: ${action}"
					# Run the command
					echo -e "${actionForm} ${action}"
					#eval "${actionForm} ${action}"
				else
					echo -e "Unable to install '${action}'. That package appears to have been removed from the repository."
				fi
			else
				#echo -e "Executing: ${action}"
				# Run the command
				echo -e "${actionForm} ${action}"
				#eval "${actionForm} ${action}"
			fi
		fi
	done
done


exit 0
2 Likes

Looking for guidance on how to "tweak" my GitHub account to allow people to submit feedback or updates on the following, very rough, initial table for Windows Application Groupings and Focus.

Until then, please feel free to send private message with any version of the file which would contain suggested additions/changes.


First stab at the spreadsheet to organize the raw data (very early stage work-in-progress):

Productivity & Office Suites,,
,Office Productivity,
,,Microsoft Word
,,Microsoft Excel
,,Microsoft PowerPoint
,,LibreOffice Writer
,,LibreOffice Calc
,,LibreOffice Impress
,,LibreOffice Base
,,LibreOffice Draw
,,LibreOffice Math
,,WPS Writer
,,WPS Spreadsheet
,,WPS Presentation
,,WPS PDF
,Note-taking & Organization,
,,OneNote
,,Evernote
,,Notion
,,Obsidian
,,Microsoft ToDo
,,Todoist
,,TickTick
,,LunaTask
,,Anytime Organizer
,,MyLifeOrganized
,,Microsoft Planner
,PDF Tools,
,,Adobe Acrobat Reader
,,PDFgear
,,Foxit Reader
,,
Communication & Collaboration Tools,,
,Messaging & Social,
,,WhatsApp
,,Discord
,,Telegram
,,Skype
,Video Conferencing,
,,Zoom
,,Microsoft Teams
,,Skype
,Email Clients,
,,Outlook
,,Mozilla Thunderbird
,,Mailbird
,,Mailspring
,,eM Client
,,Spark Mail
,,Canary Mail
,,Shortwave
,,
Web Browsers,,
,Browsers,
,,Microsoft Edge
,,Google Chrome
,,Mozilla Firefox
,,Brave
,,Vivaldi
,,Opera
,,
Multimedia & Content Creation,,
,Media Players,
,,VLC Media Player
,,Spotify
,,iTunes
,,MusicBee
,Image Editing & Design,
,,Adobe Photoshop
,,GIMP
,,Paint.NET
,,Canva
,Video Editing & Streaming,
,,OBS Studio
,,Shotcut
,,Wondershare Filmora
,,Capcut
,,
System Utilities & Security,,
,Antivirus/Anti-Malware,
,,Windows Defender
,,Malwarebytes
,,Bitdefender
,,Norton 360
,,McAfee Antivirus
,System Maintenance,
,,Ccleaner
,,Wintoys
,,O&O AppBuster
,File Compression/Management,
,,7-Zip
,,WinZIP
,,WinRAR
,System Enhancement,
,,Microsoft PowerToys
,,
Gaming & Entertainment,,
,Platforms,
,,Epic Games Launcher
,,Xbox App
,,GOG Galaxy
,,
Cloud Storage & Syncing Services,,
,Storage,
,,OneDrive
,,Google Drive
,,Dropbox
,,
Development & Technical Tools,,
,Editors/IDEs,
,,Notepad
,,Wordpad
,,Microsoft Edit
,,Notepad++
,,Sublime Text
,,Textpad
,,Editpad Lite
,,Visual Studio Code
,,Brackets
,,UltraEdit
,,Atom
,,NoteTab
,,CodePen
,,Oxygen XML Editor
,,EditPlus
,,PimNote
,,Neovim
,,Bird
,,Python IDLE
,Virtualization,
,,VirtualBox
,,Vmware
1 Like