Skip to content

Instantly share code, notes, and snippets.

@shymega
Created March 12, 2025 19:38
Show Gist options
  • Save shymega/afaceb462b5da5c2c76776eb8642a539 to your computer and use it in GitHub Desktop.
Save shymega/afaceb462b5da5c2c76776eb8642a539 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2025 Dom Rodriguez (shymega)
#
# SPDX-License-Identifier: CC-1.0
export TARGET_MONITOR="${1}"
swaymsg -t get_outputs | jq --arg TARGET_MONITOR "$TARGET_MONITOR" -r '.[] | (.make + " " + .model + " " + .serial) as $monitor | select ($monitor == $TARGET_MONITOR) | .name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment