Advertisement
KC9UZR

Bash Install All Ham Radio Apps

Aug 1st, 2024 (edited)
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.27 KB | Help | 0 0
  1. #!/bin/bash
  2. #
  3. # Installs some core Ham Apps
  4. # flsuite (flrig, fldigi, flmsgi, flAmp)
  5. # WSJT-X
  6. # GridTracker
  7. # Js8Call
  8. # HamClock
  9. # Pat (packet & ARDOP)
  10. # And some utilities for remote access
  11. # X11VNC
  12. # NoMachine
  13. # Tailscale
  14. #
  15. # v1.1: 3-22-23
  16. # Adds rigctl set mode (USB for ARDOP, FM for packet)
  17. # Adds flAmp to flSuite
  18. # Adds instructions for Tailscale
  19. #
  20. # v1.2: 4-9-23
  21. # Add hamRS 1.0.6 64-bit
  22. #
  23. # v1.3: 4-23-23
  24. # Add direwolf & YAAC
  25. #
  26. # v1.4: 5-22-23
  27. # Update Pat (uses AGWPE)
  28. #
  29. # Let us know what other apps you'd like to see!
  30. #
  31.  
  32. install_nomachine () {
  33. echo "
  34.  
  35. *********************************************
  36. ** **
  37. ** INSTALLING NOMACHINE **
  38. ** **
  39. *********************************************
  40.  
  41. "
  42. wget https://inovato.net/ham/files/nomachine_8.4.2_1_arm64.deb
  43. sudo dpkg -i nomachine_8.4.2_1_arm64.deb
  44. rm nomachine_8.4.2_1_arm64.deb
  45. echo "
  46.  
  47. *********************************************
  48. ** **
  49. ** SUCCESSFULLY INSTALLED NOMACHINE **
  50. ** **
  51. *********************************************
  52.  
  53. "
  54. }
  55.  
  56. install_x11vnc () {
  57. echo "
  58.  
  59. *********************************************
  60. ** **
  61. ** INSTALLING X11VNC **
  62. ** **
  63. *********************************************
  64.  
  65. " # install X11VNC
  66. sudo apt install -y x11vnc
  67. sudo rm /etc/systemd/system/x11vnc.service
  68. cat <<EOT >> x11vnc.service
  69. [Unit]
  70. Description=x11vnc remote desktop server
  71. Wants=network-online.target
  72. After=network-online.target
  73.  
  74. [Service]
  75. ExecStart=/usr/bin/x11vnc -ncache 10 -geometry 1920x1080 -many -nevershared -display :0 -no6 -auth /var/run/lightdm/root/:0
  76.  
  77. Restart=on.failure
  78.  
  79. [Install]
  80. WantedBy=graphical.target
  81. EOT
  82. sudo mv x11vnc.service /etc/systemd/system
  83. sudo systemctl daemon-reload
  84. sudo systemctl start x11vnc
  85. sudo systemctl enable x11vnc.service
  86. echo "
  87.  
  88. *********************************************
  89. ** **
  90. ** SUCCESSFULLY INSTALLED X11VNC **
  91. ** **
  92. *********************************************
  93.  
  94. "
  95. }
  96.  
  97.  
  98. install_tailscale () {
  99. echo "
  100.  
  101. *********************************************
  102. ** **
  103. ** INSTALLING TAILSCALE **
  104. ** **
  105. *********************************************
  106.  
  107. "
  108. curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
  109. curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
  110. sudo apt-get update
  111. sudo apt-get install -y tailscale
  112. echo "
  113.  
  114. *********************************************
  115. ** **
  116. ** SUCCESSFULLY INSTALLED TAILSCALE **
  117. ** **
  118. *********************************************
  119.  
  120. "
  121. }
  122.  
  123.  
  124. install_wsjtx () {
  125. echo "
  126.  
  127. *********************************************
  128. ** **
  129. ** INSTALLING WSJTX/JS8CALL **
  130. ** **
  131. *********************************************
  132.  
  133. "
  134. sudo apt install -y wsjtx js8call
  135. wget https://inovato.net/ham/files/wsjtx_2.6.1_arm64.deb
  136. sudo dpkg --force-overwrite -i ./wsjtx_2.6.1_arm64.deb
  137. rm ./wsjtx_2.6.1_arm64.deb
  138. # remove these so icons can show (artifact of older build)
  139. if [ -f ~/.local/share/applications/wsjtx.desktop ]; then
  140. rm ~/.local/share/applications/wsjtx.desktop
  141. fi
  142. if [ -f ~/.local/share/applications/js8call.desktop ]; then
  143. rm ~/.local/share/applications/js8call.desktop
  144. fi
  145. echo "
  146.  
  147. *********************************************
  148. ** **
  149. ** WSJTX / JS8CALL SUCCESSFULLY INSTALLED **
  150. ** **
  151. *********************************************
  152.  
  153. "
  154. }
  155.  
  156.  
  157. install_gridtracker () {
  158. echo "
  159.  
  160. *********************************************
  161. ** **
  162. ** INSTALLING GRIDTRACKER **
  163. ** **
  164. *********************************************
  165.  
  166. "
  167. if [ -d ~/GridTracker ]; then
  168. rm -r ~/GridTracker
  169. fi
  170. wget https://downloads.gridtracker.org/v1.24.0512-2/GridTracker-1.24.0512-linux-arm64.tar.gz
  171. tar -xf GridTracker-1.24.0512-linux-arm64.tar.gz -C ~/
  172. rm GridTracker-1.24.0512-linux-arm64.tar.gz
  173. mv ~/GridTracker-1.24.0512-linux-arm64 ~/GridTracker
  174. cat >GridTracker.desktop << EOF
  175. [Desktop Entry]
  176. Name=GridTracker
  177. Comment=GridTracker
  178. GenericName=GridTracker, a WSJT-X Companion
  179. Exec=$HOME/GridTracker/GridTracker
  180. Icon=$HOME/GridTracker/gridtracker.png
  181. Path=$HOME/GridTracker
  182. Type=Application
  183. Encoding=UTF-8
  184. Terminal=false
  185. Categories=HamRadio;
  186.  
  187. EOF
  188. sudo mv GridTracker.desktop /usr/local/share/applications
  189. echo "
  190.  
  191. *********************************************
  192. ** **
  193. ** GRIDTRACKER SUCCESSFULLY INSTALLED **
  194. ** **
  195. *********************************************
  196.  
  197. "
  198. }
  199.  
  200. install_hotspot () {
  201. echo "
  202.  
  203. *********************************************
  204. ** **
  205. ** INSTALLING HOTSPOT **
  206. ** **
  207. *********************************************
  208.  
  209. "
  210. wget -N https://inovato.net/ham/files/hotspot.tar.gz
  211. tar -xf hotspot.tar.gz
  212. rm hotspot.tar.gz
  213. source hotspot-install
  214. rm hotspot-install
  215. echo "
  216.  
  217. *********************************************
  218. ** **
  219. ** HOTSPOT SUCCESSFULLY INSTALLED **
  220. ** **
  221. *********************************************
  222.  
  223. "
  224. }
  225. install_flsuite () {
  226. echo "
  227.  
  228. *********************************************
  229. ** **
  230. ** INSTALLING FLSUITE **
  231. ** **
  232. *********************************************
  233.  
  234. "
  235. sudo apt install -y flrig fldigi flmsg flamp
  236. wget https://inovato.net/ham/files/flsuite.tar.gz
  237. tar -xf flsuite.tar.gz
  238. rm flsuite.tar.gz
  239. sudo mv fl* /usr/local/bin
  240. echo "
  241.  
  242. *********************************************
  243. ** **
  244. ** FLSUITE SUCCESSFULLY INSTALLED **
  245. ** **
  246. *********************************************
  247.  
  248. "
  249. }
  250.  
  251. install_pat () {
  252. echo "
  253.  
  254. *********************************************
  255. ** **
  256. ** INSTALLING PAT (Winlink Client) **
  257. ** **
  258. *********************************************
  259.  
  260. "
  261. # we need Direwolf (will also install flrig)
  262. install_direwolf
  263.  
  264. wget https://inovato.net/ham/files/pat.tar.gz
  265. tar -xf pat.tar.gz
  266. rm pat.tar.gz
  267. mkdir -p ~/.config/pat
  268. mv config.json.template ~/.config/pat/config.json.template
  269. cp ~/.config/pat/config.json.template ~/.config/pat/config.json
  270. sudo mv pat /usr/bin/pat
  271. sudo mv pat_config.sh /usr/local/bin
  272. #sudo mv pat_ardop.sh /usr/local/bin
  273. sudo mv pat_packet.sh /usr/local/bin
  274. sudo mv pat.png /usr/share/pixmaps
  275.  
  276. # Add Pat desktop items
  277. cat >pat-config.desktop << EOF
  278. [Desktop Entry]
  279. Name=Pat Winlink Configure
  280. Icon=pat
  281. Comment=Configure Pat files
  282. Exec=pat_config.sh
  283. Terminal=false
  284. Type=Application
  285. Categories=HamRadio
  286.  
  287. EOF
  288.  
  289. cat >pat-packet.desktop << EOF
  290. [Desktop Entry]
  291. Name=Pat Winlink (packet)
  292. Icon=pat
  293. Comment=Pat Winlink using AX.25 (pat-gensio)
  294. Exec=pat_packet.sh
  295. Terminal=true
  296. Type=Application
  297. Categories=HamRadio
  298.  
  299. EOF
  300.  
  301. sudo mv pat-config.desktop /usr/local/share/applications/
  302. sudo mv pat-packet.desktop /usr/local/share/applications/
  303.  
  304. # configure PAT (dialog)
  305. source pat_config.sh
  306. echo "
  307.  
  308. *********************************************
  309. ** **
  310. ** PAT SUCCESSFULLY INSTALLED **
  311. ** **
  312. *********************************************
  313.  
  314. "
  315. }
  316.  
  317.  
  318. install_ardop () {
  319. echo "
  320.  
  321. *********************************************
  322. ** **
  323. ** INSTALLING ARDOP MODEM **
  324. ** **
  325. *********************************************
  326.  
  327. "
  328.  
  329. wget https://inovato.net/ham/files/ardopc.tar.gz
  330. tar -xf ardopc.tar.gz
  331. rm ardopc.tar.gz
  332. if [ ! -f ~/.asoundrc.save ]; then
  333. if [ -f ~/.asoundrc ]; then
  334. mv ~/.asoundrc ~/.asoundrc.save
  335. fi
  336. fi
  337. # get sound card info and write to config.json
  338. line=$(aplay -l | grep USB)
  339. card=$(echo "$line" | awk '{print $2}' | tr -d ':')
  340. device=$(echo "$line" | awk '{print $8}' | tr -d ':')
  341. sed -i "s/hw:1,0/hw:$card,$device/g" ./asoundrc
  342.  
  343. mv ./asoundrc ~/.asoundrc
  344. sudo mv ardopc /usr/local/bin
  345. sudo mv pat_ardop.sh /usr/local/bin
  346. cat >pat-ardop.desktop << EOF
  347. [Desktop Entry]
  348. Name=Pat Winlink (ARDOP)
  349. Icon=pat
  350. Comment=Pat Winlink using ARDOP modem
  351. Exec=pat_ardop.sh
  352. Terminal=true
  353. Type=Application
  354. Categories=HamRadio
  355.  
  356. EOF
  357. sudo mv pat-ardop.desktop /usr/local/share/applications/
  358. echo "
  359.  
  360. *********************************************
  361. ** **
  362. ** ARDOP SUCCESSFULLY INSTALLED **
  363. ** **
  364. *********************************************
  365.  
  366. "
  367. }
  368.  
  369.  
  370. install_hamclock () {
  371. echo "
  372.  
  373. *********************************************
  374. ** **
  375. ** INSTALLING HAMCLOCK **
  376. ** **
  377. *********************************************
  378.  
  379. "
  380. sudo apt install -y xorg-dev libx11-dev
  381. curl -O https://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
  382. unzip ESPHamClock.zip
  383. cd ESPHamClock
  384. make -j 4 hamclock-1600x960
  385. sudo make install
  386. cd ..
  387. rm ESPHamClock.zip
  388. sudo rm -r ESPHamClock
  389. #create hamclock menu item
  390. cat >hamclock.desktop << EOF
  391. [Desktop Entry]
  392. Name=HamClock
  393. Icon=hamclock
  394. Comment=a handy clock with features for amateur radio operators
  395. Exec=hamclock
  396. Terminal=false
  397. Type=Application
  398. Categories=HamRadio
  399.  
  400. EOF
  401. sudo mv hamclock.desktop /usr/local/share/applications/
  402. wget https://inovato.net/ham/files/hamclock.png
  403. sudo mv hamclock.png /usr/share/pixmaps
  404.  
  405. # get setup files
  406. wget https://inovato.net/ham/files/hamclock-setup
  407. sudo mv hamclock-setup /usr/local/bin
  408. sudo chmod +x /usr/local/bin/hamclock-setup
  409. wget https://inovato.net/ham/files/hamclock-xrandr-wrapper
  410. sudo mv hamclock-xrandr-wrapper /usr/local/bin
  411. sudo chmod +x /usr/local/bin/hamclock-xrandr-wrapper
  412. wget https://inovato.net/ham/files/hamclock-setup.desktop
  413. sudo mv hamclock-setup.desktop /usr/local/share/applications
  414. sudo chmod +x /usr/local/share/applications/hamclock-setup.desktop
  415. wget https://inovato.net/ham/files/hamclock-no-borders.desktop
  416. sudo mv hamclock-no-borders.desktop /usr/local/share/applications
  417. sudo chmod +x /usr/local/share/applications/hamclock-no-borders.desktop
  418. wget https://inovato.net/ham/files/hamclock-screenshot-small.png
  419. sudo mv hamclock-screenshot-small.png /usr/share/pixmaps
  420. wget https://inovato.net/ham/files/hamclock-borders-compare.png
  421. sudo mv hamclock-borders-compare.png /usr/share/pixmaps
  422. echo "
  423.  
  424. *********************************************
  425. ** **
  426. ** HAMCLOCK SUCCESSFULLY INSTALLED **
  427. ** **
  428. *********************************************
  429.  
  430. "
  431. }
  432.  
  433.  
  434. install_hamrs () {
  435. echo "
  436.  
  437. *********************************************
  438. ** **
  439. ** INSTALLING HAMRS **
  440. ** **
  441. *********************************************
  442.  
  443. "
  444. wget https://hamrs-releases.s3.us-east-2.amazonaws.com/1.0.6/hamrs-1.0.6-linux-arm64.AppImage
  445.  
  446. sudo chmod +x hamrs-1.0.6-linux-arm64.AppImage
  447. sudo mv hamrs-1.0.6-linux-arm64.AppImage /usr/local/bin
  448.  
  449. cat > hamrs.desktop <<EOF
  450. [Desktop Entry]
  451. Name=HAMRS
  452. Comment=POTA Logging Software
  453. Exec=/usr/local/bin/hamrs-1.0.6-linux-arm64.AppImage
  454. Icon=/usr/share/pixmaps/hamrs-logo.png
  455. Terminal=false
  456. Type=Application
  457. Categories=HamRadio
  458. EOF
  459.  
  460. sudo mv hamrs.desktop /usr/share/applications/
  461. wget https://inovato.net/ham/files/hamrs-logo.png
  462. sudo mv hamrs-logo.png /usr/share/pixmaps/hamrs-logo.png
  463.  
  464. echo "
  465.  
  466. *********************************************
  467. ** **
  468. ** HAMRS SUCCESSFULLY INSTALLED **
  469. ** **
  470. *********************************************
  471.  
  472. "
  473. }
  474.  
  475.  
  476. install_direwolf () {
  477.  
  478. echo "
  479.  
  480. *********************************************
  481. ** **
  482. ** INSTALLING DIREWOLF **
  483. ** **
  484. *********************************************
  485.  
  486. "
  487. INFO=$(yad --form --width=420 --text-align=center --center --title="direwolf Setup" \
  488. --separator="|" --item-separator="|" \
  489. --text="<b>Make sure your rig is connected to the Quadra and powered on before continuing\r\rPlease enter your callsign below:</b>" \
  490. --field="Callsign" \
  491. --button="Continue":0 \
  492. --button="Exit":1 "" "" "")
  493. BUT=$(echo $?)
  494.  
  495. if [ ${BUT} = 1 ]; then
  496. exit
  497. fi
  498. callsign=$(echo ${INFO} | awk -F "|" '{print $1}')
  499. callsign=${callsign^^}
  500.  
  501. # we need at least flRig
  502. if [ ! -f /usr/local/bin/flrig ]; then
  503. wget https://inovato.net/ham/files/flsuite.tar.gz
  504. tar -xf flsuite.tar.gz
  505. rm flsuite.tar.gz
  506. sudo apt install -y flrig
  507. sudo mv flrig /usr/local/bin
  508. rm fldigi flmsg flamp
  509. fi
  510.  
  511. sudo apt-get install -y libasound2-dev libudev-dev direwolf
  512. rm ~/direwolf.conf
  513. wget https://www.inovato.net/ham/files/direwolf.conf ~/
  514.  
  515. # use our start_direwolf command to start rigctld/flRig
  516. wget https://inovato.net/ham/files/start_direwolf
  517. sudo chmod +x start_direwolf
  518. sudo mv start_direwolf /usr/local/bin
  519. sudo sed -i 's/\/usr\/bin\/x-terminal-emulator -e direwolf/start_direwolf/' /usr/share/applications/direwolf.desktop
  520.  
  521. # edit direwolf config to use your callsign, USB soundcard & rigctld/flRig
  522. sed -i "s/N0CALL/${callsign}/" ~/direwolf.conf
  523. # get sound card info and write to direwolf.conf
  524. line=$(aplay -l | grep USB)
  525. card=$(echo "$line" | awk '{print $2}' | tr -d ':')
  526. device=$(echo "$line" | awk '{print $8}' | tr -d ':')
  527.  
  528. sed -i "s/# ADEVICE plughw:1,0/ADEVICE plughw:$card,$device/" ~/direwolf.conf
  529. sed -i '/#PTT\ \/dev\/ttyUSB0\ RTS/a #Change line below if not using Hamlib/flrig for PTT\nPTT RIG 2 localhost:4532' ~/direwolf.conf
  530.  
  531. # start flrig now so user can configure radio
  532. pid=$(pidof -x flrig)
  533. if [ -z $pid ]; then
  534. echo "starting flrig"
  535. flrig &
  536. fi
  537.  
  538. yad --width=400 --height=100 --title="Direwolf Setup" --wrap \
  539. --text="\rConfigure your rig in flrig under 'config'/'Setup'/'Transceiver' then close it to save the configuration.\r\rIf you need help, Google your rig model number plus 'flrig'.\r" \
  540. --button="Exit":1
  541.  
  542. echo "
  543.  
  544. *********************************************
  545. ** **
  546. ** DIREWOLF SUCCESSFULLY INSTALLED **
  547. ** **
  548. *********************************************
  549.  
  550. "
  551. }
  552.  
  553. install_yaac () {
  554. echo "
  555.  
  556. *********************************************
  557. ** **
  558. ** INSTALLING YAAC **
  559. ** **
  560. *********************************************
  561.  
  562. "
  563.  
  564. # Script thanks to KM4ACK 73Linux, with minor edits
  565. cd ~
  566. wget --tries 2 --connect-timeout=60 https://www.ka2ddo.org/ka2ddo/YAAC.zip
  567. sudo apt-get install -y librxtx-java default-jre
  568. mkdir -p ${HOME}/YAAC
  569. cd ${HOME}/YAAC || return
  570. #Fix issue 375 to prevent YAAC from reopening
  571. if [ -f ${HOME}/YAAC/YAAC ]; then
  572. rm ${HOME}/YAAC/YAAC
  573. fi
  574. touch YAAC
  575. echo "#!/bin/bash" >>YAAC
  576. echo "java -jar ${HOME}/YAAC/YAAC.jar" >>YAAC
  577. chmod +x YAAC
  578. cat >yaac.desktop <<EOF
  579. [Desktop Entry]
  580. Name=YAAC
  581. GenericName=YAAC
  582. Comment=APRS Client
  583. Exec=${HOME}/YAAC/YAAC
  584. Icon=~/usr/share/pixmaps/YAAC.png
  585. Terminal=false
  586. Type=Application
  587. Categories=Network;HamRadio;
  588. EOF
  589.  
  590. sudo mv yaac.desktop /usr/share/applications/
  591. mv ~/YAAC.zip $HOME/YAAC
  592. unzip -o ${HOME}/YAAC/YAAC.zip
  593. rm $HOME/YAAC/YAAC.zip
  594. echo "
  595.  
  596. *********************************************
  597. ** **
  598. ** YAAC SUCCESSFULLY INSTALLED **
  599. ** **
  600. *********************************************
  601.  
  602. "
  603. }
  604.  
  605. install_conky () {
  606.  
  607. echo "
  608.  
  609. *********************************************
  610. ** **
  611. ** INSTALLING CONKY **
  612. ** **
  613. *********************************************
  614.  
  615. "
  616. # set user info in pat config file
  617. INFO=$(yad --form --width=420 --text-align=center --center --title="Conky Setup" \
  618. --separator="|" --item-separator="|" \
  619. --text="<b>Please enter your information below:</b>" \
  620. --field="Callsign" \
  621. --field="Six Character Gridsquare" \
  622. --button="Continue":0 \
  623. --button="Exit":1 "" "" "")
  624. BUT=$(echo $?)
  625. if [ ${BUT} = 1 ]; then
  626. exit
  627. fi
  628. callsign=$(echo ${INFO} | awk -F "|" '{print $1}')
  629. callsign=${callsign^^}
  630. gridsquare=$(echo ${INFO} | awk -F "|" '{print $2}')
  631. gridsquare=${gridsquare^^}
  632.  
  633. # install conky & GPS support via apt
  634. # remove gpsd first so re-install works
  635. sudo apt remove gpsd
  636. sudo apt install -y conky gpsd gpsd-clients pip
  637. pip install gridtools
  638. wget https://www.inovato.net/ham/files/gpsd
  639. # default is ttyACM0, but if ttyACM1 exists, use it (eg, IC705)
  640. if [ -e /dev/ttyACM1 ]; then
  641. sed -i "s/ACM0/ACM1/" gpsd
  642. fi
  643. sudo mv gpsd /etc/default
  644. sudo systemctl enable gpsd
  645. sudo systemctl start gpsd
  646. wget https://www.inovato.net/ham/files/get_gps
  647. #sed -i "s/MYGRID/$gridsquare/" get_gps
  648. sudo chmod +x get_gps
  649. sudo mv get_gps /usr/local/bin
  650. wget https://www.inovato.net/ham/files/get_freq
  651. sudo chmod +x get_freq
  652. sudo mv get_freq /usr/local/bin
  653.  
  654.  
  655. # install conkyrc file & related
  656. wget https://www.inovato.net/ham/files/vcgencmd
  657. chmod +x vcgencmd
  658. sudo mv vcgencmd /usr/bin
  659. wget https://www.inovato.net/ham/files/conkyrc
  660. sed -i "s/MYGRID/$gridsquare/" ./conkyrc
  661. sed -i "s/MYCALL/$callsign/" ./conkyrc
  662. mv conkyrc .conkyrc
  663.  
  664. # menu
  665. cat <<EOF >${HOME}/.local/share/applications/conky.desktop
  666. [Desktop Entry]
  667. Name=Conky
  668. Comment=Conky
  669. GenericName=Conky Screen Background Monitor
  670. Exec=conky --pause=5
  671. Icon=/usr/share/pixmaps/conky-logo.png
  672. Type=Application
  673. Encoding=UTF-8
  674. Terminal=false
  675. Categories=HamRadio
  676. Keywords=Radio
  677. EOF
  678.  
  679.  
  680. # misc dependencies
  681. sudo touch ${HOME}/.local/share/WSJT-X/wsjtx.log #conky will fail to load if this file doesn't exist
  682. sudo touch /var/lib/misc/dnsmasq.leases #conky will fail to load if this file doesn't exist
  683. wget https://inovato.net/ham/files/conky-logo.png
  684. sudo mv conky-logo.png /usr/share/pixmaps/conky-logo.png
  685.  
  686. # autostart
  687. ln -sf ${HOME}/.local/share/applications/conky.desktop ${HOME}/.config/autostart/conky.desktop
  688.  
  689. echo "
  690.  
  691. *********************************************
  692. ** **
  693. ** CONKY SUCCESSFULLY INSTALLED **
  694. ** **
  695. *********************************************
  696.  
  697. "
  698. }
  699.  
  700. install_chirp () {
  701.  
  702. echo "
  703.  
  704. *********************************************
  705. ** **
  706. ** INSTALLING CHIRP **
  707. ** **
  708. *********************************************
  709.  
  710. "
  711.  
  712. date=$(curl -s https://github.com/goldstar611/chirp-appimage | grep "releases/tag/" | sed 's|.*releases/tag/||;s|">||')
  713.  
  714. wget https://github.com/goldstar611/chirp-appimage/releases/download/$date/Chirp-next-$date-aarch64.AppImage
  715.  
  716. chirp=$(ls | grep Chirp-next)
  717. sudo mv $chirp /usr/local/bin/chirp
  718. sudo chmod +x /usr/local/bin/chirp
  719.  
  720. # Create desktop entry
  721. wget https://www.inovato.net/ham/files/chirp.png
  722. sudo mv chirp.png /usr/share/pixmaps/chirp.png
  723.  
  724. cat >chirp.desktop <<EOF
  725. [Desktop Entry]
  726. Name=Chirp
  727. Comment=Radio Programming Software
  728. GenericName=Chirp
  729. Exec=/usr/local/bin/chirp
  730. Icon=/usr/share/pixmaps/chirp.png
  731. Type=Application
  732. Terminal=false
  733. Categories=HamRadio;
  734. EOF
  735.  
  736. sudo mv chirp.desktop /usr/share/applications/
  737.  
  738.  
  739. echo "
  740.  
  741. *********************************************
  742. ** **
  743. ** CHIRP SUCCESSFULLY INSTALLED **
  744. ** **
  745. *********************************************
  746.  
  747. "
  748. }
  749.  
  750.  
  751. #
  752. # Application starts here
  753. #
  754. # make sure yad installed
  755. sudo apt install yad
  756. sudo mkdir /usr/local/share/applications
  757.  
  758. # display menu
  759. wget -N https://inovato.net/ham/files/install.txt
  760. options_file=install.txt
  761. yad_options=()
  762.  
  763. while IFS='|' read -r option desc version
  764. do
  765. yad_options+=(FALSE "$option" "$desc" "$version")
  766. done < $options_file
  767.  
  768. selected_options=$(yad --height=460 --width=730 --title="Quadra Installer" --center --list --print-all --search-column=2 \
  769. --multiple --borders=20 --checklist --grid-lines=hor --column="Select" --column="Name" --column="Description" --column="Version" \
  770. --text="Select apps to install. You can sort, or search by typing." --button="cancel":1 --button="Install":2 "${yad_options[@]}")
  771. exval=$?
  772. if [ $exval = 1 ]; then
  773. # cancel button pressed
  774. exit
  775. fi
  776.  
  777. echo "
  778.  
  779. *********************************************
  780. ** **
  781. ** CHECKING DEPENDENCIES **
  782. ** **
  783. *********************************************
  784.  
  785. "
  786. sudo apt update
  787.  
  788. # Make sure we have a HamRadio menu
  789. if [ -f ~/.config/menus/xfce-applications.menu ]; then
  790. rm ~/.config/menus/xfce-applications.menu
  791. fi
  792.  
  793. # install our installer in it
  794. if [ ! -f /usr/local/bin/ham_installer ]; then
  795. cat >ham_installer.desktop <<EOF
  796. [Desktop Entry]
  797. Name=Quadra Ham Apps Installer
  798. GenericName=Ham Installer
  799. Comment=Ham Installer
  800. Exec=/usr/local/bin/ham_installer
  801. Icon=/usr/share/icons/gnome/32x32/apps/system-software-install.png
  802. Terminal=true
  803. Type=Application
  804. Categories=HamRadio;
  805. EOF
  806.  
  807. sudo mv ham_installer.desktop /usr/share/applications
  808. cat >ham_installer <<EOF
  809. #!/bin/bash
  810. cd ~/
  811. wget -N https://inovato.net/ham/install
  812. sudo chmod +x install
  813. ./install
  814. EOF
  815.  
  816. sudo mv ham_installer /usr/local/bin
  817. sudo chmod +x /usr/local/bin/ham_installer
  818. fi
  819.  
  820. #sudo apt update
  821. sudo apt install -y extra-xdg-menus
  822. # use updated rig icon instead of CQ icon which is hard to see
  823. wget https://inovato.net/ham/files/hamradio.png
  824. sudo mv hamradio.png /usr/share/pixmaps/CQ.png
  825.  
  826. # Remove old hand-built Hamradio menu if it exists
  827. if [ -f ~/.config/menus/applications-merged/user-menulibre-ham-radio.menu ]; then
  828. rm ~/.config/menus/applications-merged/user-menulibre-ham-radio.menu
  829. fi
  830. # These cause duplicated multimedia and internet menus
  831. if [ -f ~/.config/menus/applications-merged/user-xfce-multimedia.menu ]; then
  832. rm ~/.config/menus/applications-merged/user-xfce-multimedia.menu
  833. fi
  834. if [ -f ~/.config/menus/applications-merged/user-xfce-network.menu ]; then
  835. rm ~/.config/menus/applications-merged/user-xfce-network.menu
  836. fi
  837.  
  838. # Remove brltty
  839. sudo apt remove -y brltty
  840.  
  841. # Install HamLib
  842. sudo apt -y install libhamlib4 libhamlib-utils
  843.  
  844. # make sure all wireless connections are set as available for all users (permission blank) so avaialable at boot!
  845. interfaces=$(nmcli -t c)
  846. while IFS= read -r line
  847. do
  848. name="$(cut -f1 -d: <<< $line)"
  849. type="$(echo $line | cut -f3 -d:)"
  850. if [ "$type" == "802-11-wireless" ]; then
  851. sudo nmcli con modify "$name" connection.permissions ""
  852. fi
  853. done <<< "${interfaces}"
  854.  
  855. # Add GPS support in chrony if not already done
  856. CHRONYCHK=$(grep "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" /etc/chrony/chrony.conf)
  857. if [ -z "$CHRONYCHK" ]; then
  858. echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf
  859. fi
  860.  
  861.  
  862. # process selected apps from YAD menu
  863. while IFS= read -r line
  864. do
  865. check=$(echo $line | cut -f1 -d'|' )
  866. name=$(echo $line | cut -f2 -d'|' )
  867. if [ $check = TRUE ]; then
  868. prefix="install_"
  869. # execute function to install this app
  870. $prefix$name
  871. fi
  872. done <<< "${selected_options}"
  873.  
  874. sleep 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement