Skip to content
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

Need a way to disable all desktop notifications #178

Open
ghost opened this issue Oct 21, 2021 · 11 comments
Open

Need a way to disable all desktop notifications #178

ghost opened this issue Oct 21, 2021 · 11 comments

Comments

@ghost
Copy link

ghost commented Oct 21, 2021

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....

@probonopd
Copy link
Owner

This is currently not posisble but if you'd like to implement it I would welcome a pull request.

You could probably change

func sendUpdateDesktopNotification(ai *AppImage, version string, _ string) {

to write to a log file in case one exists, or something like that.

@ghost
Copy link
Author

ghost commented Nov 10, 2021

@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.

@probonopd
Copy link
Owner

probonopd commented Nov 10, 2021

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.

@589290
Copy link

589290 commented Mar 28, 2022

I too would love to see a feature like this implemented. However, I don't have any time to learn Go.

@pegvin
Copy link

pegvin commented Mar 28, 2022

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.

@pegvin
Copy link

pegvin commented Mar 28, 2022

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!

@pegvin
Copy link

pegvin commented Mar 29, 2022

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
		}
	}
        ...
}

@CalebQ42
Copy link
Contributor

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.

@probonopd
Copy link
Owner

Maybe we could check for the presence of the file ~/.config/appimaged/no_desktop_notifications and if it exists, show no desktop notifications.

@probonopd
Copy link
Owner

AppImaged

It's appimaged. Upper/CamelCase for GUI applications, lowercase for command line tools.

@pegvin
Copy link

pegvin commented Apr 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants