diff options
| -rw-r--r-- | modules/by-name/au/ausweisapp/module.nix | 18 | ||||
| -rw-r--r-- | pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs | 20 |
2 files changed, 27 insertions, 11 deletions
diff --git a/modules/by-name/au/ausweisapp/module.nix b/modules/by-name/au/ausweisapp/module.nix new file mode 100644 index 00000000..3a89db9d --- /dev/null +++ b/modules/by-name/au/ausweisapp/module.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + libraries, + ... +}: let + cfg = config.soispha.programs.ausweisapp; +in { + options.soispha.programs.ausweisapp = { + enable = libraries.base.options.mkEnable "AusweisApp"; + }; + + config = lib.mkIf cfg.enable { + soispha.impermanence.userDirectories = [ + ".config/AusweisApp" + ]; + }; +} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs index 31324e1d..b8ac27d2 100644 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs @@ -8,7 +8,7 @@ // You should have received a copy of the License along with this program. // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -use std::{io::stdout, path::PathBuf}; +use std::{io::stderr, path::PathBuf}; use anyhow::Result; use crossterm::{ @@ -35,7 +35,7 @@ impl MappingsTrie { pub fn interactive_start(&self, home_path: PathBuf) -> Result<()> { terminal::enable_raw_mode()?; execute!( - stdout(), + stderr(), EnterAlternateScreen, PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES), MoveToRow(0) @@ -43,7 +43,7 @@ impl MappingsTrie { let output = self.interactive_start_inner(home_path); - execute!(stdout(), LeaveAlternateScreen, PopKeyboardEnhancementFlags)?; + execute!(stderr(), LeaveAlternateScreen, PopKeyboardEnhancementFlags)?; terminal::disable_raw_mode()?; match output? { @@ -59,18 +59,16 @@ impl MappingsTrie { fn interactive_start_inner(&self, home_path: PathBuf) -> Result<Status> { macro_rules! done { ($state:ident, $last_length:ident) => {{ - let value = self - .0 - .get(&$state) - .expect("Is some") - .value() - .expect("is some"); + let value = match self.0.get(&$state).expect("Is some").value() { + Some(value) => value, + None => return Ok(Status::Stop), + }; let path = home_path.join(&value.path); terminal::disable_raw_mode()?; execute!( - stdout(), + stderr(), MoveUp($last_length as u16), Clear(ClearType::FromCursorDown), Print(format!("{}\n", path.display())) @@ -101,7 +99,7 @@ impl MappingsTrie { terminal::disable_raw_mode()?; let string = trie.to_string(); execute!( - stdout(), + stderr(), MoveUp(last_length as u16), Clear(ClearType::FromCursorDown), Print(format!( |
