Open lmore377 opened 2 years ago
Looks like they're planning on adding adb support so once they do that step 7 probably won't be necessary
Awesome work, @lmore377! To add on, I managed to move the buttons from the top-left into being controlled by the hardware buttons using the following steps:
In the index.html
file you're working with, add style="visibility:hidden"
onto the 3 buttons, like this:
Then create a file in the js
folder called superbird_buttons.js
with the following contents:
/*
* Button support for Spotify Car Thing (superbird)
*/
(function () {
document.onkeypress = function (e) {
switch ((e || window.event).key) {
case "1":
back();
break;
case "m":
toggleDark();
break;
}
};
})();
And lastly, add a script tag for it at the bottom of your index.html
file
Make sure the updated index.html
and superbird_buttons.js
files are pushed to the device, and (after a reboot) the left-most top button will function as "Back", and the right-most top button will function as the dark mode toggle.
End result:
This is awesome! I took a swing at updating some things in the Web Client so I could use this as a daily driver, and wrote a quick-and-dirty patch to do a few things --
autoSize()
HW_KEY_TO_COL_ROW
if you want a different hardware key to onscreen button mapping.Gist for the patch -- https://gist.github.com/maclyn/9b1059469c5b46bea7097c965fd42033
Edit: Added some more tweaks for the autoconnection behavior so it doesn't reload the page every time it tries causing a somewhat annoying flicker. The only thing that I think is keeping this from being really convenient is the USB connection seems like it needs to happen after my PC starts, so right now I have to unplug -> replug the Car Thing and run the reverse command every time my computer starts/wakes from sleep. I wonder if there's a way to run the ADB script on a loop until it connects...
This is awesome! I took a swing at updating some things in the Web Client so I could use this as a daily driver, and wrote a quick-and-dirty patch to do a few things --
* Hide the buttons like @r3pwn did, with some of the padding reclaimed by updating `autoSize()` * Instead of mapping the buttons to back/dark/fullscreen, I setup mapping so 1-4 and menu map to clicking the buttons in the first row, the dial (scroll down/scroll up/press) maps to the leftmost, rightmost, and center buttons in the middle row, and back button to map to the last row's rightmost button. Just update `HW_KEY_TO_COL_ROW` if you want a different hardware key to onscreen button mapping. * The Car Thing tries to connect as soon as the page loads. It's visually a little annoying since the page refreshes if it fails to connect, but if you have the adb port forwarding setup to run when your computer starts you shouldn't need to interact with the Car Thing at all for it to get into the connected MacroPad * I also added a single line change to disable the cookie alert, since it seems like cookies aren't being persisted.
Gist for the patch -- https://gist.github.com/maclyn/9b1059469c5b46bea7097c965fd42033
Edit: Added some more tweaks for the autoconnection behavior so it doesn't reload the page every time it tries causing a somewhat annoying flicker. The only thing that I think is keeping this from being really convenient is the USB connection seems like it needs to happen after my PC starts, so right now I have to unplug -> replug the Car Thing and run the reverse command every time my computer starts/wakes from sleep. I wonder if there's a way to run the ADB script on a loop until it connects...
Do you know which version of macrodeck your patch applied to? I don't think it's the latest version 2.5.0.
I assume it's 2.37.3 as you had 2.37.3.windows.1
on last line of your patch.
Commented on the gist, but at some point it stopped applying successfully -- updated so it patches cleanly on v2.5.1 (the last line of the patch is just the version of Git I was using to make the patch)
Hi, I am using superbird_tool.py trying to load in the image that I downloaded. I am using the second one here (https://mega.nz/folder/NxNXQCaT#-n1zkoXsJuw-5rQ-ZYzRJw/folder/5kECGT5C) and trying to follow the read me. I also double checked the file extensions like it says. I am getting the below error. Would anyone happen to know why?
Traceback (most recent call last): File "\superbird-tool-main\superbird_tool.py", line 242, in
ValueError: Failed to validate partition size!
Chiming in that this still works. running the last adb command for tcp connection isn't necessary for me on Macro Deck v 2.14.1 If Macro Deck is crashing for you I had to disable "Automatically wake screen and start Macro Deck Client when connected" in Connection.
How would someone with limited knowledge be able to do this? If I can figure it out with some help, I could even make a video about it too. This is the first thing I've seen someone do to actually replace the need. Other attempts have been windows or android, which its too under powered obv for.
Is is persistent? As in don't have to reup every once in a while, and what does the dial do now?
Unfortunately these instructions don't work with the current version of Macro Deck but the developer is working on some fixes. In the meantime you should visit the Discord for more info.
Join the Car Thing Hax Discord for more info! https://discord.gg/CwwrT6xPEF
Also check out the GitHub org: https://github.com/Car-Thing-Hax-Community
The instructions below currently don't work with the modern version of Macro Deck but the developer is working on some fixes specifically for the Car Thing. Visit the Discord for more info.
Thanks to u/Jaba_Haba on reddit for bringing Macro Deck (the software making this possible) to my attention! https://www.reddit.com/r/carthinghax/comments/yq5p77/macro_deck_for_car_thing/
https://gist.github.com/lmore377/4c944a97407e34e10d998ee6a3e33f6a (For both files right click Raw then Save link as...)Currently not up to date, will fix soon ™️adb reverse tcp:8191 tcp:8191
(change 8191 if you use a different port) then press connect on the car thing. You'll need to do this every time you reboot your pc or unplug/plug in car thingThe only caveat is that none of the physical buttons work. I think this is just a limitation of macro deck but if you manage to figure out how to get keyboard keys working here's the mapping: Preset 1-4: Numbers 1-4 on a keyboard Menu: M Back: ESC Wheel Button: Either space or enter. I can't remember which Wheel: Mouse scroll wheel
The only edit on the index-edited.html file is at line 104 to autofill the IP address since there's no form of keyboard input on the car thing. supervisord.conf was just edited to disable swupdate and the process that handles phone communication to free up some resources.
Edit: one more thing, if you ever want to update the web client for whatever reason you just need to edit line 104 in index.html to match what I edited and push the updated files over ADB to /usr/share/qt-superbird-app/webapp/