commit be5a0f23d3b574e29a9c9efea02a87b07f5c0801 from: rohanverma2007 date: Mon Apr 20 20:48:46 2026 UTC mirror commit - /dev/null commit + be5a0f23d3b574e29a9c9efea02a87b07f5c0801 blob - /dev/null blob + 2a1ba1e1e919dc57d0ca479d6b811391a0583685 (mode 644) --- /dev/null +++ LICENSE @@ -0,0 +1,13 @@ +Copyright 2026 Rohan Verma + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. blob - /dev/null blob + d8c2ac1d6d695a85f9086adef637c8cc98241821 (mode 644) --- /dev/null +++ README.md @@ -0,0 +1,53 @@ +# tidal-waybar +Adds Tidal support to Hyprland Waybar + +# How does it look? +__This is how it looks with my waybar config file:__ +![image](https://github.com/user-attachments/assets/2170bc8d-b2dd-4a18-aa49-a64b5a39a193) + +# How do I set this up? +1. Ensure you have all the dependencies downloaded! +``` +sudo pacman -S python python-requests +``` + +2. Firstly, I recommend installing the ```tidal-hifi-bin``` from the AUR, you can find alternatives for your distro but I'm currently supporting Arch Linux only. Other clients are **unsupported!** +``` +yay -S tidal-hifi-bin +``` + +3. Click file at the top left, click settings, then go to the API option and ensure the API port is set to 47837 (app must be restarted after applying!) + +4. Create a ```scripts``` folder inside of your waybar config and move the .py file to the scripts folder (download it from releases), your config directory should look like this: +``` +waybar/ +├── config.json +├── style.css +├── scripts/ +└───── tidal-waybar.py +``` + +5. Once tidal-waybar.py script is setup in the scripts folder, you must chmod the file (this command works assuming you are in the scripts directory) +``` +chmod +x tidal-waybar.py +``` + +6. Add to your config.json (atleast this is what I have) +``` + "custom/tidal": { + "exec": "~/.config/waybar/scripts/tidal-waybar.py", + "interval": 5, + "return-type": "string", + "on-click": "WAYBAR_BUTTON=1 ~/.config/waybar/scripts/tidal-waybar.py", + "on-click-middle": "WAYBAR_BUTTON=2 ~/.config/waybar/scripts/tidal-waybar.py", + "on-click-right": "WAYBAR_BUTTON=3 ~/.config/waybar/scripts/tidal-waybar.py" + }, +``` + +# What features are there to be expected? +- Keybind Support (clicking has control access) +- Displays band name and song +- Minimal and lightweight integration + +# Credits +[HubertusWine](https://github.com/HubertusWine) for fixing on click actions blob - /dev/null blob + 568b0e6bb9a9f43f68c0c48e282da7fffe31fd3e (mode 644) --- /dev/null +++ tidal-waybar.py @@ -0,0 +1,45 @@ +#!/usr/bin/python3 + +import requests +import os +import sys + +TIDAL_STATUS_URL = "http://localhost:47837/current" +TIDAL_BASE_URL = "http://localhost:47837" + +def send_command(command): + try: + requests.get(f"{TIDAL_BASE_URL}/{command}") + except requests.RequestException: + pass + +def get_current_song(): + try: + response = requests.get(TIDAL_STATUS_URL) + data = response.json() + + if data.get("status") == "playing": + title = data.get("title", "Unknown Track") + artist = data.get("artists", "Unknown Artist") + + # Limit artist name to 30 characters + if len(artist) > 20: + artist = artist[:27] + "..." + + return f" 󰝚 {artist} - {title}" + else: + return " 󰝚 Paused " + except requests.RequestException: + return "" + +if __name__ == "__main__": + button = os.getenv("WAYBAR_BUTTON") + + if button == "1": # Left click → Previous song + send_command("previous") + elif button == "2": # Middle click → Play/Pause toggle + send_command("playpause") + elif button == "3": # Right click → Next song + send_command("next") + else: + print(get_current_song()) # Default output for Waybar