From 0e20d12d98b7e46b761267004ff06a21c1bafb21 Mon Sep 17 00:00:00 2001 From: altf_four <56314286+realaltffour@users.noreply.github.com> Date: Tue, 28 Apr 2020 16:41:26 +0300 Subject: [PATCH 1/2] Update README.md Accomodate for version 1.2.2 release --- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd6325e..b26a696 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![CI](https://github.com/realaltffour/fixmydownloads/workflows/CI/badge.svg?branch=master&event=push) # fixmydownloads
-The goal of the project is to make the simplest downloads folder organizer that is configured by code making it so small that the whole thing fits in one file! +The goal of the project is to make the simplest downloads folder organizer that is configured by code making it so small that the whole thing fits in one file! Eliminating the need to manually organize or clean up your downloads folder! ## Installation Their are multiple ways you can install it. Grab your distro's package from the release section and install it! Or wait for the project to get into your distro repositories (hopefully). @@ -21,16 +21,84 @@ $ ./build.sh (For debuggable binary) $ ./buildRelease.sh (For release binary) ``` The binary is outputted into ```$(PROJECT)/bin``` +Refer to [this section](#starting-up-the-application) for setting up the application to run on login. ## Technical Overview ### Overview -The program runs in the background, watching the downloads folder with ```inotify``` and copies any new files detected, based on extension of the file, to documents folder. All folders are by default sent to documents/misc. The projects applies to [XDG File directory specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). +The program runs in the background, watching the downloads folder with ```inotify``` and copies any new files detected, based on extension of the file, to documents folder. All folders are by default sent to documents/prefix/misc. The projects applies to [XDG File directory specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). By default, the prefix is `orgdl`. ### Starting up the application -The installers install the systemd/OpenRC service by default. Ex: ```.deb``` file installs ```systemd```, ```.ebuild``` file installs ```OpenRC``` service. Compiling from source gives you the option to specify the service installed. This section is not complete. Instructions should be provided to install each of the services. +To make `fixmydl` run when you login run: +```shell +$ echo 'fixmydl' >> ~/.profile +``` ### Configuring -This section is not complete, so is the application. But the main idea is to have defines that control the behavor of the application (specifing extensions to directory, documents/downloads location, etc). The defualt configuration should be enough though. +There are multiple configuration options present. + +#### Extension ignore list +In file `main.c`, adding values to element `extension_ignore_list` will make sure that the application doesn't organize these extensions. For example, by default element: `crdownloads` is added to ignore temp files that chromium/Chrome uses while downloading content. +```C +/* Example addition */ +static const int IGNORE_LIST_SIZE = 2; /* MAKE SURE TO UPDATE THIS */ +static const char *extension_ignore_list[] = { "crdownload", "tmp" }; /* Don't add dot */ +``` +Notes: + - Make sure you update `IGNORE_LIST_SIZE` + - Make sure you don't add dot for the `extension_ignore_list` + +#### Prefix Directory +This is the name or sub-path to where the categories should be placed in the documents directory. By default, it is set to `orgdl`. Ex: `.txt` files should be placed into `$HOME/$DOCS/orgdl/txt`. To disable this, set it's value to `""` +```C +/* Example change */ +static const char prefix_dir[] = "organize/folder"; /* Do not end with trailing forward-slashes. */ +/* Example disable */ +static const char prefix_dir[] = ""; +``` +Note: + - Make sure you don't end `prefix_dir` with trailing forward-slashes. + +#### Miscellaneous Directory +This is the name of the directory where file and folder without a name are placed. By default, it's set to `misc`. Example: `test` is placed into `$HOME/$DOCS/$sprefix_dir/misc/` +```C +/* Example change*/ +static const char misc_dir_default[] = "miscellaneous"; /* Do not end with trailing forward-slashes. */ +``` +Note: + - Make sure you don't end `misc_dir_default[]` with trailing forward-slashes. + +#### Downloads & Documents Directories +If automatic checking of `XDG` fails, the program falls back to `pwd struct` method. If that fails too, then it defaults to `downloads_dir_default[]` and `documents_dir_default[]` respectively. By default, `downloads_dir_default[]` is set to `Downloads`, and `documents_dir_defaults[]` is set to `Documents`, relative to `$HOME`. +```C +/* Default Downloads change example */ +static const char downloads_dir_default[] = "dl"; /* Do not end with trailing forward-slashes */ +/* Default Documents change example */ +static const char documents_dir_default[] = "dox"; /* Do not end with trailing forward-slashes */ +``` +Note: + - Make sure you don't end `downloads_dir_default[]` or `documents_dir_default[]` with trailing forward-slashes. + +#### Advanced Configuration +This section is dedicated of the configuration of how the application operates in a low level. It won't be noticed for the average user. + +##### EVENT_BUF_LEN +The application should consume very little memory. Options like `EVENT_BUF_LEN` can be used to limit the amount of events read per iteration of the main while loop. +```C +/* Example change */ +#define EVENT_BUF_LEN (512 * (EVENT_SIZE + 16)) +``` +##### PATH_BUF_LEN +This is the amount of bytes to allocate for path buffers. Usually, `ext4` supports upto `4096` characters. Which is the default. +```C +/* Example change */ +#define PATH_BUF_LEN 3072 +``` +##### CMD_BUF_LEN +This is the amount of bytes to allocate for command line buffers. It's a must for it to be atleast 2 times the size of `PATH_BUF_LEN` and a little more room, because move operations use command line. +```C +/* Example change */ +#define CMD_BUF_LEN ((PATH_BUF_LEN * 2) * 1.1) /* Do not remove the brackets. */ +``` ### Built With @@ -48,3 +116,6 @@ This project is licensed under the GPLv3 License - see the [LICENSE.md](LICENSE. ## Inspiring I never found a downloads folder organizer that is so simple that you just install it and forget about it. Adding, I wanted to a project that would be [suckless-compatible](https://suckless.org/) (if that exists). It's worthy to note that I made a 5-minute research 'session' about download organizer for Linux and didn't find any. Therefore I called this project the simplest. + +---------------- +README.md valid till version `1.2.2` From c1f928e81c97e60c807f700a2ee7675899a7328d Mon Sep 17 00:00:00 2001 From: altf_four <56314286+realaltffour@users.noreply.github.com> Date: Tue, 28 Apr 2020 16:42:37 +0300 Subject: [PATCH 2/2] Clarify README.md validation version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b26a696..9547471 100644 --- a/README.md +++ b/README.md @@ -118,4 +118,4 @@ This project is licensed under the GPLv3 License - see the [LICENSE.md](LICENSE. I never found a downloads folder organizer that is so simple that you just install it and forget about it. Adding, I wanted to a project that would be [suckless-compatible](https://suckless.org/) (if that exists). It's worthy to note that I made a 5-minute research 'session' about download organizer for Linux and didn't find any. Therefore I called this project the simplest. ---------------- -README.md valid till version `1.2.2` +README.md valid for version `1.2.2`