Closed WPettersson closed 4 years ago
That's something I've had in mind for a while! Here are my notes on the matter:
${HOME}/.local/state/splatmoji
because the XDG dir spec curiously does not have a place for such things aside from a proposal pointing to that locationuniq
get_user_selection
function currently returns the emoji/emoticon directly by itself, without annotations. So without doing some work inside there, the history would most easily be the symbols by themselves. I think I might be okay with this since the point of having them up top is not for searchability but for quick scrolling selection? Maybe the annotations can just be replaced with "recent selection"
or something in that veinThat's all I've got ¯\(ツ)\\/¯
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.
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.
This feature was merged from #24 ᕕ( ᐛ )ᕗ
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.