Compare commits

..
263 Commits
Author SHA1 Message Date
aclist 252f07cbec Merge pull request #287 from aclist/prerelease/6.0.6-beta.1
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
chore: update symlink hash logic
2026-05-17 23:42:18 +09:00
aclist a0f610ead7 chore: update symlink hash logic 2026-05-17 23:40:35 +09:00
aclist ca4bcfc1a5 Merge pull request #285 from aclist/fix/server-mods-only
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
change: only update mods local to server
2026-04-17 20:57:03 +09:00
aclist ac4892d4f0 change: only update mods local to server 2026-04-17 20:47:25 +09:00
aclist 240b660923 Merge pull request #284 from aclist/prerelease/6.0.5-beta.1
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: update module checksums
2026-04-13 16:56:02 +09:00
aclist 150dfbca72 fix: update module checksums 2026-04-13 16:54:46 +09:00
aclist 4b78114174 Merge pull request #281 from aclist/fix/glib-unix-allversions
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
fix: use conditional logic when testing GLibUnix
2026-04-13 04:38:50 +09:00
aclist d1bde9901d fix: use conditional logic when testing GLibUnix 2026-04-13 03:43:22 +09:00
aclist c5eba364d9 Merge pull request #278 from aclist/fix/glib-unix
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: use GLibUnix namespace
2026-04-10 19:03:06 +09:00
aclist 5460b53c26 fix: version number in changelog 2026-04-10 18:52:04 +09:00
aclist 99301b3312 fix: uncomment functions 2026-04-10 18:50:58 +09:00
aclist 8d30af9dee fix: use GLibUnix namespace 2026-04-10 16:50:31 +09:00
aclist 8a8109b7df chore: add preview image
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-03-30 20:56:16 +09:00
aclist e4eaf25c8f chore: update readme 2026-03-30 20:16:58 +09:00
aclist 0daf6089b9 fix: raise error correctly
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-26 16:53:42 +09:00
aclist 7e4197cdbc fix: uncomment code
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-18 15:04:26 +09:00
aclist c0f9d8a508 Merge pull request #267 from aclist/fix/threaded-dialog
fix/threaded dialog
2026-01-18 15:02:43 +09:00
aclist 2da2b19001 Merge branch 'testing' into fix/threaded-dialog 2026-01-18 15:01:48 +09:00
aclist 62936fa7b7 fix: threaded dialog 2026-01-18 15:00:12 +09:00
aclist e9fecc7fb7 fix: explicitly use python 3.13
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-17 01:21:19 +09:00
aclist 2d58bb491e Merge pull request #264 from aclist/fix/explicit-version
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: explicitly use python 3.13
2026-01-17 01:19:40 +09:00
aclist 2f123da63a fix: explicitly use python 3.13 2026-01-17 01:18:40 +09:00
aclist 7016edf7cd Merge pull request #259 from aclist/prerelease/6.0.0
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Prerelease/6.0.0
2026-01-15 05:38:25 +09:00
aclist 11c29112c2 fix: write file after wiping cache
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-15 05:18:13 +09:00
aclist b630cf4080 fix: write file after wiping cache
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-15 05:13:35 +09:00
aclist 1034a5ac04 fix: store source path 2026-01-15 05:04:10 +09:00
aclist 317f60eddd chore: update checksums 2026-01-15 04:36:21 +09:00
aclist 9fbe5029e1 fix: steam deck compatible source path expansion 2026-01-15 04:35:56 +09:00
aclist ebc62b0b1b fix: steam deck compatible source path expansion 2026-01-15 04:30:44 +09:00
aclist 4b47ff1fe0 fix: remove duplicate line 2026-01-15 03:41:38 +09:00
aclist e3155ad7ee fix: patch changes from testing 2026-01-15 03:08:00 +09:00
aclist c45d9fb234 Update funcs 2026-01-15 03:02:24 +09:00
aclist 22e92e67a7 Merge branch 'dzgui' into prerelease/6.0.0 2026-01-15 03:01:14 +09:00
aclist 896802cd6f chore: update checksums
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
2026-01-15 02:49:24 +09:00
aclist cb45ce7b9a chore: prepare 6.0.0 release
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
2026-01-15 02:48:05 +09:00
aclist 9678d41b4c Merge pull request #258 from aclist/fix/first-dialog
fix/first dialog
2026-01-15 02:30:33 +09:00
aclist 0daf567111 feat: more descriptive help dialogs
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-15 02:29:00 +09:00
aclist b75e99ffd7 feat: add link to help page 2026-01-09 10:47:56 +09:00
aclist 5562c44320 fix: regression introduced in previous hotfix
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-01-04 21:39:18 +09:00
aclist 236a5dd0a3 Merge pull request #256 from aclist/fix/unlink-loop
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
chore: normalize checksums
2026-01-04 21:34:41 +09:00
aclist 4c10958d10 chore: normalize checksums 2026-01-04 21:33:56 +09:00
aclist 23f7140c66 Merge pull request #255 from aclist/fix/unlink-loop
fix: regression introduced in 5.8.1
2026-01-04 21:25:38 +09:00
aclist fbcfa1fb34 fix: regression introduced in 5.8.1. 2026-01-04 21:24:06 +09:00
aclist 52f36e0d0a Merge pull request #252 from aclist/fix/setup-whitespaces
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: whitespaces during setup
2025-12-28 00:03:40 +09:00
aclist d90c069a73 chore: correct version number in changelog 2025-12-28 00:01:30 +09:00
aclist d2f3eebd42 chore: update changelog
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-12-27 23:57:11 +09:00
aclist af64ebb12a fix: enclose whitespaces during setup 2025-12-27 23:56:18 +09:00
aclist 203ca0d388 chore: update changelog 2025-12-27 23:44:54 +09:00
aclist 34ee8c6645 fix: enclose whitespaces during setup 2025-12-27 23:42:49 +09:00
aclist 0cd561b62a fix: enclose game_dir in quotes 2025-12-27 23:06:11 +09:00
aclist b9c30b4f52 fix: encapsulate paths 2025-12-27 21:06:44 +09:00
aclist 4bcf894704 chore: update installscript branch 2025-12-27 20:41:25 +09:00
aclist c37800795b fix: malformed vdf path discovery 2025-12-27 20:39:09 +09:00
aclist 929f497b9f chore: reword changelog
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-12-10 13:05:46 +09:00
aclist 60aebe5eeb chore: update date 2025-12-10 13:04:54 +09:00
aclist aef9a10c42 Merge pull request #246 from aclist/prerelease/6.0.0-beta.14
fix: newlines in tooltips
2025-12-10 13:03:22 +09:00
aclist c6034bc6b9 fix: strip newlines 2025-12-09 13:03:52 +09:00
aclist 005288371b fix: newlines in tooltips 2025-12-05 15:58:28 +09:00
aclist 53e50a5716 Merge pull request #245 from aclist/fix/6.0.0-beta.13
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: hide filter panel when changing contexts
2025-11-30 04:55:19 +09:00
aclist a50b11633f fix: update variable name 2025-11-30 04:54:50 +09:00
aclist 9c4541fe76 chore: update changelog 2025-11-30 04:53:43 +09:00
aclist ac3e7ee128 fix: incorrect changelog path 2025-11-30 04:51:43 +09:00
aclist 1495ad386d fix: hide filter panel when changing contexts 2025-11-30 04:43:18 +09:00
aclist 4edf71aa0a docs: update changelog
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-22 01:04:59 +09:00
aclist 113e5f885b fix: normalize beta version 2025-11-22 01:04:19 +09:00
aclist a3092b1bf3 Merge pull request #239 from aclist/prerelease/6.0.1-beta.1
fix: UI not starting if changelog was missing
2025-11-22 00:50:38 +09:00
aclist e28929bb70 chore: remove reference branch
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-22 00:47:36 +09:00
aclist 4a820e3083 chore: uncomment line
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-15 20:24:01 +09:00
aclist d866b4992b fix: update error message string
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
2025-11-14 13:41:47 +09:00
aclist 376c5294d9 chore: require python 3.13 2025-11-14 13:16:14 +09:00
aclist 71651bab6c chore: update reference branch
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
2025-11-13 12:54:31 +09:00
aclist 1dba57af4b chore: update reference branch 2025-11-13 12:53:59 +09:00
aclist dabf5d4ef0 fix: uncomment lines 2025-11-13 12:53:41 +09:00
aclist 75f8c841df feat: support sandboxed flatpak 2025-11-13 12:50:27 +09:00
aclist 5bce8709af chore: enforce stricter python version
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-10 12:07:35 +09:00
aclist a418bcfb90 fix: return from finally block 2025-11-10 11:42:26 +09:00
aclist 90d59cec97 chore: drop legacy src_path logic 2025-11-06 14:52:35 +09:00
aclist a8ae07931d feat: disable version check on beta branch
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-06 14:45:04 +09:00
aclist a4ce65fe57 feat: use reference branch for beta releases 2025-11-06 14:30:16 +09:00
aclist d7e94eab90 fix: UI not starting if changelog was missing 2025-11-05 14:27:15 +09:00
aclist a08c588df3 chore: update changelog date
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-04 16:00:31 +09:00
aclist 385b1a5af2 Merge pull request #230 from aclist/prerelease/6.0.0-beta.8
Prerelease/6.0.0-beta.8
2025-11-04 15:59:48 +09:00
aclist be02f086c7 docs: update changelog
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-11-03 12:43:08 +09:00
aclist cc35b2cd85 Merge pull request #233 from GaryBlackbourne/prerelease/latlon-update
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Prerelease/latlon update
2025-10-31 10:06:13 +09:00
aclist a419aad160 chore: move comments 2025-10-31 10:05:21 +09:00
aclist 21d4601e41 chore: add comments about pretty printing 2025-10-31 10:01:46 +09:00
aclist adf8a62e8a Merge pull request #238 from aclist/doc/port-contributing
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Doc/port contributing
2025-10-30 11:50:23 +09:00
aclist a1d14669c7 Merge pull request #237 from aclist/doc/port-contributing
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
docs: add contributing file
2025-10-30 11:49:04 +09:00
aclist 46a54cef12 docs: add contributing file 2025-10-30 11:47:10 +09:00
aclist a94f8f0e32 Merge pull request #236 from GaryBlackbourne/doc/add-contributing
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
Doc/add contributing
2025-10-30 11:36:43 +09:00
aclist 0da098afb6 chore: mention branch basing conventions 2025-10-30 11:36:10 +09:00
aclist c8e9f8f1fc chore: move location of notes file in advance of 7.0 release
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-10-26 21:53:19 +09:00
aclist 506c82e86a chore: reword CONTRIBUTING.md
Corrected some typos and reworded passive voice/some sections for
brevity.
2025-10-25 11:51:19 +09:00
aclist 7e45cb0fa2 chore: backport funcs file changes from testing
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-10-25 11:37:48 +09:00
aclist 3729d3c656 chore: update changelog 2025-10-25 11:35:22 +09:00
aclist 773d24a00c chore: backport patch from testing 2025-10-25 11:33:42 +09:00
aclist 661329877f Merge pull request #232 from GaryBlackbourne/fix-deadlock-on-ip-api-server
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Fix deadlock on ip api server
2025-10-25 11:30:05 +09:00
aclist 08f1f9f4d1 Merge pull request #235 from GaryBlackbourne/dzgui-sh-cleanup
dzgui.sh argument handling and cleanup
2025-10-25 11:28:43 +09:00
Gergely Koloszar cc73f23c1c fix: suppress ping stderr output 2025-10-24 12:35:56 +00:00
aclist ec7daf7f6b fix: store filepaths in array
I opted to encapsulate these in an array because I was paranoid about
needing to separate each directory with a whitespace when storing them
on a stringwise basis. This should be safer and ensure the paths don't
get concatenated together if the whitespace is omitted.
2025-10-23 13:57:19 +09:00
aclist d0de2974d8 fix: emit heredoc directly 2025-10-23 13:44:50 +09:00
aclist 5a54d43601 fix: encapsulate usage command 2025-10-23 13:38:56 +09:00
aclist cbc131028f chore: capitalize TODO for syntax highlighting 2025-10-23 08:22:20 +09:00
Gergely Koloszar 239a82876e fix: silence ping while checking remote urls 2025-10-22 17:20:56 +02:00
Gergely Koloszar 1dfe9cd9df Fix not checking dotfiles in cache path 2025-10-21 19:04:38 +00:00
Gergely Koloszar f2124218e4 Add handling for multiple argument, version getting option and help 2025-10-18 23:12:59 +02:00
Gergely Koloszar cf087d96c7 Add check for script sourcing 2025-10-18 23:12:31 +02:00
Gergely Koloszar 6bb59f4060 Clean up depcheck 2025-10-18 22:53:14 +02:00
Gergely Koloszar d53476399d Clean up setup_state_files 2025-10-18 22:52:49 +02:00
Gergely Koloszar d34293e2c8 Clean up setup_dirs 2025-10-18 22:52:13 +02:00
Gergely Koloszar f82df9eacf Clean up set_im_module 2025-10-18 22:51:52 +02:00
Gergely Koloszar e73617c2f4 Add gitignore for latlon 2025-10-18 21:14:39 +02:00
Gergely Koloszar 67b0559058 Add makefile, and move latlon to a 'tools' directory 2025-10-18 21:13:15 +02:00
Gergely Koloszar dfe65aacd4 Rewrite and document latlon tool source
- incorrect argument count has been fixed
- The code has been split up into smaller units to be more
understandable
- sources were put in comments to help find resources for the
algorithm
- output is now in meters
2025-10-18 21:00:00 +02:00
aclist 6aa1ec4201 fix: early abort if local coords are missing 2025-10-17 19:12:59 +02:00
Gergely Koloszar d6223e54b0 Fix unintended deletion 2025-10-17 19:12:59 +02:00
Gergely Koloszar 83552f833c Add availability checks for local_latlon function 2025-10-17 19:12:59 +02:00
Gergely Koloszar f0657be289 Add availability checker for remote services based on ping and timeout 2025-10-17 19:12:59 +02:00
aclist 321384dc7b Merge pull request #222 from aclist/release/5.8.0
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
chore: release 5.8.0
2025-07-07 10:28:57 +09:00
aclist e02f02b775 chore: update changelog
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2025-07-07 10:18:25 +09:00
aclist de524bd2a5 chore: backports from testing 2025-07-06 12:37:29 +09:00
aclist edee9b6234 Merge pull request #219 from aclist/feat/coc2
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
feat: add code of conduct
2025-06-05 17:49:08 +09:00
aclist cefd041e08 feat: add code of conduct 2025-06-05 17:48:38 +09:00
aclist 881b0b3008 Merge pull request #218 from aclist/feat/coc
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
feat: add code of conduct
2025-06-05 17:48:05 +09:00
aclist 2a59441dbc feat: add code of conduct 2025-06-05 17:47:07 +09:00
aclist 5ab18d0796 Merge pull request #214 from aclist/release/5.7.0
Release/5.7.0
2025-04-17 22:13:38 +09:00
aclist 23e3d34947 chore: update IP checksum 2025-04-17 21:52:36 +09:00
aclist b86dd37b50 chore: bump minor version 2025-04-17 21:50:33 +09:00
aclist 59fdd30236 docs: update changelog 2025-04-17 21:49:35 +09:00
aclist a35bfda5f1 fix: constrain window to viewport 2025-04-17 21:47:47 +09:00
aclist 5393bf1f5f fix: more robust ping method 2025-04-17 21:43:43 +09:00
aclist 90b3aa8663 Merge pull request #209 from aclist/aclist-patch-1
chore: update CHANGELOG.md
2025-04-05 09:15:56 +09:00
aclist 728e4daf7c chore: update CHANGELOG.md 2025-04-05 09:15:23 +09:00
aclist 7a210c7f39 Merge pull request #208 from aclist/fix/test-connection
chore: drop pre-boot check
2025-04-05 09:08:35 +09:00
aclist 459dd69359 chore: bump version 2025-04-05 09:07:02 +09:00
aclist fbd1a355d5 chore: drop pre-boot api check 2025-04-05 09:03:29 +09:00
aclist 82d2afb1f2 Merge pull request #207 from aclist/chore/2025-03-ipdb
chore: update ip records
2025-03-16 12:18:52 +09:00
aclist 8193980878 chore: update ip records 2025-03-16 12:17:41 +09:00
aclist acdb34d36a Merge pull request #206 from aclist/chore/index-url
chore: update to new index url
2025-03-15 17:01:19 +09:00
aclist d6d0b241e0 chore: update to new index url 2025-03-15 17:00:08 +09:00
aclist f75ef947c9 Merge pull request #204 from aclist/fix/batch-queries
fix: batch queries
2025-03-05 11:15:31 +09:00
aclist 6dc9a719ee fix: split up batch queries 2025-03-05 11:13:20 +09:00
aclist 785df28f66 Merge pull request #202 from aclist/chore/backports
chore: backports
2025-02-12 20:15:51 +09:00
aclist 66e114a400 chore: backports 2025-02-10 17:54:45 +09:00
aclist 2ba07bbba8 Merge pull request #197 from aclist/dzgui
chore: merge stable onto archival branch
2025-02-09 19:55:27 +09:00
aclist 65eda05d9f Merge pull request #200 from aclist/chore/templates-stable
chore: back up templates from stable
2025-02-09 19:54:17 +09:00
aclist f3b3f79bfb chore: back up templates from main 2025-02-09 19:53:25 +09:00
aclist 28c7d7f949 Merge pull request #198 from aclist/fix/drop-files
chore: drop extraneous file
2025-02-09 19:02:02 +09:00
aclist d072c8107e chore: drop extraneous file 2025-02-09 19:01:30 +09:00
aclist 0629c8a6ba Merge pull request #196 from aclist/release/5.6.3
chore: update IP db
2025-02-09 18:56:13 +09:00
aclist 8aea4af687 chore: update IP db 2025-02-09 18:55:33 +09:00
aclist 0562d8230d Merge pull request #195 from aclist/release/5.6.2
chore: prepare release
2025-01-24 16:40:07 +09:00
aclist 759327e932 chore: prepare release 2025-01-23 12:02:27 +09:00
aclist 36753e02f1 Merge pull request #193 from aclist/release/5.6.1
Release/5.6.1
2025-01-10 22:48:54 +09:00
aclist 2ab2e23736 docs: update readme 2025-01-10 22:45:56 +09:00
aclist 34e7b2e480 fix: jq 1.6 support 2025-01-10 22:45:25 +09:00
aclist 540d0ad7e4 Update bug_report.yml 2025-01-09 23:32:28 +09:00
aclist 47bea45111 Update feature.yml 2025-01-09 23:32:27 +09:00
aclist d03346b56a Update trouble.yml 2025-01-09 23:32:26 +09:00
aclist 54e0762882 Update feature.yml 2025-01-09 23:31:21 +09:00
aclist 0834a86d33 Update trouble.yml 2025-01-09 23:30:54 +09:00
aclist c6a8841614 Update trouble.yml 2025-01-09 23:30:37 +09:00
aclist df92acb7dc Update bug_report.yml 2025-01-09 23:30:24 +09:00
aclist a333571f94 Update bug_report.yml 2025-01-09 23:28:46 +09:00
aclist 05f88b6019 Update trouble.yml 2025-01-09 23:27:08 +09:00
aclist 1f31c43fe4 Update trouble.yml 2025-01-09 20:39:35 +09:00
aclist 0763416903 Update feature.yml 2025-01-09 20:39:25 +09:00
aclist 3b384c5a4d Update bug_report.yml 2025-01-09 20:39:17 +09:00
aclist 3ab666a807 Merge pull request #190 from aclist/release/5.6.0
Release/5.6.0
2025-01-07 21:46:53 +09:00
aclist c8f7a32284 chore: update db checksum 2025-01-07 21:39:16 +09:00
aclist a070e9fc65 chore: drop unused log file 2025-01-07 20:54:03 +09:00
aclist 5f55e3c664 Merge branch 'release/5.6.0' of github.com:aclist/dztui into release/5.6.0 2025-01-07 20:52:58 +09:00
aclist 07606d8852 docs: update changelog 2025-01-07 20:51:57 +09:00
aclist afffc90abc Update trouble.yml 2025-01-07 19:55:31 +09:00
aclist 70db7b45b3 Update trouble.yml 2025-01-07 19:54:19 +09:00
aclist aac8558079 Update trouble.yml 2025-01-07 19:53:15 +09:00
aclist ac8ff2febf Update trouble.yml 2025-01-07 19:52:29 +09:00
aclist 6369d895fd Update feature.yml 2025-01-07 19:51:58 +09:00
aclist 7413f7c029 Update bug_report.yml 2025-01-07 19:51:46 +09:00
aclist 3f1d8cb24f Merge branch 'dzgui' into release/5.6.0 2025-01-07 00:59:57 +09:00
aclist 4df12605fc chore: update changelog 2025-01-07 00:55:58 +09:00
aclist 2c5da88e06 Update bug_report.yml 2025-01-06 20:28:34 +09:00
aclist 3cb6175436 Update feature.yml 2025-01-06 20:28:23 +09:00
aclist 3739f19ab2 Update trouble.yml 2025-01-06 20:28:12 +09:00
aclist 2da4d001d6 Update trouble.yml 2025-01-06 20:27:30 +09:00
aclist 5d61a1f513 Update trouble.yml 2025-01-06 20:26:29 +09:00
aclist 56c80d187b Update trouble.yml 2025-01-06 20:26:20 +09:00
aclist e08f66cdcb Update trouble.yml 2025-01-06 20:25:22 +09:00
aclist 48fee301bb Update trouble.yml 2025-01-06 20:24:47 +09:00
aclist 20511f5661 Update trouble.yml 2025-01-06 20:24:14 +09:00
aclist d2e8333ba9 Update trouble.yml 2025-01-06 20:21:10 +09:00
aclist 5d37039064 Update trouble.yml 2025-01-06 20:20:57 +09:00
aclist ce44cdbc54 Update trouble.yml 2025-01-06 20:20:36 +09:00
aclist 5b2738420e Create trouble.yml 2025-01-06 20:19:41 +09:00
aclist 1e29288e2a Update feature.yml 2025-01-06 20:10:08 +09:00
aclist 745cc06091 Update feature.yml 2025-01-06 20:09:08 +09:00
aclist 0311cc8a95 Create feature.yml 2025-01-06 20:08:29 +09:00
aclist 7c3521cf97 Delete .github/ISSUE_TEMPLATE/feature.md 2025-01-06 20:08:16 +09:00
aclist bb0eefadd2 Delete .github/ISSUE_TEMPLATE/test.yml 2025-01-06 20:03:41 +09:00
aclist 7eb5a4fac5 Update bug_report.yml 2025-01-06 20:02:52 +09:00
aclist ebce329c3d Delete .github/ISSUE_TEMPLATE/bug_report.md 2025-01-06 20:02:38 +09:00
aclist 23464d3b51 Update bug_report.yml 2025-01-06 20:01:30 +09:00
aclist 602a7b8edc Update bug_report.yml 2025-01-06 19:59:20 +09:00
aclist 59c58a1df5 Update bug_report.yml 2025-01-06 19:57:56 +09:00
aclist 830318d98e Update bug_report.yml 2025-01-06 19:57:00 +09:00
aclist 271c3e6197 Update bug_report.yml 2025-01-06 19:56:39 +09:00
aclist 1ab9634069 Update bug_report.yml 2025-01-06 19:54:29 +09:00
aclist 8666b0055a Update bug_report.yml 2025-01-06 19:53:52 +09:00
aclist 406554e011 Create bug_report.yml 2025-01-06 19:50:39 +09:00
aclist 5334d07f7f Create test.yml 2025-01-06 19:41:34 +09:00
aclist 6cab96d1f8 Create config.yml 2025-01-06 19:39:18 +09:00
aclist bc94d989d4 Delete .github/feature.md 2025-01-06 19:37:57 +09:00
aclist e4fff5f242 Create feature.md 2025-01-06 19:37:38 +09:00
aclist 53f2fe922a Create feature.md 2025-01-06 19:37:00 +09:00
aclist 800f68a1b7 Update bug_report.md 2025-01-06 19:32:55 +09:00
aclist c6c377e8b9 Update bug_report.md 2025-01-06 19:30:16 +09:00
aclist 7a68d7e097 Update issue templates 2025-01-06 19:27:44 +09:00
aclist f60a6edf2b Merge pull request #182 from aclist/patch/yaml
Patch/yaml
2024-12-25 14:21:49 +09:00
aclist 8c33a1b371 chore: drop branch logic 2024-12-25 14:21:24 +09:00
aclist e5f7391b89 chore: add YAML file 2024-12-25 14:20:36 +09:00
aclist a8f51280e8 Update mirror.yml 2024-12-25 14:19:04 +09:00
aclist c19346529b Update mirror.yml 2024-12-25 14:12:08 +09:00
aclist 85451f765b Update mirror.yml 2024-12-25 14:09:54 +09:00
aclist 5a144f7815 Merge pull request #179 from jiriks74/add_mirror_action
feat(ci): Add workflow for pushing to Codeberg
2024-12-25 12:42:58 +09:00
jiriks74 2370e81403 feat(ci): Add workflow for pushing to Codeberg 2024-12-17 17:24:32 +01:00
aclist c11511abff Merge pull request 'chore: backports into stable' (#5) from release/testing-backports into dzgui
Reviewed-on: https://codeberg.org/aclist/dztui/pulls/5
2024-12-13 01:50:01 +00:00
aclist bda7223ac8 Merge pull request #176 from aclist/release/testing-backports
Release/testing backports
2024-12-13 10:47:54 +09:00
aclist 6b48ee127d chore: backports into stable 2024-12-13 10:45:39 +09:00
aclist aa8a52bfc0 Merge pull request 'release/readme' (#4) from release/readme into dzgui
Reviewed-on: https://codeberg.org/aclist/dztui/pulls/4
2024-12-12 09:33:32 +00:00
aclist 8ea62434ee docs: update docs link 2024-12-12 18:32:44 +09:00
aclist baeaeb1b64 docs: update README 2024-12-12 17:57:27 +09:00
aclist 32b424da5c fix: update installscript 2024-12-12 12:25:26 +09:00
aclist d71110d0a1 fix: url syntax 2024-12-12 12:10:04 +09:00
aclist bc9178d2de fix: triage hotfix from testing 2024-12-12 11:56:10 +09:00
aclist 1533febf9a Merge pull request #172 from aclist/release/5.5.1
fix: backport hotfix (#168)
2024-12-03 20:10:29 +09:00
aclist c3c8872fad fix: backport hotfix (#168) 2024-12-03 20:09:19 +09:00
aclist bae6a57e1e Merge pull request #164 from aclist/dzgui
5.5.0 backports
2024-11-11 09:35:17 +09:00
aclist 3bdc0057a2 Merge pull request #163 from aclist/release/5.5.0-stable
Release/5.5.0 stable
2024-11-11 09:22:06 +09:00
aclist 5496f914f2 fix: correct typo 2024-11-11 09:17:47 +09:00
aclist cb9db55bcb Merge branch 'dzgui' into release/5.5.0-stable 2024-11-11 06:08:47 +09:00
aclist c0ab8111fd chore: bump version 2024-11-11 06:05:56 +09:00
aclist 10c6a79b17 chore: normalize changelog 2024-11-11 06:05:49 +09:00
aclist 2b4b533a5b Merge pull request #156 from aclist/release/5.4.2
Release/5.4.2
2024-10-06 03:31:10 +09:00
aclist dcb8be9132 chore: update checksum 2024-10-06 03:27:49 +09:00
aclist 278aa8c28a chore: update checksum 2024-10-06 03:26:24 +09:00
aclist 32e5bafb33 Merge branch 'dzgui' into release/5.4.2 2024-10-06 03:25:16 +09:00
aclist 59e19510e3 Merge pull request #152 from aclist/release/5.4.1
Release/5.4.1
2024-09-28 20:51:19 +09:00
aclist 45ab112970 Merge branch 'dzgui' into release/5.4.1 2024-09-25 23:11:28 +09:00
aclist ed07fd0343 chore: normalize changelog 2024-09-25 23:08:29 +09:00
aclist c2c7b37b90 Merge pull request #151 from aclist/release/5.3.0-backports
Release/5.3.0 backports
2024-09-09 17:16:31 +09:00
aclist 23798c91d3 Merge pull request #149 from aclist/release/5.3.0
chore: normalize version
2024-09-01 13:19:35 +09:00
aclist 659cbb83a3 chore: normalize version 2024-09-01 13:19:16 +09:00
aclist 32c467fc6d Merge pull request #147 from aclist/release/5.3.3
Release/5.3.3 (stable)
2024-09-01 13:13:54 +09:00
aclist d01add3573 docs: update changelog 2024-08-29 22:11:49 +09:00
aclist 0de89a3ef1 add: set WM_CLASS name 2024-08-28 08:44:13 +09:00
aclist 5686ea76c2 fix: boolean operator 2024-08-28 08:09:32 +09:00
aclist 5fda598173 chore: update url 2024-08-28 07:31:14 +09:00
aclist 049fb47019 chore: normalize version 2024-08-28 07:30:38 +09:00
aclist 81f269b71b chore: normalize changelog 2024-08-28 07:29:02 +09:00
aclist c97a7a260f Merge pull request #133 from aclist/docs/kb
docs: update API info
2024-07-14 22:26:03 +09:00
aclist b715eb5a3e Merge pull request #132 from aclist/docs/kb
docs: fix url
2024-07-06 20:45:12 +09:00
aclist 8e6cf7e792 Merge pull request #126 from aclist/dzgui
backports
2024-06-23 12:51:24 +09:00
aclist 98868073a5 Merge pull request #124 from aclist/dzgui
backports
2024-06-23 12:00:35 +09:00
15 changed files with 932 additions and 674 deletions

No files matched your search

+4
View File
@@ -5,6 +5,10 @@ labels: ["bug"]
assignees: assignees:
- aclist - aclist
body: body:
- type: markdown
attributes:
value: |
### WARNING: When posting log/config data, redact any sensitive information like API keys.
- type: checkboxes - type: checkboxes
id: kb id: kb
attributes: attributes:
+4
View File
@@ -5,6 +5,10 @@ labels: ["troubleshooting"]
assignees: assignees:
- aclist - aclist
body: body:
- type: markdown
attributes:
value: |
### WARNING: When posting log/config data, redact any sensitive information like API keys.
- type: dropdown - type: dropdown
id: device id: device
attributes: attributes:
+3
View File
@@ -1 +1,4 @@
tags tags
__pycache__
pre-commit
tests/
+119 -8
View File
@@ -1,14 +1,125 @@
# Changelog # Changelog
## [6.0.0-beta.8] XXXX-XX-XX ## [6.0.6-beta.1] 2026-05-17
## Changed
- Update symlink hash logic to align with DZGUI 7 beta
- Update A2S helper to latest commit
## [6.0.5-beta.2] 2026-04-17
## Changed
- During server connection attempts, only download mods local to specific server
## [6.0.5-beta.1] 2026-04-13
## Fixed
- Update A2S module checksums to support servers with missing description field
## Changed
- Bump version to reflect hotfixes on stable branch
## [6.0.2-beta.5] 2026-04-12
## Fixed
- Use conditional logic when testing GLibUnix namespaces
## [6.0.2-beta.4] 2026-04-10
## Fixed
- Use GLibUnix namespace when setting up SIGINT handling
## [6.0.2-beta.3] 2026-01-26
## Fixed
- Raise error correctly from module
## [6.0.2-beta.2] 2026-01-18
## Fixed
- Helpers not being downloaded (uncommented boilerplate)
## [6.0.2-beta.1] 2026-01-18
## Fixed
- Do not spawn dialogs from inside of thread when fetching prereqs
## Changed
- Optimize time complexity of startup checks
- Optimize coordinate calculation by using local records first
- Rename some internal functions
- Wrap entire startup process in dialog
## [6.0.1-beta.1] 2026-01-16
## Fixed
- Explicitly use Python 3.13 when calling subprocesses
## [6.0.0-beta.20] 2026-01-14
## Fixed
- Write cache file after wiping
## [6.0.0-beta.19] 2026-01-14
## Fixed
- Steam Deck compatible script path expansion
## [6.0.0-beta.18] 2026-01-14
## Fixed
- Update UI checksums
## [6.0.0-beta.17] 2026-01-14
## Added ## Added
- Flag to disable branch toggle for distro-packaged releases - More descriptive help dialogs when initial dependencies are missing
## [6.0.0-beta.16] 2026-01-04
## Fixed
- Regression introduced in previous hotfix
## [6.0.0-beta.15] 2025-12-27
## Fixed
- Path discovery during first-time setup when parsing filepaths with whitespaces
- First-time setup dialog continuously triggering when DayZ install path had whitespaces in it
## [6.0.0-beta.14] 2025-12-09
## Fixed
- Dialogs with newlines breaking output in log table
## [6.0.0-beta.13] 2025-11-29
## Fixed
- Server filter panel not being hidden when entering other page contexts
- Path to remote changelog being constructed incorrectly
## [6.0.0-beta.12] 2025-11-14
## Changed
- Require Python 3.13
## Fixed
- Normalize beta version
## [6.0.0-beta.11] 2025-11-13
## Added
- Support sandboxed flatpak
## Changed
- Preferred client from radio toggle to combobox
## Fixed ## Fixed
- ESC key destroying wait dialogs while thread is pending - Config file erroneously getting updated when populating settings menu
- Tooltip signals being processed on main menu
- Leaky variable name in dialog title ## [6.0.0-beta.10] 2025-11-10
## Fixed
- Python 3.14 error in finally block
- Require Python version between 3.11 and 3.12
## [6.0.0-beta.9] 2025-11-05
## Fixed
- UI not being constructed correctly if CHANGELOG.md was missing
## [6.0.0-beta.8] 2025-11-04
## Added
- Internal flag to allow distribution packaged releases to disable in-app updates
- Pre-boot check to test whether script was invoked directly
- Commandline usage help text
## Fixed
- ESC key destroying wait dialogs while a thread is pending
- Tooltip signals being erroneously drawn on main menu
- Leaky variable name in dialog titles
- 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 (GaryBlackbourne)
## Changed
- Optimize time complexity of pre-boot checks (GaryBlackbourne)
- Moved location of notes file
- Rewrote distance calculation module (GaryBlackbourne)
## [6.0.0-beta.7] 2025-09-20 ## [6.0.0-beta.7] 2025-09-20
## Added ## Added
@@ -505,7 +616,7 @@ As part of this change, version 4.0.0 introduces the ability to connect to or ad
If you encounter any problems with this new release or with the migration of configs, please do not hesitate to submit a bug report. If you encounter any problems with this new release or with the migration of configs, please do not hesitate to submit a bug report.
Attention Fedora 38 users: problems with upstream GNOME packages causing crashes have been reported to GNOME development and a fix has been issued. You have the choice of compiling the zenity package Attention Fedora 38 users: problems with upstream GNOME packages causing crashes have been reported to GNOME development and a fix has been issued. You have the choice of compiling the zenity package
from source or waiting until the latest version is merged into Fedora's package manager. from source or waiting until the latest version is merged into Fedora's package manager.
### Added ### Added
@@ -530,7 +641,7 @@ from source or waiting until the latest version is merged into Fedora's package
- Store complete IP:Port instead of server IDs - Store complete IP:Port instead of server IDs
- Make Battlemetrics API key optional: this is only used for the 'Connect by ID' and 'Add server by ID' methods and is not required. If you prefer, you can simply connect/add by IP. - Make Battlemetrics API key optional: this is only used for the 'Connect by ID' and 'Add server by ID' methods and is not required. If you prefer, you can simply connect/add by IP.
- Prevent the application from launching in Game Mode on Steam Deck: Steam Deck's kiosk mode has problems sending keyboard input to third party applications. To prevent unintended usage, DZGUI now warns the user to launch the app in Desktop Mode if they attempt to use it from Game Mode. Adding DZGUI as a Non-Steam Game does work on desktop PCs, but is not recommended due to the way Steam handles subshells. For best results, launch DZGUI directly via the script/applications menu (PC) or via the desktop icon (Steam Deck). - Prevent the application from launching in Game Mode on Steam Deck: Steam Deck's kiosk mode has problems sending keyboard input to third party applications. To prevent unintended usage, DZGUI now warns the user to launch the app in Desktop Mode if they attempt to use it from Game Mode. Adding DZGUI as a Non-Steam Game does work on desktop PCs, but is not recommended due to the way Steam handles subshells. For best results, launch DZGUI directly via the script/applications menu (PC) or via the desktop icon (Steam Deck).
- Omit null servers from list: servers that time out or send an empty response are now omitted entirely from the My Servers list, as they will not return meaningful metadata unless they are online. - Omit null servers from list: servers that time out or send an empty response are now omitted entirely from the My Servers list, as they will not return meaningful metadata unless they are online.
The My Servers list thus shows online and accessible servers The My Servers list thus shows online and accessible servers
## [3.3.0] 2023-05-16 ## [3.3.0] 2023-05-16
@@ -549,7 +660,7 @@ from source or waiting until the latest version is merged into Fedora's package
- First-time setup: sudo escalation when checking system map count for the first time - First-time setup: sudo escalation when checking system map count for the first time
### Fixed ### Fixed
- Steam Deck: non-ASCII delimiter causing setup menu to despawn on some devices - Steam Deck: non-ASCII delimiter causing setup menu to despawn on some devices
- Don't add items in My Servers multiple times to array when the list of favorites is paginated - Don't add items in My Servers multiple times to array when the list of favorites is paginated
- Trigger progress dialogs sooner and in sequence to reduce appearance of visual lag - Trigger progress dialogs sooner and in sequence to reduce appearance of visual lag
- First-time setup: break out of dialogs correctly when user backs out - First-time setup: break out of dialogs correctly when user backs out
+38 -33
View File
@@ -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,50 @@ 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>`.
If there is no pending prerelease PR, you can base your changes off of
the `testing` branch. You may later be asked to retarget your PR to the prerelease
branch once a new one is made. This is because out-of-band PRs are consolidated into
the next release before merging.
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.
+9 -1
View File
@@ -11,6 +11,15 @@ This overcomes certain limitations in the Linux client and helps prepare the gam
- Concatenate launch options to pass to Steam - Concatenate launch options to pass to Steam
- Connect to mod-enabled LAN servers - Connect to mod-enabled LAN servers
## Design philosophy
DZGUI follows a specific set of guidelines, enumerated below:
- Provide a free and open-source tool under GPL
- Do not use undocumented, third-party servers to aggregate data; no central "DZGUI" server
- All connections go to Steam and DayZ servers directly; the tool should function in perpetuity without intermediary endpoints
- Target Linux desktop and Steam deck specifically; not a cross-platform tool
## Setup and usage ## Setup and usage
Refer to the documentation for installation and setup instructions: Refer to the documentation for installation and setup instructions:
@@ -18,7 +27,6 @@ Refer to the documentation for installation and setup instructions:
- [GitHub](https://aclist.github.io/dzgui/index.html) - [GitHub](https://aclist.github.io/dzgui/index.html)
- [Mirror (Codeberg)](https://aclist.codeberg.page) - [Mirror (Codeberg)](https://aclist.codeberg.page)
![A screenshot of DZGUI](/images/example.png) ![A screenshot of DZGUI](/images/example.png)
## Attribution ## Attribution
+289 -135
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=6.0.0.beta-8 src_path="$(readlink -e "$0")"
version=6.0.6-beta.1
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@@ -39,6 +40,7 @@ cols_file="$state_path/$prefix.cols.json"
#CACHE FILES #CACHE FILES
coords_file="$cache_path/$prefix.coords" coords_file="$cache_path/$prefix.coords"
src_path_file="$cache_path/$prefix.src"
#legacy paths #legacy paths
hist_file="$config_path/history" hist_file="$config_path/history"
@@ -63,17 +65,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 +86,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")
mkdir -p "$dir" directories+=("$cache_path")
fi directories+=("$share_path")
directories+=("$helpers_path")
directories+=("$freedesktop_path")
directories+=("$config_path")
directories+=("$log_path")
for dir in "${directories[@]}"; do
mkdir -p "$dir"
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,13 +111,13 @@ 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"
fi fi
echo "$src_path" > "$src_path_file"
} }
print_config_vals(){ print_config_vals(){
local keys=( local keys=(
@@ -132,10 +139,10 @@ print_config_vals(){
} }
test_gobject(){ test_gobject(){
python3 -c "import gi" python3.13 -c "import gi"
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
logger CRITICAL "Missing PyGObject" logger CRITICAL "Missing PyGObject"
fdialog "Requires PyGObject (python-gobject)" quit_with_help_dialog "Requires PyGObject (python-gobject)"
exit 1 exit 1
fi fi
logger INFO "Found PyGObject in Python env" logger INFO "Found PyGObject in Python env"
@@ -214,17 +221,14 @@ default_steam_path="$default_steam_path"
#Preferred Steam launch command (for Flatpak support) #Preferred Steam launch command (for Flatpak support)
preferred_client="$preferred_client" preferred_client="$preferred_client"
#DZGUI source path
src_path="$src_path"
END 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" echo "$msg"
exit 1
fi fi
done done
local jqmsg="jq must be compiled with support for oniguruma" local jqmsg="jq must be compiled with support for oniguruma"
@@ -233,14 +237,31 @@ depcheck(){
[[ $? -ne 0 ]] && raise_error_and_quit "$jqmsg" [[ $? -ne 0 ]] && raise_error_and_quit "$jqmsg"
logger INFO "Initial dependencies satisfied" logger INFO "Initial dependencies satisfied"
} }
open_url(){
url="$1"
if [[ -n "$BROWSER" ]]; then
logger INFO "Opening '$url' in '$BROWSER'"
"$BROWSER" "$url"
else
logger INFO "Opening '$url' with xdg-open"
xdg-open "$url"
fi
}
quit_with_help_dialog(){
local sel
msg="$1"
help_button="Open help page"
url="https://aclist.github.io/dzgui/installation.html"
logger CRITICAL "$msg"
sel=$(zenity --info --extra-button="$help_button" --text="$msg")
[[ $sel == "$help_button" ]] && open_url "$url" &
exit 1
}
check_pyver(){ check_pyver(){
local pyver=$(python3 --version | awk '{print $2}') if [[ ! $(python3.13 --version) ]]; then
local minor=$(<<< $pyver awk -F. '{print $2}') local msg="Requires Python 3.13"
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]] || [[ $minor -lt 10 ]]; then quit_with_help_dialog "$msg"
local msg="Requires Python >=3.10"
raise_error_and_quit "$msg"
fi fi
logger INFO "Found Python version: $pyver"
} }
watcher_deps(){ watcher_deps(){
if [[ ! $(command -v wmctrl) ]] && [[ ! $(command -v xdotool) ]]; then if [[ ! $(command -v wmctrl) ]] && [[ ! $(command -v xdotool) ]]; then
@@ -314,6 +335,8 @@ check_unmerged(){
fi fi
} }
check_version(){ check_version(){
echo "# Checking version"
[[ -n $reference_branch ]] && return
local version_url=$(format_version_url) local version_url=$(format_version_url)
local upstream=$(curl -Ls "$version_url" | awk -F= '/^version=/ {print $2}') local upstream=$(curl -Ls "$version_url" | awk -F= '/^version=/ {print $2}')
local res=$(get_response_code "$version_url") local res=$(get_response_code "$version_url")
@@ -363,7 +386,7 @@ prompt_dl(){
Your branch: $branch Your branch: $branch
Your version: $version Your version: $version
Upstream version: $upstream Upstream version: $upstream
Version updates introduce important bug fixes and are encouraged. Attempt to download the latest version? Version updates introduce important bug fixes and are encouraged. Attempt to download the latest version?
EOF EOF
} }
@@ -377,10 +400,11 @@ prompt_dl(){
dl_changelog(){ dl_changelog(){
local mdbranch local mdbranch
local md local md
source "$config_file"
[[ $branch == "stable" ]] && mdbranch="dzgui" [[ $branch == "stable" ]] && mdbranch="dzgui"
[[ $branch == "testing" ]] && mdbranch="testing" [[ $branch == "testing" ]] && mdbranch="testing"
local md="$url_prefix/${mdbranch}/$file" local changelog="$url_prefix/${mdbranch}/CHANGELOG.md"
curl -Ls "$md" > "$state_path/CHANGELOG.md" curl -Ls "$changelog" > "$state_path/CHANGELOG.md"
} }
test_display_mode(){ test_display_mode(){
pgrep -a gamescope | grep -q "generate-drm-mode" pgrep -a gamescope | grep -q "generate-drm-mode"
@@ -391,6 +415,7 @@ test_display_mode(){
fi fi
} }
check_architecture(){ check_architecture(){
echo "# Checking system architecture"
local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}') local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}')
read -a APU_MODEL <<< "$cpu" read -a APU_MODEL <<< "$cpu"
if [[ ${APU_MODEL[3]} != "0932" ]] && [[ ${APU_MODEL[3]} != "0405" ]]; then if [[ ${APU_MODEL[3]} != "0932" ]] && [[ ${APU_MODEL[3]} != "0405" ]]; then
@@ -407,6 +432,7 @@ check_architecture(){
logger INFO "Setting architecture to 'Steam Deck'" logger INFO "Setting architecture to 'Steam Deck'"
} }
check_map_count(){ check_map_count(){
echo "# Checking map count"
[[ $is_steam_deck -gt 0 ]] && return 0 [[ $is_steam_deck -gt 0 ]] && return 0
local map_count_file="/proc/sys/vm/max_map_count" local map_count_file="/proc/sys/vm/max_map_count"
local min_count=1048576 local min_count=1048576
@@ -456,6 +482,7 @@ tdialog(){
$steamsafe_zenity --info --text="$1" "${zenity_flags[@]}" $steamsafe_zenity --info --text="$1" "${zenity_flags[@]}"
} }
steam_deps(){ steam_deps(){
echo "# Checking Steam"
local flatpak local flatpak
local steam local steam
[[ $(command -v flatpak) ]] && flatpak=$(flatpak list | grep valvesoftware.Steam) [[ $(command -v flatpak) ]] && flatpak=$(flatpak list | grep valvesoftware.Steam)
@@ -464,50 +491,64 @@ steam_deps(){
local msg="Found neither Steam nor Flatpak Steam" local msg="Found neither Steam nor Flatpak Steam"
raise_error_and_quit "$msg" raise_error_and_quit "$msg"
exit 1 exit 1
elif [[ -n "$steam" ]] && [[ -n "$flatpak" ]]; then
[[ -n $preferred_client ]] && return 0
if [[ -z $preferred_client ]]; then
preferred_client="steam"
fi
elif [[ -n "$steam" ]]; then
preferred_client="steam"
else
preferred_client="flatpak"
fi fi
update_config
logger INFO "Preferred client set to '$preferred_client'"
}
migrate_files(){
if [[ ! -f $config_path/dztuirc.oldapi ]]; then
cp $config_file $config_path/dztuirc.oldapi
logger INFO "Migrated old API file"
fi
[[ ! -f $hist_file ]] && return
rm $hist_file
logger INFO "Wiped old history file"
} }
stale_symlinks(){ stale_symlinks(){
echo "# Cleaning stale symlinks"
local game_dir="$steam_path/steamapps/common/DayZ" local game_dir="$steam_path/steamapps/common/DayZ"
for l in $(find "$game_dir" -xtype l); do readarray -t links < <(find "$game_dir" -xtype l)
logger DEBUG "Updating stale symlink '$l'" for link in "${links[@]}"; do
unlink "$l" logger DEBUG "Updating stale symlink '$link'"
unlink "$link"
done done
} }
check_availability() {
if [[ -z $1 ]]; then
return 1
fi
local url=$1
local timeout_sec="1"
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(){
echo "# Checking coordinates"
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" if calc_local_coords "$local_ip"; then
local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"') return 0
fi
local url_ip_api="http://ip-api.com/json/$local_ip"
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(){
echo "# Setting up lock file"
[[ ! -f $lock_file ]] && touch $lock_file [[ ! -f $lock_file ]] && touch $lock_file
local pid=$(cat $lock_file) local pid=$(cat $lock_file)
ps -p $pid -o pid= >/dev/null 2>&1 ps -p $pid -o pid= >/dev/null 2>&1
@@ -526,9 +567,12 @@ get_hash(){
md5sum "$1" | awk '{print $1}' md5sum "$1" | awk '{print $1}'
} }
fetch_a2s(){ fetch_a2s(){
# this file is currently monolithic sum="d26da2fe03df2b95436f823f0496887b"
[[ -d $helpers_path/a2s ]] && { logger INFO "A2S helper is current"; return 0; } if [[ -d $helpers_path/a2s ]] && [[ $(get_hash "$helpers_path/a2s/info.py") == $sum ]]; then
local sha=c7590ffa9a6d0c6912e17ceeab15b832a1090640 logger INFO "A2S helper is current"
return 0
fi
local sha=b40eb24cdbb06ebd08272f224257fe5a81610e86
local author="yepoleb" local author="yepoleb"
local repo="python-a2s" local repo="python-a2s"
local url="https://github.com/$author/$repo/tarball/$sha" local url="https://github.com/$author/$repo/tarball/$sha"
@@ -542,13 +586,13 @@ fetch_a2s(){
logger INFO "Updated A2S helper to sha '$sha'" logger INFO "Updated A2S helper to sha '$sha'"
} }
fetch_dzq(){ fetch_dzq(){
local sum="0a334e1e144e76e560419d155435c91e" local sum="0d316badbb8d943c5f078e73862cac3e"
local file="$helpers_path/a2s/dayzquery.py" local file="$helpers_path/a2s/dayzquery.py"
if [[ -f $file ]] && [[ $(get_hash "$file") == $sum ]]; then if [[ -f $file ]] && [[ $(get_hash "$file") == $sum ]]; then
logger INFO "DZQ is current" logger INFO "DZQ is current"
return 0 return 0
fi fi
local sha=a22a9f428cbe075d7dda62f78000296955eea92a local sha="07483b88ed096327ebca752f5e177011b604d7fe"
local author="yepoleb" local author="yepoleb"
local repo="dayzquery" local repo="dayzquery"
local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py" local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py"
@@ -585,12 +629,12 @@ 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"]="1cd26343cd68a5382e3377a9757497fa"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["servers.py"]="ed442c3aecf33f777d59dcf53650d263" ["servers.py"]="ed442c3aecf33f777d59dcf53650d263"
["ui.py"]="f03879f088ad074f2ce3c92607c30202" ["ui.py"]="cf52a3d5883afe02a013d8673df494fa"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["pefile.py"]="21531f2c0d9dfa5f110cf6779f9d22c0" ["pefile.py"]="b452974a84bff1d821872fcebf59e380"
) )
local author="aclist" local author="aclist"
local repo="dztui" local repo="dztui"
@@ -609,6 +653,10 @@ fetch_helpers_by_sum(){
realbranch="dzgui" realbranch="dzgui"
fi fi
if [[ -n $reference_branch ]]; then
realbranch="$reference_branch"
fi
for i in "${!sums[@]}"; do for i in "${!sums[@]}"; do
file="$i" file="$i"
sum="${sums[$i]}" sum="${sums[$i]}"
@@ -646,15 +694,12 @@ fetch_km_helper(){
} }
get_response_code(){ get_response_code(){
local url="$1" local url="$1"
curl -Ls -I -o /dev/null -w "%{http_code}" "$url" curl --connect-timeout 3 -Ls -I -o /dev/null -w "%{http_code}" "$url"
}
raise_error_and_quit(){
echo "$1"
exit 1
} }
fetch_ip_db(){ fetch_ip_db(){
parse_dl_url(){ parse_dl_url(){
curl -Ls "$url" \ curl --connect-timeout 3 -Ls "$url" \
| grep "csv.gz" \ | grep "csv.gz" \
| awk -F"['']" '{print $2}' | awk -F"['']" '{print $2}'
} }
@@ -670,6 +715,9 @@ fetch_ip_db(){
fetch(){ fetch(){
logger INFO "Triggering fetch routine" logger INFO "Triggering fetch routine"
local url="$1" local url="$1"
local ip_file="${state_path}/ips.csv"
local base_file="${state_path}/${this_month}.csv.gz"
local extracted_file="${state_path}/${this_month}.csv"
curl -Ls "$url" > "$base_file" curl -Ls "$url" > "$base_file"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@@ -689,7 +737,7 @@ fetch_ip_db(){
logger WARN "Abnormal exit while parsing IPs" logger WARN "Abnormal exit while parsing IPs"
return return
fi fi
rm "${state_path}/${month}.csv" rm "${state_path}/${this_month}.csv"
readarray -t records < <(cat $ip_file | awk -F, 'NR==1 {print $1} END {print $1}') readarray -t records < <(cat $ip_file | awk -F, 'NR==1 {print $1} END {print $1}')
if [[ ${records[0]} != "0.0.0.0" ]] && [[ ${records[1]} != "224.0.0.0" ]]; then if [[ ${records[0]} != "0.0.0.0" ]] && [[ ${records[1]} != "224.0.0.0" ]]; then
@@ -704,55 +752,57 @@ fetch_ip_db(){
rm "$ip_file" rm "$ip_file"
fi fi
echo "$month" > "$month_file" echo "$this_month" > "$month_file"
logger INFO "Wrote '$month' to stub '$month_file'" logger INFO "Wrote '$this_month' to stub '$month_file'"
logger INFO "Updated '$ip_file'" logger INFO "Updated '$ip_file'"
} }
check_remote(){
local url="$1"
local res=$(get_response_code "$url")
if [[ $res -ne 200 ]]; then
logger WARN "Failed to retrieve remote resource: '$url' ($res)"
return
fi
logger INFO "Resolved remote URL: '$url'"
# test dl url
local dl_url="$(parse_dl_url)"
local res=$(get_response_code "$dl_url")
if [[ $res -ne 200 ]]; then
logger WARN "Remote resource unavailable: '$dl_url' ($res)"
return
fi
logger INFO "Resolved download URL: '$dl_url'"
fetch "$dl_url"
}
local url="https://db-ip.com/db/download/ip-to-city-lite" local url="https://db-ip.com/db/download/ip-to-city-lite"
local month_file="${state_path}/.month" month_file="${state_path}/.month"
local ip_file="${state_path}/ips.csv" this_month=$(date +%Y-%m)
# test main url
local res=$(get_response_code "$url")
if [[ $res -ne 200 ]]; then
logger WARN "Failed to retrieve remote resource: '$url' ($res)"
return
fi
logger INFO "Resolved remote URL: '$url'"
# test dl url
local dl_url="$(parse_dl_url)"
local res=$(get_response_code "$dl_url")
if [[ $res -ne 200 ]]; then
logger WARN "Remote resource unavailable: '$dl_url' ($res)"
return
fi
logger INFO "Resolved download URL: '$dl_url'"
local month=$(parse_dl_url_date "$dl_url")
local base_file="${state_path}/${month}.csv.gz"
local extracted_file="${state_path}/${month}.csv"
# no stub file # no stub file
if [[ ! -f $month_file ]]; then if [[ ! -f $month_file ]]; then
logger WARN "No stub file '$month_file' present" logger WARN "No stub file '$month_file' present"
fetch "$dl_url" check_remote "$url"
return
fi
# local needs update
local last_month=$(< "$month_file")
if [[ $last_month != "$month" ]]; then
logger WARN "Local stub '$last_month' does not match remote stub '$month'"
fetch "$dl_url"
return return
fi fi
# if stub is same date, abort # if stub is same date, abort
logger INFO "Local stub '$last_month' is identical to remote, skipping" local last_month=$(< "$month_file")
if [[ $last_month == "$this_month" ]]; then
logger INFO "Local stub '$last_month' is identical to remote, skipping"
return
fi
# local needs update
logger WARN "Local stub '$last_month' does not match '$this_month'"
check_remote "$url"
return
} }
fetch_helpers(){ fetch_helpers(){
echo "# Checking helper files"
fetch_a2s fetch_a2s
fetch_dzq fetch_dzq
fetch_km_helper fetch_km_helper
@@ -851,12 +901,26 @@ file_picker(){
} }
find_library_folder(){ find_library_folder(){
local search_path="$1" local search_path="$1"
steam_path="$(python3 "$helpers_path/vdf2json.py" -i "$1/steamapps/libraryfolders.vdf" \ readarray -t paths < <(python3.13 "$helpers_path/vdf2json.py" -i "$1/steamapps/libraryfolders.vdf" \
| jq -r '.libraryfolders[]|select(.apps|has("221100")).path')" | jq -r '.libraryfolders[]|select(.apps|has("221100")).path')
if [[ ! $? -eq 0 ]] || [[ -z $steam_path ]]; then if [[ ! $? -eq 0 ]]; then
logger WARN "Failed to parse Steam path using '$search_path'" logger WARN "Failed to parse Steam path using '$search_path'"
return 1 return 1
fi fi
if [[ ${#paths[@]} -eq 0 ]]; then
logger WARN "No valid VDF paths in '$search_path'"
return 1
fi
if [[ ${#paths[@]} -gt 1 ]]; then
for path in "${paths[@]}"; do
if [[ -d "$path" ]]; then
steam_path="$path"
break
fi
done
else
steam_path="${paths[0]}"
fi
logger INFO "Steam path resolved to: $steam_path" logger INFO "Steam path resolved to: $steam_path"
} }
create_config(){ create_config(){
@@ -865,6 +929,7 @@ create_config(){
unset default_steam_path unset default_steam_path
unset steam_path unset steam_path
preferred_client="steam"
while true; do while true; do
local player_input="$($steamsafe_zenity \ local player_input="$($steamsafe_zenity \
--forms \ --forms \
@@ -925,6 +990,7 @@ create_config(){
done done
} }
varcheck(){ varcheck(){
echo "# Checking config file"
local msg="Config file '$config_file' missing. Start first-time setup now?" local msg="Config file '$config_file' missing. Start first-time setup now?"
local msg2="The Steam paths set in your config file appear to be invalid (DayZ was moved or uninstalled). Restart first-time setup now?" local msg2="The Steam paths set in your config file appear to be invalid (DayZ was moved or uninstalled). Restart first-time setup now?"
if [[ ! -f $config_file ]]; then if [[ ! -f $config_file ]]; then
@@ -938,7 +1004,7 @@ varcheck(){
source "$config_file" source "$config_file"
local workshop_dir="$steam_path/steamapps/workshop/content/$aid" local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
local game_dir="$steam_path/steamapps/common/DayZ" local game_dir="$steam_path/steamapps/common/DayZ"
if [[ ! -d $steam_path ]] || [[ ! -d $game_dir ]] || [[ ! $(find $game_dir -type f) ]]; then if [[ ! -d $steam_path ]] || [[ ! -d $game_dir ]] || [[ ! $(find "$game_dir" -type f) ]]; then
logger WARN "DayZ path resolved to '$game_dir'" logger WARN "DayZ path resolved to '$game_dir'"
logger WARN "Workshop path resolved to '$workshop_dir'" logger WARN "Workshop path resolved to '$workshop_dir'"
qdialog "$msg2" "Yes" "Exit" qdialog "$msg2" "Yes" "Exit"
@@ -949,18 +1015,16 @@ varcheck(){
create_config create_config
return 0 return 0
fi fi
if [[ $src_path != $(realpath "$0") ]]; then
src_path=$(realpath "$0")
update_config
fi
} }
is_dzg_downloading(){ is_dzg_downloading(){
echo "# Checking DayZ"
if [[ -d $steam_path ]] && [[ -d $steam_path/downloading/$aid ]]; then if [[ -d $steam_path ]] && [[ -d $steam_path/downloading/$aid ]]; then
logger WARN "DayZ may be scheduling updates" logger WARN "DayZ may be scheduling updates"
return 0 return 0
fi fi
} }
is_steam_running(){ is_steam_running(){
echo "# Checking Steam"
local res=$(ps aux | grep "steamwebhelper" | grep -v grep) local res=$(ps aux | grep "steamwebhelper" | grep -v grep)
if [[ -z $res ]]; then if [[ -z $res ]]; then
logger WARN "Steam may not be running" logger WARN "Steam may not be running"
@@ -973,6 +1037,7 @@ get_response_code(){
curl -Ls -I -o /dev/null -w "%{http_code}" "$url" curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
} }
test_connection(){ test_connection(){
echo "# Testing connection"
declare -A hr declare -A hr
local res1 local res1
local res2 local res2
@@ -1006,6 +1071,7 @@ legacy_cols(){
mv $cols_file.new $cols_file mv $cols_file.new $cols_file
} }
stale_mod_signatures(){ stale_mod_signatures(){
echo "# Checking stale mods"
[[ ! -f "$versions_file" ]] && return [[ ! -f "$versions_file" ]] && return
local workshop_dir="$steam_path/steamapps/workshop/content/$aid" local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
if [[ -d $workshop_dir ]]; then if [[ -d $workshop_dir ]]; then
@@ -1019,18 +1085,48 @@ stale_mod_signatures(){
} }
create_new_links(){ create_new_links(){
echo "# Setting up symlinks"
"$func_helper" "update_symlinks" "$func_helper" "update_symlinks"
} }
calc_local_coords(){
local ip="$1"
[[ ! -f "$geo_helper" ]] && return 1
IFS="." read -ra split <<< "$ip"
[[ ${#split[@]} -ne 4 ]] && return 1
prefix="^${split[0]}.${split[1]}."
readarray -t res < <(grep "$prefix" "$geo_helper")
for address in "${res[@]}"; do
IFS="," read -ra fields <<< "$address"
upper="${fields[1]}"
IFS="." read -ra upper_digits <<< "$upper"
if [[ ${split[2]} -gt ${upper_digits[2]} ]]; then
continue
fi
if [[ ${split[2]} -eq ${upper_digits[2]} ]]; then
if [[ ${split[3]} -gt ${upper_digits[3]} ]]; then
continue
fi
if [[ ${split[3]} -eq ${upper_digits[3]} ]]; then
echo "${fields[-2]}" >> "$coords_file"
echo "${fields[-1]}" >> "$coords_file"
return 0
fi
fi
if [[ ${split[2]} -lt ${upper_digits[2]} ]]; then
echo "${fields[-2]}" >> "$coords_file"
echo "${fields[-1]}" >> "$coords_file"
return 0
fi
done
return 1
}
initial_setup(){ initial_setup(){
setup_dirs
setup_state_files
depcheck
check_pyver
test_gobject
watcher_deps
check_architecture check_architecture
test_connection test_connection
fetch_helpers > >(pdialog "Checking helper files") fetch_helpers
varcheck varcheck
source "$config_file" source "$config_file"
lock lock
@@ -1039,14 +1135,12 @@ initial_setup(){
check_version check_version
check_map_count check_map_count
steam_deps steam_deps
migrate_files
stale_symlinks stale_symlinks
stale_mod_signatures stale_mod_signatures
create_new_links create_new_links
local_latlon local_latlon
is_steam_running is_steam_running
is_dzg_downloading is_dzg_downloading
print_config_vals
} }
uninstall(){ uninstall(){
_full(){ _full(){
@@ -1090,22 +1184,82 @@ 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
exit 0 while [[ $# -gt 0 ]]; do
fi case $1 in
"--uninstall" | "-u")
uninstall
exit 0
# 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
printf "Initializing setup...\n" printf "Checking dependencies...\n"
initial_setup setup_dirs
setup_state_files
depcheck
check_pyver
test_gobject
watcher_deps
initial_setup > >(pdialog "Initializing setup")
printf "All OK. Kicking off UI...\n" printf "All OK. Kicking off UI...\n"
python3 "$ui_helper" "--init-ui" "$version" "$is_steam_deck" python3.13 "$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
+161 -166
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version="6.0.0-beta.8" version="6.0.5-beta.2"
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@@ -51,6 +51,7 @@ _cache_binary="$cache_dir/$prefix.binary"
_cache_coords="$cache_path/$prefix.coords" _cache_coords="$cache_path/$prefix.coords"
_cache_cooldown="$cache_path/$prefix.cooldown" _cache_cooldown="$cache_path/$prefix.cooldown"
_cache_lan="$cache_path/$prefix.lan" _cache_lan="$cache_path/$prefix.lan"
_cache_src_path="$cache_path/$prefix.src"
#XDG #XDG
freedesktop_path="$HOME/.local/share/applications" freedesktop_path="$HOME/.local/share/applications"
@@ -87,17 +88,14 @@ steam_api_url="https://steamcommunity.com/dev/apikey"
battlemetrics_api_url="https://www.battlemetrics.com/developers" battlemetrics_api_url="https://www.battlemetrics.com/developers"
bm_api="https://api.battlemetrics.com/servers" bm_api="https://api.battlemetrics.com/servers"
if [[ $preferred_client == "steam" ]]; then steam_cmd="$preferred_client"
steam_cmd="steam"
else
steam_cmd="flatpak run com.valvesoftware.Steam"
fi
declare -A funcs=( declare -A funcs=(
["Highlight stale"]="find_stale_mods" ["Highlight stale"]="find_stale_mods"
["Change player name"]="update_config_val" ["Change player name"]="update_config_val"
["Change Steam API key"]="update_config_val" ["Change Steam API key"]="update_config_val"
["Change Battlemetrics API key"]="update_config_val" ["Change Battlemetrics API key"]="update_config_val"
["Change client"]="update_config_val"
["Change favorite server"]="add_record" ["Change favorite server"]="add_record"
["Add server by IP"]="add_record" ["Add server by IP"]="add_record"
["Add server by ID"]="add_record" ["Add server by ID"]="add_record"
@@ -288,7 +286,7 @@ a2s(){
local mode="$3" local mode="$3"
logger INFO "Querying '$ip:$qport' with mode '$mode'" logger INFO "Querying '$ip:$qport' with mode '$mode'"
local res local res
res=$(python3 "$query_helper" "$ip" "$qport" "$mode") res=$(python3.13 "$query_helper" "$ip" "$qport" "$mode")
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
res=$(try_fallback "$ip" "$qport" "$mode") res=$(try_fallback "$ip" "$qport" "$mode")
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
@@ -311,7 +309,7 @@ is_in_favs(){
find_id(){ find_id(){
local file="$default_steam_path/config/loginusers.vdf" local file="$default_steam_path/config/loginusers.vdf"
[[ ! -f $file ]] && return 1 [[ ! -f $file ]] && return 1
local res=$(python3 "$helpers_path/vdf2json.py" \ local res=$(python3.13 "$helpers_path/vdf2json.py" \
-i "$file" \ -i "$file" \
| jq -r '.users | jq -r '.users
|to_entries[] |to_entries[]
@@ -340,7 +338,7 @@ list_mods(){
name=$(awk -F\" '/name/ {print $2}' "${dir}/meta.cpp") name=$(awk -F\" '/name/ {print $2}' "${dir}/meta.cpp")
base_dir=$(basename $(readlink -f $game_dir/$symlink)) base_dir=$(basename $(readlink -f $game_dir/$symlink))
size=$(du -s "$(readlink -f "$game_dir/$symlink")" | awk '{print $1}') size=$(du -s "$(readlink -f "$game_dir/$symlink")" | awk '{print $1}')
size=$(python3 -c "n=($size/1024) +.005; print(round(n,4))") size=$(python3.13 -c "n=($size/1024) +.005; print(round(n,4))")
LC_NUMERIC=C printf "%s$sep%s$sep%s$sep%3.3f\n" "$name" "$symlink" "$base_dir" "$size" LC_NUMERIC=C printf "%s$sep%s$sep%s$sep%3.3f\n" "$name" "$symlink" "$base_dir" "$size"
done | sort -k1) done | sort -k1)
# user may have manually pruned mods out-of-band # user may have manually pruned mods out-of-band
@@ -369,6 +367,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')
@@ -395,6 +397,7 @@ get_dist(){
logger INFO "Distance: $dist km" logger INFO "Distance: $dist km"
fi fi
} }
query_config(){ query_config(){
[[ -n $2 ]] && local key=$2 [[ -n $2 ]] && local key=$2
keys=( keys=(
@@ -420,6 +423,7 @@ query_config(){
echo "${!i}" echo "${!i}"
done done
} }
align_versions_file(){ align_versions_file(){
shift shift
local mod="$1" local mod="$1"
@@ -585,9 +589,6 @@ default_steam_path="$default_steam_path"
#Preferred Steam launch command (for Flatpak support) #Preferred Steam launch command (for Flatpak support)
preferred_client="$preferred_client" preferred_client="$preferred_client"
#DZGUI source path
src_path="$src_path"
END END
} }
format_version_url(){ format_version_url(){
@@ -641,6 +642,7 @@ download_new_version(){
return 1 return 1
fi fi
local version_url="$(format_version_url)" local version_url="$(format_version_url)"
local src_path="$(< "$_cache_src_path")"
mv "$src_path" "$src_path.old" mv "$src_path" "$src_path.old"
curl -Ls "$version_url" > "$src_path" curl -Ls "$version_url" > "$src_path"
rc=$? rc=$?
@@ -688,6 +690,7 @@ toggle(){
auto_install="1" auto_install="1"
else else
auto_install="" auto_install=""
rm "$versions_file"
fi fi
;; ;;
Toggle[[:space:]]debug[[:space:]]mode) Toggle[[:space:]]debug[[:space:]]mode)
@@ -697,13 +700,6 @@ toggle(){
debug="" debug=""
fi fi
;; ;;
Toggle[[:space:]]Steam/Flatpak)
if [[ $preferred_client == "steam" ]]; then
preferred_client="flatpak"
else
preferred_client="steam"
fi
;;
Toggle[[:space:]]DZGUI[[:space:]]fullscreen[[:space:]]boot) Toggle[[:space:]]DZGUI[[:space:]]fullscreen[[:space:]]boot)
if [[ $fullscreen == "true" ]]; then if [[ $fullscreen == "true" ]]; then
fullscreen="false" fullscreen="false"
@@ -802,6 +798,9 @@ update_config_val(){
local context="$1" local context="$1"
local value="$2" local value="$2"
case $1 in case $1 in
"Change client")
key="preferred_client"
;;
"Change player name") "Change player name")
key="name" key="name"
if [[ -z "${value// }" ]]; then if [[ -z "${value// }" ]]; then
@@ -827,7 +826,6 @@ update_config_val(){
declare -n nr=$key declare -n nr=$key
nr="$value" nr="$value"
update_config update_config
echo "Updated the key '$key' to '$value'"
return 80 return 80
} }
show_log(){ show_log(){
@@ -932,13 +930,19 @@ query_defunct(){
<<< "$result" awk '{print $2}' <<< "$result" awk '{print $2}'
} }
encode(){ encode(){
echo "$1" | md5sum | cut -c -8 echo -n "$1" | md5sum | cut -c -8
} }
compare(){ compare(){
local modlist="$@" local modlist="$@"
diff=$(comm -23 <(<<< "$modlist" sort -u) <(installed_mods | sort)) diff=$(comm -23 <(<<< "$modlist" sort -u) <(installed_mods | sort))
echo "$diff" echo "$diff"
} }
unlink_all(){
readarray -t links < <(find "$game_dir" -maxdepth 1 -mindepth 1 -type l)
for link in "${links[@]}"; do
unlink "$link"
done
}
legacy_symlinks(){ legacy_symlinks(){
logger INFO "Removing legacy symlinks" logger INFO "Removing legacy symlinks"
@@ -1029,7 +1033,10 @@ update_symlinks(){
if [[ ! -d "$workshop_dir" ]]; then if [[ ! -d "$workshop_dir" ]]; then
return return
fi fi
legacy_symlinks if [[ ! -d "$game_dir" ]]; then
return
fi
unlink_all
symlinks symlinks
} }
try_fallback(){ try_fallback(){
@@ -1080,41 +1087,42 @@ try_connect(){
local appid="$2" local appid="$2"
local binary="$3" local binary="$3"
local ip=$(<<< $record awk -F: '{print $1}') IFS=":" read -ra address <<< "$record"
local gameport=$(<<< $record awk -F: '{print $2}') local ip
local qport=$(<<< $record awk -F: '{print $3}') local gameport
local qport
ip=${address[0]}
gameport=${address[1]}
qport=${address[2]}
[[ $appid -eq $exp ]] && echo "$binary" > $_cache_binary [[ $appid -eq $exp ]] && echo "$binary" > "$_cache_binary"
local remote_mods local remote_mods
remote_mods=$(a2s $ip $qport rules) remote_mods=$(a2s "$ip" "$qport" rules)
if [[ $? -eq 1 ]]; then if [[ $? -eq 1 ]]; then
printf "Failed to fetch server modlist, possibly timed out" printf "Failed to fetch server modlist, possibly timed out"
return 1 return 1
fi fi
logger INFO "Server returned modlist: $(<<< $remote_mods tr '\n' ' ')" logger INFO "Server returned modlist: $(<<< "$remote_mods" tr '\n' ' ')"
local sanitized_mods=$(query_defunct "$remote_mods")
local diff=$(compare "$sanitized_mods") local sanitized_mods
sanitized_mods=$(query_defunct "$remote_mods")
logger INFO "Connection attempt for $ip:$qport" logger INFO "Connection attempt for $ip:$qport"
update_history "$record" update_history "$record"
if [[ -n $auto_install ]]; then case $auto_install in
logger INFO "Merging modlists" "") install_mods "$sanitized_mods" "manual" ;;
diff=$(merge_modlists "$diff") 1|2) install_mods "$sanitized_mods" "auto" ;;
diff=$(query_defunct "$diff") esac
fi
if [[ -n $diff ]]; then # NOTE: clean diff indicates that all requisite mods were downloaded
if [[ $(check_architecture) -eq 1 ]] && [[ $(test_display_mode) == "gm" ]]; then diff=$(compare "$sanitized_mods")
printf "Use Desktop Mode to download mods on Steam Deck" if [[ -z $diff ]]; then
return 1
fi
case $auto_install in
"") manual_mod_install "$ip" "$gameport" "$diff" "$sanitized_mods" "" "$appid";;
1|2) manual_mod_install "$ip" "$gameport" "$diff" "$sanitized_mods" "auto" "$appid" ;;
esac
else
launch "$ip" "$gameport" "$sanitized_mods" "$appid" launch "$ip" "$gameport" "$sanitized_mods" "$appid"
else
printf "User aborted download process, or some mods may have failed to download. Try connecting again to resync."
exit 1
fi fi
} }
check_architecture(){ check_architecture(){
@@ -1130,13 +1138,15 @@ force_update(){
printf "Only available when mod auto-install is ON" printf "Only available when mod auto-install is ON"
return 1 return 1
fi fi
# NOTE: forcibly regenerate signatures by removing file
rm "$versions_file" rm "$versions_file"
local update=$(check_timestamps) local mods
manual_mod_install "null" "null" "$update" "null" "force" "null" mods=$(ls -1 "$workshop_dir")
install_mods "$mods" "force"
echo "Finished requesting mod updates." echo "Finished requesting mod updates."
return 0 return 0
} }
get_local_stamps(){ get_timestamps(){
readarray -t modlist < <(printf "%s\n" "$@") readarray -t modlist < <(printf "%s\n" "$@")
local max="${#modlist[@]}" local max="${#modlist[@]}"
_concat(){ _concat(){
@@ -1161,67 +1171,6 @@ update_stamps(){
printf "%s\n" "${stamps[$i]}" >> $versions_file printf "%s\n" "${stamps[$i]}" >> $versions_file
done done
} }
check_timestamps(){
readarray -t local_modlist < <(ls -1 $workshop_dir)
local max=${#local_modlist[@]}
logger INFO "Local mod count: $max"
[[ $max -eq 0 ]] && return 1
local local_stamps=$(get_local_stamps "${local_modlist[@]}")
if [[ -z $local_stamps ]]; then
logger WARN "Timestamp query returned empty response"
return 1
fi
local aligned=$(<<< "$local_stamps" jq -r '.response.publishedfiledetails[]|"\(.publishedfileid),\(.time_updated)"')
readarray -t remote_ids < <(<<< "$aligned" awk -F, '{print $1}')
readarray -t remote_times < <(<<< "$aligned" awk -F, '{print $2}')
if [[ ! -f $versions_file ]]; then
logger INFO "No prior versions file found, creating"
update_stamps "$aligned"
#force refresh all mods if versions file was missing
printf "%s\n" "${remote_ids[@]}"
return 0
fi
readarray -t old_ids < <(< $versions_file awk -F, '{print $1}')
readarray -t old_times < <(< $versions_file awk -F, '{print $2}')
declare -A remote_version
declare -A local_version
for((i = 0; i < ${#remote_ids[@]}; ++i)); do
remote_version[${remote_ids[$i]}]=${remote_times[$i]}
done
needs_update=()
for((i=0;i<${#old_ids[@]};i++)); do
local id=${old_ids[$i]}
local time=${old_times[$i]}
if [[ $time != ${remote_version[$id]} ]]; then
logger WARN "Mod '$id' timestamp '$time' != '${remote_version[$id]}'"
needs_update+=($id)
fi
done
printf "%s\n" "${needs_update[@]}"
}
merge_modlists(){
local diff="$1"
_sort(){
printf "%s\n" "$diff"
printf "%s\n" "${needs_update[@]}"
}
readarray -t needs_update < <(check_timestamps)
if [[ -z ${needs_update[@]} ]]; then
echo "$diff"
return 0
fi
if [[ -z "$diff" ]] && [[ ${#needs_update[@]} -gt 0 ]]; then
printf "%s\n" "${needs_update[@]}"
else
# remove duplicates
_sort | sort -u
fi
}
concat_mods(){ concat_mods(){
readarray -t concat_arr <<< "$@" readarray -t concat_arr <<< "$@"
local id local id
@@ -1263,7 +1212,7 @@ launch(){
if [[ $debug -eq 1 ]]; then if [[ $debug -eq 1 ]]; then
local launch_options="$steam_cmd -applaunch $appid -connect=$ip:$gameport -nolauncher -nosplash -name=$name -skipintro -mod=$concat" local launch_options="$steam_cmd -applaunch $appid -connect=$ip:$gameport -nolauncher -nosplash -name=$name -skipintro -mod=$concat"
printf "Debug mode: these options would have been used to launch the game: $launch_options" printf "Debug mode: these options would have been used to launch the game: %s" "$launch_options"
return 0 return 0
fi fi
echo "$concat" > "$_cache_launch" echo "$concat" > "$_cache_launch"
@@ -1299,75 +1248,121 @@ final_handshake(){
printf "\n" printf "\n"
return 6 return 6
} }
manual_mod_install(){ watcher(){
local ip="$1" local -n to_download="$1"
local gameport="$2" local -n signatures="$2"
local diff="$3" local mode="$3"
local sanitized_mods="$4"
local mode="$5"
local appid="$6"
local ex="$state_path/dzg.watcher"
readarray -t stage_mods <<< "$diff" declare -i i=0
[[ -f $ex ]] && rm $ex local remote_time
local length
length=${#to_download[@]}
for mod in "${!to_download[@]}"; do
remote_time=${to_download[$mod]}
[[ -f $ex ]] && return 1
case $mode in
"auto" | "force")
$steam_cmd "steam://url/CommunityFilePage/${mod}+workshop_download_item ${aid} ${mod}"
echo "# Opening workshop page for ${mod}. If you see no progress, you may be out of disk space."
;;
*)
$steam_cmd "steam://url/CommunityFilePage/${mod}"
echo "# Opening workshop page for ${mod}. If you see no progress after subscribing, try unsubscribing and resubscribing again until the download commences."
;;
esac
sleep 1s
foreground
_watcher(){ until [[ -d $downloads_dir/${mod} ]]; do
for((i=0;i<${#stage_mods[@]};i++)); do
[[ -f $ex ]] && return 1 [[ -f $ex ]] && return 1
sleep 0.1s
if [[ $mode == "auto" ]] || [[ $mode == "force" ]]; then # NOTE: fallback for instantaneous downloads
$steam_cmd "steam://url/CommunityFilePage/${stage_mods[$i]}+workshop_download_item $aid ${stage_mods[$i]}" if [[ $mode == "auto" || $mode == "force" ]]; then
echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress, you may be out of disk space." if [[ -d $workshop_dir/${mod} ]]; then
else
$steam_cmd "steam://url/CommunityFilePage/${stage_mods[$i]}"
echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress after subscribing, try unsubscribing and resubscribing again until the download commences."
fi
sleep 1s
foreground
until [[ -d $downloads_dir/${stage_mods[$i]} ]]; do
[[ -f $ex ]] && return 1
sleep 0.1s
if [[ -d $workshop_dir/${stage_mods[$i]} ]]; then
break break
fi fi
done
foreground
if [[ $mode == "auto" ]] || [[ $mode == "force" ]]; then
echo "# Steam is downloading ${stage_mods[$i]} (mod $((i+1)) of ${#stage_mods[@]}). You do not need to manually Subscribe."
else
echo "# Steam is downloading ${stage_mods[$i]} (mod $((i+1)) of ${#stage_mods[@]})"
fi fi
until [[ -d $workshop_dir/${stage_mods[$i]} ]]; do
[[ -f $ex ]] && return 1
sleep 0.1s
done
foreground
echo "# ${stage_mods[$i]} moved to mods dir"
done done
echo "100"
}
_watcher > >($steamsafe_zenity --pulsate --progress --auto-close --title="DZG Watcher" --width=500 2>/dev/null; rc=$?; [[ $rc -eq 1 ]] && touch $ex)
if [[ $mode == "force" ]]; then foreground
rm "$versions_file" case $mode in
check_timestamps "auto" | "force")
return 0 echo "# Steam is downloading ${mod} (mod $((i+1)) of ${length}). You do not need to manually Subscribe."
;;
*)
echo "# Steam is downloading ${mod} (mod $((i+1)) of ${length})"
;;
esac
until [[ -d $workshop_dir/${mod} ]]; do
[[ -f $ex ]] && return 1
sleep 0.1s
done
foreground
if [[ ! -v signatures["${mod}"] ]]; then
echo "$mod,$remote_time" >> "$versions_file"
else
sed -i "s/$mod,${signatures[$mod]}/$mod,$remote_time/" "$versions_file"
fi
echo "# ${mod} moved to mods dir"
i+=1
done
echo "100"
}
install_mods(){
local sanitized_mods="$1"
local mode="$2"
local ex="$state_path/dzg.watcher"
[[ -f $ex ]] && rm "$ex"
if [[ -f "$versions_file" ]]; then
readarray -t local_mods < "$versions_file"
else
local_mods=()
fi fi
local diff=$(compare "$sanitized_mods") declare -A mod_signatures
if [[ -z $diff ]]; then local local_id
if [[ $mode == "auto" ]]; then local local_time
rm "$versions_file" for mod in "${local_mods[@]}"; do
check_timestamps IFS="," read -ra fields <<< "$mod"
local_id="${fields[0]}"
local_time="${fields[1]}"
mod_signatures[$local_id]=$local_time
done
readarray -t remote_mods <<< "$sanitized_mods"
declare -A download
local remote_timestamps
local remote_id
local remote_time
remote_timestamps=$(get_timestamps "${remote_mods[@]}")
for mod in $(<<< "$remote_timestamps" jq -r '.response.publishedfiledetails[]|"\(.publishedfileid),\(.time_updated)"'); do
IFS="," read -ra fields <<< "$mod"
remote_id="${fields[0]}"
remote_time="${fields[1]}"
# NOTE: mod is not present in versions file
if [[ ! -v mod_signatures["$remote_id"] ]]; then
download["$remote_id"]=$remote_time
continue
fi fi
launch "$ip" "$gameport" "$sanitized_mods" "$appid" # NOTE: mod timestamp is out of date
else local_time="${mod_signatures["$remote_id"]}"
printf "User aborted download process, or some mods may have failed to download. Try connecting again to resync." if [[ $remote_time != "$local_time" ]]; then
download["$remote_id"]=$remote_time
continue
fi
done
[[ ${#download[@]} -lt 1 ]] && return
if [[ $(check_architecture) -eq 1 ]] && [[ $(test_display_mode) == "gm" ]]; then
printf "Use Desktop Mode to download mods on Steam Deck"
exit 1 exit 1
fi fi
watcher download mod_signatures "$mode" > >($steamsafe_zenity --pulsate --progress --auto-close --title="DZG Watcher" --width=500 2>/dev/null; rc=$?; [[ $rc -eq 1 ]] && touch "$ex")
} }
test_display_mode(){ test_display_mode(){
pgrep -a gamescope | grep -q "generate-drm-mode" pgrep -a gamescope | grep -q "generate-drm-mode"
-36
View File
@@ -1,36 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define R 6371
#define TO_RAD (3.1415926536 / 180)
double dist(double th1, double ph1, double th2, double ph2)
{
double dx, dy, dz;
ph1 -= ph2;
ph1 *= TO_RAD, th1 *= TO_RAD, th2 *= TO_RAD;
dz = sin(th1) - sin(th2);
dx = cos(ph1) * cos(th1) - cos(th2);
dy = sin(ph1) * cos(th1);
return asin(sqrt(dx * dx + dy * dy + dz * dz) / 2) * 2 * R;
}
int main(int argc, const char * argv[])
{
if(argc < 5 || argc > 5){
return 1;
}
float coords[4];
for(int i=1;i<5;i++){
if(atof(argv[i]) == 0){
return 1;
}
coords[i] = atof(argv[i]);
}
double d = dist(coords[1], coords[2], coords[3], coords[4]);
printf("%.1f\n", d);
return 0;
}
+1 -1
View File
@@ -295,7 +295,7 @@ def get_dayz_version(file: Path) -> DayZVersion | Exception:
try: try:
version = get_version(file) version = get_version(file)
except Exception as e: except Exception as e:
return e raise e
patch = str(version.build) + str(version.revision) patch = str(version.build) + str(version.revision)
dz_vers = DayZVersion(version.major, version.minor, int(patch)) dz_vers = DayZVersion(version.major, version.minor, int(patch))
return dz_vers return dz_vers
+1
View File
@@ -0,0 +1 @@
latlon
+24
View File
@@ -0,0 +1,24 @@
bin := latlon
CC = gcc
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wpedantic
CFLAGS += -std=c23
CFLAGS += -O3
LDFLAGS += -lm
PREFIX ?= $(HOME)/.local/share/dzgui
all: $(bin)
install: $(bin)
install -Dm 755 $(bin) $(PREFIX)
$(bin): latlon.c
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
clean:
rm -f $(bin)
+77
View File
@@ -0,0 +1,77 @@
// This small program computes the distance between two points on the Earths
// surface. The algorithm used for computing is called haversine formula.
// Source for the algorithm can be found here:
// https://en.wikipedia.org/wiki/Haversine_formula
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
// Earth's radius in meters.
#define RADIUS ((12756L / 2.0L) * 1000L)
// PI natural constant
#define PI 3.1415926536L
// coordinates struct for storing points
struct Coordinate {
double latitude;
double longitude;
};
/**
* @brief Calculates a radian value from an angle
*/
double radian_from(const double angle) {
return (angle * PI) / 180;
}
/**
* @brief Calculate the haversine function from an angle in radian
*/
double haversine(const double angle) { return ((1.0L - cos(angle)) / 2); }
/**
* @brief Calculate the distance between two coordinates
*/
double great_circle_distance(const struct Coordinate a,
const struct Coordinate b) {
// calculate longitude and latitude differences
struct Coordinate diff_coord = {
.longitude = a.longitude - b.longitude,
.latitude = a.latitude - b.latitude,
};
// calculate haversine(theta) value, where theta is the angle between the
// two coordinates
double hav_theta = haversine(diff_coord.latitude)
+ cos(a.latitude) * cos(b.latitude) * haversine(diff_coord.longitude);
// calculate distance from radius, and haversine(theta) values
double distance = 2 * RADIUS * asin(sqrt(hav_theta));
return distance;
}
int main(int argc, const char* argv[]) {
if (argc < 5 || argc > 5) {
return 1;
}
const struct Coordinate a = {
.latitude = radian_from(atof(argv[1])),
.longitude = radian_from(atof(argv[2])),
};
const struct Coordinate b = {
.latitude = radian_from(atof(argv[3])),
.longitude = radian_from(atof(argv[4])),
};
// Returns the distance in meters.
// To pretty-print the result in a consumer of this module, it is
// recommended to divide the result by 1,000 and round it.
printf("%.1f\n", great_circle_distance(a, b));
return 0;
}
+202 -294
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB