go-appimage
go-appimage copied to clipboard
Need a way to disable all desktop notifications
I'd prefer everything to go in a log file somewhere, I don't need desktop notifications.
Is there a way to disable these? I don't see documentation pointing me how to do this anywhere....
This is currently not posisble but if you'd like to implement it I would welcome a pull request.
You could probably change
https://github.com/probonopd/go-appimage/blob/e0577130d6f626aece6a983df800cf9d473d75e2/src/appimaged/notification.go#L22
to write to a log file in case one exists, or something like that.
@probonopd I would need to learn Go first before submitting a patch ~ steep curve for a minor feature request!
But, I was thinking that if there existed a config option in ~/.config/systemd/user/appimaged.service ... something like Notifications=FALSE
that these desktop notifications would just be skipped altogether.
To me, this would seem like something an experienced Go programmer would be able to implement in a short time.
It's totally worth learning (and not too hard). In fact,I was learning it "along the way" while I was working on go-appimage.
I too would love to see a feature like this implemented. However, I don't have any time to learn Go.
It's totally worth learning (and not too hard). In fact,I was learning it "along the way" while I was working on go-appimage.
Lmao same, while working on this project I was learning go.
I too would love to see a feature like this implemented. However, I don't have any time to learn Go.
Don't worry bro, I'll implement it and send a pr soon!
Hey @probonopd
I've Implemented The Logic But I am confused how do i get the information that user wants to show or not show the notifications.
My Code RN:
import (
...
"log/syslog"
)
// notification.go
func sendUpdateDesktopNotification(ai *AppImage, version string, notificationInLog bool, _ string) {
if notificationInLog {
logWriter, err := syslog.New(syslog.LOG_SYSLOG, "AppImaged")
if err != nil {
log.Fatalln("Unable to set logfile:", err.Error())
} else {
log.SetOutput(logWriter)
log.Println(ai.Name + " can be updated to version " + version + ".")
return
}
}
...
}
Hey @probonopd
I've Implemented The Logic But I am confused how do i get the information that user wants to show or not show the notifications.
My Code RN:
import ( ... "log/syslog" ) // notification.go func sendUpdateDesktopNotification(ai *AppImage, version string, notificationInLog bool, _ string) { if notificationInLog { logWriter, err := syslog.New(syslog.LOG_SYSLOG, "AppImaged") if err != nil { log.Fatalln("Unable to set logfile:", err.Error()) } else { log.SetOutput(logWriter) log.Println(ai.Name + " can be updated to version " + version + ".") return } } ... }
If your just trying to read the service file, then gopkg.in/ini.v1 is a good library to read and write ini files (which service files generally follow). If you want examples on how it's used, it's used in goappimage to parse app's desktop files.
Maybe we could check for the presence of the file ~/.config/appimaged/no_desktop_notifications
and if it exists, show no desktop notifications.
AppImaged
It's appimaged
. Upper/CamelCase for GUI applications, lowercase for command line tools.
Maybe we could check for the presence of the file
~/.config/appimaged/no_desktop_notifications
and if it exists, show no desktop notifications.
Much better and simple