pkm 1.2.1

Simple Yay wrapper


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

pkm

PacKageManager - Simple apt-style yay wrapper

<!-- Uncomment when shelds going to add dub score --> <!-- aur dub git license aur votes --> <!-- Custom score badge, doesnt really work coz it shows 0.700090412 etc --> <!-- -->

aur dub git license aur votes dub rating dub rating <!-- --> <!-- --> <!-- Cool status badge idk. Uncommentt current one -->

<!-- Packaging status -->

Description

pkm is simple AUR helper intended to be used alongside with yay. It is not trying to be full replacement, but tries to improve and streamline installation/discovery sprocess.

All pkm commands are simply yay commands, wrapped in apt/pamac ux, which are displayed as is except search. Search in pkm is tweaked to have minimal interface and provide better results sorting.

Installation

1. Install yay and follow yay first use

2.1 Source

Compilation of this repository requires dlang.

  1. Clone this repo and build it with dub build -b release
  2. Copy created binary ./bin/pkm to somewhere in your path, for example ~/.local/bin/
  3. Or build project with dub build pkm -b release -c install to automatically move compiled binary into /usr/bin

2.2 Binary

  1. Go to releases and download binary.
  2. Copy downloaded binary pkm to somewhere in your path, for example ~/.local/bin/

2.3 AUR

  1. Install with any package manager of your choice. Assuming you have yay install with yay -Syu pkm

2.4 dub

  1. Fetch package with dub fetch pkm
  2. Build and install into /usr/bin with dub build pkm -b release -c install

Commands

pkm commands follow pamac/apt syntax. Installing pkm install package, removing pkm remove package, etc..

If you want to perform any of following command only on AUR then add --aur or -a flag to your command.

CommandDescriptionyay command
searchSearch for package.yay -Ss [terms...]
listList installed packages.yay -Q
infoPrint info about package.yay -Qi [packages...]
installInstall package.yay -S [packages...]
removeRemove package.yay -R [packages...]
checkupdatesChecks for available updates.yay -Qu
updateUpdate repositories.yay -Sy [packages...]
upgradeUpgrade installed packages.yay -Su [packages...]
cleanClean unneeded dependencies.yay -Yc

Config

pkm can be configured with config file located at ~/.config/pkm/conf.yaml, ~/.config/pkm/pkm.yaml or ~/.pkm.yaml, one at ~ takes prority.

NameTypeDescriptionDefault
yaypathstringCustom path to yay binary.Guessed with which
yaysearchboolDisable custom pkm search.false
colorboolSets if search will be printed with colors.
Will not work if yaysearch is true.
true
separateboolSeparates search results with separator.
Will not work if yaysearch is true.
false
separatorstringSets separator for separate option. If it's unicode escape sequence then it must be wrapped in ""\u2500"
separator-colorstringSets formatting for separate option. Must be set with \e as escape symbol\e[90m
auronlyboolShould yay search only AUR.false
managersstring[]Defines custom managers.[ ]
customstring[]Custom commands.[ ]

Using custom package manager instead of yay:

You can set custom main package manager with yaypath.

If you're using pacman/yay-compatible package manager then you can use it as is while only setting yaysearch to true.

yaypath: /usr/bin/pacman
yaysearch: yes

In case of package managers with flags/commands not compatible with pacman/yay you can override default commands with custom commands.

yaypath: /usr/bin/pamac
yaysearch: yes
custom:
    # Overrides default search with pamac search and disables aur
    search: search --no-aur

Managers:

Allows usage of custom managers such as pacman, pamac and other package managers and aur helpers.

Custom managers can be used only with custom commands.

managers:
    # name: path
    pacman: /usr/bin/pacman
    pamac: /usr/bin/pamac
    aura: /usr/bin/aura
custom:
    # If you want to use custom package manager with custom command simply supply it 
    # as first argument
    sysupdate: pacman -Syu

Custom commands:

Allows to create custom commands and overriding default commands.

If first argument will match any custom defined managers then this manager will be used.

If you want to override any command make sure that there's no duplicate keys in current KeyMap (i.e. custom:) since yaml does not allow for them.

Also args must be split by space, so avoid spaces inside one argument, votecool: -Wv "my thing" will be split as ['-Wv', '"my', 'thing"'].

managers:
    aura: /usr/bin/aura
    pamac: /usr/bin/pamac
custom:
    # command: [args...]
    # Args must exclude yay as pkm will auto-supply it
    updupg: -Syu
    vote: -Wv
    unvote: -Wu
    gendb: -Y --gendb
    # Uses custom package manager (in that case aura)
    updateaur: aura -Au
    # Overrides default serach
    search: pamac search

Aliases:

Aliases can be either a command or custom command.

alias:
    # alias: name
    i: install
    s: search
    find: search
    # Pointing to custom command shown in previous example
    u: unvote

Example config:

# conf.yaml
yaypath: ~/.local/bin/yay
yaysearch: yes
auronly: yes
custom:
    updupg: -Syu
    vote: -Wv
    unvote: -Wu
alias:
    i: install
    s: search
    r: remove

All available pkm commands are calling yay with corresponding flags. This is true for search, but pkm also performs special operations to customise and improve yay's search.

Search always follows this schema:

package-name  [a] [o] [i] version/installed-version  package-size/votes install-size/popularity [repo]
    description

Here's small table to assist you in reading it:

| Field | Meaning | Special notes | | :- | :- | :- | | package-name | Name of package. | | | [a] | Is package orphaned. | Highlighted in red when true. If color is disabled displayed as [ ]. "A" stands for abandoned. | | [o] | Is package outdated. | Highlighted in red when true. If color is disabled displayed as [ ]. | | [i] | Is package installed. | Highlighted in green when true. If color is disabled displayed as [ ]. | | version | Version of package. | If installed version is different from current verison then field shows installed version hightlighed in light magenta. If color is disabled version diff shown with @ at start. | | package-size/votes | See notes. | If package from AUR: Package votes.
If package not from AUR: Package size. | package-size/votes | See notes. | If package from AUR: Package popularity.
If package not from AUR: Installation size. | [repo] | Repository of package. | Repository name is cropped to 3 symbols. | description | Description. | |

If package is from AUR then it's displaying votes/popularity instead of size and votes/popularity are highlighted in this way:

FAQ

  • ### No color anywhere except search See yay faq

  • ### My config

# ~/.config/pkm/conf.yaml
managers:
pacman: /usr/bin/pacman
custom:
    updupg: -Syu
    stats: -Ps
    pkgbuild: -Gp
    vote: -Wv
    unvote: -Wu
    sysupdate: pacman -Syu
    find: -Qs
alias:
    i: install
    s: search
    r: remove
    b: pkgbuild
    u: updupg
    I: info
    f: find
separate: yes
separator: "\u2500"
separator-color: "\e[38;5;237m"

Other AUR helpers/tools

Authors:
  • Alisa Lain
Dependencies:
sily, sily:dyaml, dyaml
Versions:
1.2.1 2023-May-08
1.2.0 2022-Dec-08
1.1.5 2022-Dec-08
1.1.4 2022-Nov-26
1.1.3 2022-Nov-25
Show all 10 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 27 downloads total

Score:
0.0
Short URL:
pkm.dub.pm