Xtended Memory - Xemy
Menu
Intro
Introduction
You simply can't remember everything. It simply does not work. Command lines, processes, texts, ... Sometimes you have researched for a long time to finally get the desired result ... and then? Where to put the information? Some things you need relatively often, some things maybe never again ... or do you?
So in the beginning I collected a lot of text files, later I used MoinWiki, then DokuWiki, finally I wrote my own tool. This is now in the second generation and definitely one of my most important tools.
Short description
Xemy stores texts which are created with a simplified Creole Wiki syntax. These entries are then stored in one or more "stores". A store can be e.g. a SQLite3 database, a MariaDB database or even a directory with text files. The administration is mainly done via a command line interface. For editing different editors can be used, for output multiple styles and different programs are supported.
Install
Install (as Root)
Xemy can be installed via my private repository. To do this, the GPG key must first be downloaded:
cd /etc/apt/trusted.gpg.d/
wget http://deb.mn77.de/mn77.archive.key.2022.gpg
After that, add the repository:
echo "deb http://deb.mn77.de/stable ./" >> /etc/apt/sources.list
Now update the package system and install Xemy:
apt update
apt install xemy
Start
Xemy can now be started as a normal user:
xemy
Everything is already initialized and Xemy is immediately ready for use.
If you want it even easier, you can create an alias or a link from 'x' to 'xemy' (as root):
ln -s /usr/bin/xemy /usr/local/bin/x
After that xemy should be able to be called with a simple 'x'.
Tutorial
New entry
If Xemy is running, we can now create the first entry. To do this, we type a short "n" or "new" and send the command with 'Enter'.
new
Now we land in the standard text editor and can write the entry there. Note the "= " in the first line, after which the page title is added.
= My first page
Hello Xemy!
The rest of the document can be edited freely. The formatting is:
= First headline
== Second headline
=== Third headline
==== Fourth headline
' ' Two spaces at the beginning create a code block
**bold**
//italic//
__underline__
--stroke--
---- horizontal line
After editing and closing the editor, Xemy still asks which tags we want to give to the new entry. Here several keywords can be entered separated by spaces. If necessary, the entry can simply be terminated with 'Enter'.
Search and find
With the command "a" or "all" we can now list all entries.
all
The "s" or "search" command searches the title and content for the words mentioned.
search foo bar
The command "f" or "find" searches only the title and displays a found article immediately.
find foo
With "t" or "tag" all entries with this tag can be listed:
tag foo
Display
For easier handling, a temporary number is assigned to each entry in the search result. Thus, the search result shows the respective key and next to it the title. This key consists of the store number (1-9) and a consecutive number.
To display an entry, we enter the according key.
10
This opens the standard pager (e.g. less) with the according page.
The prompt
The prompt of Xemy has 3 possible states:
No Mapping
- >
Search result / Mapping exist
? >
Page locked
10>
With "?" the last search result can be displayed at any time. If an entry is noted, the number can be omitted for commands.
Edit
To edit an entry, we use "e" or "edit". To do this, the corresponding number must be entered:
? > edit 10
If the entry is noted in the prompt, a simple "edit" is sufficient:
10> edit
Here we end up in the editor again and can edit the entry.
Exit
Xemy can be terminated with the following commands:
q, quit, exit
STRG + d
Configuration
Finally, let's take a quick look at the config file. This can be found under "~/.config/xemy/default.conf" and should be more or less self-explanatory.
editor ~/.config/xemy/default.conf
Without further configuration, a SQLite3 database is created and the standard pager and editor are used.
Under "[Stores]" the respective stores can be defined. Here 3 examples for it:
1 = SQLite3( "/home/foobar/.config/xemy/store.sqlite3" )
2 = MariaDB( "192.168.0.100", "user", "secretpass", "xemydb" )
3 = WikiDir( "/home/foobar/xemy" )
Completion
In the meantime I can't imagine my life without this tool. I hope that everything works as it should, Xemy pleases and also makes the work on the PC easier for others.
Commands
Search
a, all [STORE]
List all pages. If an argument is given, show only the pages of this store.a
a 2
f, find [STORE] <...>
Find titles which matching all keywords.f foo bar
f 2 foo
F, Find [STORE] <...>
Find titles which matching any keywords.F foo bar
F 2 foo
last [STORE]
Search the last changed pages.
late 10
late 8 10
newest [STORE]
Search the newest created pages.
newest 10
newest 8 10
s, search [STORE] <...>
Search with matching all keywords.s foo bar
s 2 foo
S, Search [STORE] <...>
Search with matching any keywords.S foo bar
S 2 foo
top [STORE]
Search the most used pages.
top 10
top 8 10
x, trash [STORE]
Show trash. If an argument is given, show only the trash of this store.x
x 2
Tags
c, class <[+|-]TAG ...>
Classify page with these tags. Tags with leading '-' will be
removed, tags with optional '+' will be added.
c 8003 8009 foo bar
C, Class [[+|-]TAG ...]
Remove tags for this page. Tags with optional leading '-' will be
removed, tags with leading '+' will be added.
C 8003 foo bar
l, link
Link first tag to the second tag.
link foo bar
L, unlink
Remove the link from first tag to the second tag.
unlink foo bar
list
List all known and used tags.list
t, tag [STORE]
Search pages which are linked to all these tags.
t foo bar
T, Tag [STORE]
Search pages which are linked to one of these tags.
T foo bar
Page info
, show
Show page
8003
show 8003
changed
Show the last change time
changed 8003
created
Show the create time
created 8003
describe
Describe page (this is for debugging)
describe 8003
e, edit
Edit page
e 8003
E, Edit
Edit page with GUI-Editor
E 8003
hits
Show the amount of hits for this page
hits 8003
meta, info
Show the meta information of a page
info 8003
tags
Show the linked tags of this page
tags 8003
title
Show the title of the page
title 8003
Page admin
clone
Duplicate a page to the default write store.
clone 8003
combine
Combine two pages.
combine 8003 9014
cp, copy
Copy one or all pages to another store
copy 8003 2
copy 8 2
d, del
Delete single pages or all pages from a store. Single pages will
be moved to trash first. A second 'delete' will delete it finally.
d 8003
diff
Show the difference between to pages.
diff 8003 9014
Diff
Show the difference between to pages with GUI.
Diff 8003 9014
export [Directory]
Export pages or a complete store to the current or a selected
directory
export 8003
export 4 /tmp/store4
export 8003 8005 9
import [STORE]
Import one or more files to default or given store. Wildcards can
be used.
import foo.txt
import *.txt
import 3 A*.txt
mv, move
Move one or all pages to another store
move 8003 2
move 8 2
n, new [STORE]
Create new page. If an argument is given, the new page will be created in this store.n
n 2
N, New [STORE]
Create new page with GUI-Editor.N
N 2
u, undel
Undelete page(s) from trash.
u 8003
General
-
Clear mapping-
h, help [...]
Show command overview or command help pageh
help new
man, manual
Show full manualman
?, k, keys
Show the keys from last search result?
k
m, map
Show current mappingmap
q, quit, exit
Exit command line interface.q
exit
stores
Print a table with all configured stores.stores
v, version
Show version.version
X, clean [STORE]
Empty the trash of all stores or a single one.clean
X 2
Source code
The sourcecode is hosted on: https://www.gitlab.com/MN77/xemy
License
Xemy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
Xemy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Xemy. If not, see
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".