init: public

This commit is contained in:
2025-04-13 15:09:14 +08:00
parent 5995c2050b
commit 50247d94e8
253 changed files with 12964 additions and 567 deletions

View File

@@ -0,0 +1,57 @@
diff --git a/cage.c b/cage.c
index 75f0696..b733010 100644
--- a/cage.c
+++ b/cage.c
@@ -228,6 +228,9 @@ parse_args(struct cg_server *server, int argc, char *argv[])
server->output_mode = CAGE_MULTI_OUTPUT_MODE_LAST;
} else if (strcmp(optarg, "extend") == 0) {
server->output_mode = CAGE_MULTI_OUTPUT_MODE_EXTEND;
+ } else {
+ server->output_mode = CAGE_MULTI_OUTPUT_MODE_SPECIFIED;
+ server->output_name = optarg;
}
break;
case 's':
diff --git a/output.c b/output.c
index 465c0ed..992d6e1 100644
--- a/output.c
+++ b/output.c
@@ -13,6 +13,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
@@ -294,6 +295,10 @@ handle_new_output(struct wl_listener *listener, void *data)
if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST && wl_list_length(&server->outputs) > 1) {
struct cg_output *next = wl_container_of(output->link.next, next, link);
output_disable(next);
+ } else if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_SPECIFIED &&
+ strcmp(wlr_output->name, server->output_name) != 0) {
+ output_disable(output);
+ return;
}
if (!wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) {
diff --git a/server.h b/server.h
index 6e2fddf..bdb289f 100644
--- a/server.h
+++ b/server.h
@@ -15,6 +15,7 @@
enum cg_multi_output_mode {
CAGE_MULTI_OUTPUT_MODE_EXTEND,
CAGE_MULTI_OUTPUT_MODE_LAST,
+ CAGE_MULTI_OUTPUT_MODE_SPECIFIED,
};
struct cg_server {
@@ -31,6 +32,7 @@ struct cg_server {
struct wl_list inhibitors;
enum cg_multi_output_mode output_mode;
+ char *output_name;
struct wlr_output_layout *output_layout;
struct wlr_scene *scene;
/* Includes disabled outputs; depending on the output_mode

View File

@@ -1,15 +1,21 @@
# This file defines overlays
{inputs, ...}: {
{ inputs, ... }:
{
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;};
additions = final: prev: import ../pkgs prev;
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
cage = prev.cage.overrideAttrs {
patches = [ ./cage-specify-output-name.patch ];
};
qq = prev.qq.overrideAttrs {
preInstall = ''
gappsWrapperArgs+=(
--prefix GTK_IM_MODULE : fcitx
)
'';
};
easytier = final.master.easytier;
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
@@ -20,4 +26,20 @@
config.allowUnfree = true;
};
};
stable-packages = final: _prev: {
stable = import inputs.nixpkgs-stable {
system = final.system;
config.allowUnfree = true;
};
};
master-packages = final: _prev: {
master = import inputs.nixpkgs-master {
system = final.system;
config.allowUnfree = true;
};
};
nur-packages = inputs.nur.overlays.default;
}