upd
This commit is contained in:
33
modules/home/programs/waybar/scripts/audio-control.nix
Normal file
33
modules/home/programs/waybar/scripts/audio-control.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.mjallen.programs.waybar;
|
||||
|
||||
pythonEnv = pkgs.python3.withPackages (_ps: [
|
||||
pkgs.${namespace}.pipewire-python
|
||||
]);
|
||||
|
||||
waybar-audio = pkgs.writeScriptBin "waybar-audio" ''
|
||||
#!${pythonEnv}/bin/python
|
||||
"""run with the special python"""
|
||||
|
||||
from pipewire_python.controller import Controller
|
||||
|
||||
audio_controller = Controller()
|
||||
|
||||
print(audio_controller.get_config())
|
||||
print(audio_controller.get_list_targets())
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ../options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ waybar-audio ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user