aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorlukeflo2025-02-27 17:45:40 +0100
committerlukeflo2025-02-27 17:45:40 +0100
commitc52dc7ed6951af2d74804d1275e577205960b235 (patch)
tree3dc8acd0bd0e0a83922c2927cc5e00c35837ba5c /src/app.rs
parent5da77a2f812a0bb6e0057f7b2e2c642142fca125 (diff)
downloadbibiman-c52dc7ed6951af2d74804d1275e577205960b235.tar.gz
bibiman-c52dc7ed6951af2d74804d1275e577205960b235.zip
add `file_prefix` option to config and opening function
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/app.rs b/src/app.rs
index e41defc..1eaa1a3 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -359,7 +359,11 @@ pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> {
// Build command to execute pdf-reader. 'xdg-open' is Linux standard
let cmd = &cfg.general.pdf_opener;
// If necessary, replace ~ with /home dir
- let file = PathBuf::from(file);
+ let file = if cfg.general.file_prefix.is_some() {
+ cfg.general.file_prefix.clone().unwrap().join(file)
+ } else {
+ PathBuf::from(file)
+ };
let file = expand_home(&file);