default to only CLIPBOARD

correctly handling PRIMARY selection needs deprecated quirks, so let's
keep it second class
This commit is contained in:
boyska 2022-01-25 12:12:20 +01:00
parent a10aeceab4
commit bd29861999

View file

@ -203,9 +203,10 @@ class Daemon(object):
# Block at start to prevent repeated triggering
board.handler_block(event_id)
display = self.window.get_display()
while Gdk.ModifierType.BUTTON1_MASK & display.get_pointer().mask:
# Do nothing while mouse button is held down (selection drag)
pass
if selection == "PRIMARY":
while Gdk.ModifierType.BUTTON1_MASK & display.get_pointer().mask:
# Do nothing while mouse button is held down (selection drag)
pass
# Try to get text from clipboard
text = board.wait_for_text()
if text:
@ -255,29 +256,26 @@ def parse_config(args, data_dir, conf_dir):
# Set some config defaults
config_defaults = {
"data_dir": data_dir, # calippo 'root' dir (see history/socket config)
"conf_dir": conf_dir, # calippo config dir (see pattern/ignore_pattern file config). Can be overridden using -f cmd-line arg.
"default_selection": "PRIMARY", # PRIMARY or CLIPBOARD
"active_selections": "PRIMARY,CLIPBOARD", # Comma-separated list of selections to monitor/save
"pid_file": "/run/user/{}/calippo.pid".format(os.getuid()),
"max_input": "50000", # max length of selection input
"pattern_as_selection": "no", # Extracted pattern should replace current selection.
} # Comma-separated list of WM_CLASS to identify apps from which to not ignore owner-change events
"data_dir": data_dir, # calippo 'root' dir (see history/socket config)
"conf_dir": conf_dir, # calippo config dir (see pattern/ignore_pattern file config). Can be overridden using -f cmd-line arg.
# change this to PRIMARY,CLIPBOARD to activate both
"active_selections": "CLIPBOARD", # Comma-separated list of selections to monitor/save
"pid_file": "/run/user/{}/calippo.pid".format(os.getuid()),
}
config = SafeConfigParser(config_defaults)
config.add_section('calippo')
config.add_section("calippo")
# Try to read config file (either passed in, or default value)
if args.config:
config.set('calippo', 'conf_dir', args.config)
conf_file = os.path.join(config.get('calippo', 'conf_dir'), 'calippo.ini')
config.set("calippo", "conf_dir", args.config)
conf_file = os.path.join(config.get("calippo", "conf_dir"), "calippo.ini")
logging.debug("Trying to read config file: %s", conf_file)
result = config.read(conf_file)
if not result:
logging.debug("Unable to read config file: %s", conf_file)
logging.debug("Merged config: %s",
sorted(dict(config.items('calippo')).items()))
logging.debug("Merged config: %s", sorted(dict(config.items("calippo")).items()))
return config