1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37:44 +00:00

Limit max volume

This commit is contained in:
RGBCube 2023-11-08 20:07:09 +03:00
parent 00b9edd9cd
commit 20a39d18ec
No known key found for this signature in database
2 changed files with 15 additions and 0 deletions

View file

@ -5,6 +5,8 @@
})
(homeConfiguration "nixos" {
home.file.".config/hypr/volume.sh".source = ./volume.sh;
wayland.windowManager.hyprland = enabled {
package = hyprland;
@ -68,6 +70,13 @@
bind = SHIFT, PRINT, exec, grim - | wl-copy
bind = CTRL, PRINT, exec, kazam
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume --limit 1.5 @DEFAULT_AUDIO_SINK@ 5%+; /home/nixos/.config/hypr/volume.sh
binde = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; /home/nixos/.config/hypr/volume.sh
binde = , XF86MonBrightnessUp, exec, brightnessctl set 5%+; dunstctl close-all; dunstify --timeout 1000 $(brightnessctl -m | cut -d, -f4)
binde = , XF86MonBrightnessDown, exec, brightnessctl set --min-value=0 5%-; dunstctl close-all; dunstify --timeout 1000 $(brightnessctl -m | cut -d, -f4)
decoration {
drop_shadow = false
rounding = 0
@ -133,6 +142,7 @@
})
(with pkgs; homePackages "nixos" [
brightnessctl
grim
slurp
wl-clipboard

View file

@ -0,0 +1,5 @@
#!/bin/sh
dunstctl close-all;
volume_float=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/Volume: //' )
dunstify --timeout 1000 "$(awk "BEGIN { print($volume_float * 100) }")%"