{"id":17169723,"url":"https://github.com/naftulikay/autopulse","last_synced_at":"2026-01-20T01:55:23.460Z","repository":{"id":57412887,"uuid":"79173265","full_name":"naftulikay/autopulse","owner":"naftulikay","description":"Dynamically change PulseAudio sinks on hotplug events.","archived":false,"fork":false,"pushed_at":"2017-01-17T02:35:55.000Z","size":24,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T13:18:11.857Z","etag":null,"topics":["audio","linux","python","systemd","udev"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naftulikay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-17T00:50:05.000Z","updated_at":"2022-05-09T01:54:37.000Z","dependencies_parsed_at":"2022-08-29T15:31:27.320Z","dependency_job_id":null,"html_url":"https://github.com/naftulikay/autopulse","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Fautopulse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Fautopulse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Fautopulse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Fautopulse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naftulikay","download_url":"https://codeload.github.com/naftulikay/autopulse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436141,"owners_count":20938532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","linux","python","systemd","udev"],"created_at":"2024-10-14T23:27:10.966Z","updated_at":"2026-01-20T01:55:23.429Z","avatar_url":"https://github.com/naftulikay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autopulse [![Build Status][svg-build-status]][build-status]\n\nScript for dynamically changing your default PulseAudio sink on hotplug events for USB peripherals, etc.\n\n## Hotplug Configuration\n\n`autopulse` uses only one configuration file called `autopulse.yml`, located either in `$HOME/.config/autopulse.yml` or\n`/etc/autopulse.yml`. This file's format is as follows:\n\n```\n---\ndefault: \"abcd:ef01\"\nhotplug:\n  - \"dead:beef\"\n  - \"cafe:babe\"\n```\n\nOne default sink must be named, and as many hotplug sinks as desired can be listed. The script chooses the first present\nhotplug sink found, otherwise falls back to the default sink.\n\nDevice identifiers can be listed as follows:\n\n```\n$ autopulse ls\n  1002:aab0 Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] Digital Stereo (HDMI)\n  8086:0d0c Built-in Audio Digital Stereo (HDMI)\n  8086:8c20 Built-in Audio Analog Stereo\n* 0d8c:1066 I'm Fulla Schiit Analog Stereo\n```\n\nThe current sink is prefixed with a `*` character.\n\n## System Configuration\n\nThe easiest way to get auto hotplugging working is via systemd and udev. Create a systemd unit at\n`/etc/systemd/system/autopulse@.service`:\n\n```\n[Unit]\nDescription=PulseAudio Hotplug Service\n\n[Service]\nType=oneshot\nEnvironment=DISPLAY=:0\nUser=%i\nExecStart=/usr/local/bin/autopulse switch\n```\n\nNext, we'll create a udev rule which calls this unit:\n\n```\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0d8c\", ATTRS{idProduct}==\"1066\", ENV{SYSTEMD_WANTS}=\"autopulse@naftuli.service\"\n```\n\nWhenever a USB device with the given product and vendor ids is attached, detached, or changed, the systemd unit will\nbe called, running as user `naftuli`.\n\n\u003e **NOTE:** It's still unfortunately necessary to set `DISPLAY` so that the script can find the PulseAudio daemon. If\n\u003e anyone knows a better solution for this, please send it my way.\n\n [build-status]: https://travis-ci.org/naftulikay/autopulse\n\n [svg-build-status]: https://travis-ci.org/naftulikay/autopulse.svg?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaftulikay%2Fautopulse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaftulikay%2Fautopulse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaftulikay%2Fautopulse/lists"}