Martin Paul Eve bio photo

Martin Paul Eve

Professor of Literature, Technology and Publishing at Birkbeck, University of London

Email Books Twitter Github Stackoverflow MLA CORE Institutional Repo ORCID ID  ORCID iD Wikipedia Pictures for Re-Use

OK, this is probably one of the most specific posts I've ever written, but...

I wrote a bash script to automatically fetch and parse the currently used data on the 4G EE mobile network in the UK that can then be used with Conky. It's a compact one liner that looks like this:

wget -qO- | awk -v OFS=' / ' -v ORS='' '/<span class="data-used">/{sub(/^[^0-9]*/, ""); dused=$0; match(dused, /^([0-9].?[0-9]?).+([0-9][^G]?[0-9]?)/, arr);} END {print arr[1], arr[2];}'

You can then call this from a conkyrc file with something like this:

${color #F09000}Mobile Usage${color #707070}:${color white} ${execi 900 ~/.scripts/}GB