pactl
This commit is contained in:
parent
c9ba959339
commit
d5d0418f30
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
rofi-wayland
|
rofi-wayland
|
||||||
pavucontrol
|
pwvucontrol
|
||||||
swww
|
swww
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
cliphist
|
cliphist
|
||||||
|
@ -144,8 +144,8 @@
|
||||||
bindl = [
|
bindl = [
|
||||||
", XF86MonBrightnessUp, exec, brightnessctl set +10%"
|
", XF86MonBrightnessUp, exec, brightnessctl set +10%"
|
||||||
", XF86MonBrightnessDown, exec, brightnessctl set 10%-"
|
", XF86MonBrightnessDown, exec, brightnessctl set 10%-"
|
||||||
", XF86AudioRaiseVolume, exec, amixer set Master 10%+"
|
", XF86AudioRaiseVolume, exec, sh volume.sh -i"
|
||||||
", XF86AudioLowerVolume, exec, amixer set Master 10%-"
|
", XF86AudioLowerVolume, exec, sh volume.sh -d"
|
||||||
];
|
];
|
||||||
|
|
||||||
general = {
|
general = {
|
||||||
|
|
51
home/hyprland/volume.sh
Executable file
51
home/hyprland/volume.sh
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Function to display usage
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [-d|-i|-m]"
|
||||||
|
echo " -d Decrease volume by 10%"
|
||||||
|
echo " -i Increase volume by 10%"
|
||||||
|
echo " -m Toggle mute/unmute"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get the default sink
|
||||||
|
sink=$(pactl info | grep "Default Sink" | awk '{print $3}')
|
||||||
|
|
||||||
|
# Check if a sink was found
|
||||||
|
if [ -z "$sink" ]; then
|
||||||
|
echo "No default sink found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Process command-line options
|
||||||
|
while getopts "dim" opt; do
|
||||||
|
case $opt in
|
||||||
|
d)
|
||||||
|
# Decrease volume by 10%
|
||||||
|
pactl set-sink-volume "$sink" -10%
|
||||||
|
;;
|
||||||
|
i)
|
||||||
|
# Increase volume by 10%
|
||||||
|
pactl set-sink-volume "$sink" +10%
|
||||||
|
;;
|
||||||
|
m)
|
||||||
|
# Toggle mute/unmute
|
||||||
|
current_mute=$(pactl get-sink-mute "$sink" | awk '{print $2}')
|
||||||
|
if [ "$current_mute" = "yes" ]; then
|
||||||
|
pactl set-sink-mute "$sink" 0
|
||||||
|
echo "Unmuted"
|
||||||
|
else
|
||||||
|
pactl set-sink-mute "$sink" 1
|
||||||
|
echo "Muted"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Display current volume level
|
||||||
|
echo "Current volume:"
|
||||||
|
pactl list sinks | grep -A 15 "$sink" | grep "Volume:"
|
|
@ -26,6 +26,7 @@
|
||||||
mpv
|
mpv
|
||||||
cmus
|
cmus
|
||||||
obs-studio
|
obs-studio
|
||||||
|
pulseaudioFull
|
||||||
#gui stuff
|
#gui stuff
|
||||||
keepassxc
|
keepassxc
|
||||||
vesktop
|
vesktop
|
||||||
|
|
Loading…
Reference in a new issue