mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-22 20:59:32 -08:00
fixed battery and volume widgets
This commit is contained in:
parent
09ef4812e5
commit
083308eb37
3 changed files with 8 additions and 7 deletions
|
@ -7,6 +7,7 @@ in
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
playerctl
|
playerctl
|
||||||
|
pw-volume
|
||||||
alsa-utils
|
alsa-utils
|
||||||
socat
|
socat
|
||||||
jq
|
jq
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:spacing "10"
|
:spacing "10"
|
||||||
(_volume :volume volume)
|
(_volume :volume volume)
|
||||||
(_battery :status {EWW_BATTERY.BAT0.status} :battery {EWW_BATTERY.BAT0.capacity}))
|
(_battery :status {EWW_BATTERY == "" ? "" : EWW_BATTERY.BAT0.status} :battery {EWW_BATTERY == "" ? "" : EWW_BATTERY.BAT0.capacity}))
|
||||||
(_network :strength net-strength :name net-name)
|
(_network :strength net-strength :name net-name)
|
||||||
(sep)
|
(sep)
|
||||||
(buttons)))
|
(buttons)))
|
||||||
|
@ -90,11 +90,11 @@
|
||||||
(defwidget _battery [status battery]
|
(defwidget _battery [status battery]
|
||||||
(box
|
(box
|
||||||
:hexpand false
|
:hexpand false
|
||||||
:class {battery < 20 ? "alert" : "regular"}
|
:class {status == "" ? "regular" : battery < 20 ? "alert" : "regular"}
|
||||||
(revealer-on-hover
|
(revealer-on-hover
|
||||||
:toggle battery-visible
|
:toggle battery-visible
|
||||||
:togglename "battery-visible"
|
:togglename "battery-visible"
|
||||||
(label :text {status == 'Charging' ? "" :
|
(label :text {status == 'Charging' || status == "" ? "" :
|
||||||
battery < 20 ? "" :
|
battery < 20 ? "" :
|
||||||
battery < 40 ? "" :
|
battery < 40 ? "" :
|
||||||
battery < 60 ? "" :
|
battery < 60 ? "" :
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
{music != "" ? "🎵${music}" : ""}))
|
{music != "" ? "🎵${music}" : ""}))
|
||||||
|
|
||||||
(defpoll volume :interval "1s"
|
(defpoll volume :interval "1s"
|
||||||
"scripts/getvol")
|
"pw-volume status | jq '.percentage'")
|
||||||
|
|
||||||
(defpoll time :interval "10s"
|
(defpoll time :interval "10s"
|
||||||
"date '+%H:%M %b %d, %Y'")
|
"date '+%H:%M %b %d, %Y'")
|
||||||
|
|
|
@ -6,6 +6,6 @@ spaces (){
|
||||||
}
|
}
|
||||||
|
|
||||||
spaces
|
spaces
|
||||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
# socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||||
spaces
|
# spaces
|
||||||
done
|
# done
|
||||||
|
|
Loading…
Reference in a new issue