diff --git a/build/linutil b/build/linutil index 5c9389b4..733441ea 100755 Binary files a/build/linutil and b/build/linutil differ diff --git a/build/linutil-aarch64 b/build/linutil-aarch64 index f673e962..9f123cba 100755 Binary files a/build/linutil-aarch64 and b/build/linutil-aarch64 differ diff --git a/src/commands/system-setup/4-remove-snaps.sh b/src/commands/system-setup/4-remove-snaps.sh new file mode 100644 index 00000000..c839e4f0 --- /dev/null +++ b/src/commands/system-setup/4-remove-snaps.sh @@ -0,0 +1,28 @@ +#!/bin/sh -e + +. ./common-script.sh + +removeSnaps() { + case $PACKAGER in + pacman) + sudo ${PACKAGER} -Rns snapd + ;; + apt-get|nala) + sudo ${PACKAGER} autoremove --purge snapd + if [ "$ID" = ubuntu ]; then + sudo apt-mark hold snapd + fi + ;; + dnf) + sudo ${PACKAGER} remove snapd + ;; + zypper) + sudo ${PACKAGER} remove snapd + ;; + *) + echo "removing snapd not implemented for this package manager" + esac +} + +checkEnv +removeSnaps diff --git a/src/list.rs b/src/list.rs index a750f393..97e896a8 100644 --- a/src/list.rs +++ b/src/list.rs @@ -42,6 +42,49 @@ impl CustomList { name: "root", command: Command::None, } => { + ListNode { + name: "Applications Setup", + command: Command::None + } => { + ListNode { + name: "Alacritty", + command: Command::LocalFile("applications-setup/alacritty-setup.sh"), + }, + ListNode { + name: "Bash Prompt", + command: Command::Raw("bash -c \"$(curl -s https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/setup.sh)\""), + }, + ListNode { + name: "DWM-Titus", + command: Command::LocalFile("applications-setup/dwmtitus-setup.sh") + }, + ListNode { + name: "Kitty", + command: Command::LocalFile("applications-setup/kitty-setup.sh") + }, + ListNode { + name: "Neovim", + command: Command::Raw("bash -c \"$(curl -s https://raw.githubusercontent.com/ChrisTitusTech/neovim/main/setup.sh)\""), + }, + ListNode { + name: "Rofi", + command: Command::LocalFile("applications-setup/rofi-setup.sh"), + }, + ListNode { + name: "ZSH Prompt", + command: Command::LocalFile("applications-setup/zsh-setup.sh"), + } + + }, + ListNode { + name: "Security", + command: Command::None + } => { + ListNode { + name: "Firewall Baselines (CTT)", + command: Command::LocalFile("security/firewall-baselines.sh"), + } + }, ListNode { name: "System Setup", command: Command::None, @@ -58,15 +101,10 @@ impl CustomList { name: "Global Theme", command: Command::LocalFile("system-setup/3-global-theme.sh"), }, - }, - ListNode { - name: "Security", - command: Command::None - } => { ListNode { - name: "Firewall Baselines (CTT)", - command: Command::LocalFile("security/firewall-baselines.sh"), - } + name: "Remove Snaps", + command: Command::LocalFile("system-setup/4-remove-snaps.sh"), + }, }, ListNode { name: "Utilities", @@ -130,40 +168,6 @@ impl CustomList { }, }, }, - ListNode { - name: "Applications Setup", - command: Command::None - } => { - ListNode { - name: "Alacritty", - command: Command::LocalFile("applications-setup/alacritty-setup.sh"), - }, - ListNode { - name: "Bash Prompt", - command: Command::Raw("bash -c \"$(curl -s https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/setup.sh)\""), - }, - ListNode { - name: "DWM-Titus", - command: Command::LocalFile("applications-setup/dwmtitus-setup.sh") - }, - ListNode { - name: "Kitty", - command: Command::LocalFile("applications-setup/kitty-setup.sh") - }, - ListNode { - name: "Neovim", - command: Command::Raw("bash -c \"$(curl -s https://raw.githubusercontent.com/ChrisTitusTech/neovim/main/setup.sh)\""), - }, - ListNode { - name: "Rofi", - command: Command::LocalFile("applications-setup/rofi-setup.sh"), - }, - ListNode { - name: "ZSH Prompt", - command: Command::LocalFile("applications-setup/zsh-setup.sh"), - } - - }, ListNode { name: "Full System Update", command: Command::LocalFile("system-update.sh"), @@ -301,7 +305,15 @@ impl CustomList { self.toggle_preview_window(state); None } - KeyCode::Enter => self.handle_enter(), + + KeyCode::Enter | KeyCode::Right | KeyCode::Char('l') => { + if self.preview_window_state.is_none() { + self.handle_enter() + } else { + None + } + } + KeyCode::Left | KeyCode::Char('h') if !self.at_root() => self.enter_parent_directory(), _ => None, } } @@ -340,6 +352,12 @@ impl CustomList { None } + fn enter_parent_directory(&mut self) -> Option { + self.visit_stack.pop(); + self.list_state.select(Some(0)); + None + } + /// Handles the key. This key can do 3 things: /// - Run a command, if it is the currently selected item, /// - Go up a directory @@ -357,9 +375,7 @@ impl CustomList { .unwrap(); if !self.at_root() && selected_index == 0 { - self.visit_stack.pop(); - self.list_state.select(Some(0)); - return None; + return self.enter_parent_directory(); } let mut actual_index = selected_index;