You are not logged in.

#1 2024-08-15 20:45:24

aljustiet
Member
Registered: 2024-02-09
Posts: 89
Website

How to set pager for pacman?

When I run

pacman -Fl package

. It lists it without paging. To page I should pipe it. But it's uncomfortable since I should do it every time I run the pacman -Fl or similar command. How can I set pager then? I tried to search in manpages of the pacman for the 'pager' keyword, also in first 3 search results from google.

Offline

#2 2024-08-15 21:08:35

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,649

Re: How to set pager for pacman?

Write a pacman function that (maybe conditionally) invokes the commands using a pager (and you probably want less -F)

Offline

#3 2024-08-15 22:29:33

mountaintrek
Member
Registered: 2024-02-01
Posts: 60

Re: How to set pager for pacman?

Agree with Seth.

If using bash, put functions into .bashrc, set permissions, and either open a new terminal or source .bashrc.

Specific example..
Usage: pacfilelist <pkg>
Example: pacfilelist gimp

#!/bin/bash
function pacfilelist() {
  : 'List files owned by package and pipe to less'

  pacman -Fl "${1:?Missing package name}" | less
}

Generic example.
Usage:  pacless <pacman_options> <pkg>
Example1: pacless -Fl gimp
Example2: pacless -Q

#!/bin/bash
function pacless() {
  : 'Pipe pacman to less'

  pacman "${@}" | less
}

Last edited by mountaintrek (2024-08-15 22:31:36)

Offline

#4 2024-08-15 23:03:14

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,649

Offline

Board footer

Powered by FluxBB