Skip to content

Conversation

@Mayank-8127
Copy link

Added brightness control based on whichever monitor is in focus

The omarchy-monitor-brightness checks if it is the internal display or not, based on that it uses either swayosd or ddcutil to change the brightness of only the display that is in focus. The previous keybinds now just execute omarchy-monitor-brightness.

ddcutil is itself very slow so i have not added the graphical view to display brightness change as it will make the ui look laggy, went through some docs of ddcutil and the conclusion is that the speed can be improved from case to case but the the I2C hardware interface itself is very slow and unreliable. I instead made the default brightness change for external monitors to be twice that of internal display to make it feel a little faster.

[TODO] I think with some effort the apple display related controls could also be merged with this.

laptop: VivoBook_ASUSLaptop K3502ZA_S3502ZA
monitor: BenQ GW2490

Note: This is my first time contributing to anything linux related.

abs) swayosd-client --monitor "$focused_monitor" --brightness "$step" ;;
esac
else
# external display serial number is the only way to map hyperctl monitors output deterministically with the ddcutil input
Copy link

@pawlobanano pawlobanano Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this won't work in my case of PC. The command hyprctl monitors -j | jq -r '.[] | select(.focused == true).serial' output for serial property is empty 🤔

*e.g. ddcutil setvcp 10 40 works fine for me.

Here is my output of hyprctl monitors -j | jq -r

[
  {
    "id": 0,
    "name": "DP-3",
    "description": "Xiaomi Corporation Mi Monitor",
    "make": "Xiaomi Corporation",
    "model": "Mi Monitor",
    "serial": "",
    "width": 3440,
    "height": 1440,
    "physicalWidth": 800,
    "physicalHeight": 330,
    "refreshRate": 144.00000,
    "x": 0,
    "y": 0,
    "activeWorkspace": {
      "id": 2,
      "name": "2"
    },
    "specialWorkspace": {
      "id": 0,
      "name": ""
    },
    "reserved": [
      0,
      26,
      0,
      0
    ],
    "scale": 1.60,
    "transform": 0,
    "focused": true,
    "dpmsStatus": true,
    "vrr": false,
    "solitary": "0",
    "solitaryBlockedBy": [
      "WINDOWED",
      "CANDIDATE"
    ],
    "activelyTearing": false,
    "tearingBlockedBy": [
      "NOT_TORN",
      "USER",
      "CANDIDATE"
    ],
    "directScanoutTo": "0",
    "directScanoutBlockedBy": [
      "USER",
      "SW",
      "CANDIDATE"
    ],
    "disabled": false,
    "currentFormat": "XRGB8888",
    "mirrorOf": "none",
    "availableModes": [
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]",
      "[email protected]"
    ]
  }
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you share your ddcutil detect output as well, so that i can maybe find another way

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing:

~ ❯ ddcutil detect
Display 1
   I2C bus:  /dev/i2c-5
   DRM_connector:           card1-DP-3
   EDID synopsis:
      Mfg id:               XMI - UNK
      Model:                Mi Monitor
      Product code:         13380  (0x3444)
      Serial number:
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2020,  Week: 16
   VCP version:         2.1

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.

2 participants