Giter VIP home page Giter VIP logo

Comments (8)

mrichar1 avatar mrichar1 commented on July 23, 2024

Hi - sorry for the delay in looking at this!

I've added an ignore_patterns option - if this is enabled, then regular expression patterns will be read from data_dir/ignore_patterns (usually .local/share/clipster/ignore_patterns) one-per-line.

So for example:

politic
^cat(s)?$

Will ignore all selections containing the string politic and cat or cats (but not catches or scat).

Let me know if this is enough to solve your issue, or if you encounter any problems with this change. Thanks!

from clipster.

fdw avatar fdw commented on July 23, 2024

Hi @mrichar1,
I haven't tested it yet, but it looks perfect! Thank you very much! 😊

Do you think it would be a good idea to make the path/filename of the ignore-file configurable? You could even fold that into the ignore_patterns option - if ignore_patterns_from is set, load the patterns from the option's parameter. If it is not set, no patterns are ignored.

from clipster.

mrichar1 avatar mrichar1 commented on July 23, 2024

clipster follows the Freedesktop XDG specifications: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Thus the history, patterns (for extract_patterns) and now ignore_patterns files are all stored in either $XDG_DATA_HOME/clipster (or ~/.local/share/clipster if this is unset).

So you can override the data directory by setting the $XDG_DATA_HOME environment variable when launching the clipster daemon to provide a different directory for these files.

I'd probably only consider changing how this works if there was a good reason to split the locations for the pattern and history files.

from clipster.

fdw avatar fdw commented on July 23, 2024

This was exactly my reason for asking: In my opinion, these patterns should be in $XDG_CONFIG_HOME (seeing as they're config files) rather than $XDG_DATA_HOME. However, I can live with both 😊

from clipster.

mrichar1 avatar mrichar1 commented on July 23, 2024

You're right actually - I'm not sure why they're in $XDG_DATA_HOME when they're config, unlike history socket pid etc which are created by the daemon.

I'll open a new issue for this. Thanks!

from clipster.

mrichar1 avatar mrichar1 commented on July 23, 2024

Following on from #65 - in refactoring conf_dir I decided after all to add *_file config options for extract_patterns and ignore_patterns (with sensible defaults) to match history, socket etc. I decided to keep the enabling and file paths options separate, to make setting defaults and toggling state easier without having to remove files etc. The default paths are now under conf_dir which in turn inherits from$XDG_CONFIG_HOME, as you correctly pointed out.

Let me know whether this refactored version solves your original issue, and lets you override the config as requested (comments here or in #65 as appropriate). Thanks!

from clipster.

fdw avatar fdw commented on July 23, 2024

Thank you so much, it works perfectly!

I now have the ignore_patterns file in .config/clipster, so I couldn't be happier. :)

from clipster.

mrichar1 avatar mrichar1 commented on July 23, 2024

Thanks for the suggestions and for testing!

from clipster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.