Quantize clipboard screenshots
This commit is contained in:
parent
7f0e165ae6
commit
bafb134702
|
@ -2,16 +2,17 @@
|
|||
, scdoc
|
||||
, xclip
|
||||
, maim
|
||||
, pngquant
|
||||
, stdenvNoCC
|
||||
, nushell
|
||||
, xdotool
|
||||
, ...
|
||||
}:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "irs";
|
||||
version = "0.3";
|
||||
src = ./src;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nativeBuildInputs = [
|
||||
scdoc
|
||||
nushell
|
||||
];
|
||||
|
@ -39,6 +40,7 @@ stdenvNoCC.mkDerivation rec {
|
|||
substituteInPlace $out/bin/* \
|
||||
--replace "xclip" "${xclip}/bin/xclip" \
|
||||
--replace "maim" "${maim}/bin/maim" \
|
||||
--replace "pngquant" "${pngquant}/bin/pngquant" \
|
||||
--replace "xdotool" "${xdotool}/bin/xdotool"
|
||||
'';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
description = "A few random scripts";
|
||||
inputs = {
|
||||
nixpkgs.url = github:nixos/nixpkgs/nixos-23.05;
|
||||
flake-utils.url = github:numtide/flake-utils;
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
|
|
|
@ -15,7 +15,7 @@ fullscreen(){
|
|||
|
||||
selection(){
|
||||
maim -su "$filename"
|
||||
notify-send 'Maim utils' "Shot selection and saved output to:\n\n$filename\n\nBe aware that the selection process can be cancelled using any keypress and that this won't show up due to xclip eating the exit status."
|
||||
notify-send 'Maim utils' "Shot selection and saved output to:\n\n$filename\n\n"
|
||||
}
|
||||
|
||||
focus(){
|
||||
|
@ -24,23 +24,23 @@ focus(){
|
|||
}
|
||||
|
||||
clip_fullscreen(){
|
||||
maim -ui root | xclip -sel clip -t image/png
|
||||
maim -ui root | pngquant - | xclip -sel clip -t image/png
|
||||
notify-send 'Maim utils' "Shot entire screen and sent it to the clipboard."
|
||||
}
|
||||
|
||||
clip_selection(){
|
||||
maim -su | xclip -sel clip -t image/png
|
||||
maim -su | pngquant - | xclip -sel clip -t image/png
|
||||
notify-send 'Maim utils' "Shot selection and sent it to the clipboard.\nBe aware that the selection process can be cancelled using any keypress and that this won't show up due to xclip eating the exit status."
|
||||
}
|
||||
|
||||
clip_focus(){
|
||||
maim -ui "$(xdotool getactivewindow)" | xclip -sel clip -t image/png
|
||||
maim -ui "$(xdotool getactivewindow)" | pngquant - | xclip -sel clip -t image/png
|
||||
notify-send 'Maim utils' "Shot focussed window and sent it to the clipboard."
|
||||
}
|
||||
|
||||
fancy_clip(){
|
||||
# nicked straight from the maim README (https://github.com/naelstrof/maim#examples)
|
||||
maim -st 9999999 | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage PNG:- | xclip -sel clip -t image/png
|
||||
maim -st 9999999 | pngquant - | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage PNG:- | xclip -sel clip -t image/png
|
||||
notify-send 'Maim utils' "Shot selection and sent it to the clipboard.\nBe aware that the selection process can be cancelled using any keypress and that this won't show up due to xclip eating the exit status."
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
#!/usr/bin/env nu
|
||||
|
||||
# (ls).name | each {|item| (cat $"($item)/capacity") } | lines
|
||||
# open uevent | lines | parse "{key}={value}" | transpose -r
|
||||
# let batteries = ( (ls /sys/class/power_supply).name | each {|item| open $"($item)/uevent" } | each {|item| $item | lines | parse "{key}={value}" | transpose -r })
|
||||
|
||||
let dateString = ^date
|
||||
let discordianDate = ^ddate
|
||||
|
||||
|
@ -26,7 +22,7 @@ def get_batteries [] {
|
|||
} | each {|| $in}
|
||||
|
||||
$batteries | each {|i|
|
||||
[ $i.POWER_SUPPLY_MANUFACTURER $i.POWER_SUPPLY_MODEL_NAME $i.POWER_SUPPLY_CAPACITY ]
|
||||
[ $i.POWER_SUPPLY_MANUFACTURER $i.POWER_SUPPLY_MODEL_NAME $i.POWER_SUPPLY_STATUS $i.POWER_SUPPLY_CAPACITY ]
|
||||
| each {|j|
|
||||
$j | first
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue