#!/bin/bash #Script to create additional menu subcategories #and move some items to those categories. #Three new catagories will be created that can #be used in .desktop files. #flsuite - flsuite subcategory #bap - Build a Pi subcategory #km4ack - km4ack subcategory REV=20210411 source $HOME/.config/KM4ACK sudo mkdir -p /usr/local/share/applications FLSUITE(){ ########################## # FLSUITE ########################## CATEGORY=flsuite FLPATH=/usr/local/share/applications if [ -f $FLPATH/fldigi.desktop ]; then echo "updating fldigi" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/fldigi.desktop fi if [ -f $FLPATH/flamp.desktop ]; then echo "updating flamp" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flamp.desktop fi if [ -f $FLPATH/flarq.desktop ]; then echo "updating flarq" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flarq.desktop fi if [ -f $FLPATH/flmsg.desktop ]; then echo "updating flmsg" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flmsg.desktop fi if [ -f $FLPATH/flnet.desktop ]; then echo "updating flnet" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flnet.desktop fi if [ -f $FLPATH/flwrap.desktop ]; then echo "updating flwrap" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flwrap.desktop fi if [ -f $FLPATH/flwrap.desktop ]; then echo "updating flrig" sudo sed -i "s/Categories.*/Categories=$CATEGORY/" $FLPATH/flrig.desktop fi } BAP(){ ########################## # BAP ########################## cd /run/user/$UID #DONATE if [ ! -f /usr/local/share/applications/donate.desktop ]; then cat >donate.desktop <faq.desktop <support.desktop <FLsuite.directory <km4ack.directory <bap.directory <hamradio.menu < Applications Hamradio HamRadio.directory HamRadio FLSUITE FLsuite.directory flsuite KM4ACK km4ack.directory km4ack Build-a-Pi bap.directory bap EOF sudo mv hamradio.menu /usr/share/extra-xdg-menus/ } #verify ham menu is installed if [ ! -f /usr/share/extra-xdg-menus/hamradio.menu ]; then sudo apt install -y extra-xdg-menus fi BAP #check to see if this script has already run if [ "$MENU" = "$REV" ]; then REV=$(cat $HOME/.config/KM4ACK | sed 's/MENU=//') echo "menu mods already made" echo "Revision $REV installed" exit else echo "MENU=$REV" >> $HOME/.config/KM4ACK CREATEMENU FLSUITE fi