summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2022-12-09 06:49:12 +0100
committerqkzk <qu3nt1n@gmail.com>2022-12-09 06:49:12 +0100
commit83e3ea57f00f29ebdda29be85532434e9a4c90b7 (patch)
tree1c1442e07fbca9c606d0b42ef21185d2aa3a75ad
parentdd1b9aef9f81fd6c37143c1fd7a2b917103248e3 (diff)
rename unknown to default for better clarityopener-fallback
-rw-r--r--opener.yaml6
-rw-r--r--src/opener.rs9
2 files changed, 7 insertions, 8 deletions
diff --git a/opener.yaml b/opener.yaml
index 42321b4..78dc6df 100644
--- a/opener.yaml
+++ b/opener.yaml
@@ -1,3 +1,6 @@
+default:
+ opener: xdg-open
+ use_term: false
audio:
opener: mocp
use_term: true
@@ -13,9 +16,6 @@ readable:
text:
opener: nvim
use_term: true
-unknown:
- opener: rifle
- use_term: false
vectorial_image:
opener: inkscape
use_term: false
diff --git a/src/opener.rs b/src/opener.rs
index 5b09dab..d7179dd 100644
--- a/src/opener.rs
+++ b/src/opener.rs
@@ -32,7 +32,7 @@ pub enum ExtensionKind {
Office,
Readable,
Text,
- Unknown,
+ Default,
Vectorial,
Video,
}
@@ -63,7 +63,7 @@ impl ExtensionKind {
"pdf" | "epub" => Self::Readable,
- _ => Self::Unknown,
+ _ => Self::Default,
}
}
}
@@ -82,7 +82,7 @@ impl OpenerAssociation {
(ExtensionKind::Office, OpenerInfo::new("libreoffice", false)),
(ExtensionKind::Readable, OpenerInfo::new("zathura", false)),
(ExtensionKind::Text, OpenerInfo::new("nvim", true)),
- (ExtensionKind::Unknown, OpenerInfo::new("xdg-open", false)),
+ (ExtensionKind::Default, OpenerInfo::new("xdg-open", false)),
(ExtensionKind::Vectorial, OpenerInfo::new("inkscape", false)),
(ExtensionKind::Video, OpenerInfo::new("mpv", false)),
]),
@@ -93,7 +93,6 @@ impl OpenerAssociation {
macro_rules! open_file_with {
($self:ident, $key:expr, $variant:ident, $yaml:ident) => {
if let Some(o) = OpenerInfo::from_yaml(&$yaml[$key]) {
- info!("key {:?} variant {:?}", $key, ExtensionKind::$variant);
$self
.association
.entry(ExtensionKind::$variant)
@@ -113,7 +112,7 @@ impl OpenerAssociation {
open_file_with!(self, "libreoffice", Office, yaml);
open_file_with!(self, "readable", Readable, yaml);
open_file_with!(self, "text", Text, yaml);
- open_file_with!(self, "unknown", Unknown, yaml);
+ open_file_with!(self, "default", Default, yaml);
open_file_with!(self, "vectorial_image", Vectorial, yaml);
open_file_with!(self, "video", Video, yaml);