Refactor displayselect

This commit is contained in:
Oliver Davies 2025-08-19 20:56:05 +01:00
parent 8466ffcfb7
commit 94ec854383
8 changed files with 59 additions and 36 deletions

19
flake.lock generated
View file

@ -458,7 +458,8 @@
"rwxrob-dot": "rwxrob-dot",
"standard-vim": "standard-vim",
"vim-heritage": "vim-heritage",
"vim-textobj-xmlattr": "vim-textobj-xmlattr"
"vim-textobj-xmlattr": "vim-textobj-xmlattr",
"voidrice": "voidrice"
}
},
"rwxrob-dot": {
@ -569,6 +570,22 @@
"repo": "vim-textobj-xmlattr",
"type": "github"
}
},
"voidrice": {
"flake": false,
"locked": {
"lastModified": 1744355318,
"narHash": "sha256-9U1Do0w2oT5E6uZxSKoHAzbGbSLQRQlT65KcPGzwhW8=",
"owner": "lukesmithxyz",
"repo": "voidrice",
"rev": "f853f1884a8f0c244765192dc6f5a910a7e2b8e5",
"type": "github"
},
"original": {
"owner": "lukesmithxyz",
"repo": "voidrice",
"type": "github"
}
}
},
"root": "root",

View file

@ -77,6 +77,11 @@
flake = false;
url = "github:whatyouhide/vim-textobj-xmlattr";
};
voidrice = {
flake = false;
url = "github:lukesmithxyz/voidrice";
};
};
outputs =

View file

@ -17,7 +17,6 @@
build-glove80
count-tags
create-script
displayselect
get-tags
qrencode
mounter

View file

@ -0,0 +1,35 @@
{ inputs, ... }:
{
flake.modules.homeManager.gui =
{ pkgs, ... }:
{
home.packages = [
(pkgs.stdenv.mkDerivation {
pname = "displayselect";
version = "unstable";
src = inputs.voidrice;
dontUnpack = true;
buildInputs = with pkgs; [
bash
xorg.xrandr
];
prePatch = ''
cp "$src/.local/bin/displayselect" displayselect
'';
patches = [ ./scaling.patch ];
installPhase = ''
mkdir -p $out/bin
cp displayselect $out/bin
chmod +x $out/bin/displayselect
'';
})
];
};
}

View file

@ -13,7 +13,7 @@
"${pkgs.xdotool}/bin/xdotool type $(cat ~/.local/share/snippets.txt | grep -v '^#' | grep -v '^$' | sort | dmenu -i -l 50 | cut -d' ' -f1)";
"super + shift + p" = "${lib.getExe pkgs.passmenu-otp} -i";
"super + x; {1, 2, 3, 4}" = "st {notes, newsboat, nmtui, bluetuith}";
"@F3" = "${lib.getExe pkgs.displayselect}";
"@F3" = "displayselect";
"@F9" = "/home/opdavies/.local/bin/mounter";
"@F10" = "/home/opdavies/.local/bin/unmounter";
};

View file

@ -17,7 +17,6 @@ in
count-tags = callPackage ./count-tags.nix { };
create-script = callPackage ./create-script.nix { };
dev-commit = callPackage ./dev-commit.nix { };
displayselect = callPackage ./displayselect { };
get-tags = callPackage ./get-tags.nix { };
git-exclude = callPackage ./git-exclude.nix { };
git-graph = callPackage ./git-graph.nix { };

View file

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