Skip to content

Replace notify-send with dunstify #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions notify-send.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
local utils = require "mp.utils"

local cover_filenames = { "cover.png", "cover.jpg", "cover.jpeg",
"folder.jpg", "folder.png", "folder.jpeg",
"AlbumArtwork.png", "AlbumArtwork.jpg", "AlbumArtwork.jpeg" }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AlbumArtwork.* are lost. Is this intentional?

local cover_filenames = { "folder.jpg", "folder.png", "front.jpg", "front.png",
"Folder.jpg", "Folder.png", "Front.jpg", "Front.png",
"cover.png", "cover.jpg", "cover.jpeg",
"Cover.png", "Cover.jpg", "Cover.jpeg",
"Art.jpg", "art.jpg", "Art.png", "Art.jpg",
"Album.jpg", "album.jpg", "Album.png", "album.png"}

function notify(summary, body, options)
local option_args = {}
for key, value in pairs(options or {}) do
table.insert(option_args, string.format("--%s=%s", key, value))
end
return mp.command_native({
"run", "notify-send", unpack(option_args),
"run", "dunstify",
"--appname=mpv_music",
"--replace=111",
unpack(option_args),
summary, body,
})
end
Expand Down