1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

cli/notify: append file:// prefix for --file arguments

fixes #1962
This commit is contained in:
bbedward
2026-03-23 11:57:17 -04:00
parent fd1facfce8
commit 7e559cc0bb

View File

@@ -6,6 +6,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"syscall"
"github.com/godbus/dbus/v5"
@@ -59,7 +60,11 @@ func Send(n Notification) error {
hints := map[string]dbus.Variant{}
if n.FilePath != "" {
hints["image_path"] = dbus.MakeVariant(n.FilePath)
imgPath := n.FilePath
if !strings.HasPrefix(imgPath, "file://") {
imgPath = "file://" + imgPath
}
hints["image_path"] = dbus.MakeVariant(imgPath)
}
obj := conn.Object(notifyDest, notifyPath)