nixcfg/homeManagerModules/desktop/wayland/helpers.nix
Aly Raffauf 1e1a02a5b3
Some checks are pending
flakehub / flakehub-publish (push) Waiting to run
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run
reorg and switc hto grim+slurp for screenshots
2024-07-21 20:59:03 -04:00

46 lines
1.4 KiB
Nix

{
lib,
pkgs,
...
}: {
brightness = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --brightness=raise";
down = "${bin} --brightness=lower";
};
media = rec {
bin = lib.getExe pkgs.playerctl;
play = "${bin} play-pause";
paus = "${bin} pause";
next = "${bin} next";
prev = "${bin} previous";
};
screenshot = {
region = pkgs.writeShellScript "screenshot-region" ''
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" "$FILENAME"
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
'';
screen = pkgs.writeShellScript "screenshot-screen" ''
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
'';
};
volume = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --output-volume=raise";
down = "${bin} --output-volume=lower";
mute = "${bin} --output-volume=mute-toggle";
micMute = "${bin} --input-volume=mute-toggle";
};
}