NOTE: Future updates to TrAPT will be done through Codeberg.org at this link: https://codeberg.org/TheTimeTombs/TrAPT. This repository will be archived indefinitely.
New updated demo GIFs coming soon!
Use transient menus to interact with the APT package manager.
Version 2.0 of TrAPT has been updated with breaking changes! The following critical updates have been made:
- All APT commands now rely on the shelly for commands that access a shell or remote host.
- All list interfaces have been rewritten using Emacs BUI. This applies to
trapt-apt-list-modeandtrapt-exec-report. - Keybindings have changed slightly to avoid conflict with BUI default keybindings.
trapt-utils.elhas be removed and any required functionality has been merged into the other package files.trapt-apt-showremoved with plans to add this functionality as part oftrapt-apt-list-info-modein a subsequent version.- APT statistics are no longer stored in a separate file, but are recalculated every time
traptis called. They are no longer determined whenapt listis run.
TrAPT was designed to fit some niche needs:
- To make it faster and simpler to call APT commands
- To be able to view
apt listoutput in a sortable, serachable, and markable list - To make it easy to export the output of
apt listto plain text (Org mode) - To be able to run APT commands on a remote host
- To view statistics on your packages
- Use a tranisent menu to inteact with the following APT commands or directly through and interative function call:
- install
- remove
- purge
- autoremove
- list
- Install and remove programs with APT using Org mode
- Use
trapt-exec-findin your Emacs configuration to create a report or required executables that your configuration depends on - Supports sending commands to eshell or vterm
- Run APT commands on a remote host
- View statistics on your packages including:
- Number of installed packages
- Numer of upgradable packages
- Number of residual configuration files
- Number of automatically installed packages
This package requires the bui package be installed. You can install the tablist package with packages-list-packages or with use-package:
(use-package tablist
:ensure t
:defer t)Clone this repo into your Emacs load path and load with the following :
(require 'trapt)If you your version of Emacs supports use-package with the :vc keyword, you can install TrAPT using the following:
(use-package trapt
:vc (:url "https://github.com/TheTimeTombs/TrAPT"
:rev :newest
:branch "main")
:init
(require 'trapt-exec-find) ; Load early if you wish to check your config
:commands (trapt trapt-exec-find-report))Alternatively, using use-package you can put this package outside of your load path and load it with:
(use-package trapt
:load-path "/path/to/trapt"
:init
(require 'trapt-exec-find) ; Load early if you wish to check your config
:commands (trapt trapt-exec-find-report))Call the transient menu with M-x trapt. This will open the transient menu.
You can also run the following commands directly. Calling these functions will prompt the user for input.
| Emacs Function | APT Command |
|---|---|
trapt-apt-build-dep | apt build-dep |
trapt-apt-full-upgrade | apt full-upgrade |
trapt-apt-install | apt install |
trapt-apt-list | apt list |
trapt-apt-moo | apt moo |
trapt-apt-purge | apt purge |
trapt-apt-remove | apt remove |
trapt-apt-update | apt update |
Running trapt-apt-list will direct output to a tablist buffer. From this buffer, packages can be marked usinng the m key. Once packages can be marked, users can execute APT operations on the selected packages with the x key to call up the TrAPT menu, M-x trapt, or by calling the functions M-x trapt-apt-*.
From the apt list buffer, the following commands can be run:
| Key | Command | Description |
|---|---|---|
| a | trapt-org-export-all | Export all items to an Org mode buffer |
| e | trapt-org-export-marked | Export marked items to an Org mode buffer |
| x | trapt | Open trapt transient menu |
Headings in Org mode that are simply package names can be marked with customized TODO keywords corresponding to the APT commands. The defaults are below:
| APT Command | Default Org TODO Keyword |
|---|---|
build-dep | BUILD-DEP |
full-upgrade | FULL-UPGRADE |
install | INSTALL |
purge | PURGE |
reinstall | REINSTALL |
remove | REMOVE |
upgrade | UPGRADE |
In your Emacs configuration, wrap any strings contating shell commands like the example below:
(setq inferior-lisp-program (trapt-exec-find
"sbcl --noinform --no-linedit"
:pkg-mgr "apt"))Then, after Emacs has loaded, call a list of all required executables on you system and their path using trapt-exec-find-report. Any executables not found on your system will report “not found”.
From the report buffer, the following commands can be run:
| Key | Command | Description |
|---|---|---|
| p | trapt-exec-find-goto-path | Go to path where executable resides |
| c | trapt-exec-find-goto-call | Go to .el file where trapt-exec-find called |
| x | trapt | Open trapt transient menu |
This package was inspired by the Whicher pacakge for Emacs. This is an intent to take that similar idea but to extend it with more features.
TrAPT can run commands on a remote host using ssh. This uses the built-in tramp pacakage to make remote connections. To configure TrAPT, tramp needs be configured. An example configuration for a remote tramp connection that uses the fish shell is given below:
;; Set configuration options for a fish shell profile remotely
(connection-local-set-profile-variables
'remote-fish
'((shell-file-name . "/bin/fish")
(shell-command-switch . "-c")
(shell-interactive-switch . "-i")
(shell-login-switch . "-l")))
;; Tell tramp to connect to remote connection using ssh and 'remote-fish profile
(connection-local-set-profiles
`(:application tramp :protocol "ssh" :machine "IPaddress or host name")
'remote-fish)When tramp is configured, you can then define a list of remote connections for TrAPT by customizing the variable shelly-remotes:
(add-to-list shelly-remotes "username@host1")When the remote option is used on a TrAPT command, the user will then be prompted to select a host from trapt-remotes using completing-read.
- [ ] Incorporate asynchronous processes to gather APT list data. Help Approceated
- [ ] Add information from
apt showcommand into thetrapt-apt-infobuffer