Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/running-grass/system-packages
Emacs在使用
https://github.com/running-grass/system-packages
Last synced: about 1 month ago
JSON representation
Emacs在使用
- Host: GitHub
- URL: https://github.com/running-grass/system-packages
- Owner: running-grass
- License: gpl-3.0
- Created: 2024-03-11T02:28:02.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-03-11T04:52:03.000Z (10 months ago)
- Last Synced: 2024-10-12T05:07:19.256Z (2 months ago)
- Language: Emacs Lisp
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: System Packages
#+AUTHOR: J. Alexander Branham
#+LANGUAGE: en#+NAME: pipeline-status
[[https://gitlab.com/jabranham/system-packages/badges/master/pipeline.svg]]This is a collection of functions to make handling installed system
packages more convenient through Emacs.* Installation
System packages is available on [[https://elpa.gnu.org/packages/system-packages.html][GNU ELPA]]. You can get it by doing
M-x package-install RET system-packages RET.Users of Debian ≥10 and derivatives can install it with the following:
#+BEGIN_SRC sh
sudo apt install elpa-system-packages
#+END_SRC* Configuration
The package attempts to guess which package manager you use. If it
guesses wrong (or you'd like to set it manually), you may modify the
variable =system-packages-package-manager=.We also attempt to guess whether or not to use sudo with appropriate
commands (like installing and uninstalling packages). Some package
managers (like homebrew) warn not to use sudo, others (like =apt=)
need sudo privileges. You may set this manually by configuring
=system-packages-use-sudo=.Other package customization options can be accessed with M-x
=customize-group RET system-packages RET=.* Supported package managers
Currently, =system-packages= knows about the following package managers.
You can see exactly what commands are associated with =system-packages=
commands by checking =system-packages-supported-package-managers=. The
default package manager that we use is the first one found from this
list:- guix
- nix
- brew
- macports
- pacman
- apt
- aptitude
- emerge
- zypper
- dnf
- xbps* Usage
The package doesn't presume to set keybindings for you, so you may set
those up yourself or simply call functions with =M-x=. All commands
start with =system-packages=
* Adding other package managers
It is straightforward to add support for package managers. First, add
the commands to =system-packages-supported-package-managers= like so:#+BEGIN_SRC emacs-lisp
(add-to-list 'system-packages-supported-package-managers
'(pacaur .
((default-sudo . nil)
(install . "pacaur -S")
(search . "pacaur -Ss")
(uninstall . "pacaur -Rs")
(update . "pacaur -Syu")
(clean-cache . "pacaur -Sc")
(log . "cat /var/log/pacman.log")
(change-log . "pacaur -Qc")
(get-info . "pacaur -Qi")
(get-info-remote . "pacaur -Si")
(list-files-provided-by . "pacaur -Ql")
(owning-file . "pacaur -Qo")
(owning-file-remote . "pacaur -F")
(verify-all-packages . "pacaur -Qkk")
(verify-all-dependencies . "pacaur -Dk")
(remove-orphaned . "pacaur -Rns $(pacman -Qtdq)")
(list-installed-packages . "pacaur -Qe")
(list-installed-packages-all . "pacaur -Q")
(list-dependencies-of . "pacaur -Qi")
(noconfirm . "--noconfirm"))))
#+END_SRCAny occurrences of ~%p~ in a command will be replaced with the package
name during execution, otherwise the package name is simply appended
to the command.You may also need to adjust =system-packages-package-manager= and
=system-packages-use-sudo= accordingly:#+BEGIN_SRC emacs-lisp
(setq system-packages-use-sudo t)
(setq system-packages-package-manager 'pacaur)
#+END_SRC
* See also
Helm users might like [[https://github.com/emacs-helm/helm-system-packages][helm-system-packages]]