OT: html code to open a document in kwrite?

Brian Cluff brian at SnapTek.com
Fri May 31 19:23:58 MST 2019


If it doesn't need to be an web (html) based menu system and you are 
just simply wanting an menu to edit files in an infinite loop then you 
can do this:

Create a file named "files" with 2 columns that are pipe delimited like:
path/to/file1.txt|Label for file 1
path/to/file2.txt|Label for file 2
...
path/to/filex.txt|Label for file 3

As a 1 liner:
IFS=$'|\n'; while THEFILE=$(kdialog --menu "Choose a file:" $(< files)); 
do kwrite $THEFILE; done

As a script:
#!/bin/bash
IFS=$'|\n'
while THEFILE=$(kdialog --menu "Choose a file:" $(< files))
do
     kwrite $THEFILE
done

Just execute this from the same directory you wrote the "files" file or 
change the script where it says files to point to your files file.

Brian Cluff

On 5/31/19 10:16 AM, Joe Lowder wrote:
> Is it possible to write (the simplest possible)
> html code that will open a text file from a simple
> menu entry using the 'kwrite' editor ... that will
> allow me to write and edit in a pre-named text file
> and save the changes?
>
> I do this now from the command line:
>
> $ kwrite filename <E>
>
> But I would like to be able to do it by simply
> clicking on an entry in a simple html menu.
>
> These attempts do not work:
> <li><a href=file:/home/joe/notes>open notes text file</a>
> <li><a href="exec kwrite notes">open notes with kwrite</a>
> <li><a href="exec /usr/bin/kwrite notes">open notes with exec</a>
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss



More information about the PLUG-discuss mailing list