From f7c98c0a6d161059f3773c207ba0a40defee03d2 Mon Sep 17 00:00:00 2001 From: Eleonora Date: Sat, 4 May 2024 08:20:48 +0200 Subject: [PATCH] Fix: foot-transparent wasn't actually transparent --- README.md | 2 +- flake.nix | 10 ++- packages/foot-transparent/default.nix | 5 -- packages/foot-transparent/transparency.patch | 85 -------------------- 4 files changed, 8 insertions(+), 94 deletions(-) delete mode 100644 packages/foot-transparent/default.nix delete mode 100644 packages/foot-transparent/transparency.patch diff --git a/README.md b/README.md index 987a40c..3230b06 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A personal collection of unusual things |`capnp-go`|Cap'n Proto library and code generator for Go|https://github.com/capnproto/go-capnp| |`e2eirc`|E2EIRC allows you to create end to end encrpyted chat rooms on Regular (Unmodified) IRC servers and your favorite IRC client.|https://github.com/novus0rdo/e2eirc| |`flameshot-fixed`|A fork of Flameshot without selection lag, configured to work with Wayland|https://github.com/lbatalha/flameshot| -|`foot-transparent`|A fast, lightweight and minimalistic Wayland terminal emulator|https://codeberg.org/dnkl/foot/| +|`foot-transparent`|A patched version of the foot terminal emulator that brings back fullscreen transparency|https://github.com/NotAShelf/nyxpkgs/blob/main/pkgs/applications/terminal-emulators/foot-transparent/default.nix| |`fusepod`|A userspace filesystem which mounts your iPod.|https://github.com/keegancsmith/FUSEPod| |`gtk4-layer-shell`|A library to desktop components for Wayland using the Layer Shell protocol and GTK4|https://github.com/wmww/gtk4-layer-shell| |`jade`|Pug template engine for Go|https://github.com/Joker/jade| diff --git a/flake.nix b/flake.nix index 656c9aa..b6755b7 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,8 @@ hash = "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs="; }); + nyx = builtins.getFlake "github:notashelf/nyxpkgs/a9c2ef2ea7c4b7e5036f7c60108df2bbcfc9a3c4?narHash=sha256-NiL7KfpHhUx7zLVFKtwPz7d9uJq/ABQEqf1y/lTWSGI="; + mkPackages = system: let pkgs = import nixpkgs { inherit system; }; @@ -39,7 +41,6 @@ capnp-go = pkgs.callPackage ./packages/capnp-go.nix { }; e2eirc = pkgs.callPackage ./packages/e2eirc { }; flameshot-fixed = pkgs.callPackage ./packages/flameshot-fixed.nix { }; - foot-transparent = pkgs.callPackage ./packages/foot-transparent { }; fusepod = pkgs.callPackage ./packages/fusepod.nix { }; gtk4-layer-shell = pkgs.callPackage ./packages/gtk4-layer-shell.nix { }; jade = pkgs.callPackage ./packages/jade.nix { }; @@ -56,6 +57,11 @@ samloader = pkgs.callPackage ./packages/samloader.nix { }; wayland-shell = pkgs.callPackage ./packages/wayland-shell.nix { inherit gtk4-layer-shell; }; + foot-transparent = nyx.packages.${system}.foot-transparent // { + meta.description = "A patched version of the foot terminal emulator that brings back fullscreen transparency"; + meta.homepage = "https://github.com/NotAShelf/nyxpkgs/blob/main/pkgs/applications/terminal-emulators/foot-transparent/default.nix"; + }; + nixos-conf-editor = nce.packages.${system}.nixos-conf-editor // { meta.description = "A libadwaita/gtk4 app for editing NixOS configurations"; meta.homepage = "https://github.com/snowfallorg/nixos-conf-editor"; @@ -167,8 +173,6 @@ | cachix push 42loco42 ''; }; - - foo = nixpkgs.lib.getExe self.packages.${pkgs.system}.sae_pk_gen; } ]; } diff --git a/packages/foot-transparent/default.nix b/packages/foot-transparent/default.nix deleted file mode 100644 index ffb0712..0000000 --- a/packages/foot-transparent/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ foot }: foot.overrideAttrs (prev: { - mesonFlags = prev.mesonFlags ++ [ "-Dfullscreen_alpha=true" ]; - mainProgram = "foot"; - patches = (prev.patches or [ ]) ++ [ ./transparency.patch ]; -}) diff --git a/packages/foot-transparent/transparency.patch b/packages/foot-transparent/transparency.patch deleted file mode 100644 index da1c819..0000000 --- a/packages/foot-transparent/transparency.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/CHANGELOG.md b/CHANGELOG.md -index 84a8aef4..9332efed 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -63,7 +63,7 @@ - instead of the one least recently. - * Starlight theme (the default theme) updated to [V4][starlight-v4] - * Background transparency (alpha) is now disabled in fullscreened -- windows ([#1416][1416]). -+ windows ([#1416][1416]) by default but can be enabled with `fullscreen_alpha`. - * Foot server systemd units now use the standard - graphical-session.target ([#1281][1281]). - * If `$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock` does not exist, -diff --git a/meson.build b/meson.build -index aeb2daa6..6a19db47 100644 ---- a/meson.build -+++ b/meson.build -@@ -73,6 +73,9 @@ add_project_arguments( - (get_option('b_pgo') == 'use' - ? ['-DFOOT_PGO_ENABLED=1'] - : []) + -+ (get_option('fullscreen_alpha') -+ ? ['-DFOOT_FULLSCREEN_ALPHA_ENABLED=1'] -+ : []) + - cc.get_supported_arguments( - ['-pedantic', - '-fstrict-aliasing', -@@ -388,6 +391,7 @@ summary( - 'Documentation': scdoc.found(), - 'Themes': get_option('themes'), - 'IME': get_option('ime'), -+ 'Fullscreen alpha': get_option('fullscreen_alpha'), - 'Grapheme clustering': utf8proc.found(), - 'Wayland: xdg-activation-v1': xdg_activation, - 'Wayland: fractional-scale-v1': fractional_scale, -diff --git a/meson_options.txt b/meson_options.txt -index d16e23ae..153c5453 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -7,6 +7,9 @@ option('themes', type: 'boolean', value: true, - option('ime', type: 'boolean', value: true, - description: 'IME (Input Method Editor) support') - -+option('fullscreen_alpha', type: 'boolean', value: false, -+ description: 'Enables transparency on fullscreen windows') -+ - option('grapheme-clustering', type: 'feature', - description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.') - -diff --git a/render.c b/render.c -index 48957a0a..21f335eb 100644 ---- a/render.c -+++ b/render.c -@@ -534,6 +534,13 @@ render_cell(struct terminal *term, pixman_image_t *pix, - } - - else if (cell->attrs.bg_src == COLOR_DEFAULT) { -+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED -+ /* -+ * Note: I don't care about the stupid ass wayland -+ * protocol I want transparent fullscreen windows. -+ */ -+ alpha = term->colors.alpha; -+#else - if (term->window->is_fullscreen) { - /* - * Note: disable transparency when fullscreened. -@@ -559,6 +566,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, - } else { - alpha = term->colors.alpha; - } -+#endif - } - } - -@@ -2163,7 +2171,7 @@ render_csd_button_maximize_maximized( - { x_margin + shrink, y_margin + thick, thick, width - 2 * thick - shrink }, - { x_margin + width - thick - shrink, y_margin + thick, thick, width - 2 * thick - shrink }, - { x_margin + shrink, y_margin + width - thick - shrink, width - 2 * shrink, thick }}); -- -+ - pixman_image_unref(src); - - } -