fix(eww): add power information notification
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
acd52b0f5a
commit
a1d3d54b0f
2 changed files with 12 additions and 4 deletions
|
@ -177,10 +177,11 @@
|
||||||
|
|
||||||
;; A widget for tracking battery
|
;; A widget for tracking battery
|
||||||
(defwidget power []
|
(defwidget power []
|
||||||
|
(button :onclick "scripts/powernotify"
|
||||||
(icon-module :class "power"
|
(icon-module :class "power"
|
||||||
:icon "⏻"
|
:icon "⏻"
|
||||||
:visible true
|
:visible true
|
||||||
(literal :content {battery_level})))
|
(literal :content {battery_level}))))
|
||||||
|
|
||||||
;; A widget for tracking time and date
|
;; A widget for tracking time and date
|
||||||
(defwidget timedate []
|
(defwidget timedate []
|
||||||
|
|
7
.config/eww/scripts/powernotify
Executable file
7
.config/eww/scripts/powernotify
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
msg=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | \
|
||||||
|
grep -E "state|time to|percentage" | \
|
||||||
|
awk '{$1=$1};1')
|
||||||
|
|
||||||
|
notify-send -t 3000 "Battery Status" "$msg"
|
Loading…
Add table
Add a link
Reference in a new issue