Skip to content

luminoucid/hyprland-audio-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hyprland Audio Switch

Simple one-button audio output switch for Hyprland.
Toggle between speakers and headphones.

Works out of the box with the cachyos-hyprland-settings package and configuration.
(February 2025)

Preview

This script is not officially affiliated with Hyprland.

Requirements

Required Hyprland configuration:

  • PipeWire
  • WirePlumber
  • (Optional) Mako for notifications

Setup

  1. Copy the script
    Place the hyprland-audio-switch.py script in the following directory:

    ~/.config/hypr/scripts/
  2. Set permission for the script
    Allow the execution of hyprland-audio-switch.py:

    chmod +x ~/.config/hypr/scripts/hyprland-audio-switch.py
  3. Set a key bind in hyprland.conf
    Add the following line to your hyprland.conf:

    bind = , XF86HomePage, exec, ~/.config/hypr/scripts/hyprland-audio-switch.py

    Replace XF86HomePage with your preferred keybinding.

Configuration

Skip Specific Audio Outputs

If you want to exclude certain audio outputs from switching, edit this line in the script:

SKIP_SINK_NAMES = ["USB Audio S/PDIF Output", ""]

Use the following command to get the names of your audio outputs ("Sinks"):

wpctl status

(Optional) Notifications with Mako

If you have Mako installed, you can enable or disable notifications by modifying this line in the script:

ENABLE_NOTIFICATIONS = True  

About

Little python script to switch / toggle between headphones and speakers on linux systems, with keybind option for hyprland.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages