Skip to main content

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