diff options
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/sc/screenshot_persistent/package.nix | 13 | ||||
-rwxr-xr-x | pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh | 10 |
2 files changed, 10 insertions, 13 deletions
diff --git a/pkgs/by-name/sc/screenshot_persistent/package.nix b/pkgs/by-name/sc/screenshot_persistent/package.nix index f79315a1..12bb3968 100644 --- a/pkgs/by-name/sc/screenshot_persistent/package.nix +++ b/pkgs/by-name/sc/screenshot_persistent/package.nix @@ -1,5 +1,5 @@ { - sysLib, + writeShellApplication, grim, slurp, alacritty, @@ -7,12 +7,10 @@ libnotify, lf, # TODO: add llp }: -sysLib.writeShellScript { +writeShellApplication { name = "screenshot_persistent"; - src = ./screenshot_persistent.sh; - generateCompletions = false; - keepPath = true; - dependencies = [ + text = builtins.readFile ./screenshot_persistent.sh; + runtimeInputs = [ grim slurp alacritty @@ -20,4 +18,7 @@ sysLib.writeShellScript { libnotify lf # TODO: add llp ]; + meta = { + mainProgram = "screenshot_persistent"; + }; } diff --git a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh index 4308b8d2..2bea69e3 100755 --- a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh +++ b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh @@ -1,10 +1,6 @@ -#! /usr/bin/env dash +# shellcheck shell=bash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# only generate a path (this could lead to a time-of-check/time-of-use bug) -tmp="$(mktmp --dry-run)" +tmp="$(mktemp)" if grim -g "$(slurp)" "$tmp"; then name="$(rofi -dmenu -p "Name of screenshot: " -l 0)" @@ -16,7 +12,7 @@ if grim -g "$(slurp)" "$tmp"; then done mv "$tmp" "$screen_shot_path" - alacritty -e lf -command ":{{ set sortby atime; set reverse!; }}" + alacritty --title "floating please" --command lf -command ":{{ set sortby atime; set reverse!; set info time; }}" "$screen_shot_path" fi # vim: ft=sh |