mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-23 01:05:38 +00:00
volnoti volume notifications
This commit is contained in:
parent
93de15cec0
commit
f1fda23f3f
@ -7,7 +7,7 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
legendary-gl
|
legendary-gl
|
||||||
rare # GUI for Legendary (not working)
|
rare # GUI for Legendary (not working)
|
||||||
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages
|
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages, see https://nixos.wiki/wiki/Wine
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
@ -93,13 +93,6 @@ in {
|
|||||||
};
|
};
|
||||||
keybindings = {
|
keybindings = {
|
||||||
|
|
||||||
# PulseAudio adjust volume
|
|
||||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pamixer -i 2";
|
|
||||||
"XF86AudioLowerVolume" = "exec --no-startup-id pamixer -d 2";
|
|
||||||
"XF86AudioMute" = "exec --no-startup-id pamixer -t";
|
|
||||||
"XF86AudioMicMute" =
|
|
||||||
"exec --no-startup-id pamixer --default-source -t";
|
|
||||||
|
|
||||||
# Adjust screen brightness
|
# Adjust screen brightness
|
||||||
"Shift+F12" =
|
"Shift+F12" =
|
||||||
"exec ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ddcutil --display 2 setvcp 10 + 30";
|
"exec ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ddcutil --display 2 setvcp 10 + 30";
|
||||||
|
@ -1,13 +1,61 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# These micro-scripts change the volume while also triggering the volume
|
||||||
|
# notification widget
|
||||||
|
|
||||||
|
increaseVolume = pkgs.writeShellScriptBin "increaseVolume" ''
|
||||||
|
${pkgs.pamixer}/bin/pamixer -i 2
|
||||||
|
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
|
||||||
|
${pkgs.volnoti}/bin/volnoti-show $volume
|
||||||
|
'';
|
||||||
|
|
||||||
|
decreaseVolume = pkgs.writeShellScriptBin "decreaseVolume" ''
|
||||||
|
${pkgs.pamixer}/bin/pamixer -d 2
|
||||||
|
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
|
||||||
|
${pkgs.volnoti}/bin/volnoti-show $volume
|
||||||
|
'';
|
||||||
|
|
||||||
|
toggleMute = pkgs.writeShellScriptBin "toggleMute" ''
|
||||||
|
${pkgs.pamixer}/bin/pamixer --toggle-mute
|
||||||
|
mute=$(${pkgs.pamixer}/bin/pamixer --get-mute)
|
||||||
|
if [ "$mute" == "true" ]; then
|
||||||
|
${pkgs.volnoti}/bin/volnoti-show --mute
|
||||||
|
else
|
||||||
|
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
|
||||||
|
${pkgs.volnoti}/bin/volnoti-show $volume
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf config.gui.enable {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
hardware.pulseaudio.enable = true;
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs;
|
environment.systemPackages = with pkgs; [
|
||||||
[
|
|
||||||
pamixer # Audio control
|
pamixer # Audio control
|
||||||
|
volnoti # Volume notifications
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
# Graphical volume notifications
|
||||||
|
services.volnoti.enable = true;
|
||||||
|
|
||||||
|
# i3 keybinds for changing the volume
|
||||||
|
xsession.windowManager.i3.config.keybindings = {
|
||||||
|
"XF86AudioRaiseVolume" =
|
||||||
|
"exec --no-startup-id ${increaseVolume}/bin/increaseVolume";
|
||||||
|
"XF86AudioLowerVolume" =
|
||||||
|
"exec --no-startup-id ${decreaseVolume}/bin/decreaseVolume";
|
||||||
|
"XF86AudioMute" = "exec --no-startup-id ${toggleMute}/bin/toggleMute";
|
||||||
|
"XF86AudioMicMute" =
|
||||||
|
"exec --no-startup-id pamixer --default-source --toggle-mute";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user