pacboy

GUI wrapper for pacman
git clone git://git.kocotian.pl/pacboy.git
Log | Files | Refs | README | LICENSE

commit ca2dfb064bd7c6335cc3f36fecff23d15f9a0e1f
parent 1c65ac37cfd52a76503725df1a7a9b5617784235
Author: kocotian <kocotian@kocotian.pl>
Date:   Tue,  5 Jan 2021 21:09:11 +0100

removed partial upgrades

Diffstat:
ACONTRIBUTIONS | 1+
MMakefile | 6+++---
MREADME | 8++++----
Mlanguages/pl.diff | 3---
Dpacboy | 91-------------------------------------------------------------------------------
Dpacboy.desktop | 10----------
Apacgtk | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apacgtk.desktop | 10++++++++++
8 files changed, 99 insertions(+), 111 deletions(-)

diff --git a/CONTRIBUTIONS b/CONTRIBUTIONS @@ -0,0 +1 @@ + diff --git a/Makefile b/Makefile @@ -1,4 +1,4 @@ PREFIX=/usr/local -install: pacboy - install -Dm 755 pacboy ${PREFIX}/bin/ - install -Dm 755 pacboy.desktop ${PREFIX}/share/applications/ +install: pacgtk + install -Dm 755 pacgtk ${PREFIX}/bin/ + install -Dm 755 pacgtk.desktop ${PREFIX}/share/applications/ diff --git a/README b/README @@ -1,4 +1,4 @@ -pacboy - GUI wrapper for pacman by kocotian +pacgtk - GUI wrapper for pacman by kocotian depends on yad and st ============ @@ -20,7 +20,7 @@ or clone my st build: ======== LANGUAGE -pacboy comes up with a few patches for different languages - not everyone +pacgtk comes up with a few patches for different languages - not everyone speak english, especially people that will use this user-friendly program, so to add another language write: @@ -33,7 +33,7 @@ RUNNING Just write: - $ pacboy + $ pacgtk -That's all. Pacboy is more for people using DE's, so I also bring .desktop +That's all. Pacgtk is more for people using DE's, so I also bring .desktop file which will be installed by Makefile. diff --git a/languages/pl.diff b/languages/pl.diff @@ -4,7 +4,6 @@ # Language things: -lang_text_updatesys="Update system?" --lang_text_downloadfresh="Download fresh package lists?" -lang_text_search="Write program name for search:" -lang_text_btn_updateonly="Update only" -lang_text_noresults="No results" @@ -15,7 +14,6 @@ -lang_text_installationdone="Installation done." -lang_text_installationfailed="Installation failed." +lang_text_updatesys="Zaktualizować system?" -+lang_text_downloadfresh="Pobrać aktualne listy pakietów?" +lang_text_search="Wpisz nazwę (lub opis) programu aby wyszukać:" +lang_text_btn_updateonly="Tylko zaktualizuj" +lang_text_noresults="Brak wyników" @@ -25,4 +23,3 @@ +lang_text_sr_description="Opis" +lang_text_installationdone="Instalacja zakończona powodzeniem." +lang_text_installationfailed="Instalacja zakończona niepowodzeniem." - diff --git a/pacboy b/pacboy @@ -1,91 +0,0 @@ -#!/bin/sh -# pacboy - GUI wrapper for pacman by kocotian -# depends on yad and st. -# version 1.1 - -# Other configuration: -termcommand="st -e" -pacflags="--noconfirm -S" -flagtype="default" - -# Language things: -lang_text_updatesys="Update system?" -lang_text_downloadfresh="Download fresh package lists?" -lang_text_search="Write program name for search:" -lang_text_btn_updateonly="Update only" -lang_text_noresults="No results" -lang_text_searchresults="Search results:" -lang_text_sr_name="Name" -lang_text_sr_version="Version" -lang_text_sr_description="Description" -lang_text_installationdone="Installation done." -lang_text_installationfailed="Installation failed." - -# Delete this line if you are sure that you installed yad and you don't -# need checking this: -[ "pacman -Q yad 2>/dev/null | wc -l" = "0" ] && pacman -Sy --noconfirm yad - -# Main program: -yad --title "pacboy" \ - --text "$lang_text_updatesys" \ - --button=yad-yes:0 --button=yad-no:1 \ - --width=200 --height=80 --center && { - pacflags="${pacflags} -yu" - flagtype="update" - } || { - yad --title "pacboy" \ - --text "$lang_text_downloadfresh" \ - --button=yad-yes:0 --button=yad-no:1 \ - --width=200 --height=80 --center && { - pacflags="${pacflags} -y" - flagtype="freshsync" - } - } - -query="$(if [ $flagtype = update ]; then # TODO: make this in less bloated way - yad --title "pacboy" \ - --text "$lang_text_search" \ - --entry --center \ - --width=500 --height=100 \ - --button="$lang_text_btn_updateonly":2 \ - --button=yad-cancel:1 \ - --button=yad-ok:0 -else - yad --title "pacboy" \ - --text "$lang_text_search" \ - --entry --center \ - --width=500 --height=100 \ - --button=yad-cancel:1 \ - --button=yad-ok:0 -fi; exit $?)" -s=$? -if [ $s = 2 ]; then - flagtype="updateonly" -elif [ $s = 1 ]; then - exit 1 -fi - -pkgs="$(pacman -Ss $query | sed "s/\\ /\\n/;s/^\\s*//g;/^$/d")" - -[ $(echo "$pkgs" | wc -l) = 1 ] && - yad --title "pacboy" \ - --text "$lang_text_noresults" \ - --center && exit 0 - -[ $flagtype = "updateonly" ] || package="$(echo "$pkgs" | - yad --title "pacboy" \ - --text "$lang_text_searchresults" \ - --list --maximized \ - --column "$lang_text_sr_name" \ - --column "$lang_text_sr_version" \ - --column "$lang_text_sr_description" || exit 1)" || exit 1 - -$termcommand sudo pacman $pacflags $(echo $package | cut -d"|" -f1) && - yad --title "pacboy" \ - --text "$lang_text_installationdone" \ - --button=yad-ok:0 \ - --center || - yad --title "pacboy" \ - --text "$lang_text_installationfailed" \ - --button=yad-ok:1 \ - --center diff --git a/pacboy.desktop b/pacboy.desktop @@ -1,10 +0,0 @@ -[Desktop Entry] -Exec=pacboy -Name=pacboy -Comment=GUI wrapper for pacman by kocotian -Terminal=false -Type=Application -Encoding=UTF-8 -Keywords=pacman;pacboy;package;manager;yad;st; -#Icon= -#Categories= diff --git a/pacgtk b/pacgtk @@ -0,0 +1,81 @@ +#!/bin/sh +# pacgtk - GUI wrapper for pacman by kocotian +# depends on yad and st. +# version 1.2 + +# Other configuration: +termcommand="st -e" +pacflags="--noconfirm -S" +flagtype="default" + +# Language things: +lang_text_updatesys="Update system?" +lang_text_search="Write program name for search:" +lang_text_btn_updateonly="Update only" +lang_text_noresults="No results" +lang_text_searchresults="Search results:" +lang_text_sr_name="Name" +lang_text_sr_version="Version" +lang_text_sr_description="Description" +lang_text_installationdone="Installation done." +lang_text_installationfailed="Installation failed." + +# Main program: +yad --title "pacgtk" \ + --text "$lang_text_updatesys" \ + --button=yad-yes:0 --button=yad-no:1 \ + --width=200 --height=80 --center && { + pacflags="${pacflags} -yu" + flagtype="update" + } + +query="$(if [ $flagtype = update ]; then # TODO: make this in less bloated way + yad --title "pacgtk" \ + --text "$lang_text_search" \ + --entry --center \ + --width=500 --height=100 \ + --button="$lang_text_btn_updateonly":2 \ + --button=yad-cancel:1 \ + --button=yad-ok:0 +else + yad --title "pacgtk" \ + --text "$lang_text_search" \ + --entry --center \ + --width=500 --height=100 \ + --button=yad-cancel:1 \ + --button=yad-ok:0 +fi; exit $?)" +s=$? +if [ $s = 2 ]; then + flagtype="updateonly" +elif [ $s = 1 ]; then + exit 1 +fi + +pkgs="$(pacman -Ss $query | sed "s/\\ /\\n/;s/^\\s*//g;/^$/d")" + +[ $(echo "$pkgs" | wc -l) = 1 ] && + yad --title "pacgtk" \ + --text "$lang_text_noresults" \ + --center && exit 0 + +[ $flagtype = "updateonly" ] || package="$(echo "$pkgs" | + yad --title "pacgtk" \ + --text "$lang_text_searchresults" \ + --list --maximized \ + --column "$lang_text_sr_name" \ + --column "$lang_text_sr_version" \ + --column "$lang_text_sr_description" || exit 1)" || exit 1 + +echo "DEBUG: sudo pacman $pacflags $(echo $package | cut -d"|" -f1)" +if $termcommand sudo pacman $pacflags $(echo $package | cut -d"|" -f1); then + yad --title "pacgtk" \ + --text "$lang_text_installationdone" \ + --button=yad-ok:0 \ + --center +else + yad --title "pacgtk" \ + --text "$lang_text_installationfailed" \ + --button=yad-ok:1 \ + --center +fi diff --git a/pacgtk.desktop b/pacgtk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Exec=pacgtk +Name=pacgtk +Comment=GUI wrapper for pacman by kocotian +Terminal=false +Type=Application +Encoding=UTF-8 +Keywords=pacman;pacgtk;package;manager;yad;st; +#Icon= +#Categories=