hanatos / vkdt

raw photography workflow that sucks less
https://vkdt.org
BSD 2-Clause "Simplified" License
364 stars 32 forks source link

vkdt-read-icc modifications for wlroots #130

Open blitzgneisserin opened 2 weeks ago

blitzgneisserin commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

i think that's exactly the string. i know nothing about python, but these HDMI-0 (nvidia) or HDMI-A-1 (amd?) identifiers look familiar.

On Mon, Jun 17, 2024 at 12:50 PM Anna @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/hanatos/vkdt/pull/130#issuecomment-2173067299, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMAKKMDD4HBDPTAWTRORRDZH25RFAVCNFSM6AAAAABJMXPHPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZTGA3DOMRZHE . You are receiving this because you commented.Message ID: @.***>

blitzgneisserin commented 2 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago

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