about summary refs log tree commit diff stats
path: root/bonus
Commit message (Collapse)AuthorAgeFilesLines
* Update docs, w3m.tomlbptato2024-12-091-0/+1
|
* git.cgi: misc improvementsbptato2024-11-271-3/+5
|
* urlenc: strip a trailing newline from input, etcbptato2024-11-011-1/+1
| | | | | | | | | * make it so 'echo "$var\n" | urlenc' works as expected * add special query encode set * set default encode set to form data * document encode sets in help message also, remove a redundant percentEncode implementation from gopher2html
* config: refactor, accept more possible config dirsbptato2024-10-283-13/+5
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* Add `nc' tool & adjust finger/spartan to use itbptato2024-10-121-13/+15
| | | | | | | | | Simple netcat clone, useful for portable scripts. Especially because some netcats will close the connection as soon as I close stdin... this one only quits when either stdout or the socket refuses new data. Also, it uses our standard TCP connection routine, meaning it respects ALL_PROXY. (i.e. now spartan works with socks5 too)
* resize: use srgbbptato2024-10-091-2/+2
| | | | | | | | since that's our input color space (Actually, mainstream browsers seem to use linear scaling nevertheless. But apparently that produces surprising results in some cases, and stbir can do srgb, so might as well use it.)
* bonus: add stbir2, readme, makefilebptato2024-10-088-6/+260
|
* filei: misc updatesbptato2024-10-041-2/+14
| | | | | | * encode path URLs * accept directories without trailing slash * sort file names
* bonus: add prototype gallery scriptbptato2024-09-291-0/+78
| | | | see header for usage
* git.cgi: add git blamebptato2024-09-011-11/+63
|
* git.cgi: misc improvementsbptato2024-08-011-21/+27
| | | | | | | * highlight shortened commit hashes (up to 7 chars) * send status * refactor cgi commands * support git branch -a
* git.cgi: add [drop] to stash menubptato2024-07-031-1/+3
|
* git.cgi: use formsbptato2024-06-301-4/+13
| | | | it's safer this way
* git.cgi: add git stash list, switch -> branchbptato2024-06-081-20/+30
| | | | | | | | | * gitcha stash list special processing * gitcha switch no longer opens the branch view; it is now opened by gitcha branch * make gitcha branch UI consistent with the rest of the script. (the idea is that clicking on refs does not modify the repo, only action links like (switch) or (apply).)
* pager: rework D/discard bufferbptato2024-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | The previous solution had the issue that it switched between "delete buffer, then move back" and "delete buffer, then move forward" depending on whether the buffer was the root of the buffer tree, which made its behavior quite unpredictable. Now the pager (sort of) remembers the direction you are coming from, and D moves in that direction. So e.g.: * Enter, D just moves back to where you were coming from (as before) * Comma, D deletes the previous buffer, then returns to the current buffer If no buffer exists in the target direction, then we alert. Also, new commands are: `d,' `d.'. They do the same thing the non-d-prefixed variations do, but also delete the current buffer. Useful if you're no longer sure where you are coming from, but know where you want to go. (`d,' in particular is equivalent to w3m's `B'.)
* ansi2html: support passing titlesbptato2024-03-291-8/+5
| | | | | | | Use content type attributes so e.g. git.cgi can set the title even with a text/x-ansi content type. (This commit also fixes some bugs in content type attribute handling.)
* git.cgi: fix on older QJS versionsbptato2024-03-291-1/+1
| | | | Array.prototype.at is not present in previous QJS releases.
* config: improve input systembptato2024-03-261-83/+98
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* git.cgi: add "view" link to git switch panelbptato2024-03-251-1/+3
|
* git.cgi: add custom git switchbptato2024-03-241-16/+35
| | | | just a clickable UI for switching branches
* ansi2html: add separate switch for "standalone"bptato2024-03-211-1/+1
| | | | | this way its output can be embedded into documents without a pointless DT declaration
* git.cgi: show command in title for logbptato2024-03-201-0/+3
|
* bonus: add git.cgibptato2024-03-191-0/+64
| | | | just for clickable git log hashes
* trans.cgi: set content type to text/x-ansibptato2024-03-161-2/+2
|
* pager: add "open in editor" keybinding (sE)bptato2024-03-141-1/+9
| | | | | | only for source for now, rendered document is a bit more complicated (also, get rid of useless extern/editor module)
* bonus/w3m.toml: emacs-style page-up/downbptato2024-03-011-4/+6
| | | | this is more or less how it works in w3m
* magnet.cgi: fix quotingbptato2024-02-131-1/+1
|
* magnet.cgi: use urldec from libexec dirbptato2024-02-111-16/+6
|
* Re-design word handling, add e, E, W, B, etc.bptato2024-01-191-1/+1
| | | | | | | | | | | | * Add functions for moving to the beginning/end of words (vi `b', `e'). * As it turns out, there are many possible interpretations of what a word is. Now we have a function for each reasonable interpretation, and the default settings match those of vi (and w3m in w3m.toml). (Exception: it's still broken on line boundaries... TODO) * Remove `bounds` from lineedit, it was horrible API design and mostly useless. In the future, an API similar to what pager now has could be added. * Update docs, and fix some spacing issues with symbols in the tables.
* cha-http-libfetch: fix incorrect usage of strncatbptato2024-01-111-14/+3
| | | | | | | strncat does not work like that :P Luckily, BSD has strlcat which does. (While we're at it, remove the unused PDIE macro.)
* Add urlenc, urldec; fix a URL encoding bug; improve trans.cgibptato2024-01-081-12/+20
| | | | | | | | | | * Fix incorrect internal definition of the fragment percent-encode set * urlenc, urldec: these are simple utility programs mainly for use with shell local CGI scripts. (Sadly the printf + xargs solution is not portable.) * Pass libexec directory as an env var to local CGI scripts * Update trans.cgi to use urldec and add an example for combining it with selections
* bonus: add libfetch HTTP backendbptato2023-12-142-0/+163
| | | | | | | It has roughly zero utility, but maybe it's a good demonstration of local CGI? (TODO: add libfetch FTP too, that might actually be useful.)
* bonus: add magnet.cgibptato2023-12-112-0/+78
|
* Add support for gemini by default, update readmebptato2023-12-106-947/+0
| | | | | No need to leave gemini support in the bonus folder. Still TODO: proxy support.
* Enable finger protocol by defaultbptato2023-12-101-37/+0
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed
* pager: add marksbptato2023-12-091-1/+29
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* gmifetch: fix uninitialized memory access & UAFbptato2023-11-171-10/+9
| | | | C is scary
* gmi2html: fix main signaturebptato2023-11-171-1/+1
|
* gmifetch: do not decode URLs from query stringbptato2023-11-171-2/+0
|
* cha-finger: bugfixesbptato2023-11-171-10/+3
| | | | | | * Accept port 79, not 73 * Accept ipv6 addresses * We no longer have to URL decode the input
* bonus: add finger adapterbptato2023-11-141-0/+44
| | | | sort of based on lynx's finger URL parsing, except it's dumber
* gmifetch: properly set minimum TLS version, include string.hbptato2023-11-011-4/+2
| | | | | | | * Setting minimum TLS versions by SSL_CTX_set_options is deprecated, and we were doing it wrong anyway. Use SSL_CTX_set_min_proto_version instead. * Include string.h header to reduce clang whining.
* gmifetch: fix bugsbptato2023-10-291-10/+19
| | | | | | | * fix invalid file pointer being used after adding certificate (a pointer deref was missing there) * fix compatibility with gemini servers that refuse to interpret URLs that contain the default port (yes, seriously)
* container: add cursorNthLink, cursorRevNthLinkbptato2023-10-141-15/+2
|
* trans.cgi: minor fixbptato2023-10-091-1/+1
|
* update w3m.tomlbptato2023-10-091-26/+39
|
* improve trans.cgibptato2023-10-091-5/+23
| | | | document, simplify, ...
* gmifetch: get rid of globalsbptato2023-10-091-39/+43
| | | | it was horrible code style... (gmifetch still kind of is :/)
* gmifetch: -O3bptato2023-10-091-1/+1
|
* gmifetch: fix buffer overflowbptato2023-10-081-1/+1
| | | | ew