diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-11-28 21:07:00 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-11-28 21:07:00 +0100 |
commit | 0f28d763b339e7ec7d794c264a1acc42cb3ebacc (patch) | |
tree | fc7337e5c90c5bd904be3a153d9855b64eaeda3d /src | |
parent | 722ae6836ef6067805d03614c67ed80feb435267 (diff) |
prevent inxi from reading graphics drivers, which may hang.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/constant_strings_paths.rs | 3 | ||||
-rw-r--r-- | src/config/keybindings.rs | 4 | ||||
-rw-r--r-- | src/event/action_map.rs | 8 | ||||
-rw-r--r-- | src/event/event_exec.rs | 6 | ||||
-rw-r--r-- | src/modes/edit/help.rs | 3 |
5 files changed, 13 insertions, 11 deletions
diff --git a/src/common/constant_strings_paths.rs b/src/common/constant_strings_paths.rs index 8ee2f8e..945cc0f 100644 --- a/src/common/constant_strings_paths.rs +++ b/src/common/constant_strings_paths.rs @@ -168,7 +168,8 @@ pub const RENAME_LINES: [&str; 3] = [ ]; pub const TRASH_CONFIRM_LINE: &str = "Enter: restore the selected file -- x: delete permanently"; /// Executable commands whose output is a text to be displayed in terminal -pub const CLI_INFO_COMMANDS: [&str; 4] = ["duf", "inxi -v 2 --color", "neofetch", "lsusb"]; +pub const CLI_INFO_COMMANDS: [&str; 4] = + ["duf", "inxi -S -I -D -i -J -M --color", "neofetch", "lsusb"]; /// Wallpaper executable pub const NITROGEN: &str = "nitrogen"; /// Mediainfo (used to preview media files) executable diff --git a/src/config/keybindings.rs b/src/config/keybindings.rs index 6da5caf..0bbc786 100644 --- a/src/config/keybindings.rs +++ b/src/config/keybindings.rs @@ -71,7 +71,7 @@ impl Bindings { (Key::Char('M'), ActionMap::MarksNew), (Key::Char('O'), ActionMap::Sort), (Key::Char('P'), ActionMap::Preview), - (Key::Char('S'), ActionMap::ShellMenu), + (Key::Char('S'), ActionMap::TuiMenu), (Key::Char('T'), ActionMap::MediaInfo), (Key::Char('X'), ActionMap::TrashMoveFile), (Key::Char('W'), ActionMap::SetWallpaper), @@ -106,7 +106,7 @@ impl Bindings { (Key::Alt('f'), ActionMap::ToggleDualPane), (Key::Alt('g'), ActionMap::Goto), (Key::Alt('h'), ActionMap::FuzzyFindHelp), - (Key::Alt('i'), ActionMap::CliInfo), + (Key::Alt('i'), ActionMap::CliMenu), (Key::Alt('j'), ActionMap::Jump), (Key::Alt('l'), ActionMap::Log), (Key::Alt('o'), ActionMap::TrashOpen), diff --git a/src/event/action_map.rs b/src/event/action_map.rs index abccaec..df8dba7 100644 --- a/src/event/action_map.rs +++ b/src/event/action_map.rs @@ -17,7 +17,7 @@ pub enum ActionMap { Bulk, Chmod, ClearFlags, - CliInfo, + CliMenu, Command, Compress, CopyFilename, @@ -85,7 +85,7 @@ pub enum ActionMap { SetWallpaper, Shell, ShellCommand, - ShellMenu, + TuiMenu, Shortcut, Sort, Symlink, @@ -118,7 +118,7 @@ impl ActionMap { ActionMap::Bulk => EventAction::bulk(status), ActionMap::Chmod => EventAction::chmod(status), ActionMap::ClearFlags => EventAction::clear_flags(status), - ActionMap::CliInfo => EventAction::cli_info(status), + ActionMap::CliMenu => EventAction::cli_menu(status), ActionMap::Command => EventAction::command(status), ActionMap::Compress => EventAction::compress(status), ActionMap::CopyFilename => EventAction::copy_filename(current_tab), @@ -185,7 +185,6 @@ impl ActionMap { ActionMap::SetWallpaper => EventAction::set_wallpaper(current_tab), ActionMap::Shell => EventAction::shell(status), ActionMap::ShellCommand => EventAction::shell_command(current_tab), - ActionMap::ShellMenu => EventAction::shell_menu(current_tab), ActionMap::Shortcut => EventAction::shortcut(current_tab), ActionMap::Sort => EventAction::sort(current_tab), ActionMap::Symlink => EventAction::symlink(status), @@ -203,6 +202,7 @@ impl ActionMap { ActionMap::TreeFold => EventAction::tree_fold(current_tab), ActionMap::TreeFoldAll => EventAction::tree_fold_all(current_tab), ActionMap::TreeUnFoldAll => EventAction::tree_unfold_all(current_tab), + ActionMap::TuiMenu => EventAction::tui_menu(current_tab), ActionMap::Custom(string) => EventAction::custom(status, string), ActionMap::Nothing => Ok(()), diff --git a/src/event/event_exec.rs b/src/event/event_exec.rs index cea7d0a..0c61876 100644 --- a/src/event/event_exec.rs +++ b/src/event/event_exec.rs @@ -348,14 +348,14 @@ impl EventAction { } /// Enter the shell menu mode. You can pick a TUI application to be run - pub fn shell_menu(tab: &mut Tab) -> Result<()> { + pub fn tui_menu(tab: &mut Tab) -> Result<()> { tab.set_edit_mode(Edit::Navigate(Navigate::TuiApplication)); Ok(()) } /// Enter the cli info mode. You can pick a Text application to be /// displayed/ - pub fn cli_info(status: &mut Status) -> Result<()> { + pub fn cli_menu(status: &mut Status) -> Result<()> { status .current_tab() .set_edit_mode(Edit::Navigate(Navigate::CliApplication)); @@ -714,7 +714,6 @@ impl EventAction { Edit::Navigate(Navigate::TuiApplication) => LeaveMode::shellmenu(status)?, Edit::Navigate(Navigate::CliApplication) => { must_refresh = false; - must_reset_mode = false; LeaveMode::cli_info(status)?; } Edit::Navigate(Navigate::EncryptedDrive) => (), @@ -1221,6 +1220,7 @@ impl LeaveMode { pub fn cli_info(status: &mut Status) -> Result<()> { let output = status.menu.cli_applications.execute()?; log_info!("output\n{output}"); + status.current_tab().reset_edit_mode(); status.current_tab().set_display_mode(Display::Preview); let preview = Preview::cli_info(&output); status.current_tab().window.reset(preview.len()); diff --git a/src/modes/edit/help.rs b/src/modes/edit/help.rs index 1c1561e..0ff23d5 100644 --- a/src/modes/edit/help.rs +++ b/src/modes/edit/help.rs @@ -104,7 +104,8 @@ Navigate as usual. Most actions works as in 'normal' view. {Search:<10}: SEARCH {Command:<10}: COMMAND {Bulk:<10}: BULK -{ShellMenu:<10}: SHELL MENU +{TuiMenu:<10}: TUI APPS +{CliMenu:<10}: CLI APPS {RemoteMount:<10}: MOUNT REMOTE PATH {Filter:<10}: FILTER (by name \"n name\", by ext \"e ext\", only directories d or all for reset) |