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

Added shortcut to copy formatted notification text via xclip #689

Closed
wants to merge 1 commit into from

Conversation

Jaywalker
Copy link

Provides the copy shortcut, which sends the notification text formatted as specified by clipboard_format to the program specified in xclip.

Example of added config:

[global]
        clipboard_format = "%s - %b"
        xclip = /usr/bin/xclip -selection clipboard

[shortcuts]
        copy = ctrl+c

[copy-format-override]
        appname = Mumble
        clipboard_format = "%b"

@tsipinakis
Copy link
Member

tsipinakis commented Feb 23, 2020

I'm hesitant to merge this as-is as it's clearly designed to satisfy a single use-case, and introduces two three new setting knobs in the process in an already complicated configuration file.

I'd much rather this be transformed into something like what's described in #669. Specifically, create a way to define custom actions for notifications that call a script when activated. With that, this usecase can be satisfied by using a script that calls xclip while additionally allowing many more similar hacks with notifications.

Now, that's obviously a much bigger chunk of work but it's the Right Thing To Do™ if we want to avoid future configuration restructures and compatibility breakages.
Would you be willing to work on something like that to get it merged?

@tsipinakis tsipinakis closed this Mar 13, 2020
@infokiller
Copy link

@tsipinakis I'm curious why you think your suggestion is much more work. My thinking is that work required is adding configuration syntax to add custom actions, which basically call a script with the notification data (for example first arg is title, second arg is content, etc).
Am I missing something? Thanks!

@tsipinakis
Copy link
Member

No, that's pretty much it, but it's harder as you have to introduce some new concepts in the configuration and notification code, i.e. a list of all actions that can be run, a way to tell client actions and dunst actions apart etc.

If you're thinking of working on it don't be discouraged though, it's definitely doable and you can feel free to ping me if you need help.

@infokiller
Copy link

Gotcha, thanks for the explanation. I'll see if I can carve out some time to work on this.

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

Successfully merging this pull request may close these issues.

3 participants