mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-22 12:49:32 -08:00
updated volumes
This commit is contained in:
parent
34172f0ecb
commit
2d426949d9
4 changed files with 50 additions and 24 deletions
|
@ -73,17 +73,20 @@
|
|||
|
||||
(defvar volume-visible false)
|
||||
(defwidget _volume [volume]
|
||||
(box
|
||||
:hexpand false
|
||||
:class {volume > 100 ? "alert" : "regular"}
|
||||
(revealer-on-hover
|
||||
:toggle volume-visible
|
||||
:togglename "volume-visible"
|
||||
(label :text {volume <= 0 ? " " :
|
||||
volume < 33 ? " " :
|
||||
volume < 66 ? " " :
|
||||
volume < 99 ? " " : " "})
|
||||
(label :text "${volume}%"))))
|
||||
(eventbox
|
||||
:onscroll "./scripts/volume {} ${EWW_EXECUTABLE}"
|
||||
:onclick "./scripts/volume toggle ${EWW_EXECUTABLE}"
|
||||
(box
|
||||
:hexpand false
|
||||
:class {volume > 100 ? "alert" : "regular"}
|
||||
(revealer-on-hover
|
||||
:toggle volume-visible
|
||||
:togglename "volume-visible"
|
||||
(label :text {volume <= 0 ? " " :
|
||||
volume < 33 ? " " :
|
||||
volume < 66 ? " " :
|
||||
volume < 99 ? " " : " "})
|
||||
(label :text "${volume}%")))))
|
||||
|
||||
|
||||
(defvar battery-visible false)
|
||||
|
@ -144,19 +147,9 @@
|
|||
{music != "" ? "🎵${music}" : ""}))
|
||||
|
||||
(defpoll volume :interval "1s"
|
||||
"pw-volume status | jq '.percentage'")
|
||||
{"pw-volume status | jq '.percentage // 0'" ?: 500})
|
||||
|
||||
(defpoll time :interval "10s"
|
||||
"date '+%H:%M %b %d, %Y'")
|
||||
|
||||
(defwindow bar
|
||||
:monitor 1
|
||||
:exclusive true
|
||||
:windowtype "dock"
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "90%"
|
||||
:height "10px"
|
||||
:anchor "top center")
|
||||
:reserve (struts :side "top" :distance "4%")
|
||||
(bar))
|
||||
(include "windows.yuck")
|
||||
|
|
12
modules/ewwbar/eww-config/scripts/volume
Executable file
12
modules/ewwbar/eww-config/scripts/volume
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
"*") command="";;
|
||||
"up") command="change +2%";;
|
||||
"down") command="change -1.5%";;
|
||||
"toggle") command="mute toggle";;
|
||||
esac
|
||||
|
||||
[ -n "$command" ] && pw-volume $command
|
||||
|
||||
$2 update volume=$(pw-volume status | jq '.percentage // 0')
|
12
modules/ewwbar/eww-config/windows.yuck
Normal file
12
modules/ewwbar/eww-config/windows.yuck
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
(defwindow bar
|
||||
:monitor 1
|
||||
:exclusive true
|
||||
:windowtype "dock"
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "90%"
|
||||
:height "10px"
|
||||
:anchor "top center")
|
||||
:reserve (struts :side "top" :distance "4%")
|
||||
(bar))
|
|
@ -1,4 +1,4 @@
|
|||
{lib, ...}:
|
||||
{lib, pkgs, ...}:
|
||||
|
||||
let
|
||||
workspaces =
|
||||
|
@ -20,7 +20,16 @@ in
|
|||
"$mod ALT, mouse:272, resizewindow"
|
||||
];
|
||||
|
||||
# binde, will repeat when held
|
||||
#https://wiki.hyprland.org/Configuring/Binds/#bind-flags
|
||||
binde = [
|
||||
",XF86AudioRaiseVolume, exec, pw-volume change +1%; ${pkgs.eww}/bin/eww update volume=$(pw-volume status | jq '.percentage // 10')"
|
||||
",XF86AudioLowerVolume, exec, pw-volume change -1%; ${pkgs.eww}/bin/eww update volume=$(pw-volume status | jq '.percentage // 10')"
|
||||
];
|
||||
|
||||
bind = [
|
||||
",XF86AudioMute, exec, pw-volume mute toggle"
|
||||
|
||||
"$mod, RETURN, exec, kitty"
|
||||
"$mod, r, exec, rofi -show run window"
|
||||
"$mod, q, killactive"
|
||||
|
|
Loading…
Reference in a new issue