WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: OnDemand loading notification (kind of)  (Read 2149 times)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
OnDemand loading notification (kind of)
« on: March 11, 2016, 09:09:47 PM »
I've added this line to  /usr/bin/ondemand  so I get notified, by a little terminal window, that an extension is being loaded (not going to start immediately).
Code: [Select]
[ "$DESKTOP" ] && xterm -fg gold -bg black -g 45x3+0+0 -T "Loading: ${APPNAME}" -e sh -c "{ echo -n \"Loading $APPNAME \" ; while true ; do [ -e \"$INSTALLED/$APPNAME\" ] && { echo -e \" \033[0;32mOK\n\033[0;36mStarting\033[0m...\" ; sleep 1 ; break ; } || { echo -n . ; sleep 0.5 ; } ; done ; }" &

The window disappears one second after the extension is detected to be loaded.
All it does is checking for existence of  /usr/local/tce.installed/*extension-name* , backgrounded, and echo'ing dots until found.
So it can be killed without problem in case of errors while extension loading, where the loop would probably run forever (which wouldn't be caused by this code though, but could be taken as an indicator of a missing dep).

Patch for 7.0 attached.
Download a copy and keep it handy: Core book ;)