Merge pull request #12441 from k0ral/acpid

Add volume and cd events to acpid configuration

+92 -1
+92 -1
nixos/modules/services/hardware/acpid.nix
··· 20 } 21 ''; 22 23 - events = [powerEvent lidEvent acEvent]; 24 25 # Called when the power button is pressed. 26 powerEvent = ··· 55 ''; 56 }; 57 58 in 59 60 { ··· 87 type = types.lines; 88 default = ""; 89 description = "Shell commands to execute on an ac_adapter.* event."; 90 }; 91 92 };
··· 20 } 21 ''; 22 23 + events = [powerEvent lidEvent acEvent muteEvent volumeDownEvent volumeUpEvent cdPlayEvent cdNextEvent cdPrevEvent]; 24 25 # Called when the power button is pressed. 26 powerEvent = ··· 55 ''; 56 }; 57 58 + muteEvent = { 59 + name = "mute"; 60 + event = "button/mute.*"; 61 + action = '' 62 + #! ${pkgs.bash}/bin/sh 63 + ${config.services.acpid.muteCommands} 64 + ''; 65 + }; 66 + 67 + volumeDownEvent = { 68 + name = "volume-down"; 69 + event = "button/volumedown.*"; 70 + action = '' 71 + #! ${pkgs.bash}/bin/sh 72 + ${config.services.acpid.volumeDownEventCommands} 73 + ''; 74 + }; 75 + 76 + volumeUpEvent = { 77 + name = "volume-up"; 78 + event = "button/volumeup.*"; 79 + action = '' 80 + #! ${pkgs.bash}/bin/sh 81 + ${config.services.acpid.volumeUpEventCommands} 82 + ''; 83 + }; 84 + 85 + cdPlayEvent = { 86 + name = "cd-play"; 87 + event = "cd/play.*"; 88 + action = '' 89 + #! ${pkgs.bash}/bin/sh 90 + ${config.services.acpid.cdPlayEventCommands} 91 + ''; 92 + }; 93 + 94 + cdNextEvent = { 95 + name = "cd-next"; 96 + event = "cd/next.*"; 97 + action = '' 98 + #! ${pkgs.bash}/bin/sh 99 + ${config.services.acpid.cdNextEventCommands} 100 + ''; 101 + }; 102 + 103 + cdPrevEvent = { 104 + name = "cd-prev"; 105 + event = "cd/prev.*"; 106 + action = '' 107 + #! ${pkgs.bash}/bin/sh 108 + ${config.services.acpid.cdPrevEventCommands} 109 + ''; 110 + }; 111 + 112 + 113 in 114 115 { ··· 142 type = types.lines; 143 default = ""; 144 description = "Shell commands to execute on an ac_adapter.* event."; 145 + }; 146 + 147 + muteCommands = mkOption { 148 + type = types.lines; 149 + default = ""; 150 + description = "Shell commands to execute on an button/mute.* event."; 151 + }; 152 + 153 + volumeDownEventCommands = mkOption { 154 + type = types.lines; 155 + default = ""; 156 + description = "Shell commands to execute on an button/volumedown.* event."; 157 + }; 158 + 159 + volumeUpEventCommands = mkOption { 160 + type = types.lines; 161 + default = ""; 162 + description = "Shell commands to execute on an button/volumeup.* event."; 163 + }; 164 + 165 + cdPlayEventCommands = mkOption { 166 + type = types.lines; 167 + default = ""; 168 + description = "Shell commands to execute on an cd/play.* event."; 169 + }; 170 + 171 + cdNextEventCommands = mkOption { 172 + type = types.lines; 173 + default = ""; 174 + description = "Shell commands to execute on an cd/next.* event."; 175 + }; 176 + 177 + cdPrevEventCommands = mkOption { 178 + type = types.lines; 179 + default = ""; 180 + description = "Shell commands to execute on an cd/prev.* event."; 181 }; 182 183 };