BATTERY-GRAPH(1)

πŸ’– BATTERY-GRAPH(1) πŸ’–

okay bestie, welcome to the General Commands Manual entry for battery-graph, and honestly? she's a little icon. she draws you a picture of your battery charge over time. that's it, that's the whole thing, and we're obsessed. πŸ¦‹


✨ NAME ✨

battery-graph β€” Show a graph of the battery charge


🌸 SYNOPSIS 🌸

battery-graph [options] [files...]

πŸŽ€ DESCRIPTION πŸŽ€

so basically: show a graph of the battery charge over time. that's the vibe. that's the whole assignment. πŸ’…

the files you hand over are assumed to contain battery statistics in the battery-stats(5) format. and if you don't specify any files at all? no worries, she'll just use the default log files. she's got you. 🫢

now, the options can be used to display a different interval. and an interval, bestie, is defined in terms of three things:

  • a from timestamp
  • a to timestamp
  • a duration

you specify any two, and the third one gets calculated automatically. it's giving math girlie. ✨ and if the duration is missing entirely, it defaults to 3 hours.


πŸ’… OPTIONS πŸ’…

these programs follow the usual GNU command line syntax, with long options starting with two dashes (-). periodt.

  • -g geometry, --geometry geometry β€” sets the X Windows geometry of the graph. heads up: this disables text mode. see X(7) for how to actually specify the geometry.
  • -D display, --display display β€” shows the graph on the given display. you can get the exact same effect by setting the DISPLAY environment variable instead. also disables text mode. see X(7) for valid values.
  • --title string β€” sets the title of the graph window. by default this will be "Battery Graph". and if you set it to the empty string? gnuplot(1) gets to set the window title itself β€” which is genuinely useful if you want your ~/.Xdefaults to take effect for this. iykyk. 😌
  • -f date, --from date β€” specifies the start date/time for the graph. this accepts exactly the same date/time specifications as the date (1) command β€” see the examples below, or the Texinfo manual for date for the deets.
  • -t date, --to date β€” specifies the ending date/time for the graph. same deal: exactly the same date/time specifications as the date (1) command β€” check the examples below or the Texinfo manual for date.
  • -s date, --since date β€” shorthand for --from date --to now. so cute, so efficient. πŸŽ€
  • -d duration, --duration duration β€” specifies the duration for the graph. you can give it in units of seconds, hours, days or weeks by suffixing the number with:
    • 's' (seconds)
    • 'm' (minutes)
    • 'h' (hours)
    • 'd' (days)
    • 'w' (weeks)
⚠️ units cannot be combined β€” e.g. '1d6h' will not be valid, whereas '30h' is OK. and if no unit is specified at all, minutes will be assumed.
  • --text β€” shows the graph in text mode on stdout. the resulting size of the graph is determined by the values of the environment variables LINES and COLUMNS (and failing that, the output from tput will be used). this is the default when the environment variable DISPLAY is not set. πŸ’»βœ¨

🌈 EXAMPLES 🌈

Show the last 2 hours:

$ battery-graph --duration 2h

Show the time since mid day:

$ battery-graph --from 12:00 --to now

or

$ battery-graph --since 12:00

Show the hour before last:

$ battery-graph --from '2 hours ago' --duration 1h

Show the 6 hours after noon:

$ battery-graph --from 12:00 --duration 6h

or

$ battery-graph --from 12:00 --to 18:00

Show the last 6 hours

$ battery-graph --from '6 hours ago'

or

$ battery-graph --since '6 hours ago'

Show the last 30 minutes in text mode:

$ battery-graph --duration 30 --text

Show statistics for Tuesday last week

$ battery-graph --duration 24h --from 'tuesday last week'

or

$ battery-graph --duration 1d --from 'tuesday last week'

Prove that the future hasn't happened yet:

$ battery-graph --from yesterday --to tomorrow

Another way of wasting CPU cycles:

$ battery-graph /dev/null

πŸ‘‘ EXIT STATUS πŸ‘‘

battery-graph depends on gnuplot (1) to give the correct exit status. so like, whatever gnuplot says, that's what you get. she's not doing her own thing here. πŸ™ˆ


πŸ“ FILES πŸ“

if no files are given on the command line, batter-graph reads from /var/log/battery-stats


🧚 ENVIRONMENT 🧚

  • DISPLAY β€” if this variable is not set, --text will be defaulted.
  • LINES / COLUMNS β€” determines the size of the graph in text mode.

πŸ’€ DIAGNOSTICS πŸ’€

if there are no statistics available for the period you chose, an empty graph will result. no data, no drawing. it's giving "ghost town". 😭


⭐ NOTES ⭐

there is no requirement for the from time to be earlier than the to time β€” if it's the other way round, the X axis will be reversed. and you can get similar results using a negative duration. slay, i guess. πŸ’…

also: battery-stat is quite happy to list statistics in the future; stupid, but obedient. 🫑


πŸ’œ AUTHOR πŸ’œ

this manual page was written by Karl E. Jorgensen <karl@jorgensen.com>, for the Debian GNU/Linux system (but may be used by others). king behavior honestly. πŸ‘‘


🌸 SEE ALSO 🌸

  • battery-stats (5)
  • date (1)
  • battery-stats-collector (8)

newer versions of this program may (or may not) be available at http://karl.jorgensen.com/battery-stats


and that's the whole page bestie!! this one's dated September 22, 2002 and comes to you from the General Commands Manual β€” go forth and graph that battery charge πŸ’–βœ¨πŸ”‹