1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-10 22:41:51 +02:00

updated upower examples

This commit is contained in:
Kelly Brazil
2021-03-24 14:14:22 -07:00
parent 6d44091c80
commit 56011f1f17
3 changed files with 73 additions and 6 deletions

View File

@@ -2767,6 +2767,69 @@ uname -a | jc --uname -p # or: jc -p uname -a
"kernel_version": "#74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019" "kernel_version": "#74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019"
} }
``` ```
### upower
```bash
upower -i /org/freedesktop/UPower/devices/battery | jc --upower -p # or jc -p upower -i /org/freedesktop/UPower/devices/battery
```
```json
[
{
"native_path": "/sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0",
"vendor": "NOTEBOOK",
"model": "BAT",
"serial": "0001",
"power_supply": true,
"updated": "Thu 11 Mar 2021 06:28:08 PM UTC",
"has_history": true,
"has_statistics": true,
"detail": {
"type": "battery",
"present": true,
"rechargeable": true,
"state": "charging",
"energy": 22.3998,
"energy_empty": 0.0,
"energy_full": 52.6473,
"energy_full_design": 62.16,
"energy_rate": 31.6905,
"voltage": 12.191,
"time_to_full": 57.3,
"percentage": 42.5469,
"capacity": 84.6964,
"technology": "lithium-ion",
"energy_unit": "Wh",
"energy_empty_unit": "Wh",
"energy_full_unit": "Wh",
"energy_full_design_unit": "Wh",
"energy_rate_unit": "W",
"voltage_unit": "V",
"time_to_full_unit": "minutes"
},
"history_charge": [
{
"time": 1328809335,
"percent_charged": 42.547,
"status": "charging"
},
{
"time": 1328809305,
"percent_charged": 42.02,
"status": "charging"
}
],
"history_rate": [
{
"time": 1328809335,
"percent_charged": 31.691,
"status": "charging"
}
],
"updated_seconds_ago": 441975,
"updated_epoch": 1615516088,
"updated_epoch_utc": 1615487288
}
]
```
### uptime ### uptime
```bash ```bash
uptime | jc --uptime -p # or: jc -p uptime uptime | jc --uptime -p # or: jc -p uptime

View File

@@ -33,7 +33,7 @@ Examples:
"model": "BAT", "model": "BAT",
"serial": "0001", "serial": "0001",
"power_supply": true, "power_supply": true,
"updated": "Thu Feb 9 18:42:15 2012", "updated": "Thu 11 Mar 2021 06:28:08 PM UTC",
"has_history": true, "has_history": true,
"has_statistics": true, "has_statistics": true,
"detail": { "detail": {
@@ -78,7 +78,9 @@ Examples:
"status": "charging" "status": "charging"
} }
], ],
"updated_seconds_ago": 1 "updated_seconds_ago": 441975,
"updated_epoch": 1615516088,
"updated_epoch_utc": 1615487288
} }
] ]
@@ -90,7 +92,7 @@ Examples:
"model": "BAT", "model": "BAT",
"serial": "0001", "serial": "0001",
"power_supply": "yes", "power_supply": "yes",
"updated": "Thu Feb 9 18:42:15 2012 (1 seconds ago)", "updated": "Thu 11 Mar 2021 06:28:08 PM UTC (441975 seconds ago)",
"has_history": "yes", "has_history": "yes",
"has_statistics": "yes", "has_statistics": "yes",
"detail": { "detail": {

View File

@@ -31,7 +31,7 @@ Examples:
"model": "BAT", "model": "BAT",
"serial": "0001", "serial": "0001",
"power_supply": true, "power_supply": true,
"updated": "Thu Feb 9 18:42:15 2012", "updated": "Thu 11 Mar 2021 06:28:08 PM UTC",
"has_history": true, "has_history": true,
"has_statistics": true, "has_statistics": true,
"detail": { "detail": {
@@ -76,7 +76,9 @@ Examples:
"status": "charging" "status": "charging"
} }
], ],
"updated_seconds_ago": 1 "updated_seconds_ago": 441975,
"updated_epoch": 1615516088,
"updated_epoch_utc": 1615487288
} }
] ]
@@ -88,7 +90,7 @@ Examples:
"model": "BAT", "model": "BAT",
"serial": "0001", "serial": "0001",
"power_supply": "yes", "power_supply": "yes",
"updated": "Thu Feb 9 18:42:15 2012 (1 seconds ago)", "updated": "Thu 11 Mar 2021 06:28:08 PM UTC (441975 seconds ago)",
"has_history": "yes", "has_history": "yes",
"has_statistics": "yes", "has_statistics": "yes",
"detail": { "detail": {