Add a way to screenshot on sway
- grim is a screenshot program, slurp is a program to select a screen area
- by chaining them together, we can allow selection screenshots
diff --git a/modules/screenshots.nix b/modules/screenshots.nix
new file mode 100644
index 0000000..638ab5d
--- /dev/null
+++ b/modules/screenshots.nix
@@ -0,0 +1,15 @@
+{
+ pkgs,
+ lib,
+ home,
+ ...
+}: {
+ home = {
+ home.packages = with pkgs; [grim slurp];
+
+ wayland.windowManager.sway.config.keybindings = lib.mkOptionDefault {
+ "${home.wayland.windowManager.sway.config.modifier}+Shift+s" = "exec mkdir -p ~/Screenshots && grim -g \"$(slurp)\" - | tee ~/Screenshots/\"$(date --rfc-3339=seconds)\".png | wl-copy";
+ "Print" = "exec mkdir -p ~/Screenshots && grim - | tee ~/Screenshots/\"$(date --rfc-3339=seconds)\".png | wl-copy";
+ };
+ };
+}