Skip to content

Commit

Permalink
Merge pull request #91 from vcatafesta/main
Browse files Browse the repository at this point in the history
qua 03 jul 2024 01:18:15 -04 Vilmar Catafesta ([email protected])
  • Loading branch information
bigbruno authored Jul 28, 2024
2 parents fb30477 + e9dd2b8 commit 7f17188
Show file tree
Hide file tree
Showing 9 changed files with 1,344 additions and 1,191 deletions.
7 changes: 4 additions & 3 deletions big-store/usr/share/applications/big-store.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[Desktop Entry]
Categories=Settings;
Exec=big-store
Icon=big-store
Name=Big Store
Name[bg]=Магазин за приложения
Name[cs]=Obchod s aplikacemi
Expand All @@ -15,3 +12,7 @@ Name[zh]=应用商店
StartupNotify=true
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml_xml;
Categories=Settings;Biglinux;
Exec=big-store
Icon=big-store
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# Description: Big Store installing programs for BigLinux
#
# Created: 2020/01/11
# Altered: 2024/01/10
# Altered: 2024/07/10
#
# Copyright (c) 2023-2023, Vilmar Catafesta <[email protected]>
# Copyright (c) 2023-2024, Vilmar Catafesta <[email protected]>
# 2022-2023, Bruno Gonçalves <www.biglinux.com.br>
# 2022-2023, Rafael Ruscher <[email protected]>
# All rights reserved.
Expand All @@ -34,31 +34,27 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

APP="${0##*/}"
_VERSION_="1.0.0-20240110"
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"
export INI_FILE_BIG_STORE="$HOME_FOLDER/big-store.ini"
_VERSION_="1.0.0-20240710"
#
LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'}
[[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh"
[[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh"
[[ -f "${LIBRARY}/tinilib.sh" ]] && source "${LIBRARY}/tinilib.sh"

function sh_config() {
#desabilitando variáveis proxy do dde, as mesmas não permitem atualizações do pamac
unset auto_proxy ftp_proxy http_proxy https_proxy no_proxy all_proxy
#desabilitando variáveis proxy do dde, as mesmas não permitem atualizações do pamac
unset auto_proxy ftp_proxy http_proxy https_proxy no_proxy all_proxy
#Translation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=big-store
declare -g bigstorepath='/usr/share/bigbashview/bcc/apps/big-store'
declare -g snap_cache_file="$HOME_FOLDER/snap.cache"
declare -g flatpak_cache_file="$HOME_FOLDER/flatpak.cache"
declare -g bigstore_icon_file='icons/icon.svg'
declare -g bigstore_icon_file='icons/big-store.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_open]=$(gettext $"Outra instância do Big-Store já está em execução.")
[error_access_dir]=$(gettext $"Erro ao acessar o diretório:")
)
}

Expand All @@ -80,6 +76,7 @@ function sh_check_big_store_is_running() {
}

function sh_big_store_start_sh_main {
local default_size='960x720'
local height
local widht
local half_height
Expand All @@ -94,8 +91,8 @@ function sh_big_store_start_sh_main {
}

# reformat pretry .ini
[[ -e "$INI_FILE_BIG_STORE" ]] && big-tini-pretty -q "$INI_FILE_BIG_STORE"
# [[ -e "$INI_FILE_BIG_STORE" ]] && TIni.AlignIniFile "$INI_FILE_BIG_STORE"
# [[ -e "$INI_FILE_BIG_STORE" ]] && big-tini-pretty -q "$INI_FILE_BIG_STORE"
[[ -e "$INI_FILE_BIG_STORE" ]] && TIni.Sanitize "$INI_FILE_BIG_STORE"

if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_active" '1' && [[ -e "/usr/lib/libpamac-snap.so" ]]; then
[[ ! -e "$snap_cache_file" ]] || [[ "$(find "$snap_cache_file" -mtime +1 -print)" ]] && sh_update_cache_snap "$processamento_em_paralelo" &
Expand All @@ -105,15 +102,32 @@ function sh_big_store_start_sh_main {
[[ ! -e "$flatpak_cache_file" ]] || [[ "$(find "$flatpak_cache_file" -mtime +1 -print)" ]] && sh_update_cache_flatpak "$processamento_em_paralelo" &
fi

width=$(xrandr | grep -oP 'primary \K[0-9]+(?=x)')
height=$(xrandr | grep -oP 'primary \K[0-9]+x\K[0-9]+')
half_width=$((width / 2))
half_height=$((height / 2))
# Obtém a largura da tela primária usando xrandr
if width=$(xrandr | grep -oP 'primary \K[0-9]+(?=x)') && [[ -n "$width" ]]; then
# Se a largura foi obtida, tenta obter a altura da tela primária
if height=$(xrandr | grep -oP 'primary \K[0-9]+x\K[0-9]+') && [[ -n "$height" ]]; then
# Calcula metade da largura e altura
half_width=$((width / 2))
half_height=$((height / 2 * 3 / 2))
# Atualiza o tamanho padrão com metade da largura e altura da tela
default_size="${half_width}x${half_height}"
fi
fi

# Save dynamic screenshot resolution
echo "$half_height" >"${TMP_FOLDER}/screenshot-resolution.txt"

COMMON_OPTIONS="QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11 WINIT_UNIX_BACKEND=x11 GDK_BACKEND=x11 bigbashview -n \"$TITLE\" -s ${half_width}x${half_height}"
_session="$(sh_get_desktop_session)"
case "${_session^^}" in
X11)
COMMON_OPTIONS="QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11 WINIT_UNIX_BACKEND=x11 GDK_BACKEND=x11 bigbashview -n \"$TITLE\" -s ${default_size}"
;;
WAYLAND)
COMMON_OPTIONS="MOZ_ENABLE_WAYLAND=1 bigbashview -n \"$TITLE\" -s ${default_size}"
:
;;
esac

if [[ -n "$1" ]]; then
case "$1" in
"category") eval "$COMMON_OPTIONS index.sh.htm?category=\"$2\" -i $bigstore_icon_file" ;;
Expand Down
13 changes: 4 additions & 9 deletions big-store/usr/share/bigbashview/bcc/apps/big-store/config.sh.htm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# Description: Big Store installing programs for BigLinux
#
# Created: 2022/11/01
# Altered: 2024/05/08
# Altered: 2024/07/22
#
# Copyright (c) 2023-2023, Vilmar Catafesta <[email protected]>
# Copyright (c) 2023-2024, Vilmar Catafesta <[email protected]>
# 2022-2023, Bruno Gonçalves <www.biglinux.com.br>
# 2022-2023, Rafael Ruscher <[email protected]>
# All rights reserved.
Expand All @@ -34,16 +34,11 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

APP="${0##*/}"
_VERSION_="1.0.0-20240108"
_VERSION_="1.0.0-20240722"
LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'}
export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log"
export LOGGER='/dev/tty8'
export TMP_FOLDER="/tmp/bigstore-$USER"
export HOME_FOLDER="$HOME/.bigstore"
export INI_FILE_BIG_STORE="$HOME_FOLDER/big-store.ini"
[[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh"
[[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh"
[[ -f "${LIBRARY}/tinilib.sh" ]] && source "${LIBRARY}/tinilib.sh"
[[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh"

function sh_config {
#Translation
Expand Down
Loading

0 comments on commit 7f17188

Please sign in to comment.