Hi,
    I have written a script to put a tray icon while lftp is running in foreground or background. The utility of tray icon is alert us of lftp is running and if you click on it, it opens a terminal window with lftp session.
    I use these programs to do it:


#!/bin/bash

# create a FIFO file, used to manage the I/O redirection from shell
PIPE=$(mktemp -u --tmpdir ${0##*/}.XXXXXXXX)
mkfifo $PIPE

# attach a file descriptor to the file
exec 3<> $PIPE

# add handler for tray icon left click
function on_click {
    terminator -x lftp -c attach 2>/dev/null
   exit 0
}
export -f on_click

terminator -x lftp ftpkemservi &

yad --notification --listen --image="lftp1" --text="lFTP working" --command="bash -c on_click" <&3 &

sleep 1

while ps -e -o command | egrep '^lftp ftpkemservi' >/dev/null
do
    sleep 2
done

echo quit>$PIPE
rm -f $PIPE

    Explanation of some terms:

  • ftpkemservi: is the name of lftp bookmark (~/.lftp/bookmarks)
  • lftp1: is the name of the icon in ~/.local/share/icons/. You can use which you want.

    Regards.

_______________________________________________
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Reply via email to