aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/sxhkd/keybindings/maim.nix
blob: 0f0b3d808efa30a7af1ec3665f3e7c5c734c9a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  createKeybinding,
  pkgs,
  lib,
}:

let
  maim = "${pkgs.maim}/bin/maim";
in
lib.mkMerge [
  (createKeybinding "p" "Take screenshot of selected area and save to clipboard"
    "${maim} -s | xclip -selection clipboard -t image/png"
  )

  (createKeybinding "shift + p" "Take screenshot of selected area and save to ~/Pictures/Screenshots"
    "mkdir -p ~/Pictures/Screenshots && ${maim} -s ~/Pictures/Screenshots/screenshot-$(date +%Y%m%d-%H%M%S).png"
  )
]