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,6 +203,7 @@ class Daemon(object):
# Block at start to prevent repeated triggering # Block at start to prevent repeated triggering
board.handler_block(event_id) board.handler_block(event_id)
display = self.window.get_display() display = self.window.get_display()
if selection == "PRIMARY":
while Gdk.ModifierType.BUTTON1_MASK & display.get_pointer().mask: while Gdk.ModifierType.BUTTON1_MASK & display.get_pointer().mask:
# Do nothing while mouse button is held down (selection drag) # Do nothing while mouse button is held down (selection drag)
pass pass
@ -257,27 +258,24 @@ def parse_config(args, data_dir, conf_dir):
config_defaults = { config_defaults = {
"data_dir": data_dir, # calippo 'root' dir (see history/socket config) "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. "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 # change this to PRIMARY,CLIPBOARD to activate both
"active_selections": "PRIMARY,CLIPBOARD", # Comma-separated list of selections to monitor/save "active_selections": "CLIPBOARD", # Comma-separated list of selections to monitor/save
"pid_file": "/run/user/{}/calippo.pid".format(os.getuid()), "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
config = SafeConfigParser(config_defaults) config = SafeConfigParser(config_defaults)
config.add_section('calippo') config.add_section("calippo")
# Try to read config file (either passed in, or default value) # Try to read config file (either passed in, or default value)
if args.config: if args.config:
config.set('calippo', 'conf_dir', args.config) config.set("calippo", "conf_dir", args.config)
conf_file = os.path.join(config.get('calippo', 'conf_dir'), 'calippo.ini') conf_file = os.path.join(config.get("calippo", "conf_dir"), "calippo.ini")
logging.debug("Trying to read config file: %s", conf_file) logging.debug("Trying to read config file: %s", conf_file)
result = config.read(conf_file) result = config.read(conf_file)
if not result: if not result:
logging.debug("Unable to read config file: %s", conf_file) logging.debug("Unable to read config file: %s", conf_file)
logging.debug("Merged config: %s", logging.debug("Merged config: %s", sorted(dict(config.items("calippo")).items()))
sorted(dict(config.items('calippo')).items()))
return config return config