fm/common/
constant_strings_paths.rs

1/// Configuration folder path
2pub const CONFIG_FOLDER: &str = "~/.config/fm";
3/// Configuration file path
4pub const CONFIG_PATH: &str = "~/.config/fm/config.yaml";
5/// Session file path
6pub const SESSION_PATH: &str = "~/.config/fm/session.yaml";
7/// Filepath of the opener config file
8pub const OPENER_PATH: &str = "~/.config/fm/opener.yaml";
9/// Filepath of the TUIS configuration file
10pub const TUIS_PATH: &str = "~/.config/fm/tuis.yaml";
11/// Filepath of the CLI configuration file
12pub const CLI_PATH: &str = "~/.config/fm/cli.yaml";
13/// Inputhistory
14pub const INPUT_HISTORY_PATH: &str = "~/.config/fm/log/input_history.log";
15/// Syntect theme paths
16pub const SYNTECT_THEMES_PATH: &str = "~/.config/fm/syntect_themes/";
17/// Path to the normal log file
18pub const NORMAL_LOG_PATH: &str = "~/.config/fm/log/fm.log";
19/// Path to the action log file
20pub const ACTION_LOG_PATH: &str = "~/.config/fm/log/action_logger.log";
21/// Path the temporary cloned repositories
22pub const REPOSITORIES_PATH: &str = "/tmp/fm/plugin/cloned_repositories";
23/// Path to the compiled libso plugins
24pub const PLUGIN_LIBSO_PATH: &str = "~/.local/share/fm/plugins";
25/// Path to the trash folder files
26pub const TRASH_FOLDER_FILES: &str = "~/.local/share/Trash/files";
27/// Path to the trash folder info file
28pub const TRASH_FOLDER_INFO: &str = "~/.local/share/Trash/info";
29/// Trash info files extension. Watchout it includes the final '.'
30pub const TRASH_INFO_EXTENSION: &str = ".trashinfo";
31/// File where marks are stored.
32pub const MARKS_FILEPATH: &str = "~/.config/fm/marks.cfg";
33/// Temporary folder used when bulkrenaming files
34pub const TMP_FOLDER_PATH: &str = "/tmp";
35/// Video thumbnails
36pub const TMP_THUMBNAILS_DIR: &str = "/tmp/fm-thumbnails";
37/// Default syntect theme, theme is hardcoded into binary
38pub const SYNTECT_DEFAULT_THEME: &str = "monokai";
39/// setsid. Installed in most distros
40pub const SETSID: &str = "setsid";
41/// Opener used to play audio files. Does it require a terminal ?
42pub const OPENER_AUDIO: (&str, bool) = ("mocp", true);
43/// Program used to to display images. Does it require a terminal ?
44pub const OPENER_IMAGE: (&str, bool) = ("viewnior", false);
45/// Program used to open "office" documents (word, libreoffice etc). Does it require a terminal ?
46pub const OPENER_OFFICE: (&str, bool) = ("libreoffice", false);
47/// Program used to open readable documents (pdf, ebooks). Does it require a terminal ?
48pub const OPENER_READABLE: (&str, bool) = ("zathura", false);
49/// Program used to open text files. Does it require a terminal ?
50pub const OPENER_TEXT: (&str, bool) = ("nvim", true);
51/// Program used to open unknown files. Does it require a terminal ?
52pub const OPENER_DEFAULT: (&str, bool) = ("xdg-open", false);
53/// Program used to open vectorial images. Does it require a terminal ?
54pub const OPENER_VECT: (&str, bool) = ("inkscape", false);
55/// Program used to open videos. Does it require a terminal ?
56pub const OPENER_VIDEO: (&str, bool) = ("mpv", false);
57/// Array of text representation of a file permissions.
58/// The index of each string gives a correct representation.
59pub const NORMAL_PERMISSIONS_STR: [&str; 8] =
60    ["---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx"];
61pub const SETUID_PERMISSIONS_STR: [&str; 8] =
62    ["--S", "--s", "-wS", "-ws", "r-S", "r-s", "rwS", "rws"];
63pub const SETGID_PERMISSIONS_STR: [&str; 8] = SETUID_PERMISSIONS_STR;
64pub const STICKY_PERMISSIONS_STR: [&str; 8] =
65    ["--T", "--t", "-w-", "-wt", "r-T", "r-t", "rwT", "rwt"];
66/// Description of the application.
67pub const HELP_FIRST_SENTENCE: &str = " fm: a dired / ranger like file manager. ";
68/// Description of the content below, aka the help itself.
69pub const HELP_SECOND_SENTENCE: &str = " Keybindings ";
70/// Description of the content below, aka the action log file
71pub const LOG_FIRST_SENTENCE: &str = " Logs: ";
72/// Description of the content below, aka what is logged there.
73pub const LOG_SECOND_SENTENCE: &str = " Last actions affecting the file tree";
74/// Ueberzug image thumbnails
75pub const THUMBNAIL_PATH_PNG: &str = "/tmp/fm_thumbnail.png";
76/// Ueberzug image thumbnails
77pub const THUMBNAIL_PATH_JPG: &str = "/tmp/fm_thumbnail.jpg";
78/// Ueberzug image for videos, without extension
79pub const THUMBNAIL_PATH_NO_EXT: &str = "/tmp/fm_thumbnail";
80/// Libreoffice pdf output
81pub const CALC_PDF_PATH: &str = "/tmp/fm_calc.pdf";
82/// Array of hardcoded shortcuts with standard *nix paths.
83pub const HARDCODED_SHORTCUTS: [&str; 9] = [
84    "/",
85    "/dev",
86    "/etc",
87    "/mnt",
88    "/opt",
89    "/run/media",
90    "/tmp",
91    "/usr",
92    "/var",
93];
94/// Ripgrep & its parameters
95pub const RG_EXECUTABLE: &str = "rg --line-number --color=never .";
96/// Grep and its parameters
97pub const GREP_EXECUTABLE: &str = "grep -rI --line-number .";
98/// sshfs executable
99pub const SSHFS_EXECUTABLE: &str = "sshfs";
100/// Notify app executable
101pub const NOTIFY_EXECUTABLE: &str = "notity-send";
102/// Eject (of removable device) executable
103pub const EJECT_EXECUTABLE: &str = "eject";
104/// Encrypted devices bind description
105pub const ENCRYPTED_DEVICE_BINDS: &str = "m: mount   --   u: unmount   --   g: go to mount point";
106/// Sort presentation for the second window
107pub const SORT_LINES: [&str; 9] = [
108    "Type the initial",
109    "",
110    "k:  by kind (default)",
111    "n:  by name",
112    "m:  by modification time",
113    "s:  by size",
114    "e:  by extension",
115    "",
116    "r:  reverse current sort",
117];
118/// Remote menu presentation
119pub const REMOTE_LINES: [&str; 5] = [
120    "Mount a directory with sshfs",
121    "Type the arguments as below, separated by a space.",
122    "Port and local path are optional",
123    "",
124    "username hostname:port remote_path local_path",
125];
126/// Presentation of new dir. creation in cloud
127pub const CLOUD_NEWDIR_LINES: [&str; 1] = ["Create a new directory in current cloud path"];
128/// Chmod presentation for the second window
129pub const CHMOD_LINES: [&str; 5] = [
130    "Type an octal like \"754\", a text like \"rwxr.xr..\" or \"a+x\"",
131    "",
132    "4:      read",
133    "2:      write",
134    "1:      execute",
135];
136/// Filter presentation for the second window
137pub const FILTER_LINES: [&str; 6] = [
138    "Type the initial of the filter and an expression if needed",
139    "",
140    "n {name}:      by name",
141    "e {extension}: by extension",
142    "d:             only directories",
143    "a:             reset",
144];
145/// Password input presentation for the second window
146pub const PASSWORD_LINES_SUDO: [&str; 2] = [
147    "Type your sudo password.",
148    "It will be forgotten immediatly after use.",
149];
150/// Presentation of the passkey input
151pub const PASSWORD_LINES_DEVICE: [&str; 2] = [
152    "Type the device passkey.",
153    "It will be forgotten immediatly after use.",
154];
155/// Shell presentation for the second window
156pub const SHELL_LINES: [&str; 13] = [
157    "Type a shell command",
158    "",
159    "`sudo` commands are supported.",
160    "Pipes, redirections ( | < > >> ) and shell specific syntax (*) aren't supported.",
161    "",
162    "Some expression can be expanded:",
163    "%s: the selected file",
164    "%f: the flagged files",
165    "%e: the extension of the file",
166    "%n: the filename only",
167    "%d: the full path of the current directory",
168    "%t: execute the command in the same window",
169    "%c: the current clipboard as a string",
170];
171/// Nvim address setter presentation for second window
172pub const NVIM_ADDRESS_LINES: [&str; 4] = [
173    "Type the Neovim RPC address.",
174    "",
175    "You can get it from Neovim with :",
176    "`:echo v:servername`",
177];
178/// Regex matcher presentation for second window
179pub const REGEX_LINES: [&str; 3] = [
180    "Type a regular expression",
181    "",
182    "Flag every file in current directory matching the typed regex",
183];
184/// Newdir presentation for second window
185pub const NEWDIR_LINES: [&str; 3] = [
186    "mkdir a new directory",
187    "",
188    "Nothing is done if the directory already exists",
189];
190/// New file presentation for second window
191pub const NEWFILE_LINES: [&str; 3] = [
192    "touch a new file",
193    "",
194    "Nothing is done if the file already exists",
195];
196/// Rename presentation for second window
197pub const RENAME_LINES: [&str; 3] = [
198    "rename the selected file",
199    "",
200    "Nothing is done if the file already exists",
201];
202/// Trash presentation
203pub const TRASH_CONFIRM_LINE: &str =
204    "Up, Down: navigation - Enter: restore the selected file - x: delete permanently - ";
205/// Mediainfo (used to preview media files) executable
206pub const MEDIAINFO: &str = "mediainfo";
207/// ueberzug (used to preview images, videos & fonts)
208pub const UEBERZUG: &str = "ueberzug";
209/// fontimage (used to preview fonts)
210pub const FONTIMAGE: &str = "fontimage";
211/// ffmpeg (used to preview video thumbnail)
212pub const FFMPEG: &str = "ffmpeg";
213/// rsvg-convert (used to preview svg files)
214pub const RSVG_CONVERT: &str = "rsvg-convert";
215/// jupyter. used to preview notebooks (.ipynb)
216pub const JUPYTER: &str = "jupyter";
217/// pandoc. used to preview .doc & .odb documents
218pub const PANDOC: &str = "pandoc";
219/// isoinfo. used to preview iso file content
220pub const ISOINFO: &str = "isoinfo";
221/// socket file explorer
222pub const SS: &str = "ss";
223/// mkdir is used to create path before mounting
224pub const MKDIR: &str = "mkdir";
225/// mount is used to mount usb removable devices
226pub const MOUNT: &str = "mount";
227/// umount is used to mount usb removable devices
228pub const UMOUNT: &str = "umount";
229/// lsblk is used to get mountpoints, info about encrypted drives
230pub const LSBLK: &str = "lsblk";
231/// cryptsetup is used to mount encrypted drives
232pub const CRYPTSETUP: &str = "cryptsetup";
233/// udisksctl is used to mount drives
234pub const UDISKSCTL: &str = "udisksctl";
235/// gio is used to mount removable devices
236pub const GIO: &str = "gio";
237/// used to get information about fifo files
238pub const UDEVADM: &str = "udevadm";
239/// neovim executable
240pub const NVIM: &str = "nvim";
241/// bsdtar executable, used to display common archive content
242pub const BSDTAR: &str = "bsdtar";
243/// 7z executable, used to display 7z archive content
244pub const SEVENZ: &str = "7z";
245/// libreoffice executable
246pub const LIBREOFFICE: &str = "libreoffice";
247/// lazygit
248pub const LAZYGIT: &str = "lazygit";
249/// duf
250pub const NCDU: &str = "ncdu";
251/// transmission-show
252pub const TRANSMISSION_SHOW: &str = "transmission-show";
253/// Zoxide executable
254pub const ZOXIDE: &str = "zoxide";
255/// pdftoppm
256pub const PDFTOPPM: &str = "pdftoppm";
257/// pdfinfo
258pub const PDFINFO: &str = "pdfinfo";
259/// pdftotext
260pub const PDFTOTEXT: &str = "pdftotext";
261/// readelf
262pub const READELF: &str = "readelf";
263/// default nerdfont icon used for directories.
264pub const DIR_ICON: &str = " ";