notify icon indicating copy to clipboard operation
notify copied to clipboard

Add option to map keys to a name

Open taylorjdawson opened this issue 6 years ago • 9 comments

It would be nice to have the ability to name the keys and notify based on specific names. For example:

notify -n -t "<name>" "<some cool message>"

I could help implement if need be, just let me know.

taylorjdawson avatar Jul 03 '18 20:07 taylorjdawson

I like the idea - probably won't have time to add it for a while, but I'll accept a pull request that adds it (as long as it is still backwards compatible)

mashlol avatar Jul 04 '18 19:07 mashlol

Do you like the proposed format? Or do you have a better idea?

taylorjdawson avatar Jul 05 '18 20:07 taylorjdawson

I think -t is already for the text right? Perhaps -k for key?

So notify -k asdf -t "Message" -i "Title"?

In long form:

notify --only-key asdf --text "Text" --title "title"

mashlol avatar Jul 05 '18 20:07 mashlol

Yeah, that looks good. If you wanted to map a name to a key for instance, android-device-0 -> asdf , would you still use the -k option? Or would there need to be another option for key aliases?

taylorjdawson avatar Jul 05 '18 21:07 taylorjdawson

Oh right, I guess we need a command to make the mapping? Perhaps

notify --map-key 'asdf' --map-to 'android' or notify -m 'asdf' -o 'android

And then 'android' or 'asdf' will both work for the -k param?

mashlol avatar Jul 06 '18 05:07 mashlol

Yeah, I think that would make sense to the user. Just have it be specified in the read me.

taylorjdawson avatar Jul 07 '18 02:07 taylorjdawson

Should there be a way to assign the mapping when registering the key? notify -r asdf -o 'android'

taylorjdawson avatar Jul 07 '18 02:07 taylorjdawson

Oh yeah we can reuse the -r for mapping. So you could use notify -r asdf -o 'android' on an existing key or to register a new one.

mashlol avatar Jul 07 '18 02:07 mashlol

Sweet! I like that. So:

notify --register asdf --map-to 'android'
notify -r asdf -o 'android'

taylorjdawson avatar Jul 08 '18 19:07 taylorjdawson