mirror of
https://github.com/aclist/dztui.git
synced 2026-08-31 12:16:55 +02:00
Compare commits
16 Commits
73eae30395
...
f46cea0ab8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f46cea0ab8 | ||
|
|
506c82e86a | ||
|
|
7e45cb0fa2 | ||
|
|
3729d3c656 | ||
|
|
773d24a00c | ||
|
|
08f1f9f4d1 | ||
|
|
ec7daf7f6b | ||
|
|
d0de2974d8 | ||
|
|
5a54d43601 | ||
|
|
1dfe9cd9df | ||
|
|
f2124218e4 | ||
|
|
cf087d96c7 | ||
|
|
6bb59f4060 | ||
|
|
d53476399d | ||
|
|
d34293e2c8 | ||
|
|
f82df9eacf |
@ -3,12 +3,18 @@
|
|||||||
## [6.0.0-beta.8] XXXX-XX-XX
|
## [6.0.0-beta.8] XXXX-XX-XX
|
||||||
## Added
|
## Added
|
||||||
- Flag to disable branch toggle for distro-packaged releases
|
- Flag to disable branch toggle for distro-packaged releases
|
||||||
|
- Test whether script was sourced inline
|
||||||
|
- Commandline usage help text
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
- ESC key destroying wait dialogs while thread is pending
|
- ESC key destroying wait dialogs while thread is pending
|
||||||
- Tooltip signals being processed on main menu
|
- Tooltip signals being processed on main menu
|
||||||
- Leaky variable name in dialog title
|
- Leaky variable name in dialog title
|
||||||
- Prevent extraneous signals from propagating when column width is adjusted
|
- Prevent extraneous signals from propagating when column width is adjusted
|
||||||
|
- Script failing to start when remote endpoints are unavailable
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- Optimize time cost of setup checks
|
||||||
|
|
||||||
## [6.0.0-beta.7] 2025-09-20
|
## [6.0.0-beta.7] 2025-09-20
|
||||||
## Added
|
## Added
|
||||||
|
|||||||
@ -1,16 +1,15 @@
|
|||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
Thank you for considering contributing to DZGUI!
|
Thank you for your interest in DZGUI!
|
||||||
|
|
||||||
This is a guide for contributors containing conventions best practices and rules
|
This guide goes over development conventions and best practices for contributors.
|
||||||
of development and aims to ease the beginning of a contribution.
|
If you are a developer, you can skip to the end.
|
||||||
|
|
||||||
# How can I request help?
|
# Requesting help
|
||||||
|
|
||||||
There is an issue tracker on github
|
If you encounter a problem with DZGUI, you can submit tickets on the GitHub
|
||||||
(link)[https://github.com/aclist/dzgui-devel/issues] where you can submit
|
(issue tracker)[https://github.com/aclist/dzgui-devel/issues] under the
|
||||||
tickets. If you need help troubleshooting a problem, submit a ticket. There is a
|
`troubleshooting` tag.
|
||||||
category called `troubleshooting` which is exactly what you need.
|
|
||||||
|
|
||||||
# How can I help the project?
|
# How can I help the project?
|
||||||
|
|
||||||
@ -23,44 +22,48 @@ There are several ways to help this project.
|
|||||||
Before making any contribution, please read the `CODE_OF_CONDUCT.md` and act
|
Before making any contribution, please read the `CODE_OF_CONDUCT.md` and act
|
||||||
accordingly.
|
accordingly.
|
||||||
|
|
||||||
## How to report
|
## Submitting a ticket
|
||||||
|
|
||||||
|
Navigate to the GitHub (issue tracker)[https://github.com/aclist/dzgui-devel/issues].
|
||||||
|
From there, follow the onscreen prompts. You will be asked questions such as:
|
||||||
|
|
||||||
Reproduce the bug that you found. Navigate to the issue tracker on github:
|
|
||||||
(link)[https://github.com/aclist/dzgui-devel/issues]
|
|
||||||
Create a ticket where you give us the following:
|
|
||||||
- What version are you using?
|
- What version are you using?
|
||||||
- What distribution are you using?
|
- What distribution are you using?
|
||||||
- What is the issue that you found?
|
- What is the issue that you found?
|
||||||
- How can we reproduce the issue?
|
- How can we reproduce the issue?
|
||||||
- Possible screenshots, logs, other data that can help us
|
|
||||||
|
|
||||||
## How to request a feature
|
You can also attach screenshots, logs, or other data that can help us.
|
||||||
|
|
||||||
Navigate to the projects issue tracker
|
## Requesting a feature
|
||||||
(link)[https://github.com/aclist/dzgui-devel/issues]. Search for your idea to
|
|
||||||
see if anyone had posted a simmilar idea. If not, open a ticket where you
|
|
||||||
describe your feature and its possible benefits. Please note, that this is a
|
|
||||||
community project, it takes time for us to develop features, having a feature
|
|
||||||
request doesn't mean that it will be implemented, but we do our best to support
|
|
||||||
as many cool ideas as possible.
|
|
||||||
|
|
||||||
## How to contribute code or documentation
|
You can also request features via the same issue tracker. It is good practice to
|
||||||
|
first search for your idea to see if a similar one has already been posted.
|
||||||
|
If not, open a ticket where you describe your feature and its possible benefits.
|
||||||
|
|
||||||
If you have an issue of interest in the issue tracker or any other change that
|
Please note that this is a community project, so it takes time for us to develop
|
||||||
you would like to have implemented you can contribute code to this project. For
|
features. Putting in a feature request does not mean that it will be implemented,
|
||||||
this, you may fork this repository and checkout to
|
but we will do our best to support as many cool ideas as possible.
|
||||||
`prerelease/<latest-version>`. All new features and fixes will be merged to this
|
|
||||||
branch, so open your branch from here. Name it according to our convention:
|
## Contributing code or documentation
|
||||||
- fix/<your-fix> - fix branches
|
|
||||||
|
If you would like to take ownership or assist with an issue on the issue tracker, or
|
||||||
|
contribute a new change, please follow the guidelines below.
|
||||||
|
|
||||||
|
Fork this repository and check out the code up to `prerelease/<latest-version>`.
|
||||||
|
All new features and fixes will be merged to this branch, so open your branch
|
||||||
|
from here.
|
||||||
|
|
||||||
|
The following naming conventions apply for PRs:
|
||||||
|
- fix/<your-fix> - patch/hotfix branches
|
||||||
- feat/<your-feature> - feature branches
|
- feat/<your-feature> - feature branches
|
||||||
- doc/<your-doc-branch> - documentation branches
|
- doc/<your-doc-branch> - documentation branches
|
||||||
- infra/<your-infra-branch> - infrastructure branches
|
- infra/<your-infra-branch> - infrastructure branches
|
||||||
|
|
||||||
Now you can implement your changes and test it locally. If they work you may
|
Implement your changes and test them locally. If they work you may
|
||||||
open a merge request, and then we review your changes. If everything is OK, it
|
open a merge request, and then we review your changes. If everything is OK, it
|
||||||
will be merged to `prerelease/<latest-version>`, then `testing` and after a live
|
will be merged to `prerelease/<latest-version>`, then `testing` and after a live
|
||||||
testing phase, to `stable` as well.
|
testing phase, to `stable` as well.
|
||||||
|
|
||||||
During development, it is recommended to follow (conventional
|
It is recommended to follow
|
||||||
commits)[https://www.conventionalcommits.org/en/v1.0.0/], it helps the project
|
(Conventional Commits)[https://www.conventionalcommits.org/en/v1.0.0/], as this
|
||||||
maintainers when they review your code.
|
integrates well with tooling and helps the project review your code.
|
||||||
|
|||||||
133
dzgui.sh
133
dzgui.sh
@ -63,17 +63,14 @@ testing_url="$url_prefix/testing"
|
|||||||
releases_url="https://github.com/$author/$repo/releases/download/browser"
|
releases_url="https://github.com/$author/$repo/releases/download/browser"
|
||||||
km_helper_url="$releases_url/latlon"
|
km_helper_url="$releases_url/latlon"
|
||||||
|
|
||||||
|
|
||||||
set_im_module(){
|
set_im_module(){
|
||||||
#TODO: drop pending SteamOS changes
|
#TODO: drop pending SteamOS changes
|
||||||
pgrep -a gamescope | grep -q "generate-drm-mode"
|
if pgrep -a gamescope | grep -q "generate-drm-mode"; then
|
||||||
if [[ $? -eq 0 ]]; then
|
unset GTK_IM_MODULE
|
||||||
GTK_IM_MODULE=""
|
|
||||||
logger INFO "Detected Steam Deck (Game Mode), unsetting GTK_IM_MODULE"
|
logger INFO "Detected Steam Deck (Game Mode), unsetting GTK_IM_MODULE"
|
||||||
else
|
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
redact(){
|
redact(){
|
||||||
sed 's@\(/home/\)[^/]*@\1REDACTED@g'
|
sed 's@\(/home/\)[^/]*@\1REDACTED@g'
|
||||||
}
|
}
|
||||||
@ -87,13 +84,21 @@ logger(){
|
|||||||
printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" \
|
printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" \
|
||||||
| redact >> "$debug_log"
|
| redact >> "$debug_log"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_dirs(){
|
setup_dirs(){
|
||||||
for dir in "$state_path" "$cache_path" "$share_path" "$helpers_path" "$freedesktop_path" "$config_path" "$log_path"; do
|
directories=()
|
||||||
if [[ ! -d $dir ]]; then
|
directories+=("$state_path")
|
||||||
|
directories+=("$cache_path")
|
||||||
|
directories+=("$share_path")
|
||||||
|
directories+=("$helpers_path")
|
||||||
|
directories+=("$freedesktop_path")
|
||||||
|
directories+=("$config_path")
|
||||||
|
directories+=("$log_path")
|
||||||
|
for dir in "${directories[@]}"; do
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_state_files(){
|
setup_state_files(){
|
||||||
if [[ -f "$debug_log" ]]; then
|
if [[ -f "$debug_log" ]]; then
|
||||||
rm "$debug_log" && touch $debug_log
|
rm "$debug_log" && touch $debug_log
|
||||||
@ -104,9 +109,8 @@ setup_state_files(){
|
|||||||
logger INFO "Migrating legacy version file"
|
logger INFO "Migrating legacy version file"
|
||||||
fi
|
fi
|
||||||
# wipe cache files
|
# wipe cache files
|
||||||
local path="$cache_path"
|
if [[ $(ls -A "$cache_path") ]]; then
|
||||||
if find "$path" -mindepth 1 -maxdepth 1 | read; then
|
for file in "$cache_path"/*; do
|
||||||
for file in $path/*; do
|
|
||||||
rm "$file"
|
rm "$file"
|
||||||
done
|
done
|
||||||
logger INFO "Wiped cache files"
|
logger INFO "Wiped cache files"
|
||||||
@ -221,8 +225,7 @@ END
|
|||||||
}
|
}
|
||||||
depcheck(){
|
depcheck(){
|
||||||
for dep in "${!deps[@]}"; do
|
for dep in "${!deps[@]}"; do
|
||||||
command -v "$dep" 2>&1>/dev/null
|
if ! command -v "$dep" &> /dev/null; then
|
||||||
if [[ $? -eq 1 ]]; then
|
|
||||||
local msg="Requires $dep >= ${deps[$dep]}"
|
local msg="Requires $dep >= ${deps[$dep]}"
|
||||||
raise_error_and_quit "$msg"
|
raise_error_and_quit "$msg"
|
||||||
fi
|
fi
|
||||||
@ -493,20 +496,47 @@ stale_symlinks(){
|
|||||||
unlink "$l"
|
unlink "$l"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_availability() {
|
||||||
|
if [[ -z $1 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
local url=$1
|
||||||
|
local timeout_sec="3"
|
||||||
|
if [[ $2 ]]; then
|
||||||
|
timeout_sec=$2
|
||||||
|
fi
|
||||||
|
if ! ping -w "$timeout_sec" "$url" > /dev/null 2>&1; then
|
||||||
|
logger WARN "Failed to reach $url, service may be down."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
local_latlon(){
|
local_latlon(){
|
||||||
if [[ -z $(command -v dig) ]]; then
|
if [[ -z $(command -v dig) ]]; then
|
||||||
local local_ip=$(curl -Ls "https://ipecho.net/plain")
|
local url_ipecho="https://ipecho.net/plain"
|
||||||
|
if ! check_availability "ipecho.net"; then
|
||||||
|
logger WARN "Failed to get external ip address, ipecho.net service may be down."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
local local_ip=$(curl -Ls "$url_ipecho")
|
||||||
else
|
else
|
||||||
|
# TODO : implement checking remote
|
||||||
local local_ip=$(dig -4 +short myip.opendns.com @resolver1.opendns.com)
|
local local_ip=$(dig -4 +short myip.opendns.com @resolver1.opendns.com)
|
||||||
fi
|
fi
|
||||||
local url="http://ip-api.com/json/$local_ip"
|
local url_ip_api="http://ip-api.com/json/$local_ip"
|
||||||
local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"')
|
if ! check_availability "ip-api.com"; then
|
||||||
|
logger WARN "Failed to get local coordinates, ip-api.com service may be down."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
local res=$(curl -Ls "$url_ip_api" | jq -r '"\(.lat)\n\(.lon)"')
|
||||||
if [[ -z "$res" ]]; then
|
if [[ -z "$res" ]]; then
|
||||||
logger WARN "Failed to get local coordinates"
|
logger WARN "Failed to get local coordinates"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo "$res" > "$coords_file"
|
echo "$res" > "$coords_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
lock(){
|
lock(){
|
||||||
[[ ! -f $lock_file ]] && touch $lock_file
|
[[ ! -f $lock_file ]] && touch $lock_file
|
||||||
local pid=$(cat $lock_file)
|
local pid=$(cat $lock_file)
|
||||||
@ -585,7 +615,7 @@ fetch_helpers_by_sum(){
|
|||||||
[[ -f "$config_file" ]] && source "$config_file"
|
[[ -f "$config_file" ]] && source "$config_file"
|
||||||
declare -A sums
|
declare -A sums
|
||||||
sums=(
|
sums=(
|
||||||
["funcs"]="65134f86b7c9e14173e05d8e3ebea101"
|
["funcs"]="6ae3ead7034dc8e7543472bddee75c63"
|
||||||
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
||||||
["servers.py"]="ed442c3aecf33f777d59dcf53650d263"
|
["servers.py"]="ed442c3aecf33f777d59dcf53650d263"
|
||||||
["ui.py"]="f03879f088ad074f2ce3c92607c30202"
|
["ui.py"]="f03879f088ad074f2ce3c92607c30202"
|
||||||
@ -1090,13 +1120,61 @@ uninstall(){
|
|||||||
rm "$self"
|
rm "$self"
|
||||||
echo "Uninstall routine complete"
|
echo "Uninstall routine complete"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usage(){
|
||||||
|
cat <<- EOM
|
||||||
|
DZGUI - Free and Open Source DayZ launcher
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
dzgui.sh [options]
|
||||||
|
|
||||||
|
Description:
|
||||||
|
|
||||||
|
When no option is provided, the script launches DZGUI.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
-u, --uninstall:
|
||||||
|
Uninstalls the software
|
||||||
|
|
||||||
|
-v, --version:
|
||||||
|
Prints the version
|
||||||
|
|
||||||
|
-h, --help:
|
||||||
|
Prints this message
|
||||||
|
EOM
|
||||||
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
local zenv=$(zenity --version 2>/dev/null)
|
# setup zenity environment
|
||||||
|
local zenv=""
|
||||||
|
zenv=$(zenity --version 2>/dev/null)
|
||||||
[[ -z $zenv ]] && { echo "Requires zenity >= ${deps[$steamsafe_zenity]}"; exit 1; }
|
[[ -z $zenv ]] && { echo "Requires zenity >= ${deps[$steamsafe_zenity]}"; exit 1; }
|
||||||
if [[ $1 == "--uninstall" ]] || [[ $1 == "-u" ]]; then
|
|
||||||
uninstall &&
|
# parse arguments
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
"--uninstall" | "-u")
|
||||||
|
uninstall
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
# shift
|
||||||
|
;;
|
||||||
|
"--version" | "-v")
|
||||||
|
echo $version
|
||||||
|
exit 0
|
||||||
|
# shift
|
||||||
|
;;
|
||||||
|
"--help" | "-h")
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
# shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unrecognized command!"
|
||||||
|
return 1
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
set_im_module
|
set_im_module
|
||||||
|
|
||||||
@ -1105,7 +1183,12 @@ main(){
|
|||||||
|
|
||||||
printf "All OK. Kicking off UI...\n"
|
printf "All OK. Kicking off UI...\n"
|
||||||
python3 "$ui_helper" "--init-ui" "$version" "$is_steam_deck"
|
python3 "$ui_helper" "--init-ui" "$version" "$is_steam_deck"
|
||||||
|
|
||||||
}
|
}
|
||||||
main "$@"
|
|
||||||
#TODO: tech debt: cruddy handling for steam forking
|
if [[ $(basename "$0") == "dzgui.sh" ]]; then
|
||||||
[[ $? -eq 1 ]] && pkill -f dzgui.sh
|
main "$@"
|
||||||
|
|
||||||
|
#TODO: tech debt: cruddy handling for steam forking
|
||||||
|
[[ $? -eq 1 ]] && pkill -f dzgui.sh
|
||||||
|
fi
|
||||||
|
|||||||
@ -369,6 +369,10 @@ local_latlon(){
|
|||||||
get_dist(){
|
get_dist(){
|
||||||
shift
|
shift
|
||||||
local given_ip="$1"
|
local given_ip="$1"
|
||||||
|
if [[ ! -f $_cache_coords ]]; then
|
||||||
|
printf "Unknown"
|
||||||
|
return
|
||||||
|
fi
|
||||||
readarray -t coords < "$_cache_coords"
|
readarray -t coords < "$_cache_coords"
|
||||||
readarray -t n < <(<<< "$given_ip" awk 'BEGIN{RS="."}{$1=$1}1')
|
readarray -t n < <(<<< "$given_ip" awk 'BEGIN{RS="."}{$1=$1}1')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user