trigg / discover Goto Github PK
View Code? Open in Web Editor NEWYet another discord overlay for linux
License: GNU General Public License v3.0
Yet another discord overlay for linux
License: GNU General Public License v3.0
Would be pretty neat to have Mumble integration. Could even support positional audio visually perhaps?
e.g. someone on the left of you in game appears on that side of the screen, someone ahead at the centre top etc...
Currently in Wayland a small window is drawn which can be minimised and maximised. Not intended outcome
Look into whether packaging for various distributions is necessary or not.
Just as the title says. Happens with the latest version of Discord.
Me again, experiencing any and all bugs that can possibly happen! Updated to release version 0.2 to play around with it a bit, but it seems to have introduced a new launch crash, giving the following output:
INFO:root:Autostart info : desktop /home/murdo/.local/share/applications/discover_overlay.desktop auto None
Traceback (most recent call last):
File "/usr/bin/discover-overlay", line 8, in <module>
sys.exit(entrypoint())
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 125, in entrypoint
discover.main()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 109, in main
self.create_gui()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 46, in create_gui
self.menu = self.make_menu()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 74, in make_menu
autostart_opt.set_active(self.a.is_auto())
TypeError: Argument 1 does not allow None as a value
I'm assuming it's some kind of error to do with not specifying any arguments, either in the launch command or somewhere in the code where it expects them.
currently all images are shown as '--attachment--'. Optionally allow users to see the image sent
When the settings window is open, it has no icon in the system tray
Cannot run program on my machine, I receive the following error:
$ ./discover.py
REQUIRES COMPOSITING
I'm running Manjaro with i3.
System details:
$ inxi -Gxx
Graphics: Device-1: NVIDIA GM200 [GeForce GTX 980 Ti] vendor: eVga.com. driver: nvidia v: 450.66 bus ID: 01:00.0
chip ID: 10de:17c8
Display: x11 server: X.Org 1.20.8 driver: nvidia resolution: 1: 1080x1920~60Hz 2: 2560x1440~60Hz s-dpi: 101
OpenGL: renderer: GeForce GTX 980 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 450.66 direct render: Yes
$ uname -a
Linux Aether 5.4.64-1-MANJARO #1 SMP PREEMPT Wed Sep 9 18:26:19 UTC 2020 x86_64 GNU/Linux
Having a large segment of the code relying on globals and global-scoped functions which pass around a bunch of contexts is absolutely not ideal.
Move all Socket & communication into a class. Narrow down global scoped to entry point only.
Would it be possible to group the server list into different selections on the menu like one for server than one for the text channels within that server you have selected. I see that it kind of has them grouped anyway on the list but ive got quite a few servers and some have many text channels so scrolling through the entire list takes a long time.
A tickbox option to have discover autostart
Would be useful to be able to set a custom time out time for messages
Hey. One thing that stood out to me a bit (with this as well as DiscordOverlayLinux) is that there is a button labelled "close" whilst I'm used to it being labelled "Quit" or "Exit" instead. I feel that "close" is more related to partial terminations (closing a window) whilst "quit" and "exit" more clearly communicate that any related processes will be terminated.
I recommend looking at some application tray icons and surveying what they are labelled to come to your own conclusions. Here are mine:
Close: 0
Exit: 4
Quit: 11
Software observed:
I'm on KDE Neon and xdg isn't included by default. I went over and installed it with sudo apt install python3-xdg
, but I'm getting an error:
ModuleNotFoundError: No module named 'xdg.BaseDirectory'
Some commands...
pip3 freeze | grep xdg
pyxdg==0.26
xdg==4.0.1
Here ran python3, imported xdg and then typed xdg.
and double-tapped Tab:
xdg.HOME xdg.Path( xdg.XDG_CONFIG_HOME xdg.XDG_RUNTIME_DIR
xdg.List( xdg.XDG_CACHE_HOME xdg.XDG_DATA_DIRS xdg.os
xdg.Optional( xdg.XDG_CONFIG_DIRS xdg.XDG_DATA_HOME
Changing line 20 to the following fixes the issues for me.
from xdg import XDG_CONFIG_HOME as xdg_config_home
`(discover.py:2008): Gtk-CRITICAL **: 22:19:03.347: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.347: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.347: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.347: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.347: gtk_widget_get_settings: assertion 'GTK_IS_WIDGET (widget)' failed
/usr/lib/python3.8/site-packages/gi/overrides/Gtk.py:1644: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
return _Gtk_main(*args, **kwargs)
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.348: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:03.348: gtk_widget_translate_coordinates: assertion 'GTK_IS_WIDGET (dest_widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:04.582: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:04.582: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
(discover.py:2008): Gtk-CRITICAL **: 22:19:04.582: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
`
Hello,
I can't figure out how to configure the settings.
Could someone explain that to me?
Thank you!
Right now, the usernames only show beside the avatars.
Can the usernames be displayed below or above the avatars?
Cloned and installed the tool. As soon as I run discover-overlay
nothing appears on screen, the tray icon is a grey circle that allows me to change the settings but on the terminal I see the following
/usr/local/bin/discover-overlay:1000: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
from gi.repository import AppIndicator3
Could not find monitor : None
Could not find monitor : None
On Ubuntu 18.04.
Any users in voice chat who have not manually set an avatar are supplied a generic image in Discord, but overlay is supplied with no image.
i think there seems to be a problem when installing this, this is the output
output
i hope u can help me with this
This goes strongly into nitpick-territory, but makes the look a bit less perfect:
The round avatar seems to be created by cutting of all pixels over the radius. Unfortunatly this creates a rough edge that looks pixelated.
Discover/discover_overlay/discover_overlay.py
Lines 1550 to 1552 in 62aa3a7
Screenshot (upscaled 2x):
For comparison DiscordOverlay (where I assume a browser rendering engine is applying a bit of antialiasing):
Currently, joining an AFK channel doesn't show the user as muted or deafened etc.
Not sure whether it should?
Currently if you open either voice or text overlay settings, click place window, position yellow box somewhere and then close the settings window, the yellow box remains until the settings window is reopened and "Save this position" is pressed.
Would be useful if when you close the settings window, it either saves the yellow window, opens a dialogue which asks you if you want to save it, or just removes the yellow window. I know which of these 3 will probably be implemented, but a man can dream.
As we're probably still somewhat off of a formal launch, we should figure out the most sain way of managing versions now rather than later.
"Latest" is not appropriate versioning for a stable release ;). I suggest a separate branch for each version reached, with latest always being the worked on codebase.
N.B - will go hand in hand with project milestones.
Currently loading a URL to get an avatar image hangs the GTK main loop which could cause the app to appear un responsive. It also holds up communication & redrawing.
Need to change the image loader to be async and to fallback on default avatar until the image is ready
I launched the latest (pull from Github) from the command line since it didn't seem to work. The following is the output
INFO:root:Autostart info : desktop /home/cossu/.local/share/applications/discover_overlay.desktop auto None
INFO:root:Could not find monitor : None
INFO:root:Could not find monitor : None
INFO:root:Loading saved channel 741761057802158081
INFO:root:Could not find monitor : None
INFO:root:Could not find monitor : None
INFO:root:ID is 350229604365107211
INFO:root:Logged in as gjkf
INFO:root:Changing text room: 741761057802158081
Traceback (most recent call last):
File "/home/cossu/.local/lib/python3.6/site-packages/discover_overlay/discord_connector.py", line 399, in do_read
self.on_message(msg)
File "/home/cossu/.local/lib/python3.6/site-packages/discover_overlay/discord_connector.py", line 266, in on_message
self.add_text(message)
File "/home/cossu/.local/lib/python3.6/site-packages/discover_overlay/discord_connector.py", line 89, in add_text
message["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z")
File "/usr/lib/python3.6/_strptime.py", line 559, in _strptime_time
tt = _strptime(data_string, format)[0]
File "/usr/lib/python3.6/_strptime.py", line 362, in _strptime
(data_string, format))
ValueError: time data '2020-09-23T22:11:44.545Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
After that, no matter what I do, the application won't respond.
EDIT: since in the settings window for the chat there was no text channel available to be selected, I modified the config in ~/.config/discover_overlay/config.ini
to another text channel and restarted the application. It correctly loaded all the text channels but at the end, the same error appeared. When I started again discover_overlay
while I was already in a voice room, it no longer loaded the text channels.
Now, even though Ubuntu 16.04 is officially supported by Canonical until 2021-04, you don't have to spend your time on supporting such an old distro at all and I will upgrade this computer eventually.
Out of the box, I had this issue:
Traceback (most recent call last):
File "/home/k/.local/bin/discover-overlay", line 5, in <module>
from discover_overlay.discover_overlay import entrypoint
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/__init__.py", line 1, in <module>
from .discover_overlay import *
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 19, in <module>
import cairo
ImportError: No module named 'cairo'
After installing sudo apt-get install libcairo2 libcairo2-dev
(as suggested here) I get:
Traceback (most recent call last):
File "/home/k/.local/bin/discover-overlay", line 8, in <module>
sys.exit(entrypoint())
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 1077, in entrypoint
main()
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 1055, in main
create_gui()
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 997, in create_gui
win = OverlayWindow()
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 662, in __init__
self.set_untouchable()
File "/home/k/.local/lib/python3.5/site-packages/discover_overlay/discover_overlay.py", line 731, in set_untouchable
reg = Gdk.cairo_region_create_from_surface(surface)
KeyError: 'could not find foreign type Surface'
After installing sudo apt install python3-gi-cairo
(as suggested here) I get:
Segmentation fault (core dumped)
Adding sudo apt install libgirepository1.0-dev
still gave the segfault.
Let me know if you want me to try anything else or give you some information.
I was fiddling with the settings and found that changing the avatar size makes the program crash, sometimes the first time, always the second time you add/decrement the value.
Discover/discover_overlay/voice_overlay.py
Lines 190 to 198 in 7e5334c
pix
is None
on line 194, but then when draw_avatar_pix
is run, self.def_avatar
is also None
, so it throws the following error:
Traceback (most recent call last):
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 124, in draw
self.do_draw(context)
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 154, in do_draw
self.draw_avatar(context, user, rh)
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 198, in draw_avatar
self.draw_avatar_pix(
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 254, in draw_avatar_pix
Gdk.cairo_set_source_pixbuf(context, pixbuf, x, y)
TypeError: Argument 1 does not allow None as a value
Traceback (most recent call last):
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 124, in draw
self.do_draw(context)
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 154, in do_draw
self.draw_avatar(context, user, rh)
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 198, in draw_avatar
self.draw_avatar_pix(
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 254, in draw_avatar_pix
Gdk.cairo_set_source_pixbuf(context, pixbuf, x, y)
TypeError: Argument 1 does not allow None as a value
Traceback (most recent call last):
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 154, in do_draw
self.draw_avatar(context, user, rh)
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 198, in draw_avatar
self.draw_avatar_pix(
File "/home/user/Projects/Discover/discover_overlay/voice_overlay.py", line 254, in draw_avatar_pix
Gdk.cairo_set_source_pixbuf(context, pixbuf, x, y)
TypeError: Argument 1 does not allow None as a value
python3: ../../../../src/cairo.c:524: cairo_destroy: Assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count)' failed.
Currently, selecting top in Overlay Location put it right at the top - Which is great. Would be useful to have a configurable padding option so it is padded down from the top and allows system ui's to be used.
Something to think about for the future. Could be super useful for all of those Linux streamers out there.
Alternatively, could probably just find a discord bot which hooks into twitch chat
I tried installing this in a fresh virtualenv, but noticed that requests was used, but not specified in the requirements:
Lines 20 to 24 in 62aa3a7
Apart from that everything seems to be working fine on Debian Testing KDE
If you make the font size large enough the left (beginning) part of the names get cut off. More obvious with longer names and larger avatar size.
It is a minor issue, but I think it is cool if software also handles extreme edge cases well.
I think settings for text channels need a notable disconnect from voice settings. To this end I propose that the text channel settings get a window to themselves
I had to copy the __main__.py
file from which discover-overlay
over to the project to be able to run it with the debugger.
Here's my launch.json
file
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "discover_overlay"
}
]
}
As a straightforward way to choose where the text channel overlay will appear a window could pop up and after the user positions & sizes it to their need the location can be recorded and used to draw the text channel of choice.
I have an idea for a much more intuitive design for adjusting the position of the overlay to be used eventually instead of the current one with 2 or 3 dropdowns and 1 number field (also currently one can't adjust the padding from the horizontal sides).
It could work thus:
This could ideally also include the extra feature of adjusting the scaling factor and limits of the overlay in the customization mode if that is possible. Scaling factor would affect the font size and avatar size. Maybe the current settings could then be hidden behind an Advanced/Expert mode toggle of the UI. I can make a separate comment or issue fleshing out this in greater detail, if this is relevant.
[1] The preferred order of buttons seems to vary based on platform. Ideally maybe your used framework can handle that according to some preferences or platform conventions.Reset button would only be required if it is possible end up in a non-functional state somehow.
[2] Perhaps in percentages of screen size, rather than direct pixels? So as to accommodate resolution changes or monitor switches. Generally any the underlay (stuff beneath the overlay) adjusts (or gets adjusted manually) to changing resolutions or aspect ratios. I guess ideally there can be an option in the config file (and maybe Advanced/Expert mode of the UI) where you can specify whether it should be in pixels or percentages.
Unless a different system for positional adjustment gets implemented (e.g. #28 ), it would be useful to be able to adjust the offset from horizontal (left and right) edges as well. Currently Edge padding only applies to vertical (top and bottom) padding.
Let's figure out a roadmap of planned features and use the milestones features in GitHub to monitor progress
What's that? Not code? Boooooooooriiiiing
Installing works fine, but when I attempt to run from a command line I get:
Traceback (most recent call last):
File "/home/murdo/.local/bin/discover-overlay", line 8, in <module>
sys.exit(entrypoint())
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 1077, in entrypoint
main()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 1055, in main
create_gui()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 997, in create_gui
win = OverlayWindow()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 663, in __init__
self.force_location()
File "/home/murdo/.local/lib/python3.7/site-packages/discover_overlay/discover_overlay.py", line 743, in force_location
monitor = display.get_monitor(self.monitor)
AttributeError: 'X11Display' object has no attribute 'get_monitor'
With The Vive and Index now supporting Linux, I wonder how the overlay would interact with them. This needs testing.
We'll need at least a bash script or something to aid users in installation
When setting up a floating window chat it works as expected.
However, if you then change it to anchor to edge, it takes over the whole of the screen and is anchored to the wrong side.
This way, for example, changing Edge padding when overlay is vertically centered does practically nothing. It also seems unintuitive. Should edge padding affect both vertical/horizontal paddings or maybe it should be split into two separate options?
An option to only show recently received messages and not keep a log when chat is inactive would make the overlay feel less cluttered
After setting up a text channel - floating, enabled etc, it works as expected.
However, When "Popup Style" is ticked, no text is shown even when messages are received.
Using Manjaro gnome
I installed correctly but when I run discover-overlay
I get this error
$ discover-overlay
Using XShape instead of composite
Traceback (most recent call last):
File "/usr/local/bin/discover-overlay", line 1058, in <module>
main()
File "/usr/local/bin/discover-overlay", line 1039, in main
create_gui()
File "/usr/local/bin/discover-overlay", line 984, in create_gui
win = OverlayWindow()
File "/usr/local/bin/discover-overlay", line 649, in __init__
self.set_untouchable()
File "/usr/local/bin/discover-overlay", line 718, in set_untouchable
reg = Gdk.cairo_region_create_from_surface(surface)
KeyError: 'could not find foreign type Surface'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.