diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-08-19 16:29:37 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-08-19 16:29:37 +0100 |
commit | d56aea2398fee968b8b466482da859f5b795c43b (patch) | |
tree | 103d946a1e09edc202d65521f9a8a6842913ffcf /Scripts/.local/scripts/status/battery_time_left | |
parent | 927a4f96b30da9ad5c6b178d840fa1acecf72024 (diff) | |
download | dotfiles-d56aea2398fee968b8b466482da859f5b795c43b.tar.gz dotfiles-d56aea2398fee968b8b466482da859f5b795c43b.tar.bz2 dotfiles-d56aea2398fee968b8b466482da859f5b795c43b.zip |
(Scripts)+script for getting time left in battery using acpi -b
Customisable and has an exact hour + minute timer.
Diffstat (limited to 'Scripts/.local/scripts/status/battery_time_left')
-rwxr-xr-x | Scripts/.local/scripts/status/battery_time_left | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/status/battery_time_left b/Scripts/.local/scripts/status/battery_time_left new file mode 100755 index 0000000..8dfadf2 --- /dev/null +++ b/Scripts/.local/scripts/status/battery_time_left @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +capture="" +if [[ $# -eq 1 ]] +then + capture="\1H,\2M,\3s" +else + capture="\1H,\2M" +fi + +acpi -b | sed "s/.*\([0-9][0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/$capture/g" | xargs echo |