Notification sounds

This commit is contained in:
Alexander Bantyev 2022-04-28 17:49:47 +03:00
parent 7b03a2133b
commit c17f79e4d7
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
4 changed files with 19 additions and 9 deletions

6
flake.lock generated
View File

@ -721,11 +721,11 @@
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1639393537,
"narHash": "sha256-w2V+dbLTaJJnQXokxSnK6qp0VSm3nmxMTuAMDHw795Q=",
"lastModified": 1651151365,
"narHash": "sha256-00nR5swTsFqp9A04MQC1y35oK//R9P6+3sFNbaZPh6E=",
"owner": "balsoft",
"repo": "simple-osd-daemons",
"rev": "079e854664c6a4cdb10a5ca8ff646098ee808ce2",
"rev": "a105793bca69ecd78c4c8895a89eadd2a9116888",
"type": "github"
},
"original": {

View File

@ -4,7 +4,6 @@
# Internet
wget
curl
neochat
exa
] ++ lib.optionals config.deviceSpecific.goodMachine [
@ -18,6 +17,7 @@
# Messaging
libnotify
# Audio/Video
mpv
vlc
pavucontrol
# Tools

View File

@ -1,9 +1,7 @@
{ pkgs, config, ... }: {
home-manager.users.balsoft = {
systemd.user.services.mako = {
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
};
Service = { ExecStart = "${pkgs.mako}/bin/mako"; };
Install = {
After = [ "sway-session.target" ];
WantedBy = [ "sway-session.target" ];
@ -23,7 +21,19 @@
progressColor = "over ${base0B}";
iconPath = "${pkgs.papirus-icon-theme}/share/icons/Papirus-Dark";
maxIconSize = 24;
extraConfig = ''
extraConfig = let
play = sound:
"${pkgs.mpv}/bin/mpv ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/${sound}.oga";
in ''
on-notify=exec ${play "message"}
[app-name=yubikey-touch-detector]
on-notify=exec ${play "service-login"}
[app-name=command_complete summary~=".*"]
on-notify=exec ${play "dialog-warning"}
[app-name=command_complete summary~=".*"]
on-notify=exec ${play "bell"}
[category=osd]
on-notify=none
[mode=do-not-disturb]
invisible=1
[mode=do-not-disturb summary="Do not disturb: on"]

View File

@ -85,7 +85,7 @@
cmdstat=""
fi
if [ ! -z "$cmd" ] && [[ $cmd_time -gt 3 ]]; then
${pkgs.libnotify}/bin/notify-send -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`"
${pkgs.libnotify}/bin/notify-send -a command_complete -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`"
fi
unset cmd
}