Opinionated Android 15+ Linux Terminal Setup
android linux command-line-tools

Merge pull request #3 from tsirysndr/feat/neofetch

feat: enable neofetch

authored by tsiry-sandratraina.com and committed by

GitHub 0e6d367a 2bda976d

+30 -1
+24
src/apply.rs
··· 23 23 Ssh(&'a SshConfig), 24 24 Paths, 25 25 Tailscale(bool), 26 + Neofetch(bool), 26 27 } 27 28 28 29 impl<'a> SetupStep<'a> { ··· 41 42 SetupStep::Ssh(config) => setup_ssh(config), 42 43 SetupStep::Paths => setup_paths(), 43 44 SetupStep::Tailscale(enabled) => enable_tailscale(*enabled), 45 + SetupStep::Neofetch(enabled) => enable_neofetch(*enabled), 44 46 } 45 47 } 46 48 ··· 192 194 "{} {}\n - Enabled: {}", 193 195 "Tailscale".blue().bold(), 194 196 "(Install and configure Tailscale VPN)".italic(), 197 + enabled.to_string().green() 198 + ) 199 + } 200 + SetupStep::Neofetch(enabled) => { 201 + format!( 202 + "{} {}\n - Enabled: {}", 203 + "Neofetch".blue().bold(), 204 + "(Enable Neofetch on terminal startup)".italic(), 195 205 enabled.to_string().green() 196 206 ) 197 207 } ··· 506 516 } 507 517 Ok(()) 508 518 } 519 + 520 + fn enable_neofetch(enabled: bool) -> Result<(), Error> { 521 + if enabled { 522 + run_command( 523 + "bash", 524 + &[ 525 + "-c", 526 + "grep -q 'neofetch' ~/.bashrc || echo 'neofetch' >> ~/.bashrc", 527 + ], 528 + ) 529 + .context("Failed to add neofetch to .bashrc")?; 530 + } 531 + Ok(()) 532 + }
+6 -1
src/config.rs
··· 59 59 60 60 #[serde(skip_serializing_if = "Option::is_none")] 61 61 pub ssh: Option<SshConfig>, 62 + 63 + #[serde(skip_serializing_if = "Option::is_none")] 64 + pub neofetch: Option<bool>, 62 65 } 63 66 64 67 impl Configuration { ··· 99 102 self.alias.as_ref().map(SetupStep::Alias), 100 103 self.ssh.as_ref().map(SetupStep::Ssh), 101 104 self.tailscale.map(SetupStep::Tailscale), 105 + self.neofetch.map(SetupStep::Neofetch), 102 106 ] 103 107 .into_iter() 104 108 .flatten() ··· 145 149 "openssh-client", 146 150 "httpie", 147 151 "code", 148 - "screenfetch", 152 + "neofetch", 149 153 "stow", 150 154 ] 151 155 .into_iter() ··· 190 194 port: Some(8022), 191 195 authorized_keys: Some(vec![]), 192 196 }), 197 + neofetch: Some(true), 193 198 } 194 199 } 195 200 }