From davidnebauer at hotkey.net.au Sat Jan 5 07:38:23 2019 From: davidnebauer at hotkey.net.au (David Nebauer) Date: Sat, 05 Jan 2019 16:08:23 +0930 Subject: [qutebrowser] Per-domain editor.command, or equivalent Message-ID: <1546668745.scj5tav10w.astroid@hezmana.none> I use gvim as external editor and want to be able to set a particular filetype when it is launched from a specific domain. One way to "communicate" this from qutebrowser to gvim is that when launching from the specific domain, editor.command would include a "set filetype" command. In case it matters, the specifics are that TiddlyWiki on my system uses http://localhost:10744 as its domain. The file opened by gvim has no extension and no content, so gvim cannot infer the file type by its usual means. This is why, when launching from that domain, I want gvim to set the filetype to 'tiddlywiki'. When I attempted to set a per-domain editor.command in config.py and source it, I received an error that editor.command does not support URL patterns. Another option would be to embed the domain URL in editor.command in such a way that it is transferred to gvim, e.g., by using a vim option to set an internal vim variable with the URL. It appears, however, that the domain URL is not a parameter available to editor.command. All of which leaves me stuck. I'm hoping some knowledgeable members of this list may have some suggestions. Regards, David From jaygkamat at gmail.com Sat Jan 5 23:50:08 2019 From: jaygkamat at gmail.com (Jay Kamat) Date: Sat, 05 Jan 2019 14:50:08 -0800 Subject: [qutebrowser] Per-domain editor.command, or equivalent In-Reply-To: <1546668745.scj5tav10w.astroid@hezmana.none> References: <1546668745.scj5tav10w.astroid@hezmana.none> Message-ID: <871s5qd8in.fsf@eve> David Nebauer writes: > When I attempted to set a per-domain editor.command in config.py and > source it, I received an error that editor.command does not support URL > patterns. I already said this in the issue you posted, but I think the cleanest solution for this is to add url pattern support to editor.command directly. The change should be fairly trivial, with the hardest part getting the URL to match against. Here's a similar PR: https://github.com/qutebrowser/qutebrowser/pull/4046/files The place where the editor is spawned is here: https://github.com/qutebrowser/qutebrowser/blob/0cf92862bbf583b661d9b04e6671bc3c6183f5ef/qutebrowser/misc/editor.py#L181 In order to get the URL to match against, one way you could pass it in is through the top level command, like this line: https://github.com/qutebrowser/qutebrowser/blob/0cf92862bbf583b661d9b04e6671bc3c6183f5ef/qutebrowser/browser/commands.py#L635 -Jay From davidnebauer at hotkey.net.au Sun Jan 6 05:06:21 2019 From: davidnebauer at hotkey.net.au (David Nebauer) Date: Sun, 06 Jan 2019 13:36:21 +0930 Subject: [qutebrowser] Per-domain editor.command, or equivalent In-Reply-To: <871s5qd8in.fsf@eve> References: <1546668745.scj5tav10w.astroid@hezmana.none> <871s5qd8in.fsf@eve> Message-ID: <1546747083.kvast079cc.astroid@hezmana.none> Excerpts from Jay Kamat's message of January 6, 2019 8:20 am: > > I already said this in the issue you posted, but I think the cleanest > solution for this is to add url pattern support to editor.command directly. I wholeheartedly agree. As I posted in the issue, I have been able to come up with a workaround bound to another key, but it is an unholy kludge. I understand that per-domain editor commands may not be a common need, but surely I'm not the only one with a legitimate use case for it. Thanks for your advice on this. -David From me at the-compiler.org Sun Jan 6 07:48:15 2019 From: me at the-compiler.org (Florian Bruhin) Date: Sun, 6 Jan 2019 07:48:15 +0100 Subject: [qutebrowser] Per-domain editor.command, or equivalent In-Reply-To: <1546747083.kvast079cc.astroid@hezmana.none> References: <1546668745.scj5tav10w.astroid@hezmana.none> <871s5qd8in.fsf@eve> <1546747083.kvast079cc.astroid@hezmana.none> Message-ID: <20190106064815.dxnmoyr4yj62yblk@hooch.localdomain> On Sun, Jan 06, 2019 at 01:36:21PM +0930, David Nebauer wrote: > Excerpts from Jay Kamat's message of January 6, 2019 8:20 am: > > > > I already said this in the issue you posted, but I think the cleanest > > solution for this is to add url pattern support to editor.command directly. > > I wholeheartedly agree. As I posted in the issue, I have been able to > come up with a workaround bound to another key, but it is an unholy > kludge. I understand that per-domain editor commands may not be a common > need, but surely I'm not the only one with a legitimate use case for it. I'm not sure actually. Is there other use-cases you can think of apart from setting the file type? If it's only for that, I'd strongly prefer a (per-domain) setting to set the filename extension for the file getting opened: https://github.com/qutebrowser/qutebrowser/issues/2727 Because then that'd work for any editor, not just vim. Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From davidnebauer at hotkey.net.au Sun Jan 6 08:34:02 2019 From: davidnebauer at hotkey.net.au (David Nebauer) Date: Sun, 06 Jan 2019 17:04:02 +0930 Subject: [qutebrowser] Per-domain editor.command, or equivalent In-Reply-To: <20190106064815.dxnmoyr4yj62yblk@hooch.localdomain> References: <1546668745.scj5tav10w.astroid@hezmana.none> <871s5qd8in.fsf@eve> <1546747083.kvast079cc.astroid@hezmana.none> <20190106064815.dxnmoyr4yj62yblk@hooch.localdomain> Message-ID: <1546759522.5f6bvu6kk6.astroid@hezmana.none> Excerpts from Florian Bruhin's message of January 6, 2019 4:18 pm: > I'm not sure actually. Is there other use-cases you can think of apart > from setting the file type? I personally can't. But then, it's not something I've devoted a lot of thought to. It does seem to me there is more customisation possible with this setting compared to per-domain setting of the file extension. I cannot say, though, whether that translates into any real world applications. > If it's only for that, I'd strongly prefer a (per-domain) setting to set > the filename extension for the file getting opened: > https://github.com/qutebrowser/qutebrowser/issues/2727 > > Because then that'd work for any editor, not just vim. This would also completely address my use case. I vote for whichever is more likely to be implemented first :) -David From mochan at icf.unam.mx Thu Jan 17 00:34:46 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Wed, 16 Jan 2019 17:34:46 -0600 Subject: [qutebrowser] printing Message-ID: <20190116233446.GA2799@yapaque.fis.unam.mx> I tried printing a webpage as a pdf file from qutebrowser. I obtained an error 'Printing failed!' in the bottom line of the browser, and a message 17:32:10 WARNING: Failure to generate QImage from invalid or empty PDF document. 17:32:10 ERROR: Printing failed! in the terminal. Any idea of what can be wrong? I'm using the debian/testing package. Regards and thanks, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From me at the-compiler.org Thu Jan 17 08:43:59 2019 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 17 Jan 2019 08:43:59 +0100 Subject: [qutebrowser] printing In-Reply-To: <20190116233446.GA2799@yapaque.fis.unam.mx> References: <20190116233446.GA2799@yapaque.fis.unam.mx> Message-ID: <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> Hi, On Wed, Jan 16, 2019 at 05:34:46PM -0600, Luis Mochan wrote: > I tried printing a webpage as a pdf file from qutebrowser. > I obtained an error 'Printing failed!' in the bottom line of the > browser, and a message > 17:32:10 WARNING: Failure to generate QImage from invalid or empty PDF document. > 17:32:10 ERROR: Printing failed! > in the terminal. Any idea of what can be wrong? > I'm using the debian/testing package. I've seen your :report, but haven't had time to take a look yet. What page is this on? Can you reproduce it? Does using ":print --pdf filename.pdf" instead work? Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From mochan at icf.unam.mx Thu Jan 17 14:45:16 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Thu, 17 Jan 2019 07:45:16 -0600 Subject: [qutebrowser] printing In-Reply-To: <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> Message-ID: <20190117134516.GD2799@yapaque.fis.unam.mx> Hi Florian, I can reproduce this failure in all pages I have tried to print, even in the start duckduckgo page. Nevertheless, using :print --pdf filename.pdf did print correctly! So that solves my immediate problem. I tried to use the bare ':print' to send output to a real printer and I get the same error messages ... WARNING: Failure to generate QImage from invalid or empty PDF document. ... ERROR: Printing failed! Thanks and regards, Luis On Thu, Jan 17, 2019 at 08:43:59AM +0100, Florian Bruhin wrote: > Hi, > > On Wed, Jan 16, 2019 at 05:34:46PM -0600, Luis Mochan wrote: > > I tried printing a webpage as a pdf file from qutebrowser. > > I obtained an error 'Printing failed!' in the bottom line of the > > browser, and a message > > 17:32:10 WARNING: Failure to generate QImage from invalid or empty PDF document. > > 17:32:10 ERROR: Printing failed! > > in the terminal. Any idea of what can be wrong? > > I'm using the debian/testing package. > > I've seen your :report, but haven't had time to take a look yet. > What page is this on? Can you reproduce it? Does using > ":print --pdf filename.pdf" instead work? > > Florian > > -- > https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) > GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc > I love long mails! | https://email.is-not-s.ms/ -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From me at the-compiler.org Thu Jan 17 15:14:07 2019 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 17 Jan 2019 15:14:07 +0100 Subject: [qutebrowser] printing In-Reply-To: <20190117134516.GD2799@yapaque.fis.unam.mx> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> Message-ID: <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> Hey Luis, On Thu, Jan 17, 2019 at 07:45:16AM -0600, Luis Mochan wrote: > I can reproduce this failure in all pages I have tried to print, even > in the start duckduckgo page. Nevertheless, using > > :print --pdf filename.pdf > > did print correctly! So that solves my immediate problem. I tried to > use the bare ':print' to send output to a real printer and I get the > same error messages > ... WARNING: Failure to generate QImage from invalid or empty PDF document. > ... ERROR: Printing failed! Odd. Probably some issue with your QtWebEngine or printer driver or something. Can you check whether the same happens when trying to print in KDE Falkon? https://packages.debian.org/buster/falkon Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From mochan at icf.unam.mx Thu Jan 17 16:12:20 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Thu, 17 Jan 2019 09:12:20 -0600 Subject: [qutebrowser] printing In-Reply-To: <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> Message-ID: <20190117151220.GF2799@yapaque.fis.unam.mx> > ...Odd. Probably some issue with your QtWebEngine or printer driver or > something. > > Can you check whether the same happens when trying to print in KDE > Falkon? https://packages.debian.org/buster/falkon > When I print with falkon I see the same menu as in qutebrowser and printing is succesful. Just in case, I tried qutebrowser again after installing falkon and it still fails to print :( -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From mochan at icf.unam.mx Fri Jan 18 20:57:39 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Fri, 18 Jan 2019 13:57:39 -0600 Subject: [qutebrowser] editor In-Reply-To: <20190117151220.GF2799@yapaque.fis.unam.mx> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> <20190117151220.GF2799@yapaque.fis.unam.mx> Message-ID: <20190118195739.GM2799@yapaque.fis.unam.mx> While trying to test the use of an external editor, I tried commands such as :edit-url. I got errors such as Error while spawning editor: The process failed to start. I tried using different editors (visual or text based) running qutebrowser as EDITOR=/usr/bin/emacs qutebrowser or VISUAL=/usr/bin/emacs qutebrowser using other editors beyond emacs and the result was the same error. I did check using a command such as :debug-pyeval os.environ["VISUAL"] that the VISUAL, EDITOR and PATH environment variables were correctly set and visible from qutebrowser. My editors run correctly from the terminal. I can also run :spawn emacs and the editor is correctly started. Any idea what can be wrong? I'm running under debian/testing using xfce. Best regards, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From jaygkamat at gmail.com Mon Jan 21 08:50:01 2019 From: jaygkamat at gmail.com (Jay Kamat) Date: Sun, 20 Jan 2019 23:50:01 -0800 Subject: [qutebrowser] editor In-Reply-To: <20190118195739.GM2799@yapaque.fis.unam.mx> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> <20190117151220.GF2799@yapaque.fis.unam.mx> <20190118195739.GM2799@yapaque.fis.unam.mx> Message-ID: <87fttme9g6.fsf@eve> Hi Luis, Luis Mochan writes: > I tried using different editors (visual or text based) running qutebrowser as > > EDITOR=/usr/bin/emacs qutebrowser > > or > > VISUAL=/usr/bin/emacs qutebrowser qutebrowser launches the editor defined in editor.command , can you try configuring that instead? -Jay From mochan at icf.unam.mx Mon Jan 21 15:11:00 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Mon, 21 Jan 2019 08:11:00 -0600 Subject: [qutebrowser] editor In-Reply-To: <87fttme9g6.fsf@eve> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> <20190117151220.GF2799@yapaque.fis.unam.mx> <20190118195739.GM2799@yapaque.fis.unam.mx> <87fttme9g6.fsf@eve> Message-ID: <20190121141100.GU2799@yapaque.fis.unam.mx> Thanks Jay! Sorry for the confusion. I have now tried to configure 'editor' by either writing and editor script in my ~/bin directory (which is in my $PATH) or by running update-alternatives to make a system wide change. I tried nano (the default, terminal oriented) and emacs (x-windows oriented) and got the same Error while spawning editor: The process failed to start. :( Is there a way to find out why? Could this be related to my previous problem (failure to print)? Thanks and regards, Luis On Sun, Jan 20, 2019 at 11:50:01PM -0800, Jay Kamat wrote: > > Hi Luis, > > Luis Mochan writes: > > > I tried using different editors (visual or text based) running qutebrowser as > > > > EDITOR=/usr/bin/emacs qutebrowser > > > > or > > > > VISUAL=/usr/bin/emacs qutebrowser > > qutebrowser launches the editor defined in editor.command , can you try > configuring that instead? > > -Jay > -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From jaygkamat at gmail.com Mon Jan 21 19:13:16 2019 From: jaygkamat at gmail.com (Jay Kamat) Date: Mon, 21 Jan 2019 10:13:16 -0800 Subject: [qutebrowser] editor In-Reply-To: <20190121141100.GU2799@yapaque.fis.unam.mx> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> <20190117151220.GF2799@yapaque.fis.unam.mx> <20190118195739.GM2799@yapaque.fis.unam.mx> <87fttme9g6.fsf@eve> <20190121141100.GU2799@yapaque.fis.unam.mx> Message-ID: <87ef95ev5v.fsf@eve> Luis Mochan writes: > Thanks Jay! > Sorry for the confusion. > I have now tried to configure 'editor' by either writing and editor script > in my ~/bin directory (which is in my $PATH) or by running > update-alternatives to make a system wide change. I tried nano (the > default, terminal oriented) and emacs (x-windows oriented) and got the > same > Error while spawning editor: The process failed to start. Have you tried configuring the editor.command setting yet? It's not clear if you tried that or not. > :( > Is there a way to find out why? > Could this be related to my previous problem (failure to print)? > Thanks and regards, > Luis If you run ':messages debug', you should get a detailed log of what's going on. Probably, it's trying to launch with the default 'gvim' command, and you don't have gvim installed. From mochan at icf.unam.mx Mon Jan 21 21:35:50 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Mon, 21 Jan 2019 14:35:50 -0600 Subject: [qutebrowser] editor In-Reply-To: <87ef95ev5v.fsf@eve> References: <20190116233446.GA2799@yapaque.fis.unam.mx> <20190117074359.3rjdv4zfxyzgshz7@hooch.localdomain> <20190117134516.GD2799@yapaque.fis.unam.mx> <20190117141407.rgvqkae2jq5zn2ig@hooch.localdomain> <20190117151220.GF2799@yapaque.fis.unam.mx> <20190118195739.GM2799@yapaque.fis.unam.mx> <87fttme9g6.fsf@eve> <20190121141100.GU2799@yapaque.fis.unam.mx> <87ef95ev5v.fsf@eve> Message-ID: <20190121203550.GV2799@yapaque.fis.unam.mx> Thank you again! I misunderstood you. I thought you said I should configure the 'editor' command, which I did. Finally, I understood you meant I should configure the 'editor.command' configuration variable. I set editor.command to ["emacsclient", "+{line}:{column}", "{file}"] and it is working very nicely. Thanks for the help and the patience. Best regards, Luis On Mon, Jan 21, 2019 at 10:13:16AM -0800, Jay Kamat wrote: > > Luis Mochan writes: > > > Thanks Jay! > > ... > > Have you tried configuring the editor.command setting yet? It's not clear if > you tried that or not. > > > :( > > Is there a way to find out why? > > Could this be related to my previous problem (failure to print)? > > Thanks and regards, > > Luis > > If you run ':messages debug', you should get a detailed log of what's going > on. Probably, it's trying to launch with the default 'gvim' command, and you > don't have gvim installed. > -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From mochan at icf.unam.mx Tue Jan 22 02:09:06 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Mon, 21 Jan 2019 19:09:06 -0600 Subject: [qutebrowser] new protocols Message-ID: <20190122010906.GX2799@yapaque.fis.unam.mx> Which is the recommended way to add new protocols to qutebrowser. I would like, for example, to open https://doi.org/.../... when I try to open an academic article, given its digital object identifier in the form doi:.../... I would like the protocol (doi) to be recognized and the simple translation (substitution of doi: by https:://doi.org/) to be done automatically. I did this in conkeror through its set_protocol_handler function. Best regards, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From bzk0711 at aol.com Tue Jan 22 13:07:47 2019 From: bzk0711 at aol.com (Patric Schmitz) Date: Tue, 22 Jan 2019 13:07:47 +0100 Subject: [qutebrowser] new protocols In-Reply-To: <20190122010906.GX2799@yapaque.fis.unam.mx> References: <20190122010906.GX2799@yapaque.fis.unam.mx> Message-ID: Hi, could it be sufficient to define a search engine for this? So create an entry in c.url.searchengines in your config.py like 'doi': 'https://doi.org/{}', which will allow you to just write doi ... in the address line? It won't be possible to click URL links of the form you mentioned, but maybe that's enough for your usecase? Best, Patric On 1/22/19 2:09 AM, Luis Mochan wrote: > Which is the recommended way to add new protocols to qutebrowser. I > would like, for example, to open > https://doi.org/.../... > when I try to open an academic article, given its digital object > identifier in the form > doi:.../... > I would like the protocol (doi) to be recognized and the simple > translation (substitution of doi: by https:://doi.org/) to be done > automatically. I did this in conkeror through its set_protocol_handler > function. > > Best regards, > Luis > From mochan at icf.unam.mx Tue Jan 22 22:54:26 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Tue, 22 Jan 2019 15:54:26 -0600 Subject: [qutebrowser] new protocols In-Reply-To: References: <20190122010906.GX2799@yapaque.fis.unam.mx> Message-ID: <20190122215426.GZ2799@yapaque.fis.unam.mx> Hi Patric, On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via qutebrowser wrote: > ... > could it be sufficient to define a search engine for this? So create an > entry in c.url.searchengines in your config.py like > > 'doi': 'https://doi.org/{}', > > which will allow you to just write > > doi ... > > in the address line? It won't be possible to click URL links of the form you > mentioned, but maybe that's enough for your usecase? Yes, indeed. Thanks! Regards, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From mochan at icf.unam.mx Wed Jan 23 03:46:33 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Tue, 22 Jan 2019 20:46:33 -0600 Subject: [qutebrowser] new protocols In-Reply-To: <20190122215426.GZ2799@yapaque.fis.unam.mx> References: <20190122010906.GX2799@yapaque.fis.unam.mx> <20190122215426.GZ2799@yapaque.fis.unam.mx> Message-ID: <20190123024633.GA2799@yapaque.fis.unam.mx> Another question, I found out about the userscripts in qutebrowser. I guess they could also be used, as well as the solution below, for translating from a doi number to an access into the doi webpage and the actual article. What would be the advantages/disadvantages of a userscript solution as compared to the c.url.searchengines one? Regards, Luis On Tue, Jan 22, 2019 at 03:54:26PM -0600, Luis Mochan wrote: > Hi Patric, > > On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via qutebrowser wrote: > > ... > > could it be sufficient to define a search engine for this? So create an > > entry in c.url.searchengines in your config.py like > > > > 'doi': 'https://doi.org/{}', > > > > which will allow you to just write > > > > doi ... > > > > in the address line? It won't be possible to click URL links of the form you > > mentioned, but maybe that's enough for your usecase? > > Yes, indeed. Thanks! > > Regards, > Luis > > -- > > o > W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Apdo. Postal 48-3, 62251 | (*)/\/ \ > Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From mochan at icf.unam.mx Wed Jan 23 04:00:57 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Tue, 22 Jan 2019 21:00:57 -0600 Subject: [qutebrowser] user agent Message-ID: <20190123030057.GB2799@yapaque.fis.unam.mx> I am enjoying using qutebrowser and I'm trying to migrate mi conkeror configuration to it. There are some webpages that insist on forcing the user to employ a given browser and they don't recognize qutebrowser nor conkeror (I just found whatsapp web refuses to work with qutebrowser). In conkeror one can overcome those problems sometimes using two functions, user_agent_policy.define_policy and user_agent_firefox() (or similar functions for other browsers) with which one can configure the browser to make the webpage believe that it is actually another browser. Is there a similar functionality in qutebrowser? Regards, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From mochan at icf.unam.mx Wed Jan 23 04:16:46 2019 From: mochan at icf.unam.mx (Luis Mochan) Date: Tue, 22 Jan 2019 21:16:46 -0600 Subject: [qutebrowser] user agent In-Reply-To: <20190123030057.GB2799@yapaque.fis.unam.mx> References: <20190123030057.GB2799@yapaque.fis.unam.mx> Message-ID: <20190123031646.GC2799@yapaque.fis.unam.mx> On Tue, Jan 22, 2019 at 09:00:57PM -0600, Luis Mochan wrote: > ... > with qutebrowser). In conkeror one can overcome those problems > sometimes using two functions, user_agent_policy.define_policy and > user_agent_firefox() (or similar functions for other browsers) with Found it! I can configure content.headers.user_agent. Sorry for the noise. Regards, Luis -- o W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB From rcore at fastmail.fm Wed Jan 23 17:04:30 2019 From: rcore at fastmail.fm (Ryan) Date: Wed, 23 Jan 2019 11:04:30 -0500 Subject: [qutebrowser] new protocols In-Reply-To: <20190123024633.GA2799@yapaque.fis.unam.mx> References: <20190122010906.GX2799@yapaque.fis.unam.mx> <20190122215426.GZ2799@yapaque.fis.unam.mx> <20190123024633.GA2799@yapaque.fis.unam.mx> Message-ID: <31D3A3BF-F294-4144-A16C-7B3CA6291D94@fastmail.fm> A searchengine is essentially a string substitution. A userscript is a full-fledged executable with infinite possibilities. These infinite possibilities include infinite possible bugs and security risks :) If a searchengine works for your use case, keep it simple and stick with that. Userscripts are useful for advanced processing or integration with external tools, like a password manager. You might glance at some if the scripts included in qutebrowser if you're curious. -Ryan On January 22, 2019 9:46:33 PM EST, Luis Mochan wrote: >Another question, >I found out about the userscripts in qutebrowser. I guess they could >also be used, as well as the solution below, for translating from a >doi number to an access into the doi webpage and the actual article. >What would be the advantages/disadvantages of a userscript solution as >compared to the c.url.searchengines one? >Regards, >Luis > > >On Tue, Jan 22, 2019 at 03:54:26PM -0600, Luis Mochan wrote: >> Hi Patric, >> >> On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via >qutebrowser wrote: >> > ... >> > could it be sufficient to define a search engine for this? So >create an >> > entry in c.url.searchengines in your config.py like >> > >> > 'doi': 'https://doi.org/{}', >> > >> > which will allow you to just write >> > >> > doi ... >> > >> > in the address line? It won't be possible to click URL links of the >form you >> > mentioned, but maybe that's enough for your usecase? >> >> Yes, indeed. Thanks! >> >> Regards, >> Luis >> >> -- >> >> o >> W. Luis Moch?n, | tel:(52)(777)329-1734 >/<(*) >> Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ > /\ >> Apdo. Postal 48-3, 62251 | >(*)/\/ \ >> Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ >> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB >> >> > >-- > > o >W. Luis Moch?n, | tel:(52)(777)329-1734 /<(*) >Instituto de Ciencias F?sicas, UNAM | fax:(52)(777)317-5388 `>/ >/\ >Apdo. Postal 48-3, 62251 | (*)/\/ > \ >Cuernavaca, Morelos, M?xico | mochan at fis.unam.mx /\_/\__/ >GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: