From eb0771c233f322da4ea6660fe37bd9e9e5458321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Fri, 10 Apr 2020 16:18:20 +0200 Subject: [PATCH] fix: fzfmenu --- configs/alacritty.nix | 1 + configs/i3.nix | 2 +- configs/packages/default.nix | 2 +- overlays/scripts.nix | 2 +- packages/scripts/default.nix | 38 +++++++++++++++--------------------- packages/scripts/fzfmenu.sh | 1 + 6 files changed, 21 insertions(+), 25 deletions(-) diff --git a/configs/alacritty.nix b/configs/alacritty.nix index 902cd51..de75fd3 100644 --- a/configs/alacritty.nix +++ b/configs/alacritty.nix @@ -4,6 +4,7 @@ environment.systemPackages = [ pkgs.unstable.alacritty + pkgs.st pkgs.unstable.alacritty.terminfo ]; diff --git a/configs/i3.nix b/configs/i3.nix index 995a3c5..4e34ba5 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -47,12 +47,12 @@ in with config.niveum; { indicator = colours.foreground; childBorder = colours.foreground; }; - focusedInactive = focused; unfocused = scheme // { border = colours.background; indicator = colours.background; childBorder = colours.background; }; + focusedInactive = unfocused; urgent = scheme // { border = colours.red.bright; indicator = colours.red.bright; diff --git a/configs/packages/default.nix b/configs/packages/default.nix index 8fb29e9..004097e 100644 --- a/configs/packages/default.nix +++ b/configs/packages/default.nix @@ -35,7 +35,7 @@ # INTERNET aria2 firefox - tor-browser-bundle-bin + # tor-browser-bundle-bin qutebrowser tdesktop w3m diff --git a/overlays/scripts.nix b/overlays/scripts.nix index bc11e3f..fcb79de 100644 --- a/overlays/scripts.nix +++ b/overlays/scripts.nix @@ -1,3 +1,3 @@ (self: super: { - scripts = import { pkgs = super; }; + scripts = import { pkgs = super; lib = super.lib; }; }) diff --git a/packages/scripts/default.nix b/packages/scripts/default.nix index 054b41d..99361f4 100644 --- a/packages/scripts/default.nix +++ b/packages/scripts/default.nix @@ -1,17 +1,11 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: let - makeScript = { propagatedBuildInputs ? [], name, src }: pkgs.stdenv.mkDerivation { - inherit name src propagatedBuildInputs; - phases = [ "installPhase" ]; - installPhase = '' - mkdir -p $out/bin - install $src $out/bin/${name} - ''; - }; + inherit (lib.strings) makeBinPath; + makeScript = { binPath ? [], name, src }: pkgs.writeScriptBin name (builtins.readFile src); in { instaget = makeScript { - propagatedBuildInputs = [ pkgs.jq pkgs.curl pkgs.gnugrep ]; + binPath = [ pkgs.jq pkgs.curl pkgs.gnugrep ]; src = ./instaget.sh; name = "instaget"; }; @@ -27,67 +21,67 @@ in }; favicon = makeScript { - propagatedBuildInputs = [ pkgs.imagemagick ]; + binPath = [ pkgs.imagemagick ]; name = "favicon"; src = ./favicon.sh; }; genius = makeScript { - propagatedBuildInputs = [ pkgs.curl pkgs.gnused pkgs.pandoc ]; + binPath = [ pkgs.curl pkgs.gnused pkgs.pandoc ]; name = "genius"; src = ./genius.sh; }; literature-quote = makeScript { - propagatedBuildInputs = [ pkgs.xsv pkgs.curl pkgs.gnused ]; + binPath = [ pkgs.xsv pkgs.curl pkgs.gnused ]; name = "literature-quote"; src = ./literature-quote.sh; }; man-pdf = makeScript { - propagatedBuildInputs = [ pkgs.man pkgs.ghostscript ]; + binPath = [ pkgs.man pkgs.ghostscript ]; name = "man-pdf"; src = ./man-pdf.sh; }; odyssey = makeScript { - propagatedBuildInputs = [ pkgs.curl pkgs.xmlstarlet ]; + binPath = [ pkgs.curl pkgs.xmlstarlet ]; name = "odyssey"; src = ./odyssey.sh; }; tolino-screensaver = makeScript { - propagatedBuildInputs = [ pkgs.imagemagick ]; + binPath = [ pkgs.imagemagick ]; name = "tolino-screensaver"; src = ./tolino-screensaver.sh; }; wttr = makeScript { - propagatedBuildInputs = [ pkgs.curl ]; + binPath = [ pkgs.curl ]; name = "wttr"; src = ./wttr.sh; }; vf = makeScript { - propagatedBuildInputs = [ pkgs.fd pkgs.fzf ]; + binPath = [ pkgs.fd pkgs.fzf ]; name = "vf"; src = ./vf.sh; }; vg = makeScript { - propagatedBuildInputs = [ pkgs.ripgrep pkgs.fzf pkgs.gawk ]; + binPath = [ pkgs.ripgrep pkgs.fzf pkgs.gawk ]; name = "vg"; src = ./vg.sh; }; fkill = makeScript { - propagatedBuildInputs = [ pkgs.procps pkgs.gawk pkgs.gnused pkgs.fzf ]; + binPath = [ pkgs.procps pkgs.gawk pkgs.gnused pkgs.fzf ]; src = ./fkill.sh; name = "fkill"; }; nix-git = makeScript { - propagatedBuildInputs = [ pkgs.nix-prefetch-git pkgs.jq ]; + binPath = [ pkgs.nix-prefetch-git pkgs.jq ]; src = ./nix-git.sh; name = "nix-git"; }; @@ -100,7 +94,7 @@ in fzfmenu = makeScript { src = ./fzfmenu.sh; name = "fzfmenu"; - propagatedBuildInputs = [ pkgs.st pkgs.fzf ]; + binPath = [ pkgs.st pkgs.fzf ]; }; bvg = pkgs.callPackage ./bvg.nix {}; diff --git a/packages/scripts/fzfmenu.sh b/packages/scripts/fzfmenu.sh index bf40a98..9d64bfa 100755 --- a/packages/scripts/fzfmenu.sh +++ b/packages/scripts/fzfmenu.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # fzfmenu - fzf as dmenu replacement # https://github.com/junegunn/fzf/wiki/Examples#fzf-as-dmenu-replacement +set -efu input=$(mktemp -u --suffix .fzfmenu.input) output=$(mktemp -u --suffix .fzfmenu.output)