commit 0329f6d5eded1a870a37fcda8c64eabe2b3ee5e9 parent c579abd9b93b193c40ade3c4afdc7a45a27a5ae8 Author: Vincent Demeester <vincent@sbr.pm> Date: Wed, 3 Oct 2018 21:37:56 +0200 scripts: shot script Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | desktop.nix | | | 5 | ++++- |
A | pkgs/scripts/bin/shot | | | 10 | ++++++++++ |
M | pkgs/scripts/default.nix | | | 2 | +- |
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/desktop.nix b/desktop.nix @@ -64,10 +64,13 @@ gnome3.gnome_themes_standard i3lock-color keybase + libnotify + maim # pass peco - scrot + # scrot spotify + slop xdg-user-dirs xdg_utils youtube-dl diff --git a/pkgs/scripts/bin/shot b/pkgs/scripts/bin/shot @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +maim -g $(slop; sleep ${2:-0}) | { + case $1 in + %c) to='clipboard'; xclip -selection clipboard -t image/png ;; + %d) to=~/desk/Screenshot_$(date +'%Y-%m-%d_%H:%M:%S').png; cat > "$to" ;; + *) to=$1; cat > "$to" ;; + esac + notify-send -i accessories-screenshot 'Screenshot Taken' "Saved to $to" +} diff --git a/pkgs/scripts/default.nix b/pkgs/scripts/default.nix @@ -1,7 +1,7 @@ { stdenv }: stdenv.mkDerivation { - name = "vde-scripts-0.1"; + name = "vde-scripts-0.2"; builder = ./builder.sh; src = ./.; }