Added new fr24feed-dump1090 function

This commit is contained in:
Phil 2025-05-14 08:26:44 +01:00
parent 27bcc2a689
commit d10f0018d1
4 changed files with 81 additions and 5 deletions

View File

@ -414,7 +414,31 @@ echo "Unleaded - $costco_unleaded p"
## Curl Dump1090 data from scanner
alias fr24feed="curl --http0.9 192.168.10.21:30003 --output -"
alias fr24feed-dump1090="sh -c 'dump1090-mutability --net --net-only --net-bi-port 30004 --interactive & nc 192.168.10.21 30005 | nc 127.0.0.1 30004'
fr24feed-dump1090() {
# Start dump1090-mutability in the background
dump1090-mutability --net --net-only --net-bi-port 30004 --interactive &
DUMP1090_PID=$!
# Start the nc pipe in the background
nc 192.168.10.21 30005 | nc 127.0.0.1 30004 &
NC_PID=$!
# Define a cleanup function
cleanup() {
echo "Stopping processes..."
kill $DUMP1090_PID $NC_PID 2>/dev/null
wait $DUMP1090_PID $NC_PID 2>/dev/null
echo "Exited."
}
# Trap Ctrl+C (SIGINT) and call cleanup
trap cleanup SIGINT
# Wait for both background processes
wait $DUMP1090_PID
wait $NC_PID
}
"
## Subnet Table
@ -485,6 +509,17 @@ alias iplookup='iplookup-get(){ curl "ip.nclte.ch/json?ip=$1"; unset -f iplookup
## Make random dir
alias mkdir-random='mkdir $(cat /dev/urandom | tr -dc "a-zA-Z0-9" | fold -w 50 | head -n 1) && echo "Directory created: $(cat /dev/urandom | tr -dc "a-zA-Z0-9" | fold -w 50 | head -n 1)"'
function rofi-file-browser(){
rofi -dmenu -p "Select File Manager" -i -no-fixed-num-lines <<< "File Browser"
if [ $? -eq 0 ]; then
mate-terminal ranger
fi
}
## Display all commands in this Alias file
alias my-alias="cat ~/.aliases | grep -oP 'alias\s\K[^=]+' | sort -n"
name = "File Browser"
command = "/path/to/rofi-file-browser.sh"
combi-modes = ["run", "window", "file-browser"]
}

View File

@ -22,5 +22,6 @@ if [ -n "$BASH_VERSION" ]; then
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
rofi.terminal: /usr/bin/tmux
export PATH="$PATH:$HOME/opt/esp/xtensa-lx106-elf/bin"
export IDF_PATH="/opt/esp/ESP8266_RTOS_SDK"

View File

@ -4,9 +4,47 @@
# Find all dot files then if the original file exists, create a backup
# Once backed up to {file}.dtbak symlink the new dotfile in place
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
if [ -e ~/$file ]; then
mv -f ~/$file{,.dtbak}
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n"); do
# Check if it's a file and if a symlink already exists
target_file="~/$file"
if [ -e $target_file ]; then
if [ -L $target_file ]; then
# If it's a symlink and points to the correct location, skip it
target_link=$(readlink $target_file)
if [ "$target_link" != "$PWD/$file" ]; then
mv -f $target_file{,.dtbak} # Backup existing symlink or file
fi
else
mv -f $target_file{,.dtbak} # Backup if it's not a symlink
fi
fi
ln -s $PWD/$file ~/$file
ln -s $PWD/$file $target_file
done
# Handle directories
for dir in $(find . -maxdepth 1 -name ".*" -type d); do
target_dir="~/$dir"
# Create the directory in the target location if it doesn't exist
if [ ! -d $target_dir ]; then
mkdir -p $target_dir
fi
# Now handle symlinks for files inside the directory
for subfile in $(find $dir -type f); do
relative_subfile="${subfile#$dir/}"
target_subfile="$target_dir/$relative_subfile"
# Check if the symlink already exists and points to the correct location
if [ ! -e $target_subfile ]; then
ln -s $PWD/$subfile $target_subfile
elif [ -L $target_subfile ]; then
target_link=$(readlink $target_subfile)
if [ "$target_link" != "$PWD/$subfile" ]; then
mv -f $target_subfile{,.dtbak} # Backup existing symlink
ln -s $PWD/$subfile $target_subfile # Create new symlink
fi
fi
done
done

2
rofi/config.rasi Normal file
View File

@ -0,0 +1,2 @@
//@theme "/usr/share/rofi/themes/arthur.rasi"
@theme "/usr/share/rofi/themes/gruvbox-dark-soft.rasi"