antimicrox
antimicrox copied to clipboard
[Feature Request] Popup on changing the set
Is your feature request related to a problem? Please describe.
There is no indication on which set is active when I change them. Controllers already have few keys, so changing presets should only occupy one button, but this means that I always need to remember the set I'm in, or I'll loose orientation.
Describe the solution you'd like
Some kind of popup or notification (that works in fullscreen as well) and shows the number/name of the set that was changed to, potentially using a normal notification on, or such a screen popup like for display brightness, volume and such on ubuntu.
Describe alternatives you've considered
I thought about doing it myself, but frankly, I would either break something or not do it properly. Don't get me wrong, I'm not tech-illiterate (if I were, I wouldn't be using Linux), but I have other stuff that demands my attention
Additional context
Upvote & Fund
- If you find this issue important, mark it with 👍. It lets us see which fixes and features are demanded by the most users.
- We're using Polar.sh so you can upvote and help fund this issue. It may incentivize some developers to contribute to this project and fix some bugs.
- Funded developer receives the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
I think it would be a nice feature. I will investigate it later.
I think I might able to do that. It would be helpful if you could tell me which script ultimately handles set changes, as I could avoid digging through tons of grep output.
Okay, I got a first version working (although it's pretty dirty and inelegant): I execute the command notify-send "AntiMicroX" "Set n is now active" -i "<absolute path to the icon>"
after changing the set using the advanced menu. To implement it properly however, I would need to know what handles the button presses/set changes
I am not sure about this way of calling notification.
I think we should use system-independent way of creating notifications to avoid creating new problems with: #4
The best option would be using qt-based notifications, because it wouldn't change our dependencies, and it would work on all systems.
In terms of place where set is changed you can find it there:
/antimicrox/src/joytabwidget.cpp:1223
@vguttmann Could you investigate the possibility of using system-independent way of publishing notifications before you start work?
If there are none we could think about adding notifications as a linux-only feature.
I will have a look for libraries that can do that, I'm sure that there's something out there.
So, after taking a look, I found something in QT called QSystemTrayIcon
, which seems to be what we want. I hope to have implemented it until the weekend.
Although there is the possibility to add notifications on all platforms through QSystemTrayIcon::showMessage
, I definitely need to read up on my C++. I am not sure how long it will take though, but right now I am optimistic that it will go fairly well.
I think it would be better to notify users about changing sets using default linux notifications. Just like it is done here: https://github.com/AntiMicroX/antimicrox/pull/146
Yep, and it would certainly be a LOT easier. I have been tinkering for a long time now, but haven't gotten something to work yet which uses only Qt. With send-notify, I can implement that in a day or so (including setting up git once again because I had to do a clean reinstall). A day sounds pretty bad, but this would be time from reply to PR.
I will try to deal with it now. (or at least today)
Just tell me where is a good place in code to put this notification (in your opinion, if you remember where you looked). :D
Just wait, I'll do it, I think I still have that figured out. Just tell me which icon to use. You're managing the project, and shouldn't do all the work.
Ok
I think you could use input-gaming
, applications-games
or simply antimicrox
icon for this purpose.
Remember also that this implementation of notifications should be compiled only on UNIX-based systems.
notify-send has one crucial limitation: If I want it to display notifications in full screen, I would have to use "urgent" as the importance, which then results in the message not clearing itself. Normal and low urgency do, but they don't work in full screen
Otherwise I have it finished, I could submit the pull request. The command only gets sent on Linux (I assume so, I don't have a windows machine handy). notify-send has no configurable timeout (it has a timeout flag, but that one is disfunctional due to a feauture, ykwim, and the maintainer has no intention of changing it.
I did implement it in joytabwidget.cpp
Also, I have not implemented a way to disable them. @pktiuk
The command only gets sent on Linux
In this case simple #ifdef Q_OS_UNIX
should be enough
I could submit the pull request.
You can open PR marked as a work in progress. (doing it in this way makes monitoring progress easier, and allows spotting errors earlier)
Also, I have not implemented a way to disable them.
You can to it just like I did it here: https://github.com/AntiMicroX/antimicrox/pull/146/files
Well, I got it working, but I had some fights with git, and GitHub complains about code formatting.
What the hell? Git inserted stuff about the commits into the code. I don't blame git for that, but I have no idea how I did that.
Github still complains about code formatting, but at least I have no failed builds now. It would be nice if you could take a look at it.
I have reviewed your change. I have also described a way of dealing with formatting code. Just check in PR.