Commit Graph

52 Commits

Author SHA1 Message Date
Marty Oehme 1cf9971d8b
📖 Bump version
ci/woodpecker/push/woodpecker Pipeline was successful Details
2024-02-22 13:46:45 +01:00
Marty Oehme 46fa824d42
🐛 Remove deprecated CI instruction 2024-02-22 13:46:45 +01:00
Marty Oehme 551e3468d8
📖 Bump license copyright year
ci/woodpecker/push/woodpecker Pipeline was successful Details
Bumping the year again. I am honestly not entirely sure what the best or
correct way to display this is - so I am simply copying what the `curl`
project is doing and stating the whole period of me working on it.

Perhaps one day (should we get more contributors or much more popular)
it may also make sense to copy its `THANKS` file to keep a stable copy
of my contributing helpers.
2024-01-11 11:28:44 +01:00
Marty Oehme cb3d8fd5d6
🐛 Remove deprecated woodpecker ci conditions
Tag condition (when: event: tag) filters are not generalized to `ref`
instead of the old `tag` key. This switches them to the new version.

See
https://woodpecker-ci.org/docs/usage/workflow-syntax#when---conditional-execution
2024-01-11 11:17:47 +01:00
Marty Oehme e14010eb53
🐛 Print user messages to stderr (#27)
ci/woodpecker/manual/woodpecker Pipeline was successful Details
Previously, any messages only intended for the user (status messages,
warnings, errors) were sent over stdout. The actual emoji items are also
sent to the pickers over stdout so they would sometimes pick up the
messages and show them as an option to pick. If history is enabled, we
then also save the falsely included items there to forever display as an
option.

This commit changes internal messages to all be sent over stderr
instead, so they should not be picked up by any external programs we
hand off to.
2024-01-11 10:58:11 +01:00
Marty Oehme 7b5b3e6e46
🦊 Migrate major woodpecker ci version
Migrated to newer woodpecker version requiring different pipeline
naming scheme, see https://woodpecker-ci.org/docs/migrations.
2024-01-11 09:25:23 +01:00
Laureηt b97c09828d
Add support for fuzzel desktop executor
ci/woodpecker/push/woodpecker Pipeline was successful Details
Fuzzel is a wayland-native picker which support dmenu-like picking based
on standard input.
---------

Co-authored-by: Marty Oehme <marty.oehme@gmail.com>
2023-11-28 10:53:31 +01:00
Jesse Cooke 74af60c3f7
Add support for ilia desktop executor
ci/woodpecker/push/woodpecker Pipeline was successful Details
Ilia is used by Regolith Linux (Ubuntu+i3/sway).

Ilia has a slightly different presentation and prompt setup than other
pickers, and it makes more sense to use the given GTK icon instead of
the emoji character since that is what it seems to support.

Nicely explained by @jc00ke here:
https://github.com/marty-oehme/bemoji/pull/21#discussion_r1306212419

With the growing amount of picker tools supported out of the box
it seems more practical to have them together in a simple list
that can grow and through which we can always iterate instead
of a cumbersome growing if-else chain.
This commit also refactors the pick tool selection to be stored in
a bash hash map instead.
2023-09-14 17:14:39 +02:00
Marty Oehme 011fcdefdd
📖 Update usage screenshot
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-08-26 14:58:45 +02:00
Marty Oehme d44cbf5b74
Add long-form option parsing
ci/woodpecker/push/woodpecker Pipeline was successful Details
So far we could only add single-letter (POSIX) options: `-e`, `-n` and
so forth. Since we will run out of alphabet at some point, this commit
introduces parsing of multi-letter long-form (gnu) options (plus any
modern application should really support it anyways):
`--echo`, `--noline`.

Additionally, we support supplying long-form options that supply a value
both in the spaced (`--hist-limit 0`) and the equals (`--hist-limit=0`)
forms. Short, long, spaced, equals can be mixed and matched between
freely.

Lastly, we retain the ability to concatenate short options as before
(`-ne` is valid, as is `-P0` for the respective options above).

This should cover all bases and does not complicate the code too much to
keep a coherent overview.

Changed several code samples in the documentation to make
use of short- or long-form options to point out
possibility.
2023-08-26 14:37:44 +02:00
Marty Oehme 6c037a5771
📖 Add reference to stable and git archlinux versions
ci/woodpecker/push/woodpecker Pipeline was successful Details
Since there is now both a -git version and a stable version in the
AUR we make a small note for both in the installation documentation.
2023-08-25 20:55:39 +02:00
Marty Oehme a8256100f9
🐛 Fix release automation naming scheme
Names for tags in this repo start with a `v` (e.g. `v0.3.1`) but the
release automation did not know about this and would create duplicate
tags without the preceding letter.
2023-08-25 20:47:14 +02:00
Marty Oehme e720343ffc
Add ability to download nerdfont symbols (#10)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Same as the other symbol download options, this one takes a list of all
nerdfont icons and wrangles them into shape to be usable with the emoji
picker. Can be used by invoking `bemoji -D nerd` or `bemoji -D all`.

Fixes #10.
2023-05-01 16:03:09 +02:00
Marty Oehme 54b72e583b
📖 Bump license copyright year
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-04-30 18:28:23 +02:00
Marty Oehme 0aaca26b0e
BREAKING: Add ability to limit recent emoji shown (#1)
Instead of `-P` being a flag for showing history it has become an option
whose argument is the number of history entries to show, `-P 4`.

To mimic the old behavior use `-P 0`.

Added some test coverage for history functionality.

Fixes #1.
2023-04-30 18:22:44 +02:00
Marty Oehme 6b39e5e05a
🐛 Create dist package contents at root directory 2023-04-12 11:22:00 +02:00
Marty Oehme 07de35e92f
📖 Fix riverwm usage instructions assuming variable
Usage instructions for mapping the picker in riverwm falsely assumed the
super key to already be mapped to a `$mod` variable. This commit fixes
it to replace mention of the variable with the key name itself.
2023-04-11 23:25:41 +02:00
Marty Oehme 941dd4aaea
📖 Change AUR instructions to fit multiple packages
ci/woodpecker/push/woodpecker Pipeline was successful Details
Generalized AUR package installation instructions slightly to take note
of the fact that there are multiple AUR packages available for bemoji.

Thanks to @thayne for packaging up the semver release version of bemoji
for the AUR!
2023-04-11 23:20:03 +02:00
Marty Oehme 56ae0f1bab
🐛 Pass through stdin to custom typing tool (#19)
Previously, stdin contents were consumed and then not passed through to
the typing tool. With this commit, they are correctly passed to any
custom tool's stdin.

Fixes #19.
2023-04-11 23:00:19 +02:00
Marty Oehme 71d5dc455d
🦊 Exit status 1 on cancelled selection (#20)
When making no selection, i.e. cancelling during the selection process
the program will return status code 1, whereas before it would carry the
same return code as when making an emoji selection.

Fixes #20.
2023-04-11 22:33:26 +02:00
Marty Oehme 32fc9f45dd
🦊 Update emoji url to latest version (#18)
Point url to grab emoji from to latest version of emoji list, which
should automatically point to upcoming versions as well.

Fixes #18.
2023-04-11 22:00:45 +02:00
Marty Oehme 59d436a944
🦊 BREAKING: Use new XDG Base specification for state (#5)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Switched the history from using the XDG_CACHE_HOME directory by default
to use XDG_STATE_HOME by default.

This makes sense since cache can (and should be prepared to) be wiped at
any moment and the program functionality should not be hindered by this.
Since we need to retain history through such wipes the newly introduced
state directory is the perfect match for keeping the history file in.

This does constitute a breaking change for existing histories which need
to be moved to the new directory if they made use of the old cache
directory.

Concurrent with this we are renaming `XDG_CACHE_LOCATION` environment
variable to `XDG_HISTORY_LOCATION` so this is a second breaking change
for those using a custom location for their histories.

This change attempts to make the naming scheme coherent and remove some
left-over naming cruft from the old location being the cache directory.

This provides one of the larger changes to the program so far.

Fixes #5.
2022-11-19 15:03:14 +01:00
Marty Oehme 4209b90669
📖 Bump version
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
2022-11-10 16:12:15 +01:00
Marty Oehme 7f5c3772e2
🦊 Change download option to work multiple times (#16)
Changed `-D` option to always download the lists supplied, regardless of
the database directory being empty or not.

This means you can download additional lists after the first program
run, or re-download lists later on. It *will* overwrite your custom
changes however if your files are called the same as the default list
names.

Additionally removed dependency on GNU version of cut and added some
simple tests for the download functionality.

Fixes #16.
2022-11-10 16:05:23 +01:00
Marty Oehme dc68887091
Add automated tagged releases
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
Using woodpecker ci most of the release process is now automated.
That means as soon as a new version tag (e.g. `v0.2.3`) is pushed the
release process is started and will (if versions have been bumped
correctly) set up a new release on Gitea and Github simultaneously.

The release process will fail if changelog and program versions
mismatch, or the version has not been bumped in general.

The release contains the executable and some documentation, including
the README as a manpage-formatted gzip file which can be included in the
correct directory to enable a simple manpage for the program.
2022-11-10 14:58:16 +01:00
Marty Oehme 16039fe676
📖 Add missing case insensitivity fix to CHANGELOG
Added reference to the fix for no case insensitivity when searching
through rofi added in ec90201 which was so far still missing in
changelog.
2022-10-12 16:50:40 +02:00
Yann Büchau d03068dba7
Add -n option to prevent newline after emoji (#12)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Adds another commandline option `-n` to the application which prevents
newlines from being added at the end of each output.
Disabled by default.

Co-authored-by: Marty Oehme <marty.oehme@gmail.com>
2022-09-27 21:01:44 +02:00
Yann Büchau ec9020150c
🐛 Let rofi match case insensitively as well (#14)
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-09-09 15:50:17 +02:00
Marty Oehme 1ad38107d4
📖 Update usage information displayed in README
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-08-06 13:12:38 +02:00
Marty Oehme c925810889
Add woodpecker ci testing 2022-08-06 13:12:34 +02:00
Marty Oehme 05f0e71b9f
📖 Update CHANGELOG and add explanation to usage help
Added quick note that commands can be used in combination and separated
commands from other options to better highlight them.
2022-08-06 11:48:58 +02:00
Marty Oehme a776c63748
🦊 Refactor command functions and variable names
Removed redundant 'redirection' functions which did nothing to change
code and only extended the pipe with an additional `cat` call.

Renamed bm_default_cmd to bm_cmds to reflect its nature as an array.
Since there is not just one command contained in the variable anymore,
it makes much more sense to now call it bm_cmds, note the plural.
2022-08-06 11:48:48 +02:00
Marty Oehme 7e8fc0c51a
Add ability to execute multiple command options
Can combine command options (-c, -t, -e) in any way to simultaneously
clip, type and/or echo the picked results.
Still defaults to clipping, as before.

If a custom default command is given with `BEMOJI_DEFAULT_CMD` env var,
then invoking bemoji without any command option will invoke this
command. Otherwise, the other commands are added to the default given
command.

Additionally, refactor echo command to mirror other commands
Both typing and clipping simply invoke the corresponding program
function while echo had an extra role so far. This adjusts the echo
command to also work the same way.
2022-08-06 11:46:06 +02:00
Marty Oehme 28aa2aa522
🧪 Add tests for clipping, echo and typing command
Added a simple test for each of the base command options: echo, type,
clip. It uses custom commands set through environment options so does
not yet test the actual default command logic (finding a typer,
clipper), that is still a TODO.

Also split tests into tests concerning commands of the program and tests
concerning the directory settings and options of the program, to avoid
ending up with a single test file spanning hundreds of lines.
2022-08-06 10:02:34 +02:00
Marty Oehme 7cec73e2db
📖 Bump version, add to changelog 2022-06-29 12:44:42 +02:00
Marty Oehme 2a17237a96
🧪 Add tests for XDG base directory adherence
Added simple tests for database and cache locations.

Moved test PATH setup to new file-level function which should slightly
speed up testing and makes more sense conceptually to set the bemoji
executable to be in the path once for all tests.
2022-06-29 12:44:42 +02:00
Marty Oehme ce17ae58f1
📖 Add simple Changelog 2022-06-29 12:44:42 +02:00
Marty Oehme 31550448f0
🦊 Add display for directory config to -v option
Added a quick way to see if directories have been set up correctly. This
also eases testing for future ways of setting directories through
environment variables or options.
2022-06-29 12:44:42 +02:00
Marty Oehme 0b255413d0
🦊 Simplify grep string for POSIX compatibility 2022-06-29 12:44:41 +02:00
Marty Oehme 75395d2bbd
🐛 Fix custom command invocation quoting 2022-06-29 12:44:41 +02:00
Marty Oehme b9708405fa
📖 Add testing instructions to readme 2022-06-29 12:44:41 +02:00
Marty Oehme 936f19bca6
🧪 Set up default emoji list for tests
Inject a tiny sample emoji list into each test so no download function
is engaged by default.
Add tests for version display.
2022-06-29 12:37:13 +02:00
Marty Oehme ceea79eb3a
🧪 Add simple test framework
Now that the project is finding a little adoption it is really high time
to bring some tests into the code to ensure everything works as it
should.
This first version will only provide a simple test harness from which
tests can slowly be written for other parts of the program.
2022-06-29 12:35:52 +02:00
Marty Oehme edd5ebd743
📖 Improve installation documentation
Switched sections for dependencies and installation around and created
better sub-headings.
Added section on installing packaged AUR version, thanks to @firegem for
packaging it!
Fixed some whitespace on line endings.

Closes #6.
2022-06-29 08:49:45 +02:00
Marty Oehme f791bf093c
📖 Document version and help options in cli help 2022-06-29 08:20:22 +02:00
Arkadiusz Wieczorek 3c2a8b9894
 Fix parameter order for xdotool
* Change parameter's order for xdotool
* Fix order parameters

Thanks to @arkadiusz-wieczorek for spotting and fixing the bug.
Fixes #3
2022-01-07 12:10:39 +01:00
Marty Oehme 8a31a36280
Add version option
You can now ask the program for its version with `bemoji -v`.
2021-12-01 22:31:27 +01:00
Marty Oehme afdfc53bfe
🦊 Remove useless cat 2021-12-01 22:16:46 +01:00
Marty Oehme 52bf358187
📃 Improve usage screen
Improved usage message to display all currently available default
download options.
2021-12-01 22:15:30 +01:00
Marty Oehme 08947772aa
🦊 Switch from sh to bash
Switched to bash to ensure compatibility with the arrays the code uses.
2021-12-01 22:12:31 +01:00