From a9706ec27edc0aef03f72daba28647aca1c42070 Mon Sep 17 00:00:00 2001 From: Juhani Krekelä Date: Sat, 24 Jul 2021 19:15:13 +0300 Subject: Add ability to specify additional URI handlers This commit adds a new section, open-with, to the configuration file. The options specified there will be added as "Open with …" menu items in the URI context menu. This is to make it easier to perform other actions on the URI than opening it in the system default browser; a user might for example add another browser, media player, or a script that preprocesses the URI before opening it. --- config.vala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'config.vala') diff --git a/config.vala b/config.vala index 0234aac..c0a084f 100644 --- a/config.vala +++ b/config.vala @@ -1,3 +1,8 @@ +struct OpenWithProgram { + string name; + string[] command; +} + class Config { public bool autohide_mouse; @@ -18,6 +23,8 @@ class Config { public Gdk.RGBA[] palette = new Gdk.RGBA[16]; + public OpenWithProgram[] open_with_programs; + struct PaletteEntry { string name; string normal; @@ -65,6 +72,8 @@ class Config { palette[i + 8] = reader.read_colour("colours", "bright." + entry.name, entry.bright); } + open_with_programs = reader.read_open_with({}); + reader.log_unknown_keys(); } -- cgit v1.2.3-2-gb3c3