[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cache location



atHome and atWork use WiFi network names to see where we are. These
calls to nmcli can get quite CPU-intensive, so we should try to minimise
them. How about:

 - These scripts poll a single location, like /tmp/location, to see if
   it's 'work' or 'home'
 - A separate service maintains this file
 - If a corresponding WiFi network is found, update the file and sleep
   for a while (e.g. a couple of minutes), since it's unlikely to change
   in that time
 - If none is found, echo 'unknown' to the file and sleep for a short
   time, e.g. 20 seconds, since it may be e.g. the WiFi card needing to
   refresh