~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH wlr-randr] add an option to toggle output

Details
Message ID
<163592117575.12466.26117790727959132-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +9 -0
From: Anbang Wen <anb@papla.net>

The new option "toggle" is a convenient way to invert the power state
of selected output.
---
 main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/main.c b/main.c
index 40795bf..5dc4456 100644
--- a/main.c
+++ b/main.c
@@ -373,6 +373,7 @@ static const struct option long_options[] = {
	{"output", required_argument, 0, 0},
	{"on", no_argument, 0, 0},
	{"off", no_argument, 0, 0},
	{"toggle", no_argument, 0, 0},
	{"mode", required_argument, 0, 0},
	{"preferred", no_argument, 0, 0},
	{"custom-mode", required_argument, 0, 0},
@@ -466,6 +467,13 @@ static bool parse_output_arg(struct randr_head *head,
		head->enabled = true;
	} else if (strcmp(name, "off") == 0) {
		head->enabled = false;
	} else if (strcmp(name, "toggle") == 0) {
		if (head->enabled) {
			head->enabled = false;
		} else {
			fixup_disabled_head(head);
			head->enabled = true;
		}
	} else if (strcmp(name, "mode") == 0) {
		int width, height, refresh;
		if (!parse_mode(value, &width, &height, &refresh)) {
@@ -578,6 +586,7 @@ static const char usage[] =
	"--output <name>\n"
	"  --on\n"
	"  --off\n"
	"  --toggle\n"
	"  --mode|--custom-mode <width>x<height>[@<refresh>Hz]\n"
	"  --preferred\n"
	"  --pos <x>,<y>\n"
-- 
2.32.0
Details
Message ID
<1zJDGJ5kFxY-KrPAtME2eTdR4mPz3myE8JFQ2dURS9-47K6DPmkR_j2PwGzY-YGnUa6Xcpod2brBRtqylY7W0_opep-XDLf8LccuKOfW7bc=@emersion.fr>
In-Reply-To
<163592117575.12466.26117790727959132-0@git.sr.ht> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)