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

vkdt-read-icc modifications for wlroots #130

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blitzgneisserin
Copy link
Contributor

Well, don't think that this was easy. Probably it could be much shorter, but I don't know how.

This works on wlroots-based compositors, but not on KDE Plasma 6, there I get this strange number, but no idea from where:

[anna@archlinux Downloads]$ ./vkdt-rawler-wayland-0.8.99-35-gb7ce8d37-x86_64.AppImage
[gui] glfwGetVersionString() : 3.3.6 Wayland EGL OSMesa clock_gettime evdev shared
[gui] monitor [0] BNQ BenQ SW240/21573 at 0 0
[gui] vk extension required by GLFW:
[gui]   VK_KHR_surface
[gui]   VK_KHR_wayland_surface
[gui] no joysticks found
[gui] no display profile file display.BNQ BenQ SW240/21573, using sRGB!
[ERR] could not open directory '(null)'!

@hanatos
Copy link
Owner

hanatos commented Jun 16, 2024

oh, nice, thanks for putting this together. indeed looks like this is substantially more complicated to do than the old version was. need to look at it in detail. wlroots should be good enough for everyone of course.. but i suppose when writing so much code for exhaustive functionality it'd be good if it worked on kde too.

@hanatos
Copy link
Owner

hanatos commented Jun 17, 2024

just noticed that i don't even have hwinfo installed. this might be true for more people who occasionally use the script. maybe, in the interest of maximum compatibility, should we write a small c test program using exactly the same mechanism to find the monitor name as the main vkdt program would?

i.e. use some minimal glfwInit() and glfwGetMonitorName(monitors[0]); without even creating a window? not sure what this would do on macintosh or windows computers, but probably would be better than now.

needs c code to extract the icc tags but these files are simple enough.

@blitzgneisserin
Copy link
Contributor Author

a small c test program using exactly the same mechanism to find the monitor name as the main vkdt program

I had a similar idea but didn't know how to do that.

I just wrote a small test script in Python to find out the monitor name with glfw.get_monitor_name(monitor), but the script only found out the name of the connection, e.g. HDMI-A-1. But probably I am only being stupid and this needs to be done differently.

@hanatos
Copy link
Owner

hanatos commented Jun 17, 2024 via email

@blitzgneisserin
Copy link
Contributor Author

I am not sure I understand what you mean. The connection names do not work for the new native Wayland appimages. They see the monitor as e.g. [gui] monitor [0] BNQ BenQ SW240/21573 at 0 0, not as HDMI-A-1

@blitzgneisserin
Copy link
Contributor Author

blitzgneisserin commented Jun 17, 2024

I just did find a way to get the exact monitor name on KDE Plasma, with Python, but some Python modules/packages are needed for that.

import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk

def get_monitor_names():
    display = Gdk.Display.get_default()
    monitor_names = []

    for i in range(display.get_n_monitors()):
        monitor = display.get_monitor(i)
        monitor_name = monitor.get_model()
        monitor_names.append(monitor_name)

    return monitor_names

def write_monitor_names_to_file(filename):
    monitor_names = get_monitor_names()
    with open(filename, 'w') as file:
        for name in monitor_names:
            file.write(name + '\n')

if __name__ == '__main__':
    write_monitor_names_to_file('monitornames.txt')

@blitzgneisserin
Copy link
Contributor Author

Oh man, now the problem is that the file name contains a /.

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

Successfully merging this pull request may close these issues.

None yet

2 participants