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. --- weltschmerz.1 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'weltschmerz.1') diff --git a/weltschmerz.1 b/weltschmerz.1 index 77a67df..6b64184 100644 --- a/weltschmerz.1 +++ b/weltschmerz.1 @@ -1,4 +1,4 @@ -.Dd July 12, 2021 +.Dd July 24, 2021 .Dt WELTSCHMERZ 1 .Os .Sh NAME @@ -88,6 +88,9 @@ font = Iosevka Light 16 [colours] foreground = #000000 background = #ffffff + +[open-with] +mpv = mpv % .Ed .Pp Refer to the GLib documentation for detailed information on this format. @@ -254,6 +257,21 @@ selection.background/reverse video bold/inherit colour .TE .Ed +.Pp +The options in the +.Em open-with +section define programs that can be invoked from the URI context menu. +The option name determines the name of the program as displayed in the +menu, and the value the command to be executed. +.Pp +.Nm +handles quotes in the command following POSIX +.Xr sh 1 +rules, +but does not do wildcard or variable expansion. +Any +.Dq % +is replaced with the URI when executing the command. .Sh FILES .Bl -tag -width Ds .It Em $XDG_CONFIG_HOME/weltschmerz/config -- cgit v1.2.3-2-gb3c3