From 99315219aba0481466c8bb236548284ccec5a1d5 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 1 Jun 2019 13:54:57 +0200 Subject: dwim.pl This is the Perl version of dwim. It is much easier to work with and extend, thanks to Perl's excellent regex support. The "phrase" (either $ARGV[0] or the primary X selection) is matched against regular expressions in the for loop (a primitive switch statement). This is the place to add handlers. Options are specified through environment variables, defined with default values in the section before the handlers. The `path` subroutine transforms a relative path to an absolute path based on the title of the current window. It depends on the `xtitle` program, and for it to work, you must instruct your shell (or editor) to set the terminal's title to the current directory (or currently edited file). (As such, `path` doesn't work with other programs than terminals and editors.) --- dwim | 1 + 1 file changed, 1 insertion(+) create mode 120000 dwim (limited to 'dwim') diff --git a/dwim b/dwim new file mode 120000 index 0000000..06baf07 --- /dev/null +++ b/dwim @@ -0,0 +1 @@ +dwim.pl \ No newline at end of file -- cgit v1.2.3