graphical: set volume settings via window manager
sound.mediaKeys doesn't work with pulseaudio enabled, but some programs e.g. Firefox require it.
This commit is contained in:
parent
51ef800af6
commit
77a635348f
|
@ -5,7 +5,7 @@ in {
|
|||
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.driSupport = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
environment = {
|
||||
etc = {
|
||||
|
@ -37,6 +37,7 @@ in {
|
|||
};
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
pulsemixer
|
||||
adapta-gtk-theme
|
||||
cursor
|
||||
dzen2
|
||||
|
|
|
@ -96,9 +96,9 @@ for_window [app_id=".*"] inhibit_idle fullscreen
|
|||
bindsym $mod+f fullscreen
|
||||
|
||||
# display volume level when pushed
|
||||
bindsym XF86AudioRaiseVolume exec $volume
|
||||
bindsym XF86AudioLowerVolume exec $volume
|
||||
bindsym XF86AudioMute exec $volume
|
||||
bindsym XF86AudioRaiseVolume exec $volume; $mixer 2%+ unmute
|
||||
bindsym XF86AudioLowerVolume exec $volume; $mixer 2%- unmute
|
||||
bindsym XF86AudioMute exec $volume; $mixer toggle
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
|
|
|
@ -40,6 +40,7 @@ in {
|
|||
let volnoti = import ../misc/volnoti.nix { inherit pkgs; };
|
||||
in ''
|
||||
set $volume ${volnoti}
|
||||
set $mixer "${pkgs.alsaUtils}/bin/amixer -q set Master"
|
||||
|
||||
# set background
|
||||
output * bg ${pkgs.adapta-backgrounds}/share/backgrounds/adapta/tri-fadeno.jpg fill
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{ autostart, screenshots, touchtoggle, pkgs, stoggle, volnoti }: ''
|
||||
{ autostart, screenshots, touchtoggle, pkgs, stoggle, volnoti }:
|
||||
let inherit (pkgs) alsaUtils;
|
||||
in ''
|
||||
-- Function for fullscreen toggle
|
||||
fullToggle :: X ()
|
||||
fullToggle = do
|
||||
|
@ -6,6 +8,11 @@
|
|||
sendMessage $ Toggle NBFULL
|
||||
sendMessage $ SetStruts [] [minBound .. maxBound]
|
||||
|
||||
setVolume :: String -> X ()
|
||||
setVolume options = do
|
||||
spawn ("${alsaUtils}/bin/amixer -q set Master " ++ options)
|
||||
spawn "${volnoti}"
|
||||
|
||||
myAutostart :: X ()
|
||||
myAutostart = do
|
||||
spawn "${autostart}"
|
||||
|
@ -41,15 +48,15 @@
|
|||
)
|
||||
-- lower volume
|
||||
, ( ( 0 , xF86XK_AudioLowerVolume )
|
||||
, spawn "${volnoti}"
|
||||
, setVolume "2%- unmute"
|
||||
)
|
||||
-- raise volume
|
||||
, ( ( 0 , xF86XK_AudioRaiseVolume )
|
||||
, spawn "${volnoti}"
|
||||
, setVolume "2%+ unmute"
|
||||
)
|
||||
-- mute volume
|
||||
, ( ( 0 , xF86XK_AudioMute )
|
||||
, spawn "${volnoti}"
|
||||
, setVolume "toggle"
|
||||
)
|
||||
-- start qutebrowser
|
||||
, ( ( myModKey , xK_b )
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{ config, pkgs, lib, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
acpi
|
||||
lm_sensors
|
||||
|
@ -27,7 +27,7 @@
|
|||
];
|
||||
};
|
||||
|
||||
sound.mediaKeys = {
|
||||
sound.mediaKeys = lib.mkIf (!config.hardware.pulseaudio.enable) {
|
||||
enable = true;
|
||||
volumeStep = "1dB";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue