glast

For discussions about programming and projects not necessarily associated with Porteus.
User avatar
M. Eerie
Moderator
Moderator
Posts: 620
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

glast

Post#1 by M. Eerie » 06 Jun 2023, 12:55

Started exploring the awesome fzf a while ago.

you can achieve great results from single oneliners:

INSTALL ARCH PACKAGES:

Code: Select all

pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S
REMOVE ARCH PACKAGES:

Code: Select all

pacman -Qq | fzf --multi --preview 'pacman -Qi {1}' | xargs -ro sudo pacman -Rns
FUZZYACTIVATE MODULES:

Code: Select all

activate $(find "$PORTDIR"/ -name "*.xzm" | fzf --multi
To build your own file manager


Then I remembered that I had an old (gitlast) function included in my Nemesis MATE to retrieve the latest version of some packages in github. So there was no reason not to make it more interactive:

Code: Select all

glast() {
local REPO
if [ $# -eq 0 ]; then
cat <<EOF
Syntax: glast <OWNER/REPO>

	Examples:

	glast AppImage/AppImageKit
	glast AppImage/pkg2appimage
	glast clickot/ungoogled-chromium-binaries
	glast aristocratos/btop
	glast jarun/nnn
	glast sharkdp/fd
	glast BurntSushi/ripgrep
	glast doublecmd/doublecmd
	glast peazip/PeaZip
	glast imagemagick/imagemagick
	glast ksnip/ksnip
	glast flameshot-org/flameshot
	glast VSCodium/vscodium
	glast keepassxreboot/keepassxc
	glast 4gray/iptvnator
	glast arrowtype/recursive
	glast ToxicFrog/Ligaturizer
	git clone https://github.com/ToxicFrog/Ligaturizer

NOTES:
      Press <TAB> to select multiple files and download them at once
      Use ddgr in your terminal to discover GITHUB repos
EOF

else
	REPO="${1}"
	url="https://api.github.com/repos/"${REPO}"/releases/latest"
	curl -sL "${url}" | awk '/browser_download_url.*/{print $(NF)}' | fzf -m | xargs wget -qo -
fi
}
export -f glast
bind '"\C-G":" glast\n"'  # glast bound to ctrl+G
Now, whenever I open a terminal and press Ctrl+G, I get some examples of how to use it.

I.e.: glast doublecmd/doublecmd allows you to get the last doublecmd version.

Now, you can use ddgr or your browser to discover github repos and further automate your packaging.

Hope you fzf it useful :)

NOTE: It might be a good idea to include fzf in Porteux ;)
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=84002#p84002
https://forum.porteus.org/viewtopic.php?p=77174#p77174
https://forum.porteus.org/viewtopic.php?f=39&t=8584

appEnigma
White ninja
White ninja
Posts: 18
Joined: 17 Jun 2023, 12:44
Distribution: Linux

glast

Post#2 by appEnigma » 29 Jun 2023, 06:44

Hi,
How did you install pacman inside Porteus. Can you please mention the steps here.

User avatar
M. Eerie
Moderator
Moderator
Posts: 620
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

glast

Post#3 by M. Eerie » 29 Jun 2023, 08:55

appEnigma wrote:
29 Jun 2023, 06:44
pacman inside Porteus
There's a Porteus derivative called Nemesis which is based on Artix Linux (Archlinux with openrc init) and uses pacman as package manager.
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=84002#p84002
https://forum.porteus.org/viewtopic.php?p=77174#p77174
https://forum.porteus.org/viewtopic.php?f=39&t=8584

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

glast

Post#4 by ncmprhnsbl » 15 Jul 2023, 05:19

yeah, pacman in slackware porteus would be somewhat pointless ..
a fzf example for slackware might(totally untested) be more like:

Code: Select all

slapt-get --list | fzf --multi --preview 'slapt-get --show {1}' | xargs -ro sudo slapt-get --install
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply