add volume notification and changing sound effect

This commit is contained in:
Leonardo Eugênio 2022-08-13 10:08:59 -03:00
parent f7d596a488
commit 9eed8fb9c1
3 changed files with 39 additions and 42 deletions

View file

@ -68,7 +68,6 @@ in {
size = 24; size = 24;
}; };
}; };
}; };

View file

@ -38,15 +38,15 @@ min() {
} }
# Pulse{{{ # Pulse{{{
get_vol_pulse() { get_vol_system() {
pamixer --get-volume pamixer --get-volume
} }
is_muted_pulse() { is_muted_system() {
pamixer --get-mute >/dev/null pamixer --get-mute >/dev/null
} }
change_vol_pulse() { change_vol_system() {
pamixer "-$1" "$(min 120 $2)" pamixer "-$1" "$(min 120 $2)"
round_vol round_vol
pamixer --set-volume "${newvol}" pamixer --set-volume "${newvol}"
@ -57,7 +57,7 @@ change_vol_pulse() {
fi fi
} }
toggle_mute_pulse() { toggle_mute_system() {
pactl set-sink-mute @DEFAULT_SINK@ toggle pactl set-sink-mute @DEFAULT_SINK@ toggle
} }
#}}} #}}}
@ -95,7 +95,7 @@ usage() {
exit "$1" exit "$1"
} }
TARGET=pulse TARGET=system
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in

View file

@ -104,13 +104,24 @@ in {
{ class = "WebCord"; } { class = "WebCord"; }
]; ];
}; };
modes = let return_mode = lib.mapAttrs (k: v: "${v}; mode default"); modes = let
locked_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
code_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in { in {
audio = { audio = code_binds (locked_binds {
${key.tabL} = "volumes decrease"; ${key.tabR} = "exec volumesh -i 10";
} // return_mode { ${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next";
${key.left} = "exec mpc prev";
${key.up} = "exec volumesh --mpd -i 10";
${key.down} = "exec volumesh --mpd -d 10";
}) // return_mode {
"space" = "exec mpc toggle"; "space" = "exec mpc toggle";
"escape" = ""; "escape" = "";
"q" = "";
"s" = "exec ${pulse_sink}/bin/pulse_sink"; "s" = "exec ${pulse_sink}/bin/pulse_sink";
}; };
}; };
@ -365,25 +376,24 @@ in {
margin = "15"; margin = "15";
layer = "overlay"; layer = "overlay";
font = "${font.interface} ${toString font.size.small}";
textColor = color.txt;
backgroundColor = color.bg; backgroundColor = color.bg;
borderColor = accent.color; borderColor = accent.color;
progressColor = "over ${accent.color}88"; progressColor = "over ${accent.color}88";
defaultTimeout = 10000; defaultTimeout = 10000;
extraConfig = ''
[app-name=volumesh]
default-timeout=5000
group-by=app-name
format=<b>%s</b>\n%b
'';
# # {{@@ header() @@}} # # {{@@ header() @@}}
# # text # # text
# font={{@@ font.interface @@}} {{@@ font.size.small @@}}
# text-color={{@@ color.txt @@}}
# # colors
# background-color={{@@ color.bg @@}}{{@@ opacity | clamp_to_hex @@}}
# border-color={{@@ accent_color @@}}
# progress-color=over {{@@ accent_color @@}}88
# # decoration
# border-size=2
# padding=5
# margin=15
# # features # # features
# icons=1 # icons=1
@ -394,18 +404,6 @@ in {
# # position # # position
# layer=overlay # layer=overlay
# [app-name=volumesh]
# default-timeout=5000
# group-by=app-name
# format=<b>%s</b>\n%b
# [app-name=dotdrop]
# default-timeout=5000
# group-by=app-name
# format=<b>%s</b>\n%b
# # vim: ft=ini
}; };
}; };