added a volume widget
This commit is contained in:
@@ -47,4 +47,5 @@
|
|||||||
(hyprsunset)
|
(hyprsunset)
|
||||||
(datetime)
|
(datetime)
|
||||||
(stray)
|
(stray)
|
||||||
|
(volume)
|
||||||
(swaync)))
|
(swaync)))
|
||||||
|
@@ -7,3 +7,4 @@
|
|||||||
@import 'widgets/hypr_workspaces.scss';
|
@import 'widgets/hypr_workspaces.scss';
|
||||||
@import 'widgets/sysmon.scss';
|
@import 'widgets/sysmon.scss';
|
||||||
@import 'widgets/swaync.scss';
|
@import 'widgets/swaync.scss';
|
||||||
|
@import 'widgets/volume.scss';
|
||||||
|
@@ -7,3 +7,4 @@
|
|||||||
(include "widgets/hypr_activewindow.yuck")
|
(include "widgets/hypr_activewindow.yuck")
|
||||||
(include "widgets/sysmon.yuck")
|
(include "widgets/sysmon.yuck")
|
||||||
(include "widgets/swaync.yuck")
|
(include "widgets/swaync.yuck")
|
||||||
|
(include "widgets/volume.yuck")
|
||||||
|
11
eww/widgets/volume.scss
Normal file
11
eww/widgets/volume.scss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
.sourcevol{
|
||||||
|
background: steelblue;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.sinkvol{
|
||||||
|
background: slateblue;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.muted{
|
||||||
|
background: tomato;
|
||||||
|
}
|
17
eww/widgets/volume.yuck
Normal file
17
eww/widgets/volume.yuck
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
(defpoll sourcevol :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $2}'`)
|
||||||
|
(defpoll sourcemute :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $3}'`)
|
||||||
|
(defpoll sinkvol :interval "1s" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $2}'`)
|
||||||
|
(defpoll sinkmute :interval "1s" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $3}'`)
|
||||||
|
|
||||||
|
(defwidget volume []
|
||||||
|
(box
|
||||||
|
:space-evenly false
|
||||||
|
:spacing 3
|
||||||
|
(eventbox
|
||||||
|
:class "sourcevol${sourcemute == "[MUTED]" ? " muted" : ""}"
|
||||||
|
:onclick "wpctl set-mute @DEFAULT_SOURCE@ toggle"
|
||||||
|
(label :text "${sourcemute == "[MUTED]" ? "" : ""} ${sourcevol}"))
|
||||||
|
(eventbox
|
||||||
|
:class "sinkvol${sinkmute == "[MUTED]" ? " muted" : ""}"
|
||||||
|
:onclick "wpctl set-mute @DEFAULT_SINK@ toggle"
|
||||||
|
(label :text "${sinkmute == "[MUTED]" ? "" : ""} ${sinkvol}"))))
|
@@ -132,7 +132,7 @@ bindel = ,XF86AudioMute, exec, swayosd-client --output-volume mute-toggle
|
|||||||
# Input volume control
|
# Input volume control
|
||||||
bindel = SHIFT ,XF86AudioRaiseVolume, exec, swayosd-client --input-volume raise --max-volume 150
|
bindel = SHIFT ,XF86AudioRaiseVolume, exec, swayosd-client --input-volume raise --max-volume 150
|
||||||
bindel = SHIFT ,XF86AudioLowerVolume, exec, swayosd-client --input-volume lower --max-volume 150
|
bindel = SHIFT ,XF86AudioLowerVolume, exec, swayosd-client --input-volume lower --max-volume 150
|
||||||
bindel = SHIFT ,XF86AudioMute, exec, pactl set-source-mute alsa_input.usb-DCMT_Technology_USB_Condenser_Microphone_214b206000000178-00.mono-fallback toggle
|
bindel = SHIFT ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle
|
||||||
|
|
||||||
# Requires playerctl
|
# Requires playerctl
|
||||||
bindl = , XF86AudioNext, exec, swayosd-client --playerctl next
|
bindl = , XF86AudioNext, exec, swayosd-client --playerctl next
|
||||||
|
Reference in New Issue
Block a user