Set the DualShock 4 lightbar to a solid colour on macOS over USB or Bluetooth
Project description
ds4-lightbar-macos
A DualShock 4 connected to a Mac over Bluetooth never gets told what colour to make its lightbar, so it just pulses white forever even though it works fine. On a PS4 the console sends that command; macOS doesn't. This is a tiny tool that sends it, so the light goes solid instead.
It also sets the colour automatically every time the controller connects, over USB or Bluetooth, and only after it has read a real input report from the pad. That last part matters: if the light goes solid, the controller is genuinely connected and sending input. If it stays blinking white, something is wrong with the connection and you know not to trust it.
Install
Homebrew:
brew install bitmap4/tap/ds4color
ds4color enable
Or with pipx:
pipx install ds4color
ds4color enable
ds4color enable starts a small background agent that runs at login and sets
the colour whenever the controller connects. ds4color disable stops it.
Usage
ds4color # current setting and whether the pad is connected
ds4color blue # pick a colour
ds4color blue 20 # colour at 20% brightness
ds4color 20 # just the brightness
ds4color 255 90 0 # custom rgb
ds4color night # dim warm preset
ds4color day # bright blue preset
ds4color list # named colours
ds4color presets # saved presets
ds4color save night # save the current setting as a preset
Changes apply right away if the pad is connected, and the agent reuses them on every reconnect.
If you own more than one DS4 and want this to touch only one of them, connect
that one and run ds4color bind. ds4color unbind goes back to matching any
DualShock 4.
Config
~/.config/ds4color/config.json:
{
"color": "blue",
"brightness": 100,
"controller_serial": null,
"presets": {
"day": { "color": "blue", "brightness": 100 },
"night": { "color": "warm", "brightness": 12 }
}
}
controller_serial is the controller's Bluetooth MAC (the DS4 reports the same
value over USB). Leave it null to match any DS4.
How it works
Setting the lightbar is a HID output report. Over USB it's report 0x05; over
Bluetooth it's report 0x11 with a CRC32 the controller checks before it
listens. The tool figures out which transport you're on by looking at the input
report the pad sends back, then writes the matching one. That's the whole trick.
Uninstall
ds4color disable
brew uninstall ds4color # or: pipx uninstall ds4color
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ds4color-1.0.1.tar.gz.
File metadata
- Download URL: ds4color-1.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cad53cabde25d34d1d93cebe2441154422e9126e6cd70ee1bdb2f04e0b89b8e
|
|
| MD5 |
cc2589f4968f0773b9026944c1dc2bbd
|
|
| BLAKE2b-256 |
c11f0d804ca7e05679463134836b6ee67f017715d3fd43c04350f54c9837e4a1
|
Provenance
The following attestation bundles were made for ds4color-1.0.1.tar.gz:
Publisher:
publish.yml on bitmap4/ds4-lightbar-macos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ds4color-1.0.1.tar.gz -
Subject digest:
0cad53cabde25d34d1d93cebe2441154422e9126e6cd70ee1bdb2f04e0b89b8e - Sigstore transparency entry: 1915010548
- Sigstore integration time:
-
Permalink:
bitmap4/ds4-lightbar-macos@d671628779a4ea2ec5f6857cdc9afc8f357218fc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bitmap4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d671628779a4ea2ec5f6857cdc9afc8f357218fc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ds4color-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ds4color-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
741d053fa1bf8c8a2075dd617cac3a637a3f2123147b477122ff429a22898aea
|
|
| MD5 |
61cddf221b3707700c1908e8d1ec0661
|
|
| BLAKE2b-256 |
1826de5a76d840a93134f50cbcc9f5d08311e39bf30bca590dca7f2f8df05621
|
Provenance
The following attestation bundles were made for ds4color-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on bitmap4/ds4-lightbar-macos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ds4color-1.0.1-py3-none-any.whl -
Subject digest:
741d053fa1bf8c8a2075dd617cac3a637a3f2123147b477122ff429a22898aea - Sigstore transparency entry: 1915010672
- Sigstore integration time:
-
Permalink:
bitmap4/ds4-lightbar-macos@d671628779a4ea2ec5f6857cdc9afc8f357218fc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bitmap4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d671628779a4ea2ec5f6857cdc9afc8f357218fc -
Trigger Event:
workflow_dispatch
-
Statement type: