Comments (8)
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.
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.
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.
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.
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.
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.
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.
Thanks for the suggestions and for testing!
from clipster.
Related Issues (20)
- Clipster crashes when deleting multiple entries quickly from selection window HOT 2
- Clipster doesn't capture when using `Gtk.Clipboard`'s `set_text` to copy (in Python) HOT 1
- Packaging up a 2.0.2 release HOT 3
- --daemon doesn't make clipster run in background HOT 2
- sync_selections + pattern_as_selection = infinite loop HOT 1
- Clear clipboard after a configurable period of time HOT 1
- enable option -N for input HOT 1
- CLI output problems
- Feature request(s): unidirectional sync, sync without history HOT 4
- deprecation warnings when running the deamon HOT 2
- Clipboard is not replaced when selecting item from history HOT 4
- disable middle mouse button as paste HOT 2
- Gtk-WARNING: Theme parsing error HOT 1
- Question: Any plans on python3 ? HOT 1
- [Errno 2] No such file or directory: '/run/user/0/clipster.pid' HOT 1
- warnings HOT 2
- Infinite loop on re.findall HOT 4
- No Encoding Declared with Python2
- the config file does not work HOT 4
- Empty history JSON file crashes clipster HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clipster.