Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance of supporting wine/linux #14

Open
AndyHoang opened this issue Nov 3, 2022 · 6 comments
Open

Any chance of supporting wine/linux #14

AndyHoang opened this issue Nov 3, 2022 · 6 comments

Comments

@AndyHoang
Copy link

Im understand that its was mentioned that only window is tested and support.

Although I want to shoot for my luck if there're any tweak so that MF_run_counter can be used by running with Wine.

I tried it and got an error on extraction data, and some wine version show problem on permission while create a folder.
Any insight you can provide I can bypass this problem?

do see a lot of python, hopefully it can compile into a bigass bundle instead of not extraction data for installer? (This is my guess)

Screenshot_20221103_231908

Thank a bunch.

@oskros
Copy link
Owner

oskros commented Nov 3, 2022

If you want to try and make it work, I would recommend cloning the repository and trying to run the python code directly rather than running the compiled version. I expect it to require quite a bit of work though :/

@AndyHoang
Copy link
Author

AndyHoang commented Nov 4, 2022

Thank for your comment, so I take a wild guess on the python version is 2.7?

Im think im pretty close the target, but getting a few errors running the python code:

Installing requirement.txt
https://gist.github.com/AndyHoang/9b83db1c49516808bacc84eb366f0861

Running the main.py

▶ wine ../Python27/python.exe main.py
wineserver: using server-side synchronization.
002c:fixme:winediag:LdrInitializeThunk Wine TkG (staging) 6.17 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please don't report bugs about it on winehq.org and use https://github.com/Frogging-Family/wine-tkg-git/issues instead.
ERROR:root:invalid syntax (tk_dynamic.py, line 264)
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    from utils import tk_utils
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 2, in <module>
    from utils import tk_dynamic as tkd
  File "C:\MF_run_counter-1.4.9\utils\tk_dynamic.py", line 264
    super().__init__(*args, **kwargs, cursor=cs)
                                    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    raise e
  File "C:\MF_run_counter-1.4.9\utils\tk_dynamic.py", line 264
    super().__init__(*args, **kwargs, cursor=cs)
                                    ^
SyntaxError: invalid syntax
00fc:fixme:msvcrt:__clean_type_info_names_internal (1EA66C1C) stub
00fc:fixme:msvcrt:__clean_type_info_names_internal (1E7BA8D4) stub
00fc:fixme:msvcrt:__clean_type_info_names_internal (1E2719D0) stub


Update:

I tried python 3.7, passed installing libs
got this error:

▶ wine ..../windows/py.exe  main.py
wineserver: using server-side synchronization.
002c:fixme:winediag:LdrInitializeThunk Wine TkG (staging) 6.17 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please don't report bugs about it on winehq.org and use https://github.com/Frogging-Family/wine-tkg-git/issues instead.
0104:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0104:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
0104:fixme:font:find_matching_face Untranslated charset 255
0104:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0104:fixme:imm:ImmReleaseContext (0001007A, 06E51578): stub
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    raise e
  File "main.py", line 15, in <module>
    MasterFrame()
  File "C:\MF_run_counter-1.4.9\master_frame.py", line 155, in __init__
    self.profile_tab = Profile(self, parent=self.tabcontrol)
  File "C:\MF_run_counter-1.4.9\modules\profiles.py", line 21, in __init__
    self._add_new_profile(first_profile=True)
  File "C:\MF_run_counter-1.4.9\modules\profiles.py", line 82, in _add_new_profile
    profile = tk_utils.registration_form(master=self.main_frame, coords=(xc, yc), first_profile=first_profile)
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 120, in registration_form
    reg_form = RegistrationForm(master, coords, first_profile)
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 47, in __init__
    geom = get_displaced_geom(master, 290, 185, coords[0], coords[1])
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 28, in get_displaced_geom
    mon = get_monitor_from_coord(master.root.winfo_rootx(), master.root.winfo_rooty(), disable_scaling=master.disable_scaling)
  File "C:\MF_run_counter-1.4.9\utils\other_utils.py", line 27, in get_monitor_from_coord
    monitors = libs.screeninfo.get_monitors(disable_scaling=disable_scaling)
  File "C:\MF_run_counter-1.4.9\libs\screeninfo\screeninfo.py", line 38, in get_monitors
    raise ScreenInfoError("No enumerators available")
libs.screeninfo.common.ScreenInfoError: No enumerators available
00fc:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFA, 0072F358

Update:

method enumerate_monitors() for each of the implementation seem not to has parameters, but being passed with disable_scaling kwargs. Only window.py implementation has this kwargs

I got _get_monitors(Enumerator.Windows,disable_scaling=True)
the error
*** ValueError: Procedure probably called with not enough arguments (4 bytes missing)

Appreciate if there're any insight

@oskros
Copy link
Owner

oskros commented Nov 4, 2022

I think I was running the code originally with 3.7 or 3.8 - can't fully remember. I just tested a fresh install on a windows machine with python 3.9, and that works fine at least

It looks like your error is related to the screeninfo package not being able to identify the operating system correctly. I can't really tell you why that happens.

To test whether the code works without screeninfo, just

  • go to MF_run_counter/utils/tk_utils.py and comment out line 14 and line 28
  • in both functions set min_x = 0 and min_y = 0
  • in both functions set max_x to the horizontal resolution of your screen in pixels (in my case 1680)
  • in both functions set max_y to the vertical resolution of your screen in pixels (in my case 1050)

then you can test whether the rest works.

@AndyHoang
Copy link
Author

AndyHoang commented Nov 6, 2022

Thanks I made it work as you suggest. I can run it, start counting, some feature is not working (not trying automode), but at least it can record my sessions now.

There would be some improvement needed for it to run out of the box, I guess.
There're 2 thing left I would to love hear from your suggestion so that I can dig this app deeper:

  • Global hotkey seem not to applied, I have to focus on the program to make hotkey work, not sure it it run normally with windows (I dont have windows)
  • pywin32, what is it needed for. If I look for automode off as your "lite app" would it still need pywin32? Reason I asked because I cant seem to install pywin32 in linux as a dependency, I want to check it so that If I can port the app into python native app, and linux can run it without wine. Ofc its still a long way in, but its good if there're some direction.
    Again, thanks bunch.

@AndyHoang AndyHoang changed the title Any chance of support wine/linux Any chance of supporting wine/linux Nov 6, 2022
@bviktor
Copy link

bviktor commented Oct 28, 2023

To me it starts up on Ubuntu 22.04, but there's a related bug:

https://bugs.winehq.org/show_bug.cgi?id=49334

For this reason, it needs to be run with sudo. Then it runs:

image

But yeah, hotkeys don't work, which kinda defeats the purpose. I mean if you switch from Alt + Q to Ctrl + Q it does work, but only when the window is active. Oh and always on top won't work either. So... :D

@oskros
Copy link
Owner

oskros commented Nov 2, 2023

To me it starts up on Ubuntu 22.04, but there's a related bug:

https://bugs.winehq.org/show_bug.cgi?id=49334

For this reason, it needs to be run with sudo. Then it runs:

image

But yeah, hotkeys don't work, which kinda defeats the purpose. I mean if you switch from Alt + Q to Ctrl + Q it does work, but only when the window is active. Oh and always on top won't work either. So... :D

Well yeah I would need to rewrite a ton of things and I have no knowledge of linux, so unfortunately if you really want to use the app I guess running D2 + run counter in a virtual machine would be your best bet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants