diff --git a/flhelper b/flhelper new file mode 100755 index 0000000..0ac3647 --- /dev/null +++ b/flhelper @@ -0,0 +1,255 @@ +#!/bin/bash + +#script to create new instances of FLRIG for multiple radios on one Pi. +#21MARCH2022 KM4ACK + +VERSION=1 +BY="KM4ACK 21MARCH2022" + +##################### +# Main Menu +##################### + +MAINMENU(){ +clear;echo +#HEADER +cat < /run/user/$UID/flrig-$RIG.desktop +[Desktop Entry] +Name=Flrig-$RIG +GenericName=Amateur Radio Rig Control +Comment=Amateur Radio Communications +Exec=flrig --config-dir $HOME/flrig_conf/$RIG +Icon=flrig +Terminal=false +Type=Application +Categories=Network;HamRadio; +EOF + +sudo cp /run/user/$UID/flrig-$RIG.desktop /usr/local/share/applications/ +mkdir -p $HOME/flrig_conf/$RIG +clear;echo;echo +cat < /run/user/$UID/flrighelp.help + +FLRIG Helper version $VERSION :: $BY + +Navigating help file: +Use the arrow keys on the keyboard to navigate this file +as needed. To exit the help file, press "q" + +Purpose: +The purpose of this script is to help you create multiple instances of FLRIG +so that you can use the same Pi with multiple radios. This simplifies your +setup so you can use the same Pi with multiple kits. It also makes it easier +to keep your Pi up to date since there is only one Pi to update that works +with each of your field kits. + +Add Rig: +This option will install a new instance of FLRIG into the main Pi Menu. Afterwards, +you can open FLRIG using the new menu option and configure it for your radio. It +is recommended that you use the model number of your radio for the name. + +Remove Rig: +This option allows you to remove a previously added rig. This will remove both +the menu entry for the radio and the config files for said radio. + +Remove Original: +This option removes the original Pi menu entry for FLRIG. It DOES NOT remove the +FLRIG application. The purpose of this is solely to clean up the Pi menu. + +Help: +Displays this help file. +EOF +#display the help file +less /run/user/$UID/flrighelp.help +#remove the help file when done +rm /run/user/$UID/flrighelp.help +} + +INSTALL(){ +cat < /run/user/$UID/flhelper.desktop +[Desktop Entry] +Name=FLRIG HELPER +GenericName=FlHelper Script +Comment=Create multiple instances of FLRIG +Exec=lxterminal --geometry=85x24+450+150 -t FLRIG-helper -e /home/pi/bin/flrig-helper +Icon=flrig +Terminal=false +Type=Application +Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings; +EOF + +sudo cp /run/user/$UID/flhelper.desktop /usr/local/share/applications/ +} + +if [ $1 = 'install' ]; then +INSTALL +echo "FLRIG-helper installed. A shortcut has been created in the Pi menu under Preferences" +exit +fi + +#call the main menu +MAINMENU + +