Revert more termux stuff related to previous commit
This commit is contained in:
parent
7fccc55151
commit
e8667d3c98
1 changed files with 8 additions and 13 deletions
|
@ -30,23 +30,18 @@ function command_not_found_handler {
|
||||||
|
|
||||||
# search and install/remove packages with fzf
|
# search and install/remove packages with fzf
|
||||||
pi() {
|
pi() {
|
||||||
{%@@ if distro_id == "arch" or distro_id == "termux" @@%}
|
{%@@ if distro_id == "arch" @@%}
|
||||||
local pkgmanager='pacman'
|
SELECTED_PKGS="$(paru -Slq | fzf --header='Install packages' -m --preview 'paru -Si {1}' | tr '\n' ' ')"
|
||||||
if command -v paru &> /dev/null; then
|
|
||||||
pkgmanager='paru'
|
|
||||||
fi
|
|
||||||
SELECTED_PKGS="$($pkgmanager -Slq | fzf --header='Install packages' -m --preview "$pkgmanager -Si {1}" | tr '\n' ' ')"
|
|
||||||
{%@@ else @@%}
|
{%@@ else @@%}
|
||||||
SELECTED_PKGS="$(apt list 2>/dev/null | cut -d '/' -f 1 | tail +2 | fzf --header='Install packages' -m --preview 'apt show 2>/dev/null {1}' | tr '\n' ' ')"
|
SELECTED_PKGS="$(apt list 2>/dev/null | cut -d '/' -f 1 | tail +2 | fzf --header='Install packages' -m --preview 'apt show 2>/dev/null {1}' | tr '\n' ' ')"
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
if [ -n "$SELECTED_PKGS" ]; then
|
if [ -n "$SELECTED_PKGS" ]; then
|
||||||
{%@@ if distro_id == "arch" or distro_id == "termux" @@%}
|
{%@@ if distro_id == "arch" @@%}
|
||||||
if [ pkgmanager -eq 'pacman' ] && [ distro_id -ne "termux" ]; then
|
cmd="paru -S $SELECTED_PKGS"
|
||||||
pkgmanager="doas pacman"
|
|
||||||
fi
|
|
||||||
cmd="$pkgmanager -S $SELECTED_PKGS"
|
|
||||||
{%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%}
|
{%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%}
|
||||||
cmd="doas apt install $SELECTED_PKGS"
|
cmd="doas apt install $SELECTED_PKGS"
|
||||||
|
{%@@ elif distro_id == "termux" @@%}
|
||||||
|
cmd="apt install $SELECTED_PKGS"
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
|
|
||||||
# Append the expanded command to history
|
# Append the expanded command to history
|
||||||
|
@ -190,9 +185,9 @@ update() {
|
||||||
{%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%}
|
{%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%}
|
||||||
doas apt update && doas apt full-upgrade -y && doas apt autoremove -y && doas apt autoclean -y
|
doas apt update && doas apt full-upgrade -y && doas apt autoremove -y && doas apt autoclean -y
|
||||||
{%@@ elif distro_id == "termux" @@%}
|
{%@@ elif distro_id == "termux" @@%}
|
||||||
pacman -Syu --noconfirm
|
pkg update && pkg upgrade --yes
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
{%@@ if distro_id == "ubuntu" or distro_id == "debian" @@%}
|
{%@@ if distro_id == "termux" or distro_id == "ubuntu" or distro_id == "debian" @@%}
|
||||||
pip-update-installed
|
pip-update-installed
|
||||||
cargo-update-installed
|
cargo-update-installed
|
||||||
{%@@ endif @@%}
|
{%@@ endif @@%}
|
||||||
|
|
Loading…
Reference in a new issue