Add sounds for notifications & screenshot/screenrec.
This commit is contained in:
parent
8ef31a06b7
commit
e75cd9fa4d
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
__findFile,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
alpha = config.module.style.opacity.hex;
|
||||
|
@ -16,6 +17,7 @@ in {
|
|||
height = 120;
|
||||
icons = 0;
|
||||
margin = 32;
|
||||
on-notify = "exec ${pkgs.pipewire}/bin/pw-cat -p ${<static/Notification.ogg>}";
|
||||
text-color = "#${config.module.style.color.bg.dark}";
|
||||
width = 480;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
__findFile,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
@ -15,6 +16,8 @@
|
|||
selection = "slurp -d -b ${color.bg.light}${opacity} -c ${color.fg.light} -w 0 -s 00000000";
|
||||
in {
|
||||
text = let
|
||||
notifyStart = "${pkgs.pipewire}/bin/pw-cat -p ${<static/Screenrec.ogg>} &";
|
||||
notifyEnd = "${pkgs.pipewire}/bin/pw-cat -p ${<static/Screenshot.ogg>} &";
|
||||
picEdit = ''swappy -f - -o -'';
|
||||
picFull = ''-o $(swaymsg -t get_outputs | jq -r ".[] | select(.focused) | .name") -'';
|
||||
picPrepFile = prepFile "\${XDG_PICTURES_DIR[0]}" "png";
|
||||
|
@ -106,12 +109,14 @@ in {
|
|||
${getSelection}
|
||||
${getTransform}
|
||||
${vidPrepFile}
|
||||
${notifyStart}
|
||||
${updateWaybar}
|
||||
${vidStart} ${vidSelected}
|
||||
${notifyEnd}
|
||||
${updateWaybar}
|
||||
${vidMuxAudio}
|
||||
${vidTransform}
|
||||
${vidRefLatestFile}
|
||||
${updateWaybar}
|
||||
};
|
||||
'');
|
||||
|
||||
|
@ -119,26 +124,32 @@ in {
|
|||
${vidStop} || {
|
||||
${getTransform}
|
||||
${vidPrepFile}
|
||||
${notifyStart}
|
||||
${updateWaybar}
|
||||
${vidStart} ${vidFull}
|
||||
${notifyEnd}
|
||||
${updateWaybar}
|
||||
${vidMuxAudio}
|
||||
${vidTransform}
|
||||
${vidRefLatestFile}
|
||||
${updateWaybar}
|
||||
};
|
||||
'');
|
||||
|
||||
FullscreenScreenshot = pkgs.writeShellScriptBin "FullscreenScreenshot" (util.trimTabs ''
|
||||
${notifyEnd}
|
||||
${picPrepFile}
|
||||
|
||||
${screenshot} ${picFull} | ${picToFile} | ${picToBuffer} && ${picRefLatestFile}
|
||||
${screenshot} ${picFull} | ${picToFile} | ${picToBuffer} || exit
|
||||
${picRefLatestFile}
|
||||
'');
|
||||
|
||||
SelectScreenshot = pkgs.writeShellScriptBin "SelectScreenshot" (util.trimTabs ''
|
||||
${getSelection}
|
||||
${notifyEnd}
|
||||
${picPrepFile}
|
||||
|
||||
${screenshot} ${picSelected} | ${picEdit} | ${picToFile} | ${picToBuffer} && ${picRefLatestFile}
|
||||
${screenshot} ${picSelected} | ${picEdit} | ${picToFile} | ${picToBuffer} || exit
|
||||
${picRefLatestFile}
|
||||
'');
|
||||
in ''
|
||||
bindsym --to-code $mod+y exec ${lib.getExe FullscreenScreenshot}
|
||||
|
|
BIN
static/Notification.ogg
Normal file
BIN
static/Notification.ogg
Normal file
Binary file not shown.
BIN
static/Screenrec.ogg
Normal file
BIN
static/Screenrec.ogg
Normal file
Binary file not shown.
BIN
static/Screenshot.ogg
Normal file
BIN
static/Screenshot.ogg
Normal file
Binary file not shown.
Loading…
Reference in a new issue