Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Linux support #7

Open
thorsten-passfeld opened this issue Jan 10, 2020 · 12 comments
Open

Linux support #7

thorsten-passfeld opened this issue Jan 10, 2020 · 12 comments
Labels
enhancement New feature or request

Comments

@thorsten-passfeld
Copy link

Although that code is pretty platform-specifically written, I think this file can more or less easily be adapted for Linux and MacOS, as well as Windows too. I'll link to the source I found just now:

https://stackoverflow.com/questions/5226212/how-to-open-the-default-webbrowser-using-java

I really like your solution so far. But I'm playing on Linux, so I would love to be able to natively use this program. Since it's Java, I don't think we need to do more than to adapt the platform-specific code to be more cross-platform-compatible. It could really be a stand-out feature of this solution.
I'd take this any day over an Electron-based solution. Good god...

@mtricht
Copy link
Owner

mtricht commented Jan 10, 2020

Hey, nice to hear from someone playing on Linux.

Linux support will be my next task this weekend. I usually don't game on Linux but it is my preferable platform.

Things that will need to be changed:

  • WindowsAPI
  • System tray AWT (Perhaps https://github.com/dorkbox/SystemTray)
  • Use something else than APPDATA for storing configuration and cached data
  • Create a launch script (lunaris.sh)

I believe that would be all. The key and mouse listener library we use is already cross-platform.

@thorsten-passfeld
Copy link
Author

Hey! Awesome to hear, man. I was already able to open and build your program in Netbeans using Maven, after switching to Openjdk-13. I was on Openjdk-8 before due to another project and of course couldn't compile everything. :D
So yeah, I don't think we'd need to change that much. I've quickly went over your code and it was already mostly cross-platform-compatible. Another benefit of coding in Java! Let me know what the shell script would need to do. Maybe I'll have some spare time between my exams!

@mtricht
Copy link
Owner

mtricht commented Jan 12, 2020

You can follow my progress here: https://github.com/mtricht/lunaris/commits/linux
The only things missing are:

  • Get active X11 window to determine if Path of Exile is active. I hope someone has some suggestions on how to do this.
  • The overlay does not seems to work when Path of Exile is running. Sadly no exceptions are thrown... When Path of Exile is closed the tooltip does work. So I'll have to debug whether it's Swing or JavaFX that's causing issues and figure out why.
  • Add bash script for startup (very easy so leaving it for last)

@mtricht
Copy link
Owner

mtricht commented Jan 12, 2020

See #28

Is any of you willing to test it on your end?

@mkalte666
Copy link

Fundamentally its working on my end. I have a three monitor setup, with poe in the middle and the offset is working fine.

https://i.imgur.com/bdldcV8.jpg

The window is a tad cut short to the right i suppose, but i can live with that. Better than tabbing out to the browser. With the patches in #28 the config branch also works for me quite well. In theory. I patched the config branch by hand before i noticed linux had its own because im blind xD

Anyway, keep it coming, im happy to test more things :)

@mtricht
Copy link
Owner

mtricht commented Jan 14, 2020

@mkalte666 Thanks for testing! Could you test out the master branch? We've added quite a few improvements.

@thorsten-passfeld would you also mind testing the master branch? We've revamped how we get the item text from in game, so alt+D should now also work for you.

@thorsten-passfeld
Copy link
Author

Okay, some good and some "bad" news:

  • F5 works flawlessly now
  • alt + D actually does exactly what it's supposed to do, but the tooltip does not appear in front of the windowed-fullscreen game
  • alt + W reluctantly opens my browser after a few tries and then still resorts to Chromium, where Firefox is actually my main/default browser -> The "GLib-GIO-WARNING" warning appears in the console
  • alt + A didn't really seem to work on one map I tried (maybe that map is not yet supported?)

@thorsten-passfeld
Copy link
Author

thorsten-passfeld commented Jan 14, 2020

For the record, this is the log of that "session":

23:11:27.284 DEBUG dev.tricht.lunaris.Lunaris - Ready!
23:13:32.396 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.ItemPriceListener
23:13:32.406 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:13:32.766 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Got clipboard text:Rarity: Magic
Warlock's Prophecy Wand of Euphoria
--------
Wand
Physical Damage: 35-64
Critical Strike Chance: 8.00%
Attacks per Second: 1.20
--------
Requirements:
Level: 68
Int: 245
--------
Sockets: B-B B 
--------
Item Level: 69
--------
40% increased Spell Damage (implicit)
--------
22% increased Spell Damage
+32 to maximum Mana
58% increased Mana Regeneration Rate

23:13:32.801 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix 22% increased Spell Damage found as explicit.stat_2974417149
23:13:32.801 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix +32 to maximum Mana found as explicit.stat_1050105434
23:13:32.802 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix 58% increased Mana Regeneration Rate found as explicit.stat_789117908
23:13:32.833 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Unregistered clipboard listener
23:14:03.313 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.ItemPriceListener
23:14:03.314 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:14:03.610 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Got clipboard text:Rarity: Magic
Warlock's Prophecy Wand of Euphoria
--------
Wand
Physical Damage: 35-64
Critical Strike Chance: 8.00%
Attacks per Second: 1.20
--------
Requirements:
Level: 68
Int: 245
--------
Sockets: B-B B 
--------
Item Level: 69
--------
40% increased Spell Damage (implicit)
--------
22% increased Spell Damage
+32 to maximum Mana
58% increased Mana Regeneration Rate

23:14:03.610 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix 22% increased Spell Damage found as explicit.stat_2974417149
23:14:03.610 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix +32 to maximum Mana found as explicit.stat_1050105434
23:14:03.611 DEBUG dev.tricht.lunaris.com.pathofexile.PathOfExileAPI - Affix 58% increased Mana Regeneration Rate found as explicit.stat_789117908
23:14:03.611 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Unregistered clipboard listener
23:14:11.450 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.ItemPriceListener
23:14:11.451 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:14:19.553 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.ItemPriceListener
23:14:19.554 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:16:47.366 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.ItemInfoListener
23:16:47.367 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:17:34.249 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.WikiListener
23:17:34.250 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:17:38.051 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.WikiListener
23:17:38.052 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:17:40.854 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Registered clipboard listener for dev.tricht.lunaris.listeners.WikiListener
23:17:40.855 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Pressed ctrl+c
23:17:41.057 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Got clipboard text:Rarity: Currency
Scroll of Wisdom
--------
Stack Size: 37/40
--------
Identifies an item
--------
Right click this item then left click an unidentified item to apply it.
Shift click to unstack.


(java:14208): GLib-GIO-WARNING **: 23:17:41.060: /etc/xdg/kde-mimeapps.list contains a [Added Associations] group, but it is not permitted here.  Only the non-desktop-specific mimeapps.list file may add or remove associations.
23:17:41.091 DEBUG dev.tricht.lunaris.listeners.ClipboardListenerStack - Unregistered clipboard listener

@mkalte666
Copy link

mkalte666 commented Jan 14, 2020

I built 9d9fdf6 for this.

Alt-D is still cut off to the right https://i.imgur.com/Qwlo4Df.jpg

Alt-A is working for me (at least with what i have around) https://i.imgur.com/c52v5UG.jpg

Alt-W works, but i also use the skill bound to W when using it. I'll probably just rebind it, but maybe a different default would help?

Alt-Q works as intended.

F5 works as well.

Pressing those outside of POE does not cause harm aside from overwriting the clipboard as far i can see btw, so theres that.

I'll test trading hotkeys etc as soon as im actually getting a whisper. Thanks for your work!

For reference, my system is

$ java --version
openjdk 11 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
$ echo $DESKTOP_SESSION
cinnamon
$ uname -a 
Linux maltasar 5.4.10_2 #1 SMP PREEMPT Fri Jan 10 12:11:53 UTC 2020 x86_64 GNU/Linux

Steam is the Beta Client; Proton is 4.11; wine is 4.11 as well ($PROTONPATH/dist/bin/wine --version => wine-4.11)

@mtricht mtricht changed the title Replace lunaris/src/main/java/dev/tricht/lunaris/WindowsAPI.java with a cross-platform-compatible solution Linux support Jan 14, 2020
@pvaass pvaass added the enhancement New feature or request label Jan 15, 2020
@mkalte666
Copy link

mkalte666 commented Jan 15, 2020

Invite last whisper works well.

When you use "kick yourself from party" without setting a character name, it will paste null instead of doing nothing or telling you that no character name was set.

@mtricht
Copy link
Owner

mtricht commented Jan 24, 2020

@mkalte666 thanks for testing!

@thorsten-passfeld would you mind testing again? And perhaps try windowed instead of windowed-fullscreen?

I also created a guide for linux here: https://github.com/mtricht/lunaris/blob/master/LINUX.md

@thorsten-passfeld
Copy link
Author

thorsten-passfeld commented Jan 24, 2020

@mtricht
I've been testing the latest .jar for the past ~10 minutes and here are the results:

  • Every shortcut seems to work most of the time
  • One time, pressing F6 to invite the last whisperer resulted in my clipboard being pasted into the chat, the other times it worked perfectly fine
  • Even though my default browser is definitely Firefox, Lunaris still opens up Chromium
  • The overlay only works in windowed mode, which I don't want to play in, because of the borders and because it doesn't completely fill my screen
  • In windowed fullscreen, the overlay gets put behind the POE window by my window manager. Sadly, I can't force the popup to be put on top of POE, since it closes itself when I click on the icon in my task bar/dock. A possible solution (if possible) could be to force the popup to be on top of other windows? https://stackoverflow.com/questions/297938/always-on-top-windows-with-java
  • At first (I think I was in windowed fullscreen), the shortcuts to e.g. open the wiki (alt + W) didn't seem to work on items in stash tabs, but on items in my inventory. However, this issue does not happen when you are in windowed mode.

Edit:
Oh yeah and just like @mkalte666 said, the ALT + D thingy is cut off to the right.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants