2024-07-21 20:59:03 -04:00
|
|
|
{
|
2024-07-21 22:39:15 -04:00
|
|
|
config,
|
2024-07-21 20:59:03 -04:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2024-07-21 21:58:06 -04:00
|
|
|
screenshot = rec {
|
|
|
|
bin = pkgs.writeShellScript "screenshooter" ''
|
2024-07-21 22:39:15 -04:00
|
|
|
FILENAME=${config.xdg.userDirs.pictures}/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
|
2024-07-21 21:05:21 -04:00
|
|
|
|
2024-07-21 21:58:06 -04:00
|
|
|
if [ "$1" == "region" ]; then
|
|
|
|
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" "$FILENAME"
|
|
|
|
elif [ "$1" == "screen" ]; then
|
|
|
|
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-07-21 20:59:03 -04:00
|
|
|
|
|
|
|
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
|
|
|
|
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
|
|
|
|
'';
|
2024-07-21 21:58:06 -04:00
|
|
|
|
|
|
|
region = "${bin} region";
|
|
|
|
screen = "${bin} screen";
|
2024-07-21 20:59:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|