-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from vcatafesta/main
qui 24 ago 2023 15:00:39 -04 Vilmar Catafesta ([email protected])
- Loading branch information
Showing
12 changed files
with
423 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# Description: Big Store installing programs for BigLinux | ||
# | ||
# Created: 2020/01/11 | ||
# Altered: 2023/08/18 | ||
# Altered: 2023/08/24 | ||
# | ||
# Copyright (c) 2023-2023, Vilmar Catafesta <[email protected]> | ||
# 2022-2023, Bruno Gonçalves <www.biglinux.com.br> | ||
|
@@ -34,16 +34,16 @@ | |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
APP="${0##*/}" | ||
_VERSION_="1.0.0-20230818" | ||
_VERSION_="1.0.0-20230824" | ||
export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" | ||
export LOGGER='/dev/tty8' | ||
export HOME_FOLDER="$HOME/.bigstore" | ||
export TMP_FOLDER="/tmp/bigstore-$USER" | ||
LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'} | ||
[[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh" | ||
[[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh" | ||
[[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh" | ||
|
||
function sh_config { | ||
function sh_config() { | ||
#Translation | ||
export TEXTDOMAINDIR="/usr/share/locale" | ||
export TEXTDOMAIN=big-store | ||
|
@@ -53,22 +53,22 @@ function sh_config { | |
declare -g bigstore_icon_file='icons/icon.svg' | ||
declare -g TITLE="Big-Store" | ||
declare -gA Amsg=([error_open]=$(gettext $"Outra instância do Big-Store já está em execução.") | ||
[error_access_dir]=$(gettext $"Erro ao acessar o diretório:") | ||
[error_access_dir]=$(gettext $"Erro ao acessar o diretório:") | ||
) | ||
} | ||
|
||
function sh_check_big_store_is_running { | ||
function sh_check_big_store_is_running() { | ||
local PID | ||
|
||
if PID=$(pgrep -f 'Big-Store') && [[ -n "$PID" ]]; then | ||
# notify-send -u critical --icon=big-store --app-name "$0" "$TITLE" "${Amsg[error_open]}" --expire-time=2000 | ||
# kdialog --title "$TITLE" --icon warning --msgbox "${Amsg[error_open]}" | ||
# notify-send -u critical --icon=big-store --app-name "$0" "$TITLE" "${Amsg[error_open]}" --expire-time=2000 | ||
# kdialog --title "$TITLE" --icon warning --msgbox "${Amsg[error_open]}" | ||
yad --title "$TITLE" --image=big-store --text "${Amsg[error_open]}\nPID:$PID" --button="OK":0 | ||
exit 1 | ||
fi | ||
} | ||
|
||
function sh_main { | ||
function sh_main() { | ||
local resolution | ||
local half_resolution | ||
|
||
|
@@ -79,24 +79,24 @@ function sh_main { | |
return 1 | ||
} | ||
|
||
[[ ! -e "$snap_cache_file" ]] || [[ "$(find "$snap_cache_file" -mtime +1 -print)" ]] && sh_update_cache_snap & | ||
[[ ! -e "$snap_cache_file" ]] || [[ "$(find "$snap_cache_file" -mtime +1 -print)" ]] && sh_update_cache_snap & | ||
[[ ! -e "$flatpak_cache_file" ]] || [[ "$(find "$flatpak_cache_file" -mtime +1 -print)" ]] && sh_update_cache_flatpak & | ||
|
||
resolution=$(xrandr | grep -oP 'primary \K[0-9]+x\K[0-9]+') | ||
half_resolution=$((resolution / 2)) | ||
# Save dynamic screenshot resolution | ||
echo "$half_resolution" > "${TMP_FOLDER}/screenshot-resolution.txt" | ||
echo "$half_resolution" >"${TMP_FOLDER}/screenshot-resolution.txt" | ||
|
||
# sh_update_cache_flatpak & | ||
# sh_update_cache_flatpak & | ||
COMMON_OPTIONS="QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11 WINIT_UNIX_BACKEND=x11 GDK_BACKEND=x11 bigbashview -n \"$TITLE\" -w maximized " | ||
if [[ -n "$1" ]]; then | ||
case "$1" in | ||
"category") eval "$COMMON_OPTIONS index.sh.htm?category=\"$2\" -i $bigstore_icon_file" ;; | ||
"category") eval "$COMMON_OPTIONS index.sh.htm?category=\"$2\" -i $bigstore_icon_file" ;; | ||
"appstream") eval "$COMMON_OPTIONS view_appstream.sh.htm?pkg_name=\"$2\" -i $bigstore_icon_file" ;; | ||
"aur") eval "$COMMON_OPTIONS view_aur.sh.htm?pkg_name=\"$2\" -i $bigstore_icon_file" ;; | ||
"flatpak") eval "$COMMON_OPTIONS view_flatpak.sh.htm?pkg_name=\"$2\" -i $bigstore_icon_file" ;; | ||
"snap") eval "$COMMON_OPTIONS view_snap.sh.htm?pkg_id=\"$2\" -i $bigstore_icon_file" ;; | ||
*) eval "$COMMON_OPTIONS index.sh.htm?search=\"$1\" -i $bigstore_icon_file" ;; | ||
"aur") eval "$COMMON_OPTIONS view_aur.sh.htm?pkg_name=\"$2\" -i $bigstore_icon_file" ;; | ||
"flatpak") eval "$COMMON_OPTIONS view_flatpak.sh.htm?pkg_name=\"$2\" -i $bigstore_icon_file" ;; | ||
"snap") eval "$COMMON_OPTIONS view_snap.sh.htm?pkg_id=\"$2\" -i $bigstore_icon_file" ;; | ||
*) eval "$COMMON_OPTIONS index.sh.htm?search=\"$1\" -i $bigstore_icon_file" ;; | ||
esac | ||
else | ||
eval "$COMMON_OPTIONS index.sh.htm -i $bigstore_icon_file" | ||
|
@@ -106,4 +106,4 @@ function sh_main { | |
#sh_debug | ||
sh_config | ||
sh_check_big_store_is_running | ||
sh_main | ||
sh_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.