Git Product home page Git Product logo

dly's Introduction

dly - your daily note from the command line

This small utility was built because I needed a quick way to add one-line entries to my daily notes, from the command line. These would usually be some clever thoughts I do not want to forget, TODOs, things to buy, ...

I do not want to start Logseq just for that (even though I mapped it to shortcuts) and so dly was born.

Installation

The binary dly.exe (or the relevant one for your OS) attempts to read a configuration file located in .config/dly/dly.yml in your home directory. It will try hard to find said home directory and will abort if this is not possible. Should you encounter such a case, please open a bug report (a Github Issue).

If the configuration file is not found, a minimal empty one will be created. It is not yet functional as it, you need to edit it to add your Logseq daily notes folder (I could automate that if I knew how).

Binaries can be found in the Releases section.

Building from source

go install github.com/wsw70/dly@latest

Usage

Run dly.exe, a pop-up window appears to allow you to type your line. Once you are done press Enter (or click OK) and your daily note is updated.

If you use a tool such as AutoHotKey, you could bind a key combination to run dly.

Example for a hotkey under Win-N:

#n::Run "D:\Y\dev-perso\dly\dly.exe"

Debugging

If you want to have a more verbose mode or help debug the program, you can set the environment variable DLY_DEBUG to the value yes. Below is an example of the consequences of setting it inline in PowerShell:

PS D:\Y\dev-perso\dly> go run . poiytporipoerit teprotperoite r eortieproit
2023-01-13T15:05:29+01:00 INFO note D:\Y\Logseq\journals\2023_01_13.md updated

PS D:\Y\dev-perso\dly> $env:DLY_DEBUG = 'yes'; go run . poiytporipoerit teprotperoite r eortieproit
2023-01-13T15:06:27+01:00 DEBUG text starts on a new line
2023-01-13T15:06:27+01:00 DEBUG backup note is C:TEMP\2023_01_13.md
2023-01-13T15:06:27+01:00 INFO note D:\Y\Logseq\journals\2023_01_13.md updated

Configuration file

The configuration file located in .config/dly/dly.yml in your home directory is a YAML file that may contain the following directives

directive mandatory? type meaning
DailyNotesPath yes string Path to the LogSeq daily notes (typically the journals folder in Logseq data directory). The path is without any quotation marks.
FilenameFormat yes string Format of your daily note, without the .md extension. The format follows (weird) Go formatting rules, see the documentation or an article for details. As a general rule, when you want to say "the current year" and expected something like YYYY, you use 2006 (yes, exactly this string). The "current month" is 01 and the "current day" is 02. Yes this is insane. The default format (in the auto-generated file) is 2006_01_02 - this corresponds today to 2023_01_13 which in turns points to the file 2023_01_13.md, which Logseq interprets as the date 2023-01-13.
AddTimestamp no bool Should your line be prefixed with a bolded timestamp?
AppendHashtag no string add the string as hashtag (example: from-cli, note the absence of # which will be automatically added)
ShowNotificationOnSuccess
(MS Windows only)
yes bool Show a tray notification when the note is added
ShowNotificationOnNewversion
(MS Windows only)
yes bool Show a tray notification when a new version of dly is available

What next?

  • automated detection of the daily notes folder
  • cleanup of code, including more comments
  • more OSes (notably MacOS). It is easy to do but I need someone to test the binary (and information about where the home and temporary directories are)
  • anything you can think of

Feel free to open Issues if you find bugs, or start Discussions.

I should probbaly add a license but I do not care, so let it be WTFPL.

If you have the irrestible need to share your gratitude, call someone you love or send money to a clever charity that helps with education.

dly's People

Contributors

alphatroya avatar hongpong avatar wsw70 avatar

dly's Issues

update doc re overwrite warning

note overwrite risk in readme. if you click around in journal file in logseq already open it seemed like it overwrites . altho its pretty good at detecting file changes. before it is detected logseq can overwrite what dly tried to write.

temp doesn't work for me

it kick error about temp. idea create a preference in yml (optional) for tmp location filepath. seemingly temp dirs not writeable or similar

modify zenity box to have picker for multiple journals

can we have multiple journals bro lets have it .. picker like CTRL-1 CTRL-2 etc toggle buttons to each journal that exists. in this fashion i get a couple journals.

journal_2 keys in yml file. etc

perhaps it would keep last journal selected perhaps always default to first journal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.