Refactor to only download displayselect, not the

...whole repository
This commit is contained in:
Oliver Davies 2025-05-09 22:33:23 +01:00
parent 9fa76b531a
commit 56b5f099fc
2 changed files with 14 additions and 12 deletions
pkgs/displayselect

View file

@ -1,28 +1,30 @@
{ pkgs, ... }:
with pkgs;
stdenv.mkDerivation {
pkgs.stdenv.mkDerivation {
pname = "displayselect";
version = "unstable-2024-05-11";
src = fetchFromGitHub {
owner = "lukesmithxyz";
repo = "voidrice";
rev = "97687287bdfd332398b82a196b5f1feaec73f1d7";
sha256 = "sha256-9U1Do0w2oT5E6uZxSKoHAzbGbSLQRQlT65KcPGzwhW8=";
src = builtins.fetchurl {
url = "https://raw.githubusercontent.com/lukesmithxyz/voidrice/97687287bdfd332398b82a196b5f1feaec73f1d7/.local/bin/displayselect";
sha256 = "sha256:11r561pfhb48a3xmi42zzvpljahnwlfad9rz8qmmp64dhz1f2vp0";
};
buildInputs = [
dontUnpack = true;
buildInputs = with pkgs; [
bash
xorg.xrandr
];
prePatch = ''
cp $src displayselect
'';
patches = [ ./scaling.patch ];
installPhase = ''
mkdir -p $out/bin
cp .local/bin/displayselect $out/bin
cp displayselect $out/bin
chmod +x $out/bin/displayselect
'';

View file

@ -1,7 +1,7 @@
diff --git a/.local/bin/displayselect b/.local/bin/displayselect
index 51dd468..c132b7a 100755
--- a/.local/bin/displayselect
+++ b/.local/bin/displayselect
--- a/displayselect
+++ b/displayselect
@@ -15,20 +15,13 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \