mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-01 03:48:31 +08:00
Ported pacman aliases from oh-my-zsh's archlinux plugin.
Added support for having multiple sub-plugins within the archlinux family.
This commit is contained in:
parent
ede30d9f04
commit
1480c2bfa5
22
plugins/archlinux/README.md
Normal file
22
plugins/archlinux/README.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
# The Arch Linux Plugins
|
||||||
|
|
||||||
|
The Arch Linux Plugins provides a number of plugins to make using arch easier.
|
||||||
|
|
||||||
|
# The Plugins
|
||||||
|
|
||||||
|
## archlinux
|
||||||
|
|
||||||
|
This plugin includes all of provided Arch Linux Plugins wrapped in a single plugin.
|
||||||
|
|
||||||
|
To use this plugin append the following `archlinux` to `fish_plugins`.
|
||||||
|
|
||||||
|
## archlinux/pacman
|
||||||
|
|
||||||
|
This plugin makes working work pacman easier and faster. Please refer to pacman/README.md for more information.
|
||||||
|
|
||||||
|
To use this plugin append the following `archlinux` to `fish_plugins`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
6
plugins/archlinux/archlinux.load
Normal file
6
plugins/archlinux/archlinux.load
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
set -l current_dir (dirname $argv)
|
||||||
|
|
||||||
|
# add pacman related functions
|
||||||
|
set fish_function_path $current_dir/pacman $fish_function_path
|
52
plugins/archlinux/pacman/README.md
Normal file
52
plugins/archlinux/pacman/README.md
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
|
||||||
|
# pacman functions #
|
||||||
|
|
||||||
|
* pacin
|
||||||
|
Install specific package(s) from the repositories
|
||||||
|
|
||||||
|
* pacins
|
||||||
|
Install specific package not from the repositories but from a file
|
||||||
|
|
||||||
|
* pacre
|
||||||
|
Remove the specified package(s), retaining its configuration(s) and required dependencies
|
||||||
|
|
||||||
|
* pacrem
|
||||||
|
Remove the specified package(s), its configuration(s) and unneeded dependencies
|
||||||
|
|
||||||
|
* pacrep
|
||||||
|
Display information about a given package in the repositories
|
||||||
|
|
||||||
|
* pacreps
|
||||||
|
Search for package(s) in the repositories
|
||||||
|
|
||||||
|
* pacloc
|
||||||
|
Display information about a given package in the local database
|
||||||
|
|
||||||
|
* paclocs
|
||||||
|
Search for package(s) in the local database
|
||||||
|
|
||||||
|
* pacupd
|
||||||
|
Update and refresh the local package and ABS databases against repositories
|
||||||
|
|
||||||
|
* pacinsd
|
||||||
|
Install given package(s) as dependencies of another package
|
||||||
|
|
||||||
|
* pacmir
|
||||||
|
Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
* paclist
|
||||||
|
List all installed packages with a short description - Source
|
||||||
|
|
||||||
|
* paclsorphans
|
||||||
|
List all orphaned packages
|
||||||
|
|
||||||
|
* pacrmorphans
|
||||||
|
Delete all orphaned packages
|
||||||
|
|
||||||
|
* pacdisowned | less +F
|
||||||
|
List all disowned files in your system
|
||||||
|
|
||||||
|
|
||||||
|
# Based on aliases from oh-my-zsh
|
||||||
|
|
||||||
|
Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/archlinux/archlinux.plugin.zsh
|
18
plugins/archlinux/pacman/pacdisowned.fish
Normal file
18
plugins/archlinux/pacman/pacdisowned.fish
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# TODO: Need to convert to fish
|
||||||
|
function pacdisowned
|
||||||
|
# tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
|
||||||
|
# db=$tmp/db
|
||||||
|
# fs=$tmp/fs
|
||||||
|
|
||||||
|
# mkdir "$tmp"
|
||||||
|
# trap 'rm -rf "$tmp"' EXIT
|
||||||
|
|
||||||
|
# pacman -Qlq | sort -u > "$db"
|
||||||
|
|
||||||
|
# find /bin /etc /lib /sbin /usr \
|
||||||
|
# ! -name lost+found \
|
||||||
|
# \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
|
||||||
|
|
||||||
|
# comm -23 "$fs" "$db"
|
||||||
|
end
|
||||||
|
|
3
plugins/archlinux/pacman/pacin.fish
Normal file
3
plugins/archlinux/pacman/pacin.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacin -d "Install specific package(s) from the repositories"
|
||||||
|
sudo pacman -S $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacins.fish
Normal file
3
plugins/archlinux/pacman/pacins.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacins -d "Install specific package not from the repositories but from a file"
|
||||||
|
sudo pacman -U $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/paclist.fish
Normal file
3
plugins/archlinux/pacman/paclist.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function paclist
|
||||||
|
sudo pacman -Qei (pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacloc.fish
Normal file
3
plugins/archlinux/pacman/pacloc.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacloc -d "Display information about a given package in the local database"
|
||||||
|
pacman -Qi $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/paclocs.fish
Normal file
3
plugins/archlinux/pacman/paclocs.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function paclocs -d "Search for package(s) in the local database"
|
||||||
|
sudo pacman -Qs $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/paclsorphans.fish
Normal file
3
plugins/archlinux/pacman/paclsorphans.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function paclsorphans -d "Display a list of packages that were installed as dependencies but are no longer required by any installed package"
|
||||||
|
pacman -Qdt $argv
|
||||||
|
end
|
7
plugins/archlinux/pacman/pacmanallkeys.fish
Normal file
7
plugins/archlinux/pacman/pacmanallkeys.fish
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# TODO: Need to convert to fish
|
||||||
|
function pacmanallkeys
|
||||||
|
# Get all keys for developers and trusted users
|
||||||
|
#curl https://www.archlinux.org/{developers,trustedusers}/ |
|
||||||
|
#awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
|
||||||
|
#xargs sudo pacman-key --recv-keys
|
||||||
|
end
|
9
plugins/archlinux/pacman/pacmansignkeys.fish
Normal file
9
plugins/archlinux/pacman/pacmansignkeys.fish
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# TODO: Need to convert to fish
|
||||||
|
function pacmansignkeys
|
||||||
|
# for key in $*; do
|
||||||
|
# sudo pacman-key --recv-keys $key
|
||||||
|
# sudo pacman-key --lsign-key $key
|
||||||
|
# printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
|
||||||
|
# --no-permission-warning --command-fd 0 --edit-key $key
|
||||||
|
# done
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacmir.fish
Normal file
3
plugins/archlinux/pacman/pacmir.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacmir -d "Force refresh of all package lists after updating /etc/pacman.d/mirrorlist"
|
||||||
|
sudo pacman -Syy $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacre.fish
Normal file
3
plugins/archlinux/pacman/pacre.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacre -d "Remove the specified package(s), retaining its configuration(s) and required dependencies"
|
||||||
|
sudo pacman -R $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacrem.fish
Normal file
3
plugins/archlinux/pacman/pacrem.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacrem -d "Remove the specified package(s), its configuration(s) and unneeded dependencies"
|
||||||
|
sudo pacman -Rns $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacrep.fish
Normal file
3
plugins/archlinux/pacman/pacrep.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacrep -d "Display information about a given package in the repositories"
|
||||||
|
pacman -Si $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacreps.fish
Normal file
3
plugins/archlinux/pacman/pacreps.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacreps -d "Search for package(s) in the repositories"
|
||||||
|
command pacman -Ss $argv
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacrmorphans.fish
Normal file
3
plugins/archlinux/pacman/pacrmorphans.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacrmorphans -d "Remove all real orphan packages"
|
||||||
|
sudo pacman -Rs (pacman -Qtdq) $argv
|
||||||
|
end
|
10
plugins/archlinux/pacman/pacupd.fish
Normal file
10
plugins/archlinux/pacman/pacupd.fish
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
which abs ^ /dev/null > /dev/null
|
||||||
|
if test $status -ne 1
|
||||||
|
function pacupd -d "Update and refresh the local package and ABS databases against repositories"
|
||||||
|
sudo pacman -Sy; and sudo abs
|
||||||
|
end
|
||||||
|
else
|
||||||
|
function pacupd -d "Update and refresh the local package against repositories"
|
||||||
|
sudo pacman -Sy
|
||||||
|
end
|
||||||
|
end
|
3
plugins/archlinux/pacman/pacupg.fish
Normal file
3
plugins/archlinux/pacman/pacupg.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function pacupg -d "Synchronize with repositories before upgrading packages that are out of date on the local system."
|
||||||
|
sudo pacman -Syu $argv
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user