Batterytime
This commit is contained in:
parent
aa27b55609
commit
59bb4a9fb7
4 changed files with 7 additions and 13 deletions
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
programs.eww = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck" = {
|
||||
enable = true;
|
||||
text = builtins.readFile ./eww/eww.yuck;
|
||||
};
|
||||
}
|
|
@ -76,8 +76,7 @@
|
|||
(deflisten micMuted :initial "false"
|
||||
"pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done")
|
||||
|
||||
(deflisten batteryTime :initial "unknown"
|
||||
"upower -d | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'; upower --monitor-detail | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'")
|
||||
; "upower -d | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'; upower --monitor-detail | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'")
|
||||
|
||||
; (deflisten batteryTime :initial "unknown"
|
||||
; "upower -d | rg '\s*time to empty:\s*(\d.*)\$' -r '\$1'; upower --monitor-detail | rg '\\s*time to empty:\\s*(\\d.*)\$' -r '\$1'")
|
||||
|
@ -96,5 +95,7 @@
|
|||
(defpoll brightness :interval "10s"
|
||||
"echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))")
|
||||
|
||||
(deflisten batteryTime :initial "unknown" "scripts/battery-time.bash")
|
||||
|
||||
(deflisten workspace "scripts/hypr-workspaces.bash")
|
||||
(defwidget workspaces [] (literal :content workspace))
|
||||
|
|
3
modules/home-manager/eww/scripts/battery-time.bash
Executable file
3
modules/home-manager/eww/scripts/battery-time.bash
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
{ upower -d; upower --monitor-detail; } \
|
||||
| rg '\s*time to.*:\s*(\d.*)\s*$' -r '$1'
|
|
@ -1,3 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = [pkgs.eww];
|
||||
environment.systemPackages = with pkgs; [eww upower];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue