Initial commit

parents
This diff is collapsed.
DC=dmd
SRC=*.d
FLAGS=-J=. -O -wi
TFLAGS=-unittest -g -cov
LIBS=-L-l:libpostphobos-$(DC)-static.a
APP=vitis
DEBPATH=build/deb
RPMPATH=build/rpm
BINPATH=build/bin
ARCH=`dpkg --print-architecture`
RES=resources
HELPPATH=usr/share/help
BASHCOMP=usr/share/bash-completion/completions
VERSION=`cat source/version`
ifdef PREFIX
ifeq ($(PREFIX),"")
ALTROOTPATH=/usr/local
else
ALTROOTPATH=$(PREFIX)
endif
endif
#Building of executable bin-file
bin: source/*.d
utils/localesconverter.script.d $(RES)/locales.ods source/locales.dtxt
cd source; $(DC) *.d $(FLAGS) $(LIBS) -of../$(BINPATH)/$(ARCH)/$(APP)
rm $(BINPATH)/$(ARCH)/$(APP).o
#Building of executable bin-file with unit-tests
test:
utils/localesconverter.script.d $(RES)/locales.ods source/locales.dtxt
cd source; \
$(DC) $(TFLAGS) *.d $(FLAGS) $(LIBS) -of../$(BINPATH)/$(ARCH)/$(APP)
rm $(BINPATH)/$(ARCH)/$(APP).o
testing/testing.sh
#Building of deb-package for given architecture
deb: bin
mkdir -p $(DEBPATH)/$(ARCH)/DEBIAN
mkdir -p $(DEBPATH)/$(ARCH)/usr/bin
mkdir -p $(DEBPATH)/$(ARCH)/$(BASHCOMP)
cp source/_vitis $(DEBPATH)/$(ARCH)/$(BASHCOMP)/vitis
objcopy --strip-debug --strip-unneeded \
$(BINPATH)/$(ARCH)/$(APP) $(DEBPATH)/$(ARCH)/usr/bin/$(APP)
mkdir -p $(DEBPATH)/$(ARCH)/$(HELPPATH)/en/$(APP)
mkdir -p $(DEBPATH)/$(ARCH)/$(HELPPATH)/ru/$(APP)
cp $(RES)/help/en_US/* $(DEBPATH)/$(ARCH)/$(HELPPATH)/en/$(APP)
cp $(RES)/help/ru_RU/* $(DEBPATH)/$(ARCH)/$(HELPPATH)/ru/$(APP)
sed -i "s/^Version:.*/Version: $(VERSION)/g" deb-info/control_amd64
sed -i "s/^Architecture:.*/Architecture: $(ARCH)/g" deb-info/control_amd64
cp deb-info/control_amd64 $(DEBPATH)/$(ARCH)/DEBIAN/control
mkdir -p $(DEBPATH)/$(ARCH)/usr/share/doc/$(APP)
cp copyright $(DEBPATH)/$(ARCH)/usr/share/doc/$(APP)
chmod 644 $(DEBPATH)/$(ARCH)/usr/share/help/en/vitis/*
chmod 644 $(DEBPATH)/$(ARCH)/usr/share/help/ru/vitis/*
chmod 644 $(DEBPATH)/$(ARCH)/usr/share/doc/vitis/copyright
chmod 755 $(DEBPATH)/$(ARCH)/usr/
chmod 755 $(DEBPATH)/$(ARCH)/usr/bin $(DEBPATH)/$(ARCH)/usr/bin/vitis
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/bash-completion
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/bash-completion/completions
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/doc
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/doc/vitis
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/help
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/help/en
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/help/ru
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/help/en/vitis
chmod 755 $(DEBPATH)/$(ARCH)/usr/share/help/ru/vitis
gzip -9 -k -n deb-info/changelog
mv deb-info/changelog.gz $(DEBPATH)/$(ARCH)/usr/share/doc/$(APP)/
cd $(DEBPATH)/$(ARCH) ; find usr -type f -exec md5sum {} + > DEBIAN/md5sums
chmod 644 $(DEBPATH)/$(ARCH)/DEBIAN/md5sums
fakeroot dpkg-deb --build $(DEBPATH)/$(ARCH) $(DEBPATH)
lintian $(DEBPATH)/*.deb --no-tag-display-limit
release: deb rpm doc
#Building of rpm-package
rpm: deb
mkdir -p $(RPMPATH)
fakeroot alien --to-rpm --scripts $(DEBPATH)/*.deb
chmod 777 *.rpm
mv *.rpm $(RPMPATH)
rm -rf ~/rpmbuild
#Installing of deb-package
install-deb: deb
sudo dpkg -i $(DEBPATH)/$(APP)*.deb
#Generating of documentation
doc:
utils/localesconverter.script.d $(RES)/locales.ods source/locales.dtxt
cd source; $(DC) $(SRC) $(FLAGS) $(LIBS) -Dd=../documentation
rm source/main source/main.o
#Remove deb-, rpm- and bin-files
clean:
rm -rf build/
rm -f source/locales.dtxt
ALL=deb-info/ resources/ source/ utils/ COPYING copyright Makefile README.md
PKG=$(APP)-$(VERSION)
ALTBINDIR=$(ALTROOTPATH)/bin
ALTSHAREDIR=$(ALTROOTPATH)/share
tarball: $(ALL)
mkdir $(PKG)
cp -r $(ALL) $(PKG)
tar --xz -cf $(PKG).tar.xz $(PKG)
rm -rf $(PKG)
mkdir -p build/
mv $(PKG).tar.xz build/
install:
@echo "prefix: " $(ALTROOTPATH)
mkdir -p $(ALTBINDIR)
mkdir -p $(ALTSHAREDIR)/help/en/vitis
mkdir -p $(ALTSHAREDIR)/help/ru/vitis
install $(BINPATH)/$(ARCH)/$(APP) $(ALTBINDIR)
install $(RES)/help/en_US/* $(ALTSHAREDIR)/help/en/vitis
install $(RES)/help/ru_RU/* $(ALTSHAREDIR)/help/ru/vitis
uninstall:
rm $(ALTSHAREDIR)/help/ru/vitis/*
rm $(ALTSHAREDIR)/help/en/vitis/*
rm $(ALTBINDIR)/$(APP)
Vitis 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.
This program 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.
---
## vitis
vitis is a category manager for files.
It allows to move from a hierarchical organization of files to a semantic one.
Categories are stored as directories (in ~/Vitis by default).
These directories contain links to file on your file system.
The vitis settings are stored in the file '~/.vitis.conf'.
See details: `vitis --help`
---
## Ready-made packages
(to do)
---
## Build from source
Before assembling, you need to install [dmd](https://dlang.org/download.html#dmd).
In Debian-based distributions, you can do this:
`sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list`
`sudo apt update --allow-insecure-repositories`
`sudo apt -y --allow-unauthenticated install --reinstall d-apt-keyring`
`sudo apt install dmd-bin dmd-doc`
-
Creating of executable bin-file:
`make`
Installation (by default, main directory is /usr/local/):
`sudo make install`
After that, the aplication is ready for use.
You can install this application in any other directory:
`make install PREFIX=/home/$USER/sandbox`
Uninstall:
`sudo make uninstall`
If you installed in an alternate directory:
`make uninstall PREFIX=/home/$USER/sandbox`
---
## Using
See: `link-editor --help`
Copyright (C) 2018 Eugene 'Vindex' Stulin
Vitis 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.
This program 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:
<https://www.gnu.org/licenses/gpl-3.0.html>
On Debian systems, the complete text of the GNU General Public License
can be found in `/usr/share/common-licenses/GPL'.
Development version
Package: vitis
Version: 0.9.8.4
Section: misc
Architecture: amd64
Priority: optional
Depends: libc6 (>= 2.14)
Homepage:
Maintainer: Eugene 'Vindex' Stulin <tech.vindex@gmail.com>
Description: semantic file manager.
Vitis is a program that serves to organize work with files, classified
by category system. In other words, vitis is a category manager for files.
--------------------------------------------------------------------------------
Basic format for command 'assign':
vitis assign [-c] <category> [-action] <data> [[--yes][--no]]
The optional '--yes' or '--no' flag is used to automatically respond
to possible user requests, for example, to create a category.
vitis assign [-c] <category> -a <alias>
An alias is created for the category.
vitis assign [-c] <category> -e <expression>
The category is assigned to files the list obtained
as a result of evaluating the expression.
See the information about expression in the help of command 'show'.
vitis assign [-c] <category> -d <directory> [--save] [--to <path>]
The category is assigned to the files from the directory
and files from all subdirectories.
Local subcategories are formed from subdirectories.
Additional option '--save' causes the files to be copied
into a user-defined file space (see: vitis service --help),
additional option '--to' allows to select a directory to copy
from the list of file spaces (if there are many of them).
vitis assign [-c] <category> -f <file list> [--save] [--to <path>]
The category is assigned to the listed files
and filesfrom all subdirectories.
Local subcategories are formed from subdirectories.
See description of options '--save' and '--to' above.
vitis assign [-c] <category> -i <net-links> [--save]
A link (or links) to a Internet resource (or other network path)
is assigned a category.
Example:
vitis assign GitHub -i https://github.com/
Option '--save' allows to save a local copy of an HTML-page.
vitis assign [-c] <category> -n <new name>
The category is renamed.
vitis assign [-c] <category> -s <subcategory> [[--local][--global]]
The category has a subcategory.
By default, an alias is created for the subcategory,
category can be used as a normal category.
Example:
vitis assign C++ -s Boost --yes
A subcategory 'C++/Boost' and link-alias 'Boost' are created.
Everything that falls into the category 'Boost' also has
the category 'C++'. If the category 'Boost' did not exist before,
it will be created automatically thanks to the '--yes' flag.
If the category 'Boost' existed, its contents are moved to 'C++/Boost'.
This command is equivalent to 'vitis assign C++/Boost -a Boost'.
If the '--local' flag was used instead of '--global' (by default) flag,
the category is created only locally.
Example:
vitis assign BigProject -s resources --local --yes
A subcategory 'BigProject/resources' is created.
This command is equivalent to "vitis create BigProject/resources".
vitis assign [-c] <category> -v <[category/]file>
The command allows to assign categories to files with known names
and with pre-defined assigned categories. If the category is not specified,
a search is performed by name across the entire Vitis system.
vitis assign -f <file_path> -n <new_name>
The file is renamed for all categories with which it was associated.
Specifies the absolute or relative path to the file in the file system.
vitis assign -v <[category/]file> -n <new_name>
Rename the file for all categories with which it was associated.
To simplify identification, it is possible to specify one of the categories
associated with it. If the category is not specified,
a search is performed by name across the entire Vitis system.
\ No newline at end of file
vitis is a category manager for files.
It allows to move from a hierarchical organization of files to a semantic one.
Categories are stored as directories (in ~/Vitis by default).
These directories contain links to file on your file system.
The vitis settings are stored in the file '~/.vitis.conf'.
--------------------------------------------------------------------------------
As first argument, vitis takes one of following commands:
assign - category assigning for files and some other operations;
copy - copying files from categories to the designated place;
create - creation of new categories;
delete - deleting of categories and deleting of links from categories;
help - displaying of this help;
open - opening of files;
run - launching files as programs;
service - settings, service information, analysis of system data;
show - output lists of files and categories on the screen.
For each command, you can add '--help' (or '-h') to display help about command.
Example: 'vitis show --help'.
Also, the option '--conf=<path_to_configuration_file> is applied to each
command, which allows to use an alternative configuration file
at the specific time of the vitis call.
For details on the settings, see help of the service command.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'assign':
vitis copy [-e] <expression> -d <destination>
For the format of the expression, see the help for the 'show' command:
vitis show --help
Example:
vitis copy Books -d .
This command copies files of the 'Books' category to the current directory.
vitis copy C++ i: Qt -d /home/user/Documents
This command copies files those have both 'C++' category and 'Qt' category
to the 'home/user/Documents'.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'create':
vitis create [-c] <category> ...
This is used to create a new category.
If it is nested, then the full path is specified.
If there are non-existent categories in the full path,
their creation will be requested. Flag '-c' is optional.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'delete':
vitis delete <input data>
vitis delete -c <category list>
This command deletes the categories.
vitis delete -c <category> -f <names of links (files)>
Specific links from the specified category are deleted.
vitis delete -v <[category/]file_name>
Deleting links for all categories with which they were associated.
To simplify identification, it is possible to specify one of the categories
associated with it. If the category is not specified,
a search is performed by name across the entire Vitis system.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'open':
vitis open [-e] <input data> [options]
This command opens files from the expression using program by default.
This is used in the same way as command 'vitis show'.
If utility 'vts-fs-open' is installed on the system,
the task of determining the opening programs is delegated to it.
Flag '-n' is used to select one or a series of files.
If there is a number after the '-n' flag, one file will be displayed.
If there is the expression in enclosed in square brackets,
the numbers and ranges of the desired files are listed,
separated by commas without spaces.
Flag --sort=<sorting> is used to specify the sorting type:
--sort=extension - sort by file extension;
--sort=name - sort by file name (default);
--sort=none - without sorting;
--sort=size - sort by file size;
--sort=time - sort by file modification time;
--sort=atime - sort by file access time.
Option '--hidden' enables the use of hidden files.
Option '-app' allows to select an alternative prorgam to open the files.
Example:
vitis open Music --app vlc
File from 'Music' category will be opened in the VLC player.
Option '--saved-page' option allows to open local copies of saved HTML pagesб
if they exist.
Option '--mix' causes the list of opened files to randomly intermix.
Option '--reverse' reverses the sort order.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'run':
vitis run [-e] <input data> [options]
This command runs files by the expression like executable applications.
This is used in the same way as command 'vitis open'.
Flag '-n' is used to select one or a series of files.
If there is a number after the '-n' flag, one file will be displayed.
If there is the expression in enclosed in square brackets,
the numbers and ranges of the desired files are listed,
separated by commas without spaces.
Example:
vitis run Apps -n 2
Second file in the 'Apps' category starts.
It makes sense with the preliminary use of 'vitis show Apps'.
Flag --sort=<sorting> is used to specify the sorting type:
--sort=extension - sort by file extension;
--sort=name - sort by file name (default);
--sort=none - without sorting;
--sort=size - sort by file size;
--sort=time - sort by file modification time;
--sort=atime - sort by file access time.
Option '--hidden' enables the use of hidden files.
Option '--sudo' (or '--root') option allows to run programs
with root privileges when accounting for the sudo utility in the system
and the presence of the corresponding rights of the current user.
Option '--user=<username>' allows to run a program with permissions
specified user when accounting system installed in the system 'sudo'
and the presense of the corresponding rights of the current user.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'service':
vitis service <subcommand> <data> [options]
The command is used to configure vitis and retrieve service information.
By default, the settings are stored in the file '~/.vitis.conf', but each time
you call vitis, you can use an alternate configuration file
using option '--conf=<path_to_configure_file>'.
Subcommands 'add', 'get', 'set' allow to work with the vitis settings.
The configuration elements currently are:
path - path where vitis stores all categories and links to files;
lang - language used is vitis;
filespace(s) - paths to directories in the file system;
opener - program selected for universal opening of files;
default - parameters by default (only for the set command).
vitis service get path
Displays the path to the root directory of Vitis.
By default, '/home/$USERNAME/Vitis'.
vitis service get lang
Displays the language locale used, for example, ru_RU or en_US.
vitis service get opener
Displays the program selected for use with the 'vitis open' command.
By default, the vts-fs-open utility (if installed) is a by-product
of the Vitis project. If the utility is not installed,
an attempt is made to use one of the standart options offered
by your desktop environment.
vitis service set path <my_path>
Sets the path to the root directory of Vitis.
Example:
vitis service set path /data/local/VitisDir
vitis service set lang <language>
Sets the language localization for vitis.
Example:
vitis service set lang ru_RU
vitis service set opener <application>
The program for opening files is the the one specified by the user.
Example:
vitis service set opener mime-open
vitis service set default
Sets the Vitis path, the language and the opening program
to the default settings.
The configuration parameters 'filespace' and 'filespaces' allows to assign
files to which the Vitis system will refer.
File spaces are used in the assign command with the '--save' flag:
vitis service reset filespaces
vitis service add filespace /mnt/BigDisk/All
vitis assign -c Photo -f /my/path/IMG_20180505_171403.jpg --save
The file 'IMG_20180505_171403.jpg' from '/my/path/' will be copied
to the first available directory from the number of filespaces
(i.e. to the directory '/mnt/BigDisk/All').
Details: vitis assign --help
vitis service get filespaces
Displays a list of paths to filespaces.
By default, the list is empty.
vitis service reset filespaces
Clears the list of filespaces.
vitis service add filespace </my/path>
Allows to add a filespace.
Example:
vitis service add filespace /mnt/BigDisk/All/
vitis service prioritize filespace </my/path>
Puts the filespace first in the list.
vitis service disregard filespace </path/to/filespace>
Removes a more unused filespace from the configuration settings.
Example:
vitis service disregard filespace /mnt/BigDisk/All
Subcommand 'check' checks the state of the Vitis system.
Format of subcommand:
vitis check <object> [-c category] [--fix]
Objects of checking (options after 'check'):
broken-links - broken symbolic links;
unnecessary-links - redundant links;
network - presence of saved pages to net-bookmarks.
Option '--fix' fixes invalid situations.
Option '-c' allows to specify the category by which the check will be performed.
If you do not use the '-c' option,
the test is performed throughout the Vitis system.
Option '--interactive' is a compromise between simple diagnostics
and automatic fixing of problems. User himself makes a decision on each case
during the diagnostics.
It cancels the '--fix' option.
Option '--fresh' is only available for the network object, it allows to update
local copies of previously save pages.
Examples:
vitis check broken-links
It will search for the broken links, the result of the diagnostics
will be displayed in the terminal for the possibility of correction.
vitis check broken-links --fix
All broken links will be deleted.
vitis check broken-links -c Музыка --interactive
Diagnostics for the presence of broken links in the category 'Music'.
For each such link the user is asked to delete.
vitis check unnecessary-links
Searching of files those are simultaneously assigned a category
and its subcategory.
vitis check unnecessary-links --fix
Redundant links will be deleted.
vitis check network
Passes through the contents of the automatic category 'NetworkBookmarks',
displays information about which pages were not saved locally.
vitis check network --fix
Local copies of the pages will be saved
for all bookmarks those did not have them.
vitis check network --fresh
Previously created local copies will be updated.
vitis check network --fix --fresh
All net-bookmarks will receive updated copies of the pages.
\ No newline at end of file
--------------------------------------------------------------------------------
Basic format for command 'show':
vitis show [[-e][-f][--all-categories]] <input data> [options]
vitis show --all-categories [--hidden]
The command displays a list of all created categories.
vitis show <category> [options]
This command displays a list of files from the category.
Categories those have spaces in their composition are quoted.
If the category is nested, the full path is spelled.
Example:
vitis show "Disco 80's"
vitis show [-e] <expression> [options]
This command displays a list of files according to the expression
with the operations of intersection, union, complement (subtraction).
If the category or path contains spaces, you should use quotation marks.
The '-e' flag is optional.
Variants of the designation of operations:
union: u: + ∪ ⋃
intersection: i: ∩ ⋂
complement: c: d: \\
Grouping the parts of the expression is done using braces.