The officially official Devuan Forum!

You are not logged in.

#1 2019-10-05 17:44:52

msi
Member
Registered: 2017-02-04
Posts: 123  

A script to facilitate random note-taking in the terminal

I've put together a more or less elaborate helper script for random note-taking in the terminal (because I happen to do that a lot). It's not really finished yet, though very much usable already. I use it on a daily basis and it serves me quite well.

So, if anyone wants to check it out, the source is available on GitHub (for want of a suitable libre alternative). You can either browse the repository on the site or create a local copy of it with the following command:

git clone https://github.com/msiism/mote

For usage information, just run mote help. On second thoughts, you might rather want to make that mote help | less.

Comments welcome.

Offline

#2 2019-10-06 12:42:20

HevyDevy
Member
Registered: 2019-09-06
Posts: 64  

Re: A script to facilitate random note-taking in the terminal

Nice, thanks for sharing.

One gripe is the folder structure, is there a way you could just date one folder instead of 3 ?

Example

$HOME/.mote/notes/2019/10/06/0001

to

$HOME/.mote/notes/2019-10-06/0001

Offline

#3 2019-10-06 15:00:25

msi
Member
Registered: 2017-02-04
Posts: 123  

Re: A script to facilitate random note-taking in the terminal

Thanks for trying it out.

The directory structure is actually something that keeps me thinking. There are two apparent problems with the current one:

  • The notebook requires more storage space because of additional directory entries.

  • I haven't tested this, but I guess having less directories, maybe only a single notes directory, would help to increase the speed of searches.

The main reason I went with the current structure is that, to me, it seems the most logical and easy to grasp for humans (e.g., in case you lose the script). What are the problems you see with it?

Apart from that, I've thought about the interface a bit more and I think the list and search commands should be merged into a single find command with which you can then search notes based on a pattern, a date range or both, or nothing at all, which would be equivalent to listing all existing notes (just like running find (the Unix command) without arguments).

The only problem with that is that specifying a date range will have to be done via an additional option, which I'll then also have to implement for the browse command for consistency.

Offline

#4 2019-10-06 16:39:38

noname
Member
Registered: 2019-09-25
Posts: 10  

Re: A script to facilitate random note-taking in the terminal

msi wrote:

So, if anyone wants to check it out, the source is available on GitHub (for want of a suitable libre alternative). You can either browse the repository on the site or create a local copy of it with the following command:

git clone https://github.com/msiism/mote

Haven't tried it but thanks for putting it out there.  LOL, make up a simple note-taker with timestamp, convert it for use under Android, make a million bucks.  With all the BS about blogging and so forth, it amazes me that there's no simple note-taker.

Suggest you stick with simplicity. if you stick with UTC all you need is:  yyyymmddhhmmss text
Hook it up to an accelerator key (no idea how to do that, but it can definitely be done) for taking notes, hook it up to a real editor for browsing and cetera, you're off to the races.

There are too many editors out there already, people invent a new one at the drop of a hat.

Anyway Kudos for doing it, i'll probably be back to complain about it once i get a chance to try it LOL

Offline

#5 2019-10-06 16:56:04

golinux
Administrator
Registered: 2016-11-25
Posts: 1,768  

Re: A script to facilitate random note-taking in the terminal

@msi . . . Long time, no see.  So are you still playing with Adelie or running Devuan  again?

Offline

#6 2019-10-06 17:44:09

msi
Member
Registered: 2017-02-04
Posts: 123  

Re: A script to facilitate random note-taking in the terminal

noname wrote:

make up a simple note-taker with timestamp, convert it for use under Android, make a million bucks.  With all the BS about blogging and so forth, it amazes me that there's no simple note-taker.

While I'm not adversed to making a million bucks, I doubt there's any chance to achieve that with this project. I've already given it away under the terms of the ISC license so others can capitalize on it if they should find a way to do that. (Good luck...)

Making the script work on Android as it ships would require two things:

  • making it run in mksh, a comparatively minimalist Bourne-like shell that almost certainly won't support all the Bash features used in mote

  • making sure the external commands run by mote exist on Android and behave as expected

The second aspect is probably the more important one because it means that even if you managed to install Bash on your Android system, there's no guarantee the script would work correctly.

The only sort of compatibility testing I'm planning to do is with OpenBSD. And that will only concern external commands. You'll still have to get Bash and change the shebang accordingly. (I'll add that to the README when testing is done.)

noname wrote:

if you stick with UTC all you need is:  yyyymmddhhmmss text

Well, that's a debate, apparently. Currently, the structure of a notebook will look somewhat like this:

/home/msi/.mote/notes/
├── 2018
│   ├── 06
│   │   ├── 18
│   │   │   ├── 0001
│   │   │   └── 0002-variables
│   │   ├── 20
│   │   │   ├── 0002-desktops
│   │   │   └── 0003-user-dirs
│   │   ├── 21
│   │   │   ├── 0001-bash-empty-unset
│   │   │   └── 0002-parameters-vs-gui
│   │   ├── 22
│   │   │   ├── 0003-funny-wms
│   │   │   └── 0004
│   │   ├── 23
│   │   │   └── 0001-icons
│   │   ├── 25
│   │   │   ├── 0001-bash-good-practice
│   │   │   ├── 0003-paramater-parsing
│   │   │   └── 0004-html-checker
│   │   ├── 29
│   │   │   ├── 0002-while-read-IFS
│   ├── 07
│   │   ├── 04
│   │   │   └── 0001-nano
[...]
noname wrote:

Hook it up to an accelerator key (no idea how to do that, but it can definitely be done) for taking notes, hook it up to a real editor for browsing and cetera, you're off to the races.

There are too many editors out there already, people invent a new one at the drop of a hat.

I should probably have included the README in my first post because it explains that mote...

...will use the user's preferred text editor and pager as defined by the shell environment or via command-line options provided on its invocation.

noname wrote:

Anyway Kudos for doing it, i'll probably be back to complain about it once i get a chance to try it LOL

Please do.

Last edited by msi (2019-10-06 17:45:50)

Offline

#7 2019-10-06 18:01:09

msi
Member
Registered: 2017-02-04
Posts: 123  

Re: A script to facilitate random note-taking in the terminal

golinux wrote:

@msi . . . Long time, no see.  So are you still playing with Adelie or running Devuan  again?

I'm still running Devuan on my main computer because Adélie is still beta. But it shouldn't be too long until 1.0 now. I have it running on a laptop with sort of the same hardware as my Devuan system. It definitely beats Devuan in terms of speed here and also offers a few other advantages. But Devuan runs pretty well too.

Apart from that, I now also have a box running OpenBSD available. That's mainly for compatibility testing and getting to know the system.

Offline

#8 2019-10-08 05:23:36

HevyDevy
Member
Registered: 2019-09-06
Posts: 64  

Re: A script to facilitate random note-taking in the terminal

msi wrote:

Thanks for trying it out.

The directory structure is actually something that keeps me thinking. There are two apparent problems with the current one:

  • The notebook requires more storage space because of additional directory entries.

  • I haven't tested this, but I guess having less directories, maybe only a single notes directory, would help to increase the speed of searches.

The main reason I went with the current structure is that, to me, it seems the most logical and easy to grasp for humans (e.g., in case you lose the script). What are the problems you see with it?

Apart from that, I've thought about the interface a bit more and I think the list and search commands should be merged into a single find command with which you can then search notes based on a pattern, a date range or both, or nothing at all, which would be equivalent to listing all existing notes (just like running find (the Unix command) without arguments).

The only problem with that is that specifying a date range will have to be done via an additional option, which I'll then also have to implement for the browse command for consistency.

Sorry for late reply, been away from computers for a few days. I dont see any problems with it, i guess its just a case of me thinking in year-month-day for note taking where you have folders for this type of directory format $HOME/.mote/2019-10-08/001 instead of empty folders for the year and the month in this (2019/10) empty folders format $HOME/.mote/2019/10/08/001.

Offline

#9 2019-10-09 15:40:12

msi
Member
Registered: 2017-02-04
Posts: 123  

Re: A script to facilitate random note-taking in the terminal

HevyDevy wrote:

I dont see any problems with it, i guess its just a case of me thinking in year-month-day for note taking where you have folders for this type of directory format $HOME/.mote/2019-10-08/001 instead of empty folders for the year and the month in this (2019/10) empty folders format $HOME/.mote/2019/10/08/001.

Ok, I see. I tend to organize things in a hierarchical way where that is possible because it provides better order through encapsulation. 

msi wrote:

Apart from that, I've thought about the interface a bit more and I think the list and search commands should be merged into a single find command with which you can then search notes based on a pattern, a date range or both, or nothing at all, which would be equivalent to listing all existing notes (just like running find (the Unix command) without arguments).

The only problem with that is that specifying a date range will have to be done via an additional option, which I'll then also have to implement for the browse command for consistency.

That is now done.

Offline

Board footer