Live data from Hacker News

KDE Plasma Widget for external monitor brightness adjustment

github.com

31–40 of 65 posts

Re: KDE Plasma Widget for external monitor brightness adjustment

#31
Neat! I'm working on something very similar for Xfce, but invoking ddcutil natively: https://github.com/apsun/xfce4-ddc-plugin (very much WIP, currently only supports hotkeys and a single monitor)

I've found that shelling out to the ddcutil CLI directly tends to be "lossy" - as in, if invoked very quickly (i.e. via keyboard shortcuts), it will tend to race with itself and fail half the time. So far the best solution I've found is to run a daemon to queue and batch together multiple operations, which significantly improved reliability.

Re: KDE Plasma Widget for external monitor brightness adjustment

#32

Neat! I'm working on something very similar for Xfce, but invoking ddcutil natively: https://github.com/apsun/xfce4-ddc-plugin (very much WIP, currently only supports hotkeys and a single monitor) I've found that shelling out to the ddcutil CLI directly tends to be "lossy" - as in, if invoked very quickly (i.e. via keyboard shortcuts), it will tend to race with itself and fail half the time. So far the best solution…

On my desktop ddcutil commands take around 20 seconds unless I specify the --bus manually. Right now I just remember the appropriate bus number, but a daemon to cache that would be handy.

I wonder if a desktop-independent ddcutil daemon makes sense.

Re: KDE Plasma Widget for external monitor brightness adjustment

#33
post #2

Oh I'm definitely trying this. I currently have kb shortcuts defined for brightness up/down that invoke ddcutil. This really ought to be built into every OS. From what I've read, the catch is that DDC implementations are often very buggy and can cause problems, so it would be risky to do this out of the box.

I’d love a database of monitors with good DDC/CI support. You can’t just assume a good or high end monitor will work as you want it to.

My Samsung, for example, supports DDC/CI for HDMI but not DisplayPort, so I have to choose between software control and a refresh rate higher than 60Hz. It also only supports a small subset of commands and doesn’t work if the device sending the command isn’t the active display input.

I wanted to build a small utility that switches from my work PC to home PC automatically after 5pm, but all those compromises make it a very tedious process.

Re: KDE Plasma Widget for external monitor brightness adjustment

#34
Debian in particular has the ddcci-dkms package that once installed should solve the entire problem and let you control external monitors the same way you control internal ones.

I just found it, and I have to restart KDE to see if it worked, so no certainty here yet :)

Re: KDE Plasma Widget for external monitor brightness adjustment

#35
post #25
post #18

Earlier quoted context omitted.

In what sense is it supported? What functionality is exposed to end users?

Automatic detection of default and supported resolutions and information about DPI? Or is it not the same?

DDC is how monitors send EDID information about their capabilities to the computer. DDC/CI adds the ability for the computer to send commands to the monitor for things like brightness and color settings and input selection. So Windows obviously is using plain DDC to offer you the right set of resolution choices, but none of the DDC/CI functionality appears to be exposed to end users, making it effectively unsupported and unused and untested.

Re: KDE Plasma Widget for external monitor brightness adjustment

#36
post #33
post #2

Oh I'm definitely trying this. I currently have kb shortcuts defined for brightness up/down that invoke ddcutil. This really ought to be built into every OS. From what I've read, the catch is that DDC implementations are often very buggy and can cause problems, so it would be risky to do this out of the box.

I’d love a database of monitors with good DDC/CI support. You can’t just assume a good or high end monitor will work as you want it to. My Samsung, for example, supports DDC/CI for HDMI but not DisplayPort, so I have to choose between software control and a refresh rate higher than 60Hz. It also only supports a small subset of commands and doesn’t work if the device sending the command isn’t the active display input.…

I maintain a database of monitors coming from Lunar users here: https://db.lunar.fyi

It's not curated or anything like that because DDC can be affected by more than just the monitor itself (adapters/hubs/docks/GPU etc.) but you can run some statistics to see what specific monitors support DDC for most people.

For example, here's a query you can run to find the monitors that are most likely to support DDC:

    SELECT
        regexp_replace("name", ' \(\d+\)$', '') AS name,
        count(ddc) working_ddc_count,
        connection,
        "DisplayProductID",
        "isHiDPI"
    FROM
        displays
    WHERE
        ddc
        AND NOT "kCGDisplayIsVirtualDevice"
        AND NOT "isAirPlayDisplay"
        AND NOT "isTV"
        AND "DisplayProductID" != 0
        AND "DisplayVendorID" NOT IN(7789, 1552) -- Filter out LGs as they don't have a useful name and Apple displays
            AND name NOT LIKE 'Unknown Display%' -- Filter out those in a semi-connected state
        GROUP BY
            name,
            "DisplayProductID",
            connection,
            "isHiDPI"
        ORDER BY
            working_ddc_count DESC;

Re: KDE Plasma Widget for external monitor brightness adjustment

#37
post #29

Earlier quoted context omitted.

Sure, but gddccontrol has a GUI, has been supported since 2004 and works fine in 2023, that's why I find it a bit odd that he didn't know what to recommend to Linux users until now.

Maybe because it's discoverability is bad. I've been looking for something to control screen brightness because I wanted to give Linux another shot, so this random post was a lucky find. If I look for this topic on ddg I either find a Ubuntu wiki entry(not really relevant to me on suse with KDE), the arch Wiki which focuses solely on technical details and clis. The first ten articles are clis, a lot of them truly str…

Second Google result for me is the GitHub repository with clear information. You're making a mountain out of a molehill.

Re: KDE Plasma Widget for external monitor brightness adjustment

#38
post #6

I develop Lunar ( https://lunar.fyi/ ) for controlling monitors on Mac and stumbled upon this gem for Linux which I wanted to share with you. I regularly get asked to recommend something similar to Lunar for Linux and Windows and while there's TwinkleTray for Windows, I didn't have a good recommendation for Linux. Glad this finally exists! A lot of people also use MonitorControl for Mac and might be curious what's th…

There is also Clight (https://github.com/FedeDP/Clight) if you want automatic backlight adjusting given ambient brightness. It supports external monitors through ddcutil C library and has many more features to offer. Disclaimer: i am its creator ;)

Re: KDE Plasma Widget for external monitor brightness adjustment

#39
post #22

If your distro doesn't have a package for the backend of this plasmoid yet, it invokes the backend with[1]: python3 -m ddcci_plasmoid_backend So you can probably get away with this: git clone https://github.com/davidhi7/ddcci-plasmoid \ && cd $(python3 -c "import site; print(site.getsitepackages()[0])") \ && ln -s $(cd -)/ddcci-plasmoid/backend/ddcci_plasmoid_backend . [1]: https://github.com/davidhi7/ddcci-plasmoid/…

Developer here, why wouldn't you just install the official pip package `ddcci-plasmoid-backend`?

Re: KDE Plasma Widget for external monitor brightness adjustment

#40

Debian in particular has the ddcci-dkms package that once installed should solve the entire problem and let you control external monitors the same way you control internal ones. I just found it, and I have to restart KDE to see if it worked, so no certainty here yet :)

Using this module, Powerdevil does not allow you to set values individually per monitor, instead gives you only a single slider. This is absolutely sufficient for single monitor or multi monitor setups with identical models, but in my case I need the option to set the brightness individually since my monitors are all differently bright on 100%.
Post reply on HN