cspeterson / splatmoji

Quickly look up and input emoji and/or emoticons/kaomoji on your GNU/Linux desktop via pop-up menu.
MIT License
212 stars 19 forks source link

[Feature request] Add recently used emoji to top of list? #23

Closed WPettersson closed 4 years ago

WPettersson commented 4 years ago

Many mobile phone keyboards keep a history of recently used emoji, which I find useful. In particular, I'd use this when sending multiple copies of the same emoji, so even a history of length 1 would be useful to me. I'd imagine that personally I'd have maybe 5 or so.

I figure it isn't too hard to do this in splatmoji, just create a new data file, but called history or something I guess, to keep a history, and add emoji as they are used. It might be slightly tricky to add emoji, because you don't necessarily want the history to have 50 copies of a smiley face if you've used it 50 times, but that seems to be the only issue to consider. So I think it's just "add to top, remove if found elsewhere in file, else remove any lines after line X" where X is the number of emoji to keep a track of.

Is there anything else I've missed? If not, I'll probably try to get this working this weekend, but wanted to see if people had other obviously related ideas that I'd missed.

cspeterson commented 4 years ago

That's something I've had in mind for a while! Here are my notes on the matter:

That's all I've got ¯\(ツ)\\/¯

WPettersson commented 4 years ago

I've added a draft PR that seems to work fine. There is a couple of things to note. 1) The config file does not expand variables, so the history_file entry in the configuration file needs to be absolute. This makes it awkward to have a useful default config file. This is the big one that needs fixing. 2) The main function (in the splatmoji file) should probably have a "if nothing selected, return" statement, around line ~70. This is the second commit in the PR at the moment, but there might be other ways to do this too.

WPettersson commented 4 years ago

I've modified the config reading to expand ~ to ${HOME} if the ~ occurs at the start of the line. This will happen for all variables, but I don't see this causing any problems. #24 is now ready for review.

cspeterson commented 4 years ago

This feature was merged from #24 ᕕ( ᐛ )ᕗ