02-13-2020, 08:11 AM
(This post was last modified: 02-13-2020, 12:03 PM by undo.
Edit Reason: script fix
)
(02-10-2020, 08:54 AM)PinePhoneCoder Wrote: Nice! You made a nice menu I see. I did sort of the same thing: Bash scripts for the basic functions of the PinePhone on GitHub: https://github.com/dirkjanbuter/pinephone-commands (I try to keep it up to date).
Hey, thanks for the script collection. Here's a little suggestion: I made a hidden script in the folder like this:
Code:
#!/bin/bash
scriptdir=$HOME/cmd/
cd $scriptdir
ls -1 | nl
echo "Make your choice"
read choice
choicetorun=$(ls -1 | nl -s \: | sed -e 's/^[ \t]*//' | grep ^"$choice"\: | sed -e 's/[0-9]\://' | sed -e 's/^[0-9]//')
./$choicetorun
It makes a list of the folder, like so:
Code:
pine:~/pinephone-commands/.la.sh
1 change-password.sh
2 ear-on.sh
3 image-to-internal-storage.sh
4 install-ffmpeg.sh
5 install-samba.sh
6 install-tor-site.sh
7 killer.sh
8 mixer.sh
9 radio-nl-bnr.sh
10 radio-nl-qmusic.sh
11 speaker-half.sh
12 speaker-max.sh
13 speaker-mute.sh
14 speaker-on.sh
15 tor-my-domain.sh
16 wifi-reset.sh
Make your choice
And you can choose the script you want by number. And if you add a script in the folder, you won't have to modify a file for to have a menu selection.