-
-
Save flexiondotorg/753034f12b65a0c9f5892028cc909437 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "ERROR! Must be root." | |
exit 1 | |
fi | |
export GOPATH="/tmp/go" | |
if [ -d "${GOPATH}" ]; then | |
rm -rf "${GOPATH}" | |
fi | |
mkdir -p "${GOPATH}/src" | |
cat << 'EOF' > /etc/udev/rules.d/99-streamdeck.rules | |
SUBSYSTEM=="input", GROUP="input", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE:="666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE:="666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", MODE:="666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE:="666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", MODE:="666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0090", MODE:="666", GROUP="plugdev" | |
EOF | |
sudo udevadm control --reload-rules | |
# The driver: https://github.com/unix-streamdeck/streamdeckd | |
apt -y install golang-go libusb-1.0-0-dev xdotool | |
cd /tmp/go/src | |
git clone --recursive https://github.com/unix-streamdeck/streamdeckd.git --branch v1.0.2 | |
cd streamdeckd | |
go build | |
go install | |
# The UI: https://github.com/unix-streamdeck/streamdeckui | |
apt -y install libglfw3 libxxf86vm-dev libgl1-mesa-dev xorg-dev zenity | |
cd /tmp/go/src | |
git clone --recursive https://github.com/unix-streamdeck/streamdeckui --branch v1.0.1 | |
cd streamdeckui | |
go build | |
go install | |
find "${GOPATH}/bin/" -type f -executable | while read -r EXECUTABLE; do | |
install -DT "${EXECUTABLE}" "/usr/local/bin/$(basename "${EXECUTABLE}")" | |
done | |
# Remove the now obsolete old systemd unit | |
if [ -e /usr/lib/systemd/user/streamdeckd.service ]; then | |
systemctl --user disable streamdeckd | |
rm -f /usr/lib/systemd/user/streamdeckd.service | |
fi | |
mkdir -p /usr/local/share/icons/hicolor/256x256/apps/ 2>/dev/null | |
wget -q "https://cdn.jsdelivr.net/gh/pauby/ChocoPackages@f08050f3/icons/streamdeck.png" -O /usr/local/share/icons/hicolor/256x256/apps/streamdeckui.png | |
mkdir -p /usr/local/share/applications 2>/dev/null | |
cat << 'EOF' > /usr/local/share/applications/streamdeckui.desktop | |
[Desktop Entry] | |
Type=Application | |
Encoding=UTF-8 | |
Name=StreamDeck Editor | |
Comment=StreamDeck Unix Editor | |
Exec=/usr/local/bin/streamdeckui | |
Icon=/usr/local/share/icons/hicolor/256x256/apps/streamdeckui.png | |
Terminal=false | |
Categories=Utility; | |
EOF | |
cat << 'EOF' > /etc/xdg/autostart/streamdeckd.desktop | |
[Desktop Entry] | |
Type=Application | |
Encoding=UTF-8 | |
Name=streamdeckd | |
Comment=StreamDeck Unix Daemon | |
Exec=/usr/local/bin/streamdeckd | |
Terminal=false | |
NoDisplay=true | |
EOF | |
update-desktop-database /usr/local/share/applications/ | |
rm -rf "${GOPATH}" | |
echo | |
echo "streamdeckd will autostart when logging in via /etc/xdg/autostart/streamdeckd.desktop" | |
echo "To start streamdeckd:" | |
echo " /usr/local/bin/streamdeckd &" | |
echo | |
echo "To restart streamdeckd:" | |
echo " pkill streamdeckd && /usr/local/bin/streamdeckd &" | |
echo | |
echo "NOTE! If you just installed streamdeckd for the first time, unplug and plugin your StreamDeck now." |
You may also want to add
mkdir -p /usr/local/share/applications
before the creation of the desktop file, on my brand new Ubuntu MATE install the folder didn't exist.
Fixed that. Thanks 👍
This fails to launch for me, with the daemon running.
$ streamdeckui
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running, locked to thread]:
main.newEditor({0x0, 0x0, 0x0}, {0x7f8680, 0xc00043e000})
/tmp/go/src/streamdeckui/ui.go:39 +0x30d
main.main()
/tmp/go/src/streamdeckui/main.go:28 +0x195
@popey I think we tracked that down to needing to unplug/plugin the StreamDeck after this script ran, right?
@flexiondotorg yeah, that did it.
@ymauray I've updated the script to use upstream streamdeckd
with the new driver changes. I've also dropped the systemd unit in favour of XDG autostart so that streamdeckd
is automatically started for any user logging into a desktop session.
@popey I've added text at the end of the script that first time installs may require the StreamDeck to be replugged.
Updated the script now that streamdeckd
1.0.2 is released.
If you really want to latest of the latest, with support for the upcoming pre-releases of the OBS plugin and the plugin that shall not be talked about just yet, you may want to use this part to install the driver and the UI:
# The driver: https://github.com/unix-streamdeck/streamdeckd
apt -y install golang-go libusb-1.0-0-dev xdotool
go install github.com/unix-streamdeck/streamdeckd@78b7a80
# The UI: https://github.com/frenchguych/streamdeckui
apt -y install libglfw3 libxxf86vm-dev libgl1-mesa-dev xorg-dev zenity
cd "${GOPATH}/src"
git clone --recursive https://github.com/frenchguych/streamdeckui --branch feature/select_field_type
cd streamdeckui
go build
go install
Last one for today: wouldn't it make more sense to make a local systemd service? That way, every use could have its own config, using the same device. Spoiler: that's what I did on machine.