add images to the README, clean up the imports in the python code

This commit is contained in:
2022-11-03 08:37:57 -04:00
parent 938a023a11
commit 925ae23f64
5 changed files with 46 additions and 29 deletions
+34 -15
View File
@@ -40,6 +40,9 @@ or if terminal apps are your preference.
The <code>**dirnotes-cli**</code> is a command line tool,
which may be handy for scripting. This all can also do maintenance on the database.
<img src=images/gui_sample.png alt="gui sample" />
<img src=images/tui_sample.png alt="tui sample" />
## USAGE
The <code>**dirnotes**</code> program displays usage and keystoke info
@@ -49,7 +52,7 @@ The <code>**dirnotes-cli**</code> program has a man page.
In short, you navigate <code>**dirnotes**</code> and
<code>**dirnotes-tui**</code> by using the up/down arrow keys,
<enter> to enter into a directory.
\<enter\> to enter into a directory.
The **-tui** version accepts _e_ for edit, _s_ for sort, _M_ to change
between xattr/database priority.
@@ -68,10 +71,22 @@ The <code>**dirnotes**</code> app requires _Python3_ and the _Qt5_ framework.
The <code>**dirnotes-tui**</code> and <code>**dirnotes-cli**</code> apps
simply require _Python3_.
Simply copy the file into your path, to ~/.local/bin for example.
Simply mark the 3 python files as executable copy them into your
path, to <code>\~/.local/bin/</code> or <code>/usr/local/bin/</code>.
chmod a+x dirnotes dirnotes-tui dirnotes-cli
cp dirnotes dirnotes-tui dirnotes-cli \~/.local/bin/
For a better GUI experience, copy
<code>dirnotes.desktop</code> to <code>~/.local/share/applications</code> and
<code>dirnotes.xpm</code> to <code>~/.local/share/icons/</code>
<code>dirnotes.desktop</code> to <code>\~/.local/share/applications</code> and
<code>dirnotes.xpm</code> to <code>\~/.local/share/icons/</code>
If you are using the command-line tool <code>**dirnotes-cli**</code>,
you can generate a man page using
pandoc -s -t man -o dirnotes-cli.1 dirnotes-cli.md
and copy that to ```~/.local/share/man/man1```
### CONFIG FILE
@@ -79,9 +94,9 @@ By default, the file **~/.config/dirnotes/dirnotes.conf** will be used to
load the user's config.
This is a JSON file, with three attributes that are important:
> * xattr_tag (default: <code>usrr.xdg.comment</code>)
> * database (default: <code>~/.local/share/dirnotes/dirnotes.db</code>, sensible alt: <code>/var/lib/dirnotes.db</code>)
> * start_mode (_xattr_ or _db_ display priority)
* xattr_tag (default: <code>user.xdg.comment</code>)
* database (default: <code>~/.local/share/dirnotes/dirnotes.db</code>, sensible alt: <code>/var/lib/dirnotes.db</code>)
* start_mode (_xattr_ or _db_ display priority)
The _config_file_ should be auto-generated the first time one of
the **dirnotes** apps is run.
@@ -190,9 +205,7 @@ As comments are editted or appended, new records are added to the database.
Older records are are not purged. This gives you a history of the comments,
but it means that fetching the most recent comment involves something like
~~~~
SELECT * FROM dirnotes WHERE name=? ORDER BY comment_date DESC
~~~~
SELECT * FROM dirnotes WHERE name=? ORDER BY comment_date DESC
and just fetch the first record.
@@ -202,7 +215,12 @@ The database is created the first time one of the **dirnotes** apps is run.
The <code>**dirnotes**</code> gui app has a desktop icon built into the code.
There is not need for an external .icon file, but there is an .xpm file included
in the project, which can be copied to ~/.local/share/icons/
in the project, which can be copied to <code>~/.local/share/icons/</code>
The 3 apps share a big block of common code. At this point, the code is embedded
in each executable, but perhaps in the future it will be brought out as a library.
I just like apps to be a single file I can copy to my various devices and servers,
but it does create a problem of keepint the 3 apps in sync.
### comment date & author
@@ -262,10 +280,10 @@ Does anyone have an opinion?
2. Is it ok to put the config file and database file buried in ~/.config and ~/.local?
These directories exist on computers with a gui/windowing system installed,
but don't neccessarily exist on headless servers.
Perhaps the default locations should be in the user directory?
(~/.dirnotes.conf and ~/.dirnotes.db)
These directories exist on computers with a gui/windowing system installed,
but don't neccessarily exist on headless servers.
Perhaps the default locations should be in the user directory?
(~/.dirnotes.conf and ~/.dirnotes.db)
3. Who needs translations?
@@ -284,3 +302,4 @@ Perhaps the default locations should be in the user directory?
- so, for example, the user can't add comments to /usr/bin/\*
6. Is anyone interested in the MacOS version?