mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-10 02:19:41 +00:00
Add wayland applications for screenshot/video taking
This commit is contained in:
parent
183c97f992
commit
c2ddd6e720
|
@ -8,7 +8,35 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf osConfig.myOptions.home-manager.wms.isWayland {
|
config = mkIf osConfig.myOptions.home-manager.wms.isWayland {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
wl-clipboard
|
wl-clipboard # clipboard interactions
|
||||||
|
grim # grab images
|
||||||
|
slurp # select a region
|
||||||
|
wf-recorder # screen recording
|
||||||
|
|
||||||
|
# Grabs text from screenshot image
|
||||||
|
(pkgs.writeShellApplication {
|
||||||
|
name = "ocr";
|
||||||
|
runtimeInputs = with pkgs; [tesseract grim slurp coreutils];
|
||||||
|
text = ''
|
||||||
|
echo "Generating a random ID..."
|
||||||
|
id=$(tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 6 | head -n 1 || true)
|
||||||
|
echo "Image ID: $id"
|
||||||
|
|
||||||
|
echo "Taking screenshot..."
|
||||||
|
grim -g "$(slurp -w 0)" /tmp/ocr-"$id".png
|
||||||
|
|
||||||
|
echo "Running OCR..."
|
||||||
|
tesseract /tmp/ocr-"$id".png - | wl-copy
|
||||||
|
echo -en "File saved to /tmp/ocr-'$id'.png\n"
|
||||||
|
|
||||||
|
|
||||||
|
echo "Sending notification..."
|
||||||
|
notify-send "OCR " "Text copied!"
|
||||||
|
|
||||||
|
echo "Cleaning up..."
|
||||||
|
rm /tmp/ocr-"$id".png -vf
|
||||||
|
'';
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf osConfig.myOptions.home-manager.wms.isWayland {
|
config = mkIf osConfig.myOptions.home-manager.wms.isWayland {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
wlogout
|
wlogout # logout menu
|
||||||
|
swappy # screenshot editing
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue