shithub: wiki.9front.org

Download patch

ref: f2b13d621a4367e8f26a2425607f53beba65f34b
parent: 156de7367a4aa65fe938917947af6b197a1c5359
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Aug 13 04:17:17 EDT 2020

tips and tricks: not just about rio

--- a/howto.md
+++ b/howto.md
@@ -7,7 +7,7 @@
 
 [Building a kernel-only 9front ISO](kernel-iso.html)
 
-[Rio tips and tricks](rio-tips-and-tricks.html)
+[Tips and tricks](tips-and-tricks.html)
 
 [Mounting 9p on Unix-like operating systems](9p-on-unix.html)
 
--- a/rio-tips-and-tricks.md
+++ /dev/null
@@ -1,48 +1,0 @@
-Rio tips and tricks
-===================
-
-Filename completion is available with CTRL+F. To go from anywhere back to the command prompt, use CTRL+B.
-More information about shortcuts and keys in general is available in `rio(1)` and `keyboard(6)`.
-
-Command `"` prints the last used command.
-`""` _executes_ the last command.
-Both accept an optional argument to match a command string, ie:
-
-	term% touch /tmp/1
-	term% lc /tmp
-	1
-	term% "
-		term% lc /tmp
-	term% ""
-		term% lc /tmp
-	1
-	term% "" to
-		term% touch /tmp/1
-	term% "" l
-		term% lc /tmp
-	1
-
-Hint: `grep '^term% ' /dev/text`.
-
-If there is a command you want to run repeatedly, it's easy to define a rc function and use it instead:
-
-	fn t { mk && ./6.out some arguments here >log && grep something log }
-	t
-
-To change the function without having to search it in the window, run `whatis t`, then redefined it.
-`ls /env/fn*` will show which functions are defined.
-
-To clear the window from any text run `echo >/dev/text`.
-
-If you need to snarf an output of some command, instead of outputting into the window and then using mouse,
-consider doing it directly instead: `command arg arg >/dev/snarf`.
-
-Want to do advanced searching on window's text? Run your favorite text editor on it: `sam /dev/text`.
-
-Want to take a screenshot of a window, but no idea which id that window has? Try seaching by its label:
-`grep sam /dev/wsys/*/label`. Replace the `label` in the path to `window` and take the screenshot:
-`topng </dev/wsys/X/window >/n/mycoolblog.com/www/files/acme.png`.
-
-When it gets difficult to work with too many windows on the screen, consider running `winwatch` and using one
-nested `rio` per virtual "workspace". If you're into keyboard-controlled window managers with virtual
-desktops, try out [riow](https://git.sr.ht/~ft/riow).
--- /dev/null
+++ b/tips-and-tricks.md
@@ -1,0 +1,57 @@
+Tips and tricks
+===============
+
+## Rio
+
+Filename completion is available with CTRL+F. To go from anywhere back to the command prompt, use CTRL+B.
+More information about shortcuts and keys in general is available in `rio(1)` and `keyboard(6)`.
+
+Command `"` prints the last used command.
+`""` _executes_ the last command.
+Both accept an optional argument to match a command string, ie:
+
+	term% touch /tmp/1
+	term% lc /tmp
+	1
+	term% "
+		term% lc /tmp
+	term% ""
+		term% lc /tmp
+	1
+	term% "" to
+		term% touch /tmp/1
+	term% "" l
+		term% lc /tmp
+	1
+
+Hint: `grep '^term% ' /dev/text`.
+
+If there is a command you want to run repeatedly, it's easy to define a rc function and use it instead:
+
+	fn t { mk && ./6.out some arguments here >log && grep something log }
+	t
+
+To change the function without having to search it in the window, run `whatis t`, then redefined it.
+`ls /env/fn*` will show which functions are defined.
+
+To clear the window from any text run `echo >/dev/text`.
+
+If you need to snarf an output of some command, instead of outputting into the window and then using mouse,
+consider doing it directly instead: `command arg arg >/dev/snarf`.
+
+Want to do advanced searching on window's text? Run your favorite text editor on it: `sam /dev/text`.
+
+Want to take a screenshot of a window, but no idea which id that window has? Try seaching by its label:
+`grep sam /dev/wsys/*/label`. Replace the `label` in the path to `window` and take the screenshot:
+`topng </dev/wsys/X/window >/n/mycoolblog.com/www/files/acme.png`.
+
+When it gets difficult to work with too many windows on the screen, consider running `winwatch` and using one
+nested `rio` per virtual "workspace". If you're into keyboard-controlled window managers with virtual
+desktops, try out [riow](https://git.sr.ht/~ft/riow).
+
+## Random facts
+
+`cat input | something >output` or `something <input >output`? Prefer the latter as it requires
+less resources. It also allows the `something` program to use `input` as a normal file rather than
+a pipe, ie it is able to have random file access, while with pipes all it can do is read the file
+in sequential order.