Package: nf
IN SHORTnfis a tool to make notification for user that its command finish work. For example “make” program that takes long time to finish.SPDX-License-Identifier: 0BSDProject name: nf
License: 0BSD / Free Public License 1.0.0
More information about license:https://opensource.org/licenses/0BSDCHANGELOGFrom 1.3.2:–detachfor run command as detached process (stdout is still the same, but parent of process is system dependant)–wait-for-pidswait for one or more processes then run cmdadd new backend: win10toast-persistfix backends priorities on Winfix ‘null’ dbus interface on some Linux configurationsdetect WSL (Win) but do not support it yetSCREENSHOTSScreenshot from KDE:Screenshot from KDE:Screenshot from KDE:Screenshot from Android:NON-INSTALLIt is one-file script so you can download and use it.
You can also run it from sources without any dependancies* (need only python and maybe some modules delivered with it [or not])* - Windows needs some modules to work, see setup.py for details. On 2020-03-08 they are:python -m install psutil win10toast-persistLatest developement version:wget-chttps://github.com/NIC-MichalLabedzki/nf/raw/master/nf.pyorcurlhttps://github.com/NIC-MichalLabedzki/nf/raw/master/nf.py-f-L-onf.pyor put link into your browserhttps://github.com/NIC-MichalLabedzki/nf/raw/master/nf.pyorgitclonegit@github.com:NIC-MichalLabedzki/nf.gitpython./nf.pySee:python./nf.py--helpSee CLI section for more details.Previous stable versions:wget-chttps://github.com/NIC-MichalLabedzki/nf/raw/v1.4.0/nf.pywget-chttps://github.com/NIC-MichalLabedzki/nf/raw/v1.3.2/nf.pywget-chttps://github.com/NIC-MichalLabedzki/nf/raw/v1.2.0/nf.pywget-chttps://github.com/NIC-MichalLabedzki/nf/raw/v1.1.1/nf.pywget-chttps://github.com/NIC-MichalLabedzki/nf/raw/v1.0.1/nf.pyINSTALLATIONpython-mpipinstallnforpython-mpipinstallnf--userorpython-mpipinstallnf--user--proxy=YOUR.PROXY.IP.v4:YOUR_PORTorpython-mpipinstall-egit+https://github.com/NIC-MichalLabedzki/nf.git#egg=masterorgitclonehttps://github.com/NIC-MichalLabedzki/nf.gitcdnfpythonsetup.py# or python -m pip install -e .orgitclonegit@github.com:NIC-MichalLabedzki/nf.gitcdnfpythonsetup.py# or python -m pip install -e .To update:python-mpipinstallnf-UINTERFACEThere are one kind of interfaces:CLI.If you think there is a need to havelib/moduleto please let me know why.
Maybe there is a reason.CLICLI is Command Line Interface. So you have tool called: nf$pythonnf.py--helpusage:nf.py[-h][-lLABEL][-p][-n][-s][-wWAIT_FOR_PID][--detach][-b{paramiko,ssh,dbus,gdbus,notify-send,termux-notification,win10toast-persist,win10toast,plyer,plyer_toast,stdout}][-v][-d][--debugfileDEBUGFILE][--custom_notification_textCUSTOM_NOTIFICATION_TEXT][--custom_notification_titleCUSTOM_NOTIFICATION_TITLE][--custom_notification_exit_codeCUSTOM_NOTIFICATION_EXIT_CODE]cmd...Simplecommandlinetooltomakenotificationaftertargetprogramfinishedworkpositionalarguments:cmdargsoptionalarguments:-h,--helpshowthishelpmessageandexit-lLABEL,--labelLABELAddhumnreadabletexttocustomjobidentification-p,--printPrintnotificationtextinstdouttoo-n,--no-notifyDonotdoannoyingnotifications-s,--saveSave/appendcommandandstatto.nffile-wWAIT_FOR_PID,--wait-for-pidWAIT_FOR_PIDWaitforPIDakawaitforalreadyrunprocessfinishwork.Thisoptioncanbeusedmultipletimes.--detachRuncommandorwaitforpidindetachedprocess-b{paramiko,ssh,dbus,gdbus,notify-send,termux-notification,win10toast-persist,win10toast,plyer,plyer_toast,stdout},--backend{paramiko,ssh,dbus,gdbus,notify-send,termux-notification,win10toast-persist,win10toast,plyer,plyer_toast,stdout}Notificationbackend-v,--versionPrintversion-d,--debugMoreprintdebuggingonstdout--debugfileDEBUGFILEMoreprintdebuggingsaveintofile--custom_notification_textCUSTOM_NOTIFICATION_TEXTCustomnotificationtext--custom_notification_titleCUSTOM_NOTIFICATION_TITLECustomnotificationtitle--custom_notification_exit_codeCUSTOM_NOTIFICATION_EXIT_CODECustomnotificationexitcodeExamples:nfmakenflsnflsnot_exist_filenfsleep2nf-lsleepingsleep2nf-l`tty`lsnf"ls | grep .py"nf--detachsleep15nf-w55555lsnf-w55555--detachechoFinishednf-w55555-w55556echoDone"/home/nic/src/nf$nf.py -p ls
LICENSE  nf.py  pytest.ini  README  README.dev  requirements-dev.txt  setup.cfg  setup.py  tox.ini
-----------------------------------------------------------
"/home/nic/src/nf$ls" finished work.

Start time:   17:32.50
End time:     17:32.50
Elapsed time: 00:00.00
-----------------------------------------------------------LIMITATIONSWork with Jython: it does not have dbus module, fallback to command line.Observed in KDE: notification with the same body (text) can be dropped. To avoid that I add timestamp text to make nofitications unique.FEATURESSupport Android notification by termux-notifications (of course bytermux)Support dbus by python module or fallback tonotify-send(part oflibnotify0.7.7 or 0.7.8)Option to print notification on stdout.Option to save full command line and stat to file into working directory.Support whole python implementations/versions (at least not crash and print on stdout)Case SSH: If you are over SSH send notification over backward-SSH connection to your native system (force password)Supported notification backends: paramiko (ssh), ssh, dbus, notify-send, termux-notification (Android), win10toast (Windows),plyer, plyer_toast, stdoutyakuake/konsole terminal tab name in labelscreen/tmux session/window/pane title/name in labelPython module aka library interface “import nf;nf.nf([‘ls’])”TMUX/SCREEN used bynfor how to test it1. tmux session name:
.. code-block:: bashtmux rename-session sesja
tmux list-sessions -F “#{session_name}”2. tmux window name:
.. code-block:: bashtmux rename-window okno
tmux list-window -F “#{window_name} #{window_active}”3. tmux pane name:
.. code-block:: bashprintf ‘033]2;%s033' ‘this is a title’
tmux list-pane -F “#{pane_title} #{pane_active}”4. client pid to get parent (for example: yakuake)
.. code-block:: bashtmux display-message -p “#{client_pid}”5. screen sessions:
.. code-block:: bashscreen -list
There are screens on:
7842.pts-30.nic (Attached)
6981.pts-25.nic (Attached)
2 Sockets in /tmp/screens/S-nic.6. screen window title
.. code-block:: bashscreen -S 6981.pts-25.nic -Q title
terefere7. screen windows:
.. code-block:: bashscreen -S 6981.pts-25.nic -Q windows
0* terefere  1 bash  2 bash  3- bashTODOnf 1.5.0–try-version=1.3.2 - download (need Internet connection), put in home directory and use it instead of installed version–try-version=dev - latest git version to tests$HOME/.nf directory and “versions” subdir to downloaded versionsWSL support