index.html 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="stylesheet" href="../style.css#" type="text/css" />
  7. <title>Address bar command line</title>
  8. <script type="text/javascript">
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  31. <nav>
  32. </nav>
  33. </header>
  34. <br />
  35. <div class="container">
  36. <h1 class="title">Address bar command line
  37. <br>
  38. <span class="subtitle"></span>
  39. </h1>
  40. <ul class="tags">
  41. </ul>
  42. <h3 id="--or--command-line">&quot;:!&quot; ( or &quot;!&quot;) command line</h3>
  43. <p>Pressing &quot;:&quot; or &quot;!&quot; with hardware keyboard sets focus on the address bar.<br>
  44. The command line could be a &quot;.js&quot;, &quot;.sh&quot; or other executable with arguments. Ex. &quot;:!s g keyword&quot; could invoke &quot;s.js&quot; executable with the whole string as arguments (&quot;s.sh&quot; or &quot;s&quot; if file exists, here &quot;g&quot; as google search engine); &quot;:! g keyword&quot; would invoke the file &quot;.js&quot; or &quot;.sh&quot; as executable.</p>
  45. <p>For regular (non-js) executables, the standard output of the command line could be treated as lines of urls (or html, plain text).</p>
  46. <p><a href="i:0h.js:../searchurl/txt/web.js">Install the example file &quot;.js&quot; (supporting search engine bundle)</a><br>
  47. <a href="i:0hs.sh:../searchurl/txt/web.sh">Install the example file &quot;s.sh&quot;</a></p>
  48. <p>Click the following links to make commands appear in address bar, then press &quot;enter&quot; to execute:<br>
  49. <a href="i:15:!cd /data/data/com.termux/files/home;ln -s ../../../info.torapp.uweb/files uweb">Make uweb configuration folder accessible by file managers with termux installed</a><br>
  50. (<a href="https://wiki.termux.com/wiki/Internal_and_external_storage">File manager list at end of the page</a>)</p>
  51. <h3 id="address-bar-command-modes">Address bar command modes</h3>
  52. <p><a href="../cmds/index.html#">Commands</a> are the best for repeated execution of an instruction. Address bar command modes provide ways to run different commands in the same category easily.</p>
  53. <p>The configure file &quot;default.acmd&quot; has the exactly same format as <a href="../cmds/index.html#">default.cmds</a>. Click the following links to install new modes (cold start the app to take effect, then long click the &quot;refresh&quot; button to switch modes):</p>
  54. <p><a href="i:0gdefault.acmd::shell:text/plain:%25s%0A">Shell command mode</a></p>
  55. <p><a href="i:0gdefault.acmd::bc:text/plain:echo '%25s'|bc -l -q%0A">GNU bc (basic calculator) command mode (need termux for Android 10- )</a></p>
  56. <p><a href="i:0gdefault.acmd::plot 2D function:image/svg%2Bxml:gnuplot -e 'set term svg;set
  57. output;plot %25s'%0A">GNUPlot plot (2D function), needs uweb adapted termux &amp; gnuplot</a></p>
  58. <p><a href="i:0gdefault.acmd::plot 3D function:image/svg%2Bxml:gnuplot -e 'set term svg;set
  59. output;splot %25s'%0A">GNUPlot plot (3D function), needs uweb adapted termux &amp; gnuplot</a></p>
  60. </div>
  61. <p>Last Modified: 2 April 2024<br>
  62. add js function in README<br>
  63. <pre></pre>
  64. </p>
  65. <script id='jsgiscus'
  66. src='https://giscus.app/client.js'
  67. data-repo="torappinfo/uweb"
  68. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  69. data-category="Announcements"
  70. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  71. data-mapping="title"
  72. data-strict="0"
  73. data-reactions-enabled="1"
  74. data-emit-metadata="0"
  75. data-input-position="top"
  76. data-theme="light"
  77. data-lang="en"
  78. data-loading="lazy"
  79. crossorigin="anonymous" async>
  80. </script>
  81. <footer class="site-footer">
  82. <div class="container">
  83. &copy; 2018-2024 Richard H. Cao
  84. </div>
  85. </footer>
  86. <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
  87. </body>
  88. </html>