Re-add output switcher

This commit is contained in:
Agatha Lovelace 2023-06-19 20:25:08 +02:00
parent a2185ada67
commit 9203bef1ba
Signed by: sorceress
GPG Key ID: 01D0B3AB10CED4F8
3 changed files with 32 additions and 1 deletions

View File

@ -86,6 +86,9 @@
"XF86AudioMute" = "pamixer -t";
"XF86Audio{Prev,Next}" = "playerctl {previous,next}";
"XF86AudioPlay" = "playerctl play-pause";
# Switch outputs
"super + o" = ''
dunstify -r 112119 "Sound output switched to $(${pkgs.pads}/bin/pads next && ${pkgs.pads}/bin/pads list | rg '^\*' | choose 1:)"'';
# Screenshot
"Print" = "flameshot gui && bspc desktop --focus focused";
"shift + Print" =

24
common/pkgs/pads.nix Normal file
View File

@ -0,0 +1,24 @@
{ rustPlatform, fetchFromGitHub, libpulseaudio, pkg-config }:
rustPlatform.buildRustPackage rec {
pname = "pads";
version = "89d69d4b9b199e08671c947120d5b2e1b6295d68";
src = fetchFromGitHub {
owner = "dogue";
repo = pname;
rev = version;
sha256 = "sha256-vVmEKvRSBiHv4skh2/B6cl17jVsgRI0IJeSgpSpPPTE=";
};
cargoLock = { lockFile = "${src}/Cargo.lock"; };
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libpulseaudio ];
meta = {
description =
"A simple CLI tool for swtiching the default/active output device for PulseAudio.";
homepage = "https://github.com/dogue/pads";
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: {
{
imports = [
./hardware-configuration.nix
../../common/fragments/graphical
@ -6,6 +6,10 @@
../../common/home_manager/common.nix
];
nixpkgs.overlays = [
(final: prev: { pads = final.callPackage ../../common/pkgs/pads.nix { }; })
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;