Better Streaming on Twitch for Linux users

Anything related to gaming on Linux Mint including game discussion or questions concerning Steam or Wine.
Forum rules
Before you post please read how to get help
Post Reply
Zeddrich
Level 2
Level 2
Posts: 55
Joined: Sun Dec 04, 2016 2:23 pm

Better Streaming on Twitch for Linux users

Post by Zeddrich » Fri Aug 16, 2019 9:48 pm

So, with twitch many people use Streamlabs, but this is a problem for those of us that don't use windows. I ran searches looking for alternatives, rather than running Streamlabs under wine(which I'd prefer not to do). Alas, I didn't really find much, and I also couldn't find much when it came to monitoring chat while streaming a game that you might be playing in fullscreen; the solution being to use a 2nd device(I prefer not to do this also).

I came up with a solution that I wanted to share here, just because the linuxmint community is great online community.

Linuxmint comes with hexchat by default. So, I wrote a Python script for hexchat that does everything I need and I hope this helps others. I've posted this in here before, but I wanted to make another post since I've updated the script.

Code: Select all

__module_name__ = "Twitch_Notifications"
__module_version__ = "2.0"
__module_author__ = "Mysterious_Loner"
__module_description__ = "Display messages and streamevents as system notifications"

import hexchat
import os
import sys

# Display message as system notifications
def twitch_notify(word, word_eol, userdata):
    
    nick = word[0].split('!')[1].split('@')[0].upper()
    message = ' '.join(word[3:])
    os.system('notify-send -t 120000 "' +nick +' ' +message +'"')
    return hexchat.EAT_NONE

# Display streamalerts as system nofications
def streamalerts(word, word_eol, userdata):

    capture = ' '.join(word[0:])
    for line in capture:
        print(capture + '\n')
    return hexchat.EAT_NONE

hexchat.hook_server("PRIVMSG", twitch_notify)
hexchat.hook_server("USERNOTICE", streamalerts)
You can just copy/paste this into a text file and save it your home/.config/hexchat/addons then load it as a plugin.
After doing that you'll need to connect Hexchat to the twitch server is just a matter of settings, I'm just gonna leave this to you via internet search.

Some notes on this script, I arbitrarily set the time for the chat bubbles to 2 minutes... if you want to alter this simply adjust the time by changing "-t 120000" to a value that corresponds to the time you desire. Please let me know if you encounter any issues with this script.

Zeddrich
Level 2
Level 2
Posts: 55
Joined: Sun Dec 04, 2016 2:23 pm

Re: Better Streaming on Twitch for Linux users

Post by Zeddrich » Wed Sep 04, 2019 7:25 pm

Yeh, there is a push for such a thing as many gamers are switching to linux(slight performance boost)... but... even with such a push the industry politics still has microsoft influency gaming quite a bit... so while the demand might be there... there might be other things that just keep it from happening

Post Reply

Return to “Gaming on Linux Mint”