├── .github └── workflows │ └── build.yml ├── .gitignore ├── COPYING ├── README.md ├── al.getcryst.jadegui.json ├── al.getcryst.jadegui.yml ├── build.sh ├── data ├── al.getcryst.jadegui.appdata.xml.in ├── al.getcryst.jadegui.desktop.in ├── al.getcryst.jadegui.gschema.xml ├── icons │ ├── hicolor │ │ ├── scalable │ │ │ └── apps │ │ │ │ └── al.getcryst.jadegui.svg │ │ └── symbolic │ │ │ └── apps │ │ │ ├── al.getcryst.jadegui-symbolic.svg │ │ │ └── al.getcyrst.jadegui-symbolic.svg │ ├── meson.build │ └── padlock2-symbolic.svg └── meson.build ├── jadegui.flatpak ├── main-page-screenshot.png ├── meson.build ├── po ├── LINGUAS ├── POTFILES ├── jade_gui.pot └── meson.build └── src ├── __init__.py ├── about.ui ├── classes ├── __init__.py ├── install_prefs.py ├── keymap.py ├── locale.py ├── meson.build └── partition.py ├── crystal-logo-minimal.png ├── desktops.py ├── functions ├── __init__.py ├── desktop_screen.py ├── finished_screen.py ├── install_screen.py ├── keyboard_screen.py ├── language_screen.py ├── meson.build ├── misc_screen.py ├── partition_screen.py ├── summary_screen.py ├── timezone_screen.py └── user_screen.py ├── gtk └── help-overlay.ui ├── jade_gui.gresource.xml ├── jade_gui.in ├── keymaps.py ├── locales.py ├── locales ├── __init__.py ├── africa.py ├── america.py ├── antarctica.py ├── arctic.py ├── asia.py ├── atlantic.py ├── australia.py ├── brazil.py ├── canada.py ├── chile.py ├── europe.py ├── indian.py ├── locales_list.py ├── meson.build ├── mexico.py └── pacific.py ├── main.py ├── manualpartitioning.py ├── meson.build ├── pages ├── desktop_screen.ui ├── finished_screen.ui ├── install_screen.ui ├── keyboard_screen.ui ├── language_screen.ui ├── misc_screen.ui ├── partition_screen.ui ├── summary_screen.ui ├── timezone_screen.ui └── user_screen.ui ├── resources.gresource.xml ├── scripts ├── checkEFI.sh ├── getDiskName.sh ├── getDiskSize.sh ├── getDiskType.sh ├── getDisks.sh ├── getPartitions.sh ├── install.sh ├── meson.build ├── openBash.sh ├── openGparted.sh ├── reboot.sh └── savePrefs.sh ├── utils ├── __init__.py ├── command.py ├── disks.py ├── meson.build └── threading.py ├── widgets ├── __init__.py ├── desktop.py ├── desktop.ui ├── disk.py ├── disk.ui ├── layout.py ├── layout.ui ├── meson.build ├── partition.py ├── partition.ui ├── timezone.py ├── timezone.ui ├── variant.py └── variant.ui ├── window.py └── window.ui /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main] 4 | pull_request: 5 | workflow_dispatch: 6 | name: Build Flatpak 7 | jobs: 8 | flatpak: 9 | name: "build-packages" 10 | runs-on: ubuntu-latest 11 | container: 12 | image: bilelmoussaoui/flatpak-github-actions:gnome-43 13 | options: --privileged 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 17 | with: 18 | bundle: jadegui.flatpak 19 | manifest-path: al.getcryst.jadegui.json 20 | cache-key: flatpak-builder-${{ github.sha }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | subprojects/blueprint-compiler 2 | build/ 3 | .flatpak-builder/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Logo 4 | 5 |

6 | 7 |

Jade

8 | 9 |

10 | License 11 | GitHub isses 12 | GitHub pull requests
13 | Twitter Follow 14 | Discord 15 | The maintainer of this repository
16 | Mastodon Follow 17 | Twitter Follow 18 | Please don't theme
19 |
CodeFactor 20 | 21 |

22 | 23 |

The libadwaita/gtk based gui installer using jade as the backend. 24 |

25 | 26 |

The jade gui mockups

27 | 28 | 29 | ![](main-page-screenshot.png) 30 | 31 | 32 | ### Building 33 | Building as a flatpak (recommended for development) 34 | ```sh 35 | git clone https://github.com/crystal-linux/jade-gui 36 | cd jade-gui 37 | flatpak-builder --user --install --install-deps-from=flathub --force-clean build-dir al.getcryst.jadegui.yml 38 | flatpak run al.getcryst.jadegui 39 | ``` 40 | 41 | Building with meson 42 | ```sh 43 | git clone https://github.com/crystal-linux/jade-gui 44 | cd jade-gui 45 | meson --prefix=/usr _build 46 | ninja -C _build 47 | cd _build 48 | sudo ninja install 49 | ``` 50 | -------------------------------------------------------------------------------- /al.getcryst.jadegui.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "al.getcryst.jadegui", 3 | "runtime": "org.gnome.Platform", 4 | "runtime-version": "43", 5 | "sdk": "org.gnome.Sdk", 6 | "command": "jade-gui", 7 | "finish-args": [ 8 | "--share=network", 9 | "--share=ipc", 10 | "--socket=fallback-x11", 11 | "--device=dri", 12 | "--socket=wayland", 13 | "--talk-name=org.freedesktop.Flatpak", 14 | "--filesystem=home:rw" 15 | ], 16 | "cleanup": [ 17 | "/include", 18 | "/lib/pkgconfig", 19 | "/man", 20 | "/share/doc", 21 | "/share/gtk-doc", 22 | "/share/pkgconfig", 23 | "*.la", 24 | "*.a" 25 | ], 26 | "modules": [ 27 | { 28 | "name": "python3-pytz", 29 | "buildsystem": "simple", 30 | "sources": [ 31 | { 32 | "type": "archive", 33 | "url": "https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz", 34 | "sha256": "1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7" 35 | } 36 | ], 37 | "build-commands": [ 38 | "ls", 39 | "pip3 install --prefix=/app ." 40 | ] 41 | }, 42 | { 43 | "name": "jadegui", 44 | "buildsystem": "meson", 45 | "sources": [ 46 | { 47 | "type": "dir", 48 | "path": "." 49 | } 50 | ] 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /al.getcryst.jadegui.yml: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "al.getcryst.jadegui", 3 | "runtime": "org.gnome.Platform", 4 | "runtime-version": "43", 5 | "sdk": "org.gnome.Sdk", 6 | "command": "jade-gui", 7 | "finish-args": [ 8 | "--share=network", 9 | "--share=ipc", 10 | "--socket=fallback-x11", 11 | "--device=dri", 12 | "--socket=wayland", 13 | "--talk-name=org.freedesktop.Flatpak", 14 | "--filesystem=home:rw" 15 | ], 16 | "cleanup": [ 17 | "/include", 18 | "/lib/pkgconfig", 19 | "/man", 20 | "/share/doc", 21 | "/share/gtk-doc", 22 | "/share/pkgconfig", 23 | "*.la", 24 | "*.a" 25 | ], 26 | "modules": [ 27 | { 28 | "name": "python3-pytz", 29 | "buildsystem": "simple", 30 | "sources": [ 31 | { 32 | "type": "archive", 33 | "url": "https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz", 34 | "sha256": "1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7" 35 | } 36 | ], 37 | "build-commands": [ 38 | "ls", 39 | "pip3 install --prefix=/app ." 40 | ] 41 | }, 42 | { 43 | "name": "jadegui", 44 | "buildsystem": "meson", 45 | "sources": [ 46 | { 47 | "type": "dir", 48 | "path": "." 49 | } 50 | ] 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | if [[ $1 == "build" ]]; then 3 | if [[ ! -d "build" ]]; then 4 | meson build 5 | else 6 | meson --reconfigure build 7 | fi 8 | ninja -C build 9 | elif [[ $1 == "install" ]]; then 10 | pushd build 11 | sudo ninja install 12 | elif [[ $1 == "build-install" ]]; then 13 | if [[ ! -d "build" ]]; then 14 | meson build 15 | else 16 | meson --reconfigure build 17 | fi 18 | ninja -C build 19 | pushd build 20 | sudo ninja install 21 | else 22 | echo "Unkown command $1" 23 | echo "usage:" 24 | echo "build build jade gui" 25 | echo "install install jade gui" 26 | echo "build-install build and install jade_gui" 27 | fi 28 | -------------------------------------------------------------------------------- /data/al.getcryst.jadegui.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | al.getcryst.jadegui.desktop 4 | CC0-1.0 5 | GPL-3.0-only 6 | 7 |

No description

8 |
9 |
10 | -------------------------------------------------------------------------------- /data/al.getcryst.jadegui.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Install Crystal Linux 3 | 4 | Exec=jade-gui 5 | 6 | Icon=al.getcryst.jadegui 7 | 8 | Terminal=false 9 | Type=Application 10 | Categories=GTK; 11 | StartupNotify=true 12 | -------------------------------------------------------------------------------- /data/al.getcryst.jadegui.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 34 | 38 | 42 | 46 | 50 | 51 | 55 | 59 | 63 | 64 | 68 | 72 | 73 | 78 | 83 | 88 | 89 | 91 | 94 | 98 | 99 | 107 | 111 | 117 | 120 | 123 | 127 | 131 | 136 | 142 | 143 | 151 | 155 | 161 | 164 | 167 | 171 | 175 | 180 | 186 | 187 | 195 | 199 | 205 | 209 | 212 | 216 | 220 | 225 | 231 | 232 | 240 | 244 | 250 | 252 | 255 | 259 | 263 | 268 | 274 | 275 | 276 | 277 | -------------------------------------------------------------------------------- /data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/icons/meson.build: -------------------------------------------------------------------------------- 1 | application_id = 'al.getcryst.jadegui' 2 | 3 | scalable_dir = join_paths('hicolor', 'scalable', 'apps') 4 | install_data( 5 | join_paths(scalable_dir, ('@0@.svg').format(application_id)), 6 | install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir) 7 | ) 8 | 9 | symbolic_dir = join_paths('hicolor', 'symbolic', 'apps') 10 | install_data( 11 | join_paths(symbolic_dir, ('@0@-symbolic.svg').format(application_id)), 12 | install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir) 13 | ) 14 | -------------------------------------------------------------------------------- /data/icons/padlock2-symbolic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | desktop_file = i18n.merge_file( 2 | input: 'al.getcryst.jadegui.desktop.in', 3 | output: 'al.getcryst.jadegui.desktop', 4 | type: 'desktop', 5 | po_dir: '../po', 6 | install: true, 7 | install_dir: join_paths(get_option('datadir'), 'applications') 8 | ) 9 | 10 | desktop_utils = find_program('desktop-file-validate', required: false) 11 | if desktop_utils.found() 12 | test('Validate desktop file', desktop_utils, 13 | args: [desktop_file] 14 | ) 15 | endif 16 | 17 | appstream_file = i18n.merge_file( 18 | input: 'al.getcryst.jadegui.appdata.xml.in', 19 | output: 'al.getcryst.jadegui.appdata.xml', 20 | po_dir: '../po', 21 | install: true, 22 | install_dir: join_paths(get_option('datadir'), 'appdata') 23 | ) 24 | 25 | appstream_util = find_program('appstream-util', required: false) 26 | if appstream_util.found() 27 | test('Validate appstream file', appstream_util, 28 | args: ['validate', appstream_file] 29 | ) 30 | endif 31 | 32 | install_data('al.getcryst.jadegui.gschema.xml', 33 | install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') 34 | ) 35 | 36 | compile_schemas = find_program('glib-compile-schemas', required: false) 37 | if compile_schemas.found() 38 | test('Validate schema file', compile_schemas, 39 | args: ['--strict', '--dry-run', meson.current_source_dir()] 40 | ) 41 | endif 42 | 43 | subdir('icons') 44 | -------------------------------------------------------------------------------- /jadegui.flatpak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/jadegui.flatpak -------------------------------------------------------------------------------- /main-page-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/main-page-screenshot.png -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('jade-gui', 2 | version: '0.1.0', 3 | meson_version: '>= 0.59.0', 4 | default_options: [ 'warning_level=2', 5 | 'werror=false', 6 | ], 7 | ) 8 | 9 | i18n = import('i18n') 10 | localedir = get_option('localedir') 11 | gnome = import('gnome') 12 | 13 | 14 | 15 | subdir('data') 16 | subdir('src') 17 | subdir('po') 18 | 19 | gnome.post_install( 20 | glib_compile_schemas: true, 21 | gtk_update_icon_cache: true, 22 | update_desktop_database: true, 23 | ) 24 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/po/LINGUAS -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | data/al.getcryst.jadegui.desktop.in 2 | data/al.getcryst.jadegui.appdata.xml.in 3 | data/al.getcryst.jadegui.gschema.xml 4 | src/window.ui 5 | src/pages/desktop_screen.ui 6 | src/pages/finished_screen.ui 7 | src/pages/install_screen.ui 8 | src/pages/keyboard_screen.ui 9 | src/pages/language_screen.ui 10 | src/pages/misc_screen.ui 11 | src/pages/partition_screen.ui 12 | src/pages/summary_screen.ui 13 | src/pages/timezone_screen.ui 14 | src/pages/user_screen.ui 15 | src/main.py 16 | src/window.py 17 | 18 | -------------------------------------------------------------------------------- /po/jade_gui.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the jade_gui package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: jade_gui\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2022-10-03 18:58+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/al.getcryst.jadegui.desktop.in:3 21 | msgid "Install Crystal Linux" 22 | msgstr "Install Crystal Linux" 23 | 24 | #: data/al.getcryst.jadegui.appdata.xml.in:7 25 | msgid "No description" 26 | msgstr "No description" 27 | 28 | #: src/window.ui:17 29 | msgid "About Jade GUI" 30 | msgstr "About Jade GUI" 31 | 32 | #: src/window.ui:85 33 | msgid "Welcome to Crystal Linux" 34 | msgstr "Welcome to Crystal Linux" 35 | 36 | #: src/window.ui:86 37 | msgid "Press Start to start installing Crystal Linux!" 38 | msgstr "Press Start to start installing Crystal Linux!" 39 | 40 | #: src/pages/desktop_screen.ui:13 41 | msgid "Select Desktop" 42 | msgstr "Select Desktop" 43 | 44 | #: src/pages/desktop_screen.ui:14 45 | msgid "You can install more desktops later." 46 | msgstr "You can install more desktops later." 47 | 48 | #: src/pages/desktop_screen.ui:40 src/pages/keyboard_screen.ui:57 49 | #: src/pages/language_screen.ui:57 src/pages/misc_screen.ui:81 50 | #: src/pages/partition_screen.ui:135 51 | msgid "Next" 52 | msgstr "Next" 53 | 54 | #: src/pages/finished_screen.ui:15 55 | msgid "Installation Completed!" 56 | msgstr "Installation Completed!" 57 | 58 | #: src/pages/finished_screen.ui:16 59 | msgid "Reboot the device to start using Crystal Linux!" 60 | msgstr "Reboot the device to start using Crystal Linux!" 61 | 62 | #: src/pages/finished_screen.ui:28 63 | msgid "Reboot" 64 | msgstr "Reboot" 65 | 66 | #: src/pages/install_screen.ui:15 67 | msgid "Installing Crystal" 68 | msgstr "Installing Crystal" 69 | 70 | #: src/pages/install_screen.ui:16 71 | msgid "This may take some time" 72 | msgstr "This may take some time" 73 | 74 | #: src/pages/keyboard_screen.ui:15 75 | msgid "Select Keyboard Layout" 76 | msgstr "Select Keyboard Layout" 77 | 78 | #: src/pages/language_screen.ui:15 79 | msgid "Select additional locales" 80 | msgstr "Select additional locales" 81 | 82 | #: src/pages/language_screen.ui:16 83 | msgid "Select additional locales to enable" 84 | msgstr "Select additional locales to enable" 85 | 86 | #: src/pages/misc_screen.ui:15 87 | msgid "Miscellaneous" 88 | msgstr "Miscellaneous" 89 | 90 | #: src/pages/misc_screen.ui:22 91 | msgid "Enter Hostname" 92 | msgstr "Enter Hostname" 93 | 94 | #: src/pages/misc_screen.ui:33 95 | msgid "IPv6 loopback" 96 | msgstr "IPv6 loopback" 97 | 98 | #: src/pages/misc_screen.ui:34 99 | msgid "This can fix IPv6 connectivity issues with some ISPs." 100 | msgstr "This can fix IPv6 connectivity issues with some ISPs." 101 | 102 | #: src/pages/misc_screen.ui:45 103 | msgid "Timeshift" 104 | msgstr "Timeshift" 105 | 106 | #: src/pages/misc_screen.ui:46 107 | msgid "Support snapshots as a means to roll back to earlier states of the system." 108 | msgstr "Support snapshots as a means to roll back to earlier states of the system." 109 | 110 | #: src/pages/misc_screen.ui:57 111 | msgid "Zramd" 112 | msgstr "Zramd" 113 | 114 | #: src/pages/misc_screen.ui:58 115 | msgid "Creates a compressed area of Swap in RAM." 116 | msgstr "Creates a compressed area of Swap in RAM." 117 | 118 | #: src/pages/partition_screen.ui:26 119 | msgid "Select partitions to install to" 120 | msgstr "Select partitions to install to" 121 | 122 | #: src/pages/partition_screen.ui:27 123 | msgid "Make sure to have at least one root partition" 124 | msgstr "Make sure to have at least one root partition" 125 | 126 | #: src/pages/partition_screen.ui:37 127 | msgid "Quick Actions" 128 | msgstr "Quick Actions" 129 | 130 | #: src/pages/partition_screen.ui:45 131 | msgid "Automatic Partitioning" 132 | msgstr "Automatic Partitioning" 133 | 134 | #: src/pages/partition_screen.ui:50 135 | msgid "Open GParted" 136 | msgstr "Open GParted" 137 | 138 | #: src/pages/partition_screen.ui:55 139 | msgid "Open terminal" 140 | msgstr "Open terminal" 141 | 142 | #: src/pages/partition_screen.ui:68 143 | msgid "Available partitions" 144 | msgstr "Available partitions" 145 | 146 | #: src/pages/partition_screen.ui:96 147 | msgid "Select Installation Disk" 148 | msgstr "Select Installation Disk" 149 | 150 | #: src/pages/partition_screen.ui:97 151 | msgid "" 152 | "Select the disk you want to install Crystal Linux on. This will wipe the " 153 | "entire disk you selected." 154 | msgstr "" 155 | "Select the disk you want to install Crystal Linux on. This will wipe the " 156 | "entire disk you selected." 157 | 158 | #: src/pages/partition_screen.ui:107 159 | msgid "Switch to manual partitioning" 160 | msgstr "Switch to manual partitioning" 161 | 162 | #: src/pages/summary_screen.ui:15 163 | msgid "Summary" 164 | msgstr "Summary" 165 | 166 | #: src/pages/summary_screen.ui:21 167 | msgid "Timezone and Locale" 168 | msgstr "Timezone and Locale" 169 | 170 | #: src/pages/summary_screen.ui:27 171 | msgid "region/location" 172 | msgstr "region/location" 173 | 174 | #: src/pages/summary_screen.ui:47 175 | msgid "Keyboard Layout" 176 | msgstr "Keyboard Layout" 177 | 178 | #: src/pages/summary_screen.ui:53 179 | msgid "layout" 180 | msgstr "layout" 181 | 182 | #: src/pages/summary_screen.ui:73 183 | msgid "User Settings" 184 | msgstr "User Settings" 185 | 186 | #: src/pages/summary_screen.ui:79 187 | msgid "username" 188 | msgstr "username" 189 | 190 | #: src/pages/summary_screen.ui:91 191 | msgid "sudo enabled/disabled" 192 | msgstr "sudo enabled/disabled" 193 | 194 | #: src/pages/summary_screen.ui:103 195 | msgid "root enabled/disabled" 196 | msgstr "root enabled/disabled" 197 | 198 | #: src/pages/summary_screen.ui:122 199 | msgid "Desktop" 200 | msgstr "Desktop" 201 | 202 | #: src/pages/summary_screen.ui:128 203 | msgid "desktop" 204 | msgstr "desktop" 205 | 206 | #: src/pages/summary_screen.ui:147 207 | msgid "Partition Settings" 208 | msgstr "Partition Settings" 209 | 210 | #: src/pages/summary_screen.ui:153 211 | msgid "selected install partition" 212 | msgstr "select install partition" 213 | 214 | #: src/pages/summary_screen.ui:166 215 | msgid "legacy bios/uefi" 216 | msgstr "legacy bios/uefi" 217 | 218 | #: src/pages/summary_screen.ui:178 219 | msgid "Miscellaneous Settings" 220 | msgstr "Miscellaneous Settings" 221 | 222 | #: src/pages/summary_screen.ui:184 223 | msgid "ipv6 enabled/disabled" 224 | msgstr "ipv6 enabled/disabled" 225 | 226 | #: src/pages/summary_screen.ui:196 227 | msgid "timeshift enabled/disabled" 228 | msgstr "timeshift enabled/disabled" 229 | 230 | #: src/pages/summary_screen.ui:208 231 | msgid "zramd enabled/disabled" 232 | msgstr "zramd enabled/disabled" 233 | 234 | #: src/pages/summary_screen.ui:238 src/pages/timezone_screen.ui:59 235 | #: src/pages/user_screen.ui:83 236 | msgid "Move to next page" 237 | msgstr "Move to next page" 238 | 239 | #: src/pages/timezone_screen.ui:15 240 | msgid "Select Timezone" 241 | msgstr "Select Timezone" 242 | 243 | #: src/pages/timezone_screen.ui:26 244 | msgid "Search for a timezone" 245 | msgstr "Search for a timezone" 246 | 247 | #: src/pages/user_screen.ui:15 248 | msgid "Create User" 249 | msgstr "Create User" 250 | 251 | #: src/pages/user_screen.ui:16 252 | msgid "You can add more users in the settings on the installed system." 253 | msgstr "You can add more users in the settings on the installed system." 254 | 255 | #: src/pages/user_screen.ui:23 256 | msgid "Enter Username" 257 | msgstr "Enter Username" 258 | 259 | #: src/pages/user_screen.ui:28 260 | msgid "Enter Password" 261 | msgstr "Enter Password" 262 | 263 | #: src/pages/user_screen.ui:33 264 | msgid "Re-enter Password" 265 | msgstr "Re-enter Password" 266 | 267 | #: src/pages/user_screen.ui:44 268 | msgid "Enable Administrative Rights for User" 269 | msgstr "Enable Administrative Rights for User" 270 | 271 | #: src/pages/user_screen.ui:56 272 | msgid "Enable Superuser Account" 273 | msgstr "Enable Superuser Account" 274 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n = import('i18n') 2 | i18n.gettext('jade_gui', install_dir: localedir, preset: 'glib', args: '--from-code=UTF-8') 3 | -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/__init__.py -------------------------------------------------------------------------------- /src/about.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Jade GUI 6 | al.getcryst.jadegui 7 | True 8 | 1.1.4-2 9 | Easily install Crystal Linux 10 | https://getcryst.al 11 | https://github.com/crystal-linux/jade-gui/issues 12 | gpl-3-0-only 13 | Crystal Linux dev team 14 | axtlos https://github.com/axtloss 15 | Michal https://github.com/not-my-segfault 16 | Matt https://github.com/SomethingGeneric 17 | Mirko Brombin https://github.com/mirkobrombin 18 | Hari Rana (TheEvilSkeleton) https://theevilskeleton.gitlab.io/ 19 | jasio https://github.com/hericiumvevo 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/classes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/classes/__init__.py -------------------------------------------------------------------------------- /src/classes/install_prefs.py: -------------------------------------------------------------------------------- 1 | # install_prefs.py 2 | # 3 | # Copyright 2022 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # SPDX-License-Identifier: GPL-3.0-only 19 | 20 | from jade_gui.utils import disks 21 | import json 22 | 23 | class InstallPrefs: 24 | def __init__( 25 | self, 26 | timezone, 27 | layout, 28 | variant, 29 | username, 30 | password, 31 | enable_sudo, 32 | disk, 33 | hostname, 34 | ipv_enabled, 35 | timeshift_enabled, 36 | zramd_enabled, 37 | desktop, 38 | partition_mode, 39 | partitions, 40 | ): 41 | self.timezone = timezone 42 | self.layout = layout 43 | self.variant = variant 44 | self.username = username 45 | self.password = password 46 | self.enable_sudo = enable_sudo 47 | self.disk = disk.disk 48 | self.hostname = hostname if len(hostname) != 0 else "crystal" 49 | self.ipv_enabled = ipv_enabled 50 | self.timeshift_enabled = timeshift_enabled 51 | self.zramd_enabled = zramd_enabled 52 | self.desktop = desktop 53 | self.partition_mode = partition_mode 54 | self.partitions = partitions 55 | self.is_efi = disks.get_uefi() 56 | self.bootloader_type = "grub-efi" if self.is_efi else "grub-legacy" 57 | self.bootloader_location = "/boot/efi/" if self.is_efi else self.disk 58 | 59 | def generate_json(self): 60 | prefs = { 61 | 'partition': { 62 | 'device': self.disk, 63 | 'mode': self.partition_mode, 64 | 'efi': self.is_efi, 65 | 'partitions': self.partitions, 66 | }, 67 | 'bootloader': { 68 | 'type': self.bootloader_type, 69 | 'location': self.bootloader_location 70 | }, 71 | 'locale': { 72 | 'locale': [ 73 | self.timezone.locale 74 | ], 75 | 'keymap': self.layout.country_shorthand, 76 | 'timezone': self.timezone.region+"/"+self.timezone.location 77 | }, 78 | 'networking': { 79 | 'hostname': self.hostname, 80 | 'ipv6': self.ipv_enabled 81 | }, 82 | 'users': [ 83 | { 84 | 'name': self.username, 85 | 'password': self.password, 86 | 'hasroot': self.enable_sudo, 87 | 'shell': 'bash' 88 | } 89 | ], 90 | 'rootpass': self.password, 91 | 'desktop': self.desktop.lower(), 92 | 'timeshift': self.timeshift_enabled, 93 | 'extra_packages': [ 94 | 'firefox' 95 | ], 96 | 'flatpak': True, 97 | 'zramd': self.zramd_enabled, 98 | 'unakite': { 99 | 'enable': False, 100 | 'root': '/dev/null', 101 | 'oldroot': self.disk, 102 | 'efidir': '/dev/null', 103 | 'bootdev': '/dev/null' 104 | }, 105 | 'kernel': 'linux' 106 | } 107 | return json.dumps(prefs) 108 | -------------------------------------------------------------------------------- /src/classes/keymap.py: -------------------------------------------------------------------------------- 1 | # keymap.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | class keymap: 21 | def __init__(self, layout, variant, backend_layout): 22 | self.layout = layout 23 | self.variant = variant 24 | self.backend_layout = backend_layout 25 | -------------------------------------------------------------------------------- /src/classes/locale.py: -------------------------------------------------------------------------------- 1 | # locale.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | class locale: 21 | def __init__(self, locales, region, location): 22 | self.locales = locales 23 | self.region = region 24 | self.location = location 25 | -------------------------------------------------------------------------------- /src/classes/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | classesdir = join_paths(pkgdatadir, 'jade_gui/classes') 3 | 4 | jade_gui_sources = [ 5 | '__init__.py', 6 | 'locale.py', 7 | 'keymap.py', 8 | 'install_prefs.py', 9 | 'partition.py' 10 | ] 11 | install_data(jade_gui_sources, install_dir: classesdir) -------------------------------------------------------------------------------- /src/classes/partition.py: -------------------------------------------------------------------------------- 1 | # manualpartition.py 2 | # 3 | # Copyright 2022 axtlos 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3 of the License only. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # SPDX-License-Identifier: GPL-3.0 18 | 19 | class Partition(): 20 | 21 | def __init__(self, partition, mountpoint, filesystem, size): 22 | self.partition = partition 23 | self.mountpoint = mountpoint 24 | self.filesystem = filesystem 25 | self.size = size 26 | 27 | def generate_jade_entry(self): 28 | mountpoint = "/mnt"+self.mountpoint 29 | if self.mountpoint == "none": 30 | mountpoint = "none" 31 | return mountpoint+":/dev/"+self.partition[5:]+":"+self.filesystem 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/crystal-logo-minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/crystal-logo-minimal.png -------------------------------------------------------------------------------- /src/desktops.py: -------------------------------------------------------------------------------- 1 | desktops = [ 2 | "Onyx", 3 | "GNOME", 4 | "Plasma", 5 | "XFCE", 6 | "Sway", 7 | "i3-gaps", 8 | ] 9 | -------------------------------------------------------------------------------- /src/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/functions/__init__.py -------------------------------------------------------------------------------- /src/functions/desktop_screen.py: -------------------------------------------------------------------------------- 1 | # desktop_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | 21 | from gi.repository import Gtk, Adw 22 | from gettext import gettext as _ 23 | 24 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/desktop_screen.ui') 25 | class DesktopScreen(Adw.Bin): 26 | __gtype_name__ = 'DesktopScreen' 27 | 28 | list_desktops = Gtk.Template.Child() 29 | next_page_button = Gtk.Template.Child() 30 | 31 | chosen_desktop = "" 32 | move_to_summary = False 33 | 34 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 35 | super().__init__(**kwargs) 36 | self.window = window 37 | self.carousel = main_carousel 38 | self.next_page = next_page 39 | 40 | self.list_desktops.connect("row-selected", self.selected_desktop) 41 | self.next_page_button.connect("clicked", self.carousel_next) 42 | 43 | def carousel_next(self, widget): 44 | self.window.set_previous_page(self.window.user_screen) 45 | if self.move_to_summary: 46 | self.window.summary_screen.initialize() 47 | self.carousel.scroll_to(self.window.summary_screen, True) 48 | else: 49 | self.carousel.scroll_to(self.next_page, True) 50 | 51 | def carousel_next_summary(self, widget): 52 | self.next_page.move_to_summary=True 53 | self.carousel.scroll_to(self.next_page, True) 54 | 55 | def selected_desktop(self, widget, row): 56 | if row is not None: 57 | print(row.get_title()) 58 | self.chosen_desktop = row.get_title() 59 | row.select_button.set_active(True) 60 | self.next_page_button.set_sensitive(True) 61 | else: 62 | print("row is none!!") 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/functions/finished_screen.py: -------------------------------------------------------------------------------- 1 | # desktop_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | 21 | import subprocess, shutil 22 | from gi.repository import Gtk, Adw 23 | from gettext import gettext as _ 24 | from jade_gui.utils.command import CommandUtils 25 | 26 | 27 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/finished_screen.ui') 28 | class FinishedScreen(Adw.Bin): 29 | __gtype_name__='FinishedScreen' 30 | 31 | reboot_button = Gtk.Template.Child() 32 | 33 | def __init__(self, window, application, **kwargs): 34 | super().__init__(**kwargs) 35 | self.reboot_button.connect("clicked", self.reboot) 36 | 37 | def reboot(self, widget): 38 | CommandUtils.run_command(["gnome-session-quit", "--reboot"]) 39 | -------------------------------------------------------------------------------- /src/functions/install_screen.py: -------------------------------------------------------------------------------- 1 | # installer_Screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | import subprocess, os, shutil 21 | import asyncio 22 | from gi.repository import Gtk, GLib, Adw 23 | from gettext import gettext as _ 24 | from jade_gui.utils.command import CommandUtils 25 | 26 | 27 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/install_screen.ui') 28 | class InstallScreen(Adw.Bin): 29 | __gtype_name__="InstallScreen" 30 | 31 | log_text = Gtk.Template.Child() 32 | 33 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 34 | super().__init__(**kwargs) 35 | self.window = window 36 | self.main_carousel = main_carousel 37 | self.next_page = next_page 38 | 39 | def install(self): 40 | prefs = self.window.summary_screen.installprefs.generate_json() 41 | with open(os.getenv("HOME")+"/jade-gui.log", "wb") as f: 42 | process=subprocess.Popen(["bash", "-c", "bash -- /usr/share/jade-gui/jade_gui/scripts/install.sh"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 43 | for c in iter(lambda: process.stdout.read(1), b""): 44 | log=c 45 | try: 46 | GLib.idle_add(self.update_output, c.decode("utf-8")) 47 | except: 48 | pass 49 | f.write(c) 50 | 51 | def carousel_next(self, result, error=None): 52 | self.main_carousel.scroll_to(self.next_page, True) 53 | 54 | def update_output(self, message): 55 | log=self.log_text.get_label() 56 | new_log=f"{log}{message}" 57 | self.log_text.set_label(new_log) 58 | 59 | -------------------------------------------------------------------------------- /src/functions/keyboard_screen.py: -------------------------------------------------------------------------------- 1 | # keyboard_Screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | 21 | from jade_gui.locales.locales_list import locations 22 | from jade_gui.widgets.variant import KeyboardVariant 23 | from gi.repository import Gtk, Adw 24 | from gettext import gettext as _ 25 | 26 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/keyboard_screen.ui') 27 | class KeyboardScreen(Adw.Bin): 28 | __gtype_name__ = 'KeyboardScreen' 29 | 30 | event_controller = Gtk.EventControllerKey.new() 31 | 32 | next_page_button = Gtk.Template.Child() 33 | layout_list = Gtk.Template.Child() 34 | keyboard_entry_search = Gtk.Template.Child() 35 | keyboard_search = Gtk.Template.Child() 36 | 37 | layout = None 38 | variant = "" 39 | move_to_summary = False 40 | 41 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 42 | super().__init__(**kwargs) 43 | self.window = window 44 | self.carousel = main_carousel 45 | self.next_page = next_page 46 | self.next_page_button.connect("clicked", self.carousel_next) 47 | self.event_controller.connect("key-released", self.search_keyboards) 48 | self.keyboard_entry_search.add_controller(self.event_controller) 49 | 50 | def carousel_next(self, widget=None): 51 | self.window.set_previous_page(self.window.timezone_screen) 52 | if self.move_to_summary: 53 | self.window.summary_screen.initialize() 54 | self.carousel.scroll_to(self.window.summary_screen, True) 55 | else: 56 | self.carousel.scroll_to(self.next_page, True) 57 | 58 | def carousel_next_summary(self, widget): 59 | self.next_page.move_to_summary=True 60 | self.carousel.scroll_to(self.next_page, True) 61 | 62 | def search_keyboards(self, *args): 63 | terms = self.keyboard_entry_search.get_text() 64 | self.layout_list.set_filter_func(self.filter_layouts, terms) 65 | 66 | @staticmethod 67 | def filter_layouts(row, terms=None): 68 | try: 69 | text = row.get_title() 70 | text = text.lower() + row.get_subtitle().lower() 71 | if terms.lower() in text: 72 | return True 73 | except: 74 | return True 75 | return False 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/functions/language_screen.py: -------------------------------------------------------------------------------- 1 | # language_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, only 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | 20 | from gi.repository import Gtk, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/language_screen.ui') 24 | class LanguageScreen(Adw.Bin): 25 | __gtype_name__ = 'LanguageScreen' 26 | 27 | event_controller = Gtk.EventControllerKey.new() 28 | 29 | ### Page and widgets on timezone screen 30 | list_languages = Gtk.Template.Child() 31 | language_entry_search = Gtk.Template.Child() 32 | language_search = Gtk.Template.Child() 33 | next_page_button = Gtk.Template.Child() 34 | 35 | chosen_language = None 36 | move_to_summary = False 37 | 38 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 39 | super().__init__(**kwargs) 40 | self.window = window 41 | self.carousel = main_carousel 42 | self.next_page = next_page 43 | 44 | self.event_controller.connect("key-released", self.search_languages()) 45 | self.language_entry_search.add_controller(self.event_controller) 46 | self.list_languages.connect("row-selected", self.selected_language) 47 | self.next_page_button.connect("clicked", self.carousel_next) 48 | 49 | def selected_language(self, widget, row): 50 | print(row) 51 | if row is not None or row is not self.language_search: 52 | print(row.get_title()) 53 | self.chosen_language = row 54 | self.next_page_button.set_sensitive(False) 55 | else: 56 | print("row is none!!") 57 | 58 | def carousel_next(self, widget=None): 59 | self.window.set_previous_page(self.window) 60 | if self.move_to_summary: 61 | self.window.summary_screen.initialize() 62 | self.carousel.scroll_to(self.window.summary_screen, True) 63 | else: 64 | self.carousel.scroll_to(self.next_page, True) 65 | 66 | def carousel_next_summary(self, widget): 67 | self.next_page.move_to_summary=True 68 | self.carousel.scroll_to(self.next_page, True) 69 | 70 | def search_languages(self, *args): 71 | terms = self.language_entry_search.get_text() 72 | self.list_languages.set_filter_func(self.filter_languages, terms) 73 | 74 | @staticmethod 75 | def filter_languages(row, terms=None): 76 | try: 77 | text = row.get_title() 78 | text = text.lower() + row.get_subtitle().lower() 79 | if terms.lower() in text: 80 | return True 81 | except: 82 | return True 83 | return False 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/functions/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | functionsdir = join_paths(pkgdatadir, 'jade_gui/functions') 3 | 4 | jade_gui_sources = [ 5 | '__init__.py', 6 | 'keyboard_screen.py', 7 | 'timezone_screen.py', 8 | 'user_screen.py', 9 | 'desktop_screen.py', 10 | 'misc_screen.py', 11 | 'partition_screen.py', 12 | 'summary_screen.py', 13 | 'install_screen.py', 14 | 'finished_screen.py', 15 | ] 16 | install_data(jade_gui_sources, install_dir: functionsdir) -------------------------------------------------------------------------------- /src/functions/misc_screen.py: -------------------------------------------------------------------------------- 1 | # misc_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from gi.repository import Gtk, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/misc_screen.ui') 24 | class MiscScreen(Adw.Bin): 25 | __gtype_name__ = "MiscScreen" 26 | 27 | hostname_entry = Gtk.Template.Child() 28 | ipv_switch = Gtk.Template.Child() 29 | timeshift_switch = Gtk.Template.Child() 30 | zramd_switch = Gtk.Template.Child() 31 | next_page_button = Gtk.Template.Child() 32 | 33 | hostname = "crystal" 34 | ipv_enabled = False 35 | zramd_enabled = False 36 | timeshift_enabled = True 37 | zramd_enabled = True 38 | move_to_summary = False 39 | 40 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 41 | super().__init__(**kwargs) 42 | self.window = window 43 | self.carousel = main_carousel 44 | self.next_page = next_page 45 | self.next_page_button.connect("clicked", self.carousel_next) 46 | 47 | def carousel_next(self, widget): 48 | self.window.set_previous_page(self.window.desktop_screen) 49 | self.hostname = self.hostname_entry.get_text() 50 | self.ipv_enabled = self.ipv_switch.get_state() 51 | self.zramd_enabled = self.zramd_switch.get_state() 52 | self.timeshift_enabled = self.timeshift_switch.get_state() 53 | if self.move_to_summary: 54 | self.window.summary_screen.initialize() 55 | self.carousel.scroll_to(self.window.summary_screen, True) 56 | else: 57 | self.carousel.scroll_to(self.next_page, True) 58 | 59 | def carousel_next_summary(self, widget): 60 | self.next_page.move_to_summary=True 61 | self.carousel.scroll_to(self.next_page, True) 62 | -------------------------------------------------------------------------------- /src/functions/partition_screen.py: -------------------------------------------------------------------------------- 1 | # partition_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3 of the License only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | import subprocess, shutil 20 | from gi.repository import Gtk, Adw 21 | from gettext import gettext as _ 22 | from jade_gui.utils import disks 23 | from jade_gui.utils.command import CommandUtils 24 | from jade_gui.widgets.partition import PartitionEntry 25 | from jade_gui.classes.partition import Partition 26 | 27 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/partition_screen.ui') 28 | class PartitionScreen(Adw.Bin): 29 | __gtype_name__ = "PartitionScreen" 30 | 31 | disk_list = Gtk.Template.Child() 32 | open_bash = Gtk.Template.Child() 33 | open_gparted = Gtk.Template.Child() 34 | partition_list = Gtk.Template.Child() 35 | next_page_button = Gtk.Template.Child() 36 | reload_partitions = Gtk.Template.Child() 37 | manual_partitioning = Gtk.Template.Child() 38 | automatic_partitioning = Gtk.Template.Child() 39 | manual_partitioning_page = Gtk.Template.Child() 40 | automatic_partitioning_page = Gtk.Template.Child() 41 | 42 | selected_partition = None 43 | move_to_summary = False 44 | 45 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 46 | super().__init__(**kwargs) 47 | self.window = window 48 | self.carousel = main_carousel 49 | self.next_page = next_page 50 | self.next_page_button.connect("clicked", self.carousel_next) 51 | self.disk_list.connect("row_selected", self.row_selected) 52 | self.manual_partitioning.connect("clicked", self.switch_manual_partitioning) 53 | self.reload_partitions.connect("clicked", self.check_partitions) 54 | self.automatic_partitioning.connect("clicked", self.switch_automatic_partitioning) 55 | self.open_bash.connect("clicked", self.bash) 56 | self.open_gparted.connect("clicked", self.gparted) 57 | 58 | def gparted(self, widget): 59 | CommandUtils.run_command(["pkexec", "gparted"]) 60 | 61 | def bash(self, widget): 62 | CommandUtils.run_command(["gnome-terminal", "--", "bash"]) 63 | 64 | def check_partitions(self, widget): 65 | self.partition_list.select_all() 66 | print(self.partition_list.get_row_at_index(2)) 67 | for i in range(0, len(self.window.available_partitions)): 68 | self.partition_list.remove(self.partition_list.get_row_at_index(0)) 69 | self.available_partitions = disks.get_partitions() 70 | self.window.available_partitions = self.available_partitions 71 | for partition in self.available_partitions: 72 | self.partition_list.append( 73 | PartitionEntry( 74 | window=self, 75 | partition=Partition(partition=partition, mountpoint="", filesystem="", size=disks.get_disk_size(partition)), 76 | application=None 77 | ) 78 | ) 79 | 80 | def switch_automatic_partitioning(self, widget): 81 | self.automatic_partitioning_page.set_visible(True) 82 | self.manual_partitioning_page.set_visible(False) 83 | self.window.partition_mode = "Auto" 84 | 85 | 86 | def switch_manual_partitioning(self, widget): 87 | self.automatic_partitioning_page.set_visible(False) 88 | self.manual_partitioning_page.set_visible(True) 89 | self.window.partition_mode = "Manual" 90 | 91 | def row_selected(self, widget, row): 92 | if row is not None: 93 | print(row.get_title()) 94 | row.select_button.set_active(True) 95 | self.selected_partition = row 96 | self.next_page_button.set_sensitive(True) 97 | else: 98 | print("ERROR: invalid row slected") 99 | 100 | def carousel_next(self, widget): 101 | self.window.set_previous_page(self.window.misc_screen) 102 | self.window.summary_screen.initialize() 103 | self.carousel.scroll_to(self.next_page, True) 104 | 105 | -------------------------------------------------------------------------------- /src/functions/summary_screen.py: -------------------------------------------------------------------------------- 1 | # summary_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | import os 21 | from jade_gui.utils import disks 22 | from jade_gui.classes.install_prefs import InstallPrefs 23 | from jade_gui.utils.threading import RunAsync 24 | from gi.repository import Gtk, Adw 25 | from gettext import gettext as _ 26 | 27 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/summary_screen.ui') 28 | class SummaryScreen(Adw.Bin): 29 | __gtype_name__ = "SummaryScreen" 30 | 31 | next_page_button = Gtk.Template.Child() 32 | 33 | timezone_label = Gtk.Template.Child() 34 | timezone_button = Gtk.Template.Child() 35 | keyboard_label = Gtk.Template.Child() 36 | keyboard_button = Gtk.Template.Child() 37 | username_label = Gtk.Template.Child() 38 | username_button = Gtk.Template.Child() 39 | sudo_label = Gtk.Template.Child() 40 | sudo_button = Gtk.Template.Child() 41 | root_label = Gtk.Template.Child() 42 | root_button = Gtk.Template.Child() 43 | desktop_label = Gtk.Template.Child() 44 | desktop_button = Gtk.Template.Child() 45 | partition_label = Gtk.Template.Child() 46 | partition_button = Gtk.Template.Child() 47 | uefi_label = Gtk.Template.Child() 48 | ipv_label = Gtk.Template.Child() 49 | ipv_button = Gtk.Template.Child() 50 | timeshift_label = Gtk.Template.Child() 51 | timeshift_button = Gtk.Template.Child() 52 | zramd_label = Gtk.Template.Child() 53 | zramd_button = Gtk.Template.Child() 54 | #unakite_label = Gtk.Template.Child() 55 | 56 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 57 | super().__init__(**kwargs) 58 | self.window = window 59 | self.main_carousel = main_carousel 60 | self.next_page = next_page 61 | self.next_page_button.connect("clicked", self.carousel_next) 62 | 63 | def carousel_next(self, widget): 64 | self.window.set_previous_page(None) 65 | self.main_carousel.scroll_to(self.next_page, True) 66 | #(self.window.installer_screen.install()) 67 | with open(os.getenv('HOME')+'/.config/jade.json', 'w') as f: 68 | f.write(self.installprefs.generate_json()) 69 | RunAsync(self.window.installer_screen.install, callback=self.window.installer_screen.carousel_next) 70 | 71 | def initialize(self): 72 | self.timezone_button.connect("clicked", self.window.carousel_next) 73 | self.keyboard_button.connect("clicked", self.window.timezone_screen.carousel_next_summary) 74 | self.username_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) 75 | self.sudo_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) 76 | self.root_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) 77 | self.desktop_button.connect("clicked", self.window.user_screen.carousel_next_summary) 78 | self.partition_button.connect("clicked", self.window.misc_screen.carousel_next_summary) 79 | self.ipv_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) 80 | self.timeshift_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) 81 | self.zramd_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) 82 | 83 | self.timezone_label.set_title(self.window.timezone_screen.chosen_timezone.region+"/"+self.window.timezone_screen.chosen_timezone.location) 84 | self.timezone_label.set_subtitle(self.window.timezone_screen.chosen_timezone.locale) 85 | 86 | self.keyboard_label.set_title(self.window.keyboard_screen.variant.country) 87 | self.keyboard_label.set_subtitle(self.window.keyboard_screen.variant.variant) 88 | 89 | self.username_label.set_title(self.window.user_screen.username) 90 | self.sudo_label.set_title("sudo enabled" if self.window.user_screen.sudo_enabled else "sudo disabled") 91 | self.root_label.set_title("root enabled" if self.window.user_screen.root_enabled else "root disabled") 92 | 93 | self.desktop_label.set_title(self.window.desktop_screen.chosen_desktop) 94 | 95 | if self.window.partition_mode == "Manual": 96 | self.partition_label.set_title("Manual partitioning selected") 97 | self.partition_label.set_subtitle("") 98 | else: 99 | self.partition_label.set_title(self.window.partition_screen.selected_partition.disk) 100 | self.partition_label.set_subtitle(self.window.partition_screen.selected_partition.disk_size) 101 | self.uefi_label.set_title("UEFI" if disks.get_uefi() else "Legacy BIOS") 102 | 103 | self.ipv_label.set_title("ipv6 enabled" if self.window.misc_screen.ipv_enabled else "ipv6 disabled") 104 | self.timeshift_label.set_title("timeshift enabled" if self.window.misc_screen.timeshift_enabled else "timeshift disabled") 105 | self.zramd_label.set_title("zramd enabled" if self.window.misc_screen.zramd_enabled else "zramd disabled") 106 | #self.unakite_label.set_title("Unakite enabled "+"enabled" if self.window.misc_screen.) 107 | 108 | partitions=[] 109 | for i in range(0, len(self.window.available_partitions)): 110 | partition = self.window.partition_screen.partition_list.get_row_at_index(i).partition 111 | partitions.append(partition.generate_jade_entry()) 112 | 113 | 114 | self.installprefs = InstallPrefs( 115 | timezone=self.window.timezone_screen.chosen_timezone, 116 | layout=self.window.keyboard_screen.variant, 117 | variant=self.window.keyboard_screen.variant, 118 | username=self.window.user_screen.username, 119 | password=self.window.user_screen.password, 120 | enable_sudo=self.window.user_screen.sudo_enabled, 121 | disk=self.window.partition_screen.selected_partition, 122 | hostname=self.window.misc_screen.hostname, 123 | ipv_enabled=self.window.misc_screen.ipv_enabled, 124 | timeshift_enabled=self.window.misc_screen.timeshift_enabled, 125 | zramd_enabled=self.window.misc_screen.zramd_enabled, 126 | desktop=self.window.desktop_screen.chosen_desktop, 127 | partition_mode=self.window.partition_mode, 128 | partitions=partitions, 129 | ) 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /src/functions/timezone_screen.py: -------------------------------------------------------------------------------- 1 | # timezone_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | 21 | from gi.repository import Gtk, Adw 22 | from gettext import gettext as _ 23 | 24 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/timezone_screen.ui') 25 | class TimezoneScreen(Adw.Bin): 26 | __gtype_name__ = 'TimezoneScreen' 27 | 28 | event_controller = Gtk.EventControllerKey.new() 29 | 30 | ### Page and widgets on timezone screen 31 | list_timezones = Gtk.Template.Child() 32 | timezone_entry_search = Gtk.Template.Child() 33 | timezone_search = Gtk.Template.Child() 34 | next_page_button = Gtk.Template.Child() 35 | 36 | chosen_timezone = None 37 | move_to_summary = False 38 | 39 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 40 | super().__init__(**kwargs) 41 | self.window = window 42 | self.carousel = main_carousel 43 | self.next_page = next_page 44 | 45 | self.event_controller.connect("key-released", self.search_timezones) 46 | self.timezone_entry_search.add_controller(self.event_controller) 47 | self.list_timezones.connect("row-selected", self.selected_timezone) 48 | self.next_page_button.connect("clicked", self.carousel_next) 49 | 50 | def selected_timezone(self, widget, row): 51 | print(row) 52 | if row is not None or row is not self.timezone_search: 53 | print(row.get_title()) 54 | self.chosen_timezone = row 55 | self.next_page_button.set_sensitive(True) 56 | else: 57 | print("row is none!!") 58 | 59 | def carousel_next(self, widget=None): 60 | self.window.set_previous_page(self.window) 61 | if self.move_to_summary: 62 | self.window.summary_screen.initialize() 63 | self.carousel.scroll_to(self.window.summary_screen, True) 64 | else: 65 | self.carousel.scroll_to(self.next_page, True) 66 | 67 | def carousel_next_summary(self, widget): 68 | self.next_page.move_to_summary=True 69 | self.carousel.scroll_to(self.next_page, True) 70 | 71 | def search_timezones(self, *args): 72 | terms = self.timezone_entry_search.get_text() 73 | self.list_timezones.set_filter_func(self.filter_timezones, terms) 74 | 75 | @staticmethod 76 | def filter_timezones(row, terms=None): 77 | try: 78 | text = row.get_title() 79 | text = text.lower() + row.get_subtitle().lower() 80 | if terms.lower() in text: 81 | return True 82 | except: 83 | return True 84 | return False 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/functions/user_screen.py: -------------------------------------------------------------------------------- 1 | # user_screen.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | 21 | from gi.repository import Gtk, Adw 22 | from gettext import gettext as _ 23 | import re, subprocess, shutil 24 | 25 | @Gtk.Template(resource_path='/al/getcryst/jadegui/pages/user_screen.ui') 26 | class UserScreen(Adw.Bin): 27 | __gtype_name__ = "UserScreen" 28 | 29 | username_entry = Gtk.Template.Child() 30 | password_entry = Gtk.Template.Child() 31 | password_confirmation = Gtk.Template.Child() 32 | enable_sudo_switch = Gtk.Template.Child() 33 | enable_root_switch = Gtk.Template.Child() 34 | next_page_button = Gtk.Template.Child() 35 | 36 | username = "" 37 | sudo_enabled = True 38 | root_enabled = True 39 | username_filled = False 40 | password_filled = False 41 | move_to_summary = False 42 | 43 | def __init__(self, window, main_carousel, next_page, application, **kwargs): 44 | super().__init__(**kwargs) 45 | self.window = window 46 | self.carousel = main_carousel 47 | self.next_page = next_page 48 | self.sudo_enabled = True 49 | self.root_enabled = True 50 | self.enable_root_switch.set_active(self.root_enabled) 51 | self.enable_sudo_switch.set_active(self.sudo_enabled) 52 | self.username_entry.connect('changed', self.username_passes_regex) 53 | self.enable_root_switch.connect('state-set', self.enable_root_user) 54 | self.enable_sudo_switch.connect('state-set', self.enable_sudo) 55 | self.password_entry.connect('changed', self.verify_password) 56 | self.password_confirmation.connect('changed', self.verify_password) 57 | self.next_page_button.connect('clicked', self.carousel_next) 58 | 59 | def username_passes_regex(self, widget): 60 | input = self.username_entry.get_text() 61 | print(input) 62 | if not re.search("^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$", input): 63 | print("Invalid username!") 64 | self.username_entry.add_css_class('error') 65 | self.username_filled = False 66 | self.verify_continue() 67 | else: 68 | print("Valid username!") 69 | self.username_entry.remove_css_class('error') 70 | self.username_filled = True 71 | self.verify_continue() 72 | self.username = input 73 | 74 | def enable_root_user(self, widget, switch_state): 75 | print("root") 76 | print(self.root_enabled) 77 | print(switch_state) 78 | if switch_state == False and not self.sudo_enabled: 79 | self.root_enabled = switch_state 80 | self.sudo_enabled = not switch_state 81 | self.enable_sudo_switch.set_active(not switch_state) 82 | else: 83 | self.root_enabled = switch_state 84 | 85 | 86 | 87 | def enable_sudo(self, widget, switch_state): 88 | print("sudo") 89 | print(self.root_enabled) 90 | print(switch_state) 91 | if switch_state == False and not self.root_enabled: 92 | self.sudo_enabled = switch_state 93 | self.root_enabled = not switch_state 94 | self.enable_root_switch.set_active(not switch_state) 95 | else: 96 | self.sudo_enabled = switch_state 97 | 98 | def verify_password(self, widget): 99 | if self.password_entry.get_text() == self.password_confirmation.get_text() and self.password_entry.get_text().strip(): 100 | #self.next_page_button.set_sensitive(True) 101 | self.password_filled = True; 102 | self.verify_continue(); 103 | self.password_confirmation.remove_css_class('error') 104 | self.password = self.encrypt_password(self.password_entry.get_text()) 105 | else: 106 | self.password_filled = False; 107 | self.verify_continue(); 108 | self.password_confirmation.add_css_class('error') 109 | 110 | def verify_continue(self): 111 | if self.password_filled and self.username_filled: 112 | self.next_page_button.set_sensitive(True) 113 | else: 114 | self.next_page_button.set_sensitive(False) 115 | 116 | def encrypt_password(self, password): 117 | command=subprocess.run([shutil.which("openssl"), "passwd", "-crypt", password], capture_output=True) 118 | password_encrypted=command.stdout.decode('utf-8').strip('\n') 119 | return password_encrypted 120 | 121 | 122 | def carousel_next(self, widget): 123 | self.window.set_previous_page(self.window.keyboard_screen) 124 | if self.move_to_summary: 125 | self.window.summary_screen.initialize() 126 | self.carousel.scroll_to(self.window.summary_screen, True) 127 | else: 128 | self.carousel.scroll_to(self.next_page, True) 129 | 130 | def carousel_next_summary(self, widget): 131 | self.next_page.move_to_summary=True 132 | self.carousel.scroll_to(self.next_page, True) 133 | 134 | 135 | -------------------------------------------------------------------------------- /src/gtk/help-overlay.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | shortcuts 9 | 10 10 | 11 | 12 | General 13 | 14 | 15 | Show Shortcuts 16 | win.show-help-overlay 17 | 18 | 19 | 20 | 21 | Quit 22 | app.quit 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/jade_gui.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | about.ui 6 | widgets/timezone.ui 7 | widgets/layout.ui 8 | widgets/variant.ui 9 | widgets/desktop.ui 10 | widgets/disk.ui 11 | widgets/partition.ui 12 | pages/desktop_screen.ui 13 | pages/finished_screen.ui 14 | pages/install_screen.ui 15 | pages/keyboard_screen.ui 16 | pages/misc_screen.ui 17 | pages/partition_screen.ui 18 | pages/summary_screen.ui 19 | pages/timezone_screen.ui 20 | pages/user_screen.ui 21 | gtk/help-overlay.ui 22 | crystal-logo-minimal.png 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/jade_gui.in: -------------------------------------------------------------------------------- 1 | #!@PYTHON@ 2 | 3 | # jade_gui.in 4 | 5 | # 6 | # Copyright 2022 user 7 | 8 | # 9 | # This program is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | import os 23 | import sys 24 | import signal 25 | import locale 26 | import gettext 27 | 28 | VERSION = '@VERSION@' 29 | pkgdatadir = '@pkgdatadir@' 30 | localedir = '@localedir@' 31 | 32 | sys.path.insert(1, pkgdatadir) 33 | signal.signal(signal.SIGINT, signal.SIG_DFL) 34 | locale.bindtextdomain('jade_gui', localedir) 35 | locale.textdomain('jade_gui') 36 | gettext.install('jade_gui', localedir) 37 | 38 | if __name__ == '__main__': 39 | import gi 40 | 41 | from gi.repository import Gio 42 | resource = Gio.Resource.load(os.path.join(pkgdatadir, 'jade_gui.gresource')) 43 | icons = Gio.Resource.load(os.path.join(pkgdatadir, 'jade_gui_resources.gresource')) 44 | resource._register() 45 | icons._register() 46 | 47 | from jade_gui import main 48 | sys.exit(main.main(VERSION)) 49 | -------------------------------------------------------------------------------- /src/locales.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/locales.py -------------------------------------------------------------------------------- /src/locales/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/locales/__init__.py -------------------------------------------------------------------------------- /src/locales/africa.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | africa = [ 4 | locale( 5 | region="Africa", 6 | location="Abidjan", 7 | locales="fr_FR.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Africa", 11 | location="Accra", 12 | locales="en_GH.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Africa", 16 | location="Addis_Ababa", 17 | locales="en_ET.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Africa", 21 | location="Algiers", 22 | locales="ar_DZ.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Africa", 26 | location="Asmara", 27 | locales="en_ER.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Africa", 31 | location="Bamako", 32 | locales="fr_ML.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Africa", 36 | location="Bangui", 37 | locales="fr_FR.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Africa", 41 | location="Banjul", 42 | locales="en_GM.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Africa", 46 | location="Bissau", 47 | locales="pt_GW.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Africa", 51 | location="Blantyre", 52 | locales="en_MW.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Africa", 56 | location="Brazzaville", 57 | locales="fr_CD.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Africa", 61 | location="Bujumbura", 62 | locales="fr_BI.UTF-8 UTF-8", 63 | ), 64 | locale( 65 | region="Africa", 66 | location="Cairo", 67 | locales="ar_EG.UTF-8 UTF-8", 68 | ), 69 | locale( 70 | region="Africa", 71 | location="Casablanca", 72 | locales="ar_MA.UTF-8 UTF-8", 73 | ), 74 | locale( 75 | region="Africa", 76 | location="Ceuta", 77 | locales="es_ES.UTF-8 UTF-8", 78 | ), 79 | locale( 80 | region="Africa", 81 | location="Conakry", 82 | locales="fr_GN.UTF-8 UTF-8", 83 | ), 84 | locale( 85 | region="Africa", 86 | location="Dakar", 87 | locales="fr_SN.UTF-8 UTF-8", 88 | ), 89 | locale( 90 | region="Africa", 91 | location="Dar_es_Salaam", 92 | locales="en_TZ.UTF-8 UTF-8", 93 | ), 94 | locale( 95 | region="Africa", 96 | location="Djibouti", 97 | locales="fr_DJ.UTF-8 UTF-8", 98 | ), 99 | locale( 100 | region="Africa", 101 | location="Douala", 102 | locales="fr_CM.UTF-8 UTF-8", 103 | ), 104 | locale( 105 | region="Africa", 106 | location="El_Aaiun", 107 | locales="ar_EH.UTF-8 UTF-8", 108 | ), 109 | locale( 110 | region="Africa", 111 | location="Freetown", 112 | locales="en_SL.UTF-8 UTF-8", 113 | ), 114 | locale( 115 | region="Africa", 116 | location="Gaborone", 117 | locales="en_BW.UTF-8 UTF-8", 118 | ), 119 | locale( 120 | region="Africa", 121 | location="Harare", 122 | locales="en_ZW.UTF-8 UTF-8", 123 | ), 124 | locale( 125 | region="Africa", 126 | location="Johannesburg", 127 | locales="en_ZA.UTF-8 UTF-8", 128 | ), 129 | locale( 130 | region="Africa", 131 | location="Juba", 132 | locales="en_SS.UTF-8 UTF-8", 133 | ), 134 | locale( 135 | region="Africa", 136 | location="Kampala", 137 | locales="en_UG.UTF-8 UTF-8", 138 | ), 139 | locale( 140 | region="Africa", 141 | location="Khartoum", 142 | locales="", 143 | ), 144 | locale( 145 | region="Africa", 146 | location="Kigali", 147 | locales="en_RW.UTF-8 UTF-8", 148 | ), 149 | locale( 150 | region="Africa", 151 | location="Kinshasa", 152 | locales="fr_CD.UTF-8 UTF-8", 153 | ), 154 | locale( 155 | region="Africa", 156 | location="Lagos", 157 | locales="en_NG.UTF-8 UTF-8", 158 | ), 159 | locale( 160 | region="Africa", 161 | location="Libreville", 162 | locales="fr_GA.UTF-8 UTF-8", 163 | ), 164 | locale( 165 | region="Africa", 166 | location="Lome", 167 | locales="fr_TG.UTF-8 UTF-8", 168 | ), 169 | locale( 170 | region="Africa", 171 | location="Luanda", 172 | locales="pt_AO.UTF-8 UTF-8", 173 | ), 174 | locale( 175 | region="Africa", 176 | location="Lubumbashi", 177 | locales="fr_CD.UTF-8 UTF-8", 178 | ), 179 | locale( 180 | region="Africa", 181 | location="Lusaka", 182 | locales="en_ZM.UTF-8 UTF-8", 183 | ), 184 | locale( 185 | region="Africa", 186 | location="Malabo", 187 | locales="fr_GQ.UTF-8 UTF-8", 188 | ), 189 | locale( 190 | region="Africa", 191 | location="Maputo", 192 | locales="en_MZ.UTF-8 UTF-8", 193 | ), 194 | locale( 195 | region="Africa", 196 | location="Maseru", 197 | locales="en_LS.UTF-8 UTF-8", 198 | ), 199 | locale( 200 | region="Africa", 201 | location="Mbabane", 202 | locales="en_SZ.UTF-8 UTF-8", 203 | ), 204 | locale( 205 | region="Africa", 206 | location="Mogadishu", 207 | locales="en_SO.UTF-8 UTF-8", 208 | ), 209 | locale( 210 | region="Africa", 211 | location="Monrovia", 212 | locales="en_LR.UTF-8 UTF-8", 213 | ), 214 | locale( 215 | region="Africa", 216 | location="Nairobi", 217 | locales="en_KE.UTF-8 UTF-8", 218 | ), 219 | locale( 220 | region="Africa", 221 | location="Ndjamena", 222 | locales="fr_TD.UTF-8 UTF-8", 223 | ), 224 | locale( 225 | region="Africa", 226 | location="Niamey", 227 | locales="fr_NE.UTF-8 UTF-8", 228 | ), 229 | locale( 230 | region="Africa", 231 | location="Nouakchott", 232 | locales="ar_MR.UTF-8 UTF-8", 233 | ), 234 | locale( 235 | region="Africa", 236 | location="Ouagadougou", 237 | locales="fr_BF.UTF-8 UTF-8", 238 | ), 239 | locale( 240 | region="Africa", 241 | location="Porto-Novo", 242 | locales="fr_BJ.UTF-8 UTF-8", 243 | ), 244 | locale( 245 | region="Africa", 246 | location="Sao_Tome", 247 | locales="pt_ST.UTF-8 UTF-8", 248 | ), 249 | locale( 250 | region="Africa", 251 | location="Timbuktu", 252 | locales="fr_ML.UTF-8 UTF-8", 253 | ), 254 | locale( 255 | region="Africa", 256 | location="Tripoli", 257 | locales="ar_LY.UTF-8 UTF-8", 258 | ), 259 | locale( 260 | region="Africa", 261 | location="Tunis", 262 | locales="fr_TN.UTF-8 UTF-8", 263 | ), 264 | locale( 265 | region="Africa", 266 | location="Windhoek", 267 | locales="en_NA.UTF-8 UTF-8", 268 | ), 269 | ] 270 | 271 | -------------------------------------------------------------------------------- /src/locales/antarctica.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | antarctica = [ 4 | locale( 5 | region="Antarctica", 6 | location="Casey", 7 | locales="en_AQ.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Antarctica", 11 | location="Davis", 12 | locales="en_AQ.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Antarctica", 16 | location="DumontDurville", 17 | locales="en_AQ.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Antarctica", 21 | location="Macquarie", 22 | locales="en_AQ.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Antarctica", 26 | location="Mawson", 27 | locales="en_AQ.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Antarctica", 31 | location="McMurdo", 32 | locales="en_AQ.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Antarctica", 36 | location="Palmer", 37 | locales="en_AQ.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Antarctica", 41 | location="Rothera", 42 | locales="en_AQ.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Antarctica", 46 | location="South_Pole", 47 | locales="en_AQ.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Antarctica", 51 | location="Syowa", 52 | locales="en_AQ.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Antarctica", 56 | location="Troll", 57 | locales="en_AQ.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Antarctica", 61 | location="Vostok", 62 | locales="en_AQ.UTF-8 UTF-8", 63 | ), 64 | ] 65 | 66 | -------------------------------------------------------------------------------- /src/locales/arctic.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | arctic = [ 4 | locale( 5 | region="Arctic", 6 | location="Longyearbyen", 7 | locales="no_NO.UTF-8 UTF-8", 8 | ) 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /src/locales/asia.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | asia = [ 4 | locale( 5 | region="Asia", 6 | location="Aden", 7 | locales="ar_SA.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Asia", 11 | location="Almaty", 12 | locales="kk_KZ.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Asia", 16 | location="Amman", 17 | locales="ar_JO.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Asia", 21 | location="Anadyr", 22 | locales="ru_RU.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Asia", 26 | location="Aqtau", 27 | locales="kk_KZ.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Asia", 31 | location="Aqtobe", 32 | locales="kk_KZ.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Asia", 36 | location="Ashgabat", 37 | locales="tk_TM.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Asia", 41 | location="Ashkhabad", 42 | locales="tk_TM.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Asia", 46 | location="Atyrau", 47 | locales="ru_RU.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Asia", 51 | location="Baghdad", 52 | locales="ar_IQ.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Asia", 56 | location="Bahrain", 57 | locales="ar_BH.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Asia", 61 | location="Baku", 62 | locales="az_AZ.UTF-8 UTF-8", 63 | ), 64 | locale( 65 | region="Asia", 66 | location="Bangkok", 67 | locales="th_TH.UTF-8 UTF-8", 68 | ), 69 | locale( 70 | region="Asia", 71 | location="Barnaul", 72 | locales="ru_RU.UTF-8 UTF-8", 73 | ), 74 | locale( 75 | region="Asia", 76 | location="Beirut", 77 | locales="ar_LB.UTF-8 UTF-8", 78 | ), 79 | locale( 80 | region="Asia", 81 | location="Bishkek", 82 | locales="ky_KG.UTF-8 UTF-8", 83 | ), 84 | locale( 85 | region="Asia", 86 | location="Brunei", 87 | locales="ms_BN.UTF-8 UTF-8", 88 | ), 89 | locale( 90 | region="Asia", 91 | location="Chita", 92 | locales="ru_RU.UTF-8 UTF-8", 93 | ), 94 | locale( 95 | region="Asia", 96 | location="Choibalsan", 97 | locales="mn_MN.UTF-8 UTF-8", 98 | ), 99 | locale( 100 | region="Asia", 101 | location="Chongqing", 102 | locales="zh_CN.UTF-8 UTF-8", 103 | ), 104 | locale( 105 | region="Asia", 106 | location="Chungking", 107 | locales="zh_CN.UTF-8 UTF-8", 108 | ), 109 | locale( 110 | region="Asia", 111 | location="Colombo", 112 | locales="si_LK.UTF-8 UTF-8", 113 | ), 114 | locale( 115 | region="Asia", 116 | location="Dacca", 117 | locales="bn_BD.UTF-8 UTF-8", 118 | ), 119 | locale( 120 | region="Asia", 121 | location="Damascus", 122 | locales="ar_SY.UTF-8 UTF-8", 123 | ), 124 | locale( 125 | region="Asia", 126 | location="Dhaka", 127 | locales="bn_BD.UTF-8 UTF-8", 128 | ), 129 | locale( 130 | region="Asia", 131 | location="Dili", 132 | locales="id_ID.UTF-8 UTF-8", 133 | ), 134 | locale( 135 | region="Asia", 136 | location="Dubai", 137 | locales="ar_AE.UTF-8 UTF-8", 138 | ), 139 | locale( 140 | region="Asia", 141 | location="Dushanbe", 142 | locales="tg_TJ.UTF-8 UTF-8", 143 | ), 144 | locale( 145 | region="Asia", 146 | location="Famagusta", 147 | locales="tr_TR.UTF-8 UTF-8", 148 | ), 149 | locale( 150 | region="Asia", 151 | location="Gaza", 152 | locales="ar_PS.UTF-8 UTF-8", 153 | ), 154 | locale( 155 | region="Asia", 156 | location="Harbin", 157 | locales="zh_CN.UTF-8 UTF-8", 158 | ), 159 | locale( 160 | region="Asia", 161 | location="Hebron", 162 | locales="ar_PS.UTF-8 UTF-8", 163 | ), 164 | locale( 165 | region="Asia", 166 | location="Ho_Chi_Minh", 167 | locales="vi_VN.UTF-8 UTF-8", 168 | ), 169 | locale( 170 | region="Asia", 171 | location="Hong_Kong", 172 | locales="zh_HK.UTF-8 UTF-8", 173 | ), 174 | locale( 175 | region="Asia", 176 | location="Hovd", 177 | locales="mn_MN.UTF-8 UTF-8", 178 | ), 179 | locale( 180 | region="Asia", 181 | location="Irkutsk", 182 | locales="ru_RU.UTF-8 UTF-8", 183 | ), 184 | locale( 185 | region="Asia", 186 | location="Istanbul", 187 | locales="tr_TR.UTF-8 UTF-8", 188 | ), 189 | locale( 190 | region="Asia", 191 | location="Jakarta", 192 | locales="id_ID.UTF-8 UTF-8", 193 | ), 194 | locale( 195 | region="Asia", 196 | location="Jayapura", 197 | locales="id_ID.UTF-8 UTF-8", 198 | ), 199 | locale( 200 | region="Asia", 201 | location="Jerusalem", 202 | locales="he_IL.UTF-8 UTF-8", 203 | ), 204 | locale( 205 | region="Asia", 206 | location="Kabul", 207 | locales="fa_AF.UTF-8 UTF-8", 208 | ), 209 | locale( 210 | region="Asia", 211 | location="Kamchatka", 212 | locales="ru_RU.UTF-8 UTF-8", 213 | ), 214 | locale( 215 | region="Asia", 216 | location="Karachi", 217 | locales="ur_PK.UTF-8 UTF-8", 218 | ), 219 | locale( 220 | region="Asia", 221 | location="Kashgar", 222 | locales="zh_CN.UTF-8 UTF-8", 223 | ), 224 | locale( 225 | region="Asia", 226 | location="Kathmandu", 227 | locales="ne_NP.UTF-8 UTF-8", 228 | ), 229 | locale( 230 | region="Asia", 231 | location="Katmandu", 232 | locales="ne_NP.UTF-8 UTF-8", 233 | ), 234 | locale( 235 | region="Asia", 236 | location="Khandyga", 237 | locales="ru_RU.UTF-8 UTF-8", 238 | ), 239 | locale( 240 | region="Asia", 241 | location="Kolkata", 242 | locales="hi_IN.UTF-8 UTF-8", 243 | ), 244 | locale( 245 | region="Asia", 246 | location="Krasnoyarsk", 247 | locales="ru_RU.UTF-8 UTF-8", 248 | ), 249 | locale( 250 | region="Asia", 251 | location="Kuala_Lumpur", 252 | locales="ms_MY.UTF-8 UTF-8", 253 | ), 254 | locale( 255 | region="Asia", 256 | location="Kuching", 257 | locales="ms_MY.UTF-8 UTF-8", 258 | ), 259 | locale( 260 | region="Asia", 261 | location="Kuwait", 262 | locales="ar_KW.UTF-8 UTF-8", 263 | ), 264 | locale( 265 | region="Asia", 266 | location="Macao", 267 | locales="zh_MO.UTF-8 UTF-8", 268 | ), 269 | locale( 270 | region="Asia", 271 | location="Macau", 272 | locales="zh_MO.UTF-8 UTF-8", 273 | ), 274 | locale( 275 | region="Asia", 276 | location="Magadan", 277 | locales="ru_RU.UTF-8 UTF-8", 278 | ), 279 | locale( 280 | region="Asia", 281 | location="Makassar", 282 | locales="id_ID.UTF-8 UTF-8", 283 | ), 284 | locale( 285 | region="Asia", 286 | location="Manila", 287 | locales="tl_PH.UTF-8 UTF-8", 288 | ), 289 | locale( 290 | region="Asia", 291 | location="Muscat", 292 | locales="ar_OM.UTF-8 UTF-8", 293 | ), 294 | locale( 295 | region="Asia", 296 | location="Nicosia", 297 | locales="el_CY.UTF-8 UTF-8", 298 | ), 299 | locale( 300 | region="Asia", 301 | location="Novokuznetsk", 302 | locales="ru_RU.UTF-8 UTF-8", 303 | ), 304 | locale( 305 | region="Asia", 306 | location="Novosibirsk", 307 | locales="ru_RU.UTF-8 UTF-8", 308 | ), 309 | locale( 310 | region="Asia", 311 | location="Omsk", 312 | locales="ru_RU.UTF-8 UTF-8", 313 | ), 314 | locale( 315 | region="Asia", 316 | location="Oral", 317 | locales="ru_RU.UTF-8 UTF-8", 318 | ), 319 | locale( 320 | region="Asia", 321 | location="Phnom_Penh", 322 | locales="kh_KH.UTF-8 UTF-8", 323 | ), 324 | locale( 325 | region="Asia", 326 | location="Pontianak", 327 | locales="id_ID.UTF-8 UTF-8", 328 | ), 329 | locale( 330 | region="Asia", 331 | location="Pyongyang", 332 | locales="ko_KP.UTF-8 UTF-8", 333 | ), 334 | locale( 335 | region="Asia", 336 | location="Qatar", 337 | locales="ar_QA.UTF-8 UTF-8", 338 | ), 339 | locale( 340 | region="Asia", 341 | location="Qostanay", 342 | locales="kk_KZ.UTF-8 UTF-8", 343 | ), 344 | locale( 345 | region="Asia", 346 | location="Qyzylorda", 347 | locales="kk_KZ.UTF-8 UTF-8", 348 | ), 349 | locale( 350 | region="Asia", 351 | location="Rangoon", 352 | locales="my_MM.UTF-8 UTF-8", 353 | ), 354 | locale( 355 | region="Asia", 356 | location="Riyadh", 357 | locales="ar_SA.UTF-8 UTF-8", 358 | ), 359 | locale( 360 | region="Asia", 361 | location="Saigon", 362 | locales="vi_VN.UTF-8 UTF-8", 363 | ), 364 | locale( 365 | region="Asia", 366 | location="Sakhalin", 367 | locales="ru_RU.UTF-8 UTF-8", 368 | ), 369 | locale( 370 | region="Asia", 371 | location="Samarkand", 372 | locales="uz_UZ.UTF-8 UTF-8", 373 | ), 374 | locale( 375 | region="Asia", 376 | location="Seoul", 377 | locales="ko_KR.UTF-8 UTF-8", 378 | ), 379 | locale( 380 | region="Asia", 381 | location="Shanghai", 382 | locales="zh_CN.UTF-8 UTF-8", 383 | ), 384 | locale( 385 | region="Asia", 386 | location="Singapore", 387 | locales="en_SG.UTF-8 UTF-8", 388 | ), 389 | locale( 390 | region="Asia", 391 | location="Srednekolymsk", 392 | locales="ru_RU.UTF-8 UTF-8", 393 | ), 394 | locale( 395 | region="Asia", 396 | location="Taipei", 397 | locales="zh_TW.UTF-8 UTF-8", 398 | ), 399 | locale( 400 | region="Asia", 401 | location="Tashkent", 402 | locales="uz_UZ.UTF-8 UTF-8", 403 | ), 404 | locale( 405 | region="Asia", 406 | location="Tbilisi", 407 | locales="ka_GE.UTF-8 UTF-8", 408 | ), 409 | locale( 410 | region="Asia", 411 | location="Tehran", 412 | locales="fa_IR.UTF-8 UTF-8", 413 | ), 414 | locale( 415 | region="Asia", 416 | location="Tel_Aviv", 417 | locales="he_IL.UTF-8 UTF-8", 418 | ), 419 | locale( 420 | region="Asia", 421 | location="Thimbu", 422 | locales="ne_NP.UTF-8 UTF-8", 423 | ), 424 | locale( 425 | region="Asia", 426 | location="Thimphu", 427 | locales="ne_NP.UTF-8 UTF-8", 428 | ), 429 | locale( 430 | region="Asia", 431 | location="Tokyo", 432 | locales="ja_JP.UTF-8 UTF-8", 433 | ), 434 | locale( 435 | region="Asia", 436 | location="Tomsk", 437 | locales="ru_RU.UTF-8 UTF-8", 438 | ), 439 | locale( 440 | region="Asia", 441 | location="Ujung_Pandang", 442 | locales="id_ID.UTF-8 UTF-8", 443 | ), 444 | locale( 445 | region="Asia", 446 | location="Ulaanbaatar", 447 | locales="mn_MN.UTF-8 UTF-8", 448 | ), 449 | locale( 450 | region="Asia", 451 | location="Ulan_Bator", 452 | locales="mn_MN.UTF-8 UTF-8", 453 | ), 454 | locale( 455 | region="Asia", 456 | location="Urumqi", 457 | locales="zh_CN.UTF-8 UTF-8", 458 | ), 459 | locale( 460 | region="Asia", 461 | location="Ust-Nera", 462 | locales="ru_RU.UTF-8 UTF-8", 463 | ), 464 | locale( 465 | region="Asia", 466 | location="Vientiane", 467 | locales="vi_VN.UTF-8 UTF-8", 468 | ), 469 | locale( 470 | region="Asia", 471 | location="Vladivostok", 472 | locales="ru_RU.UTF-8 UTF-8", 473 | ), 474 | locale( 475 | region="Asia", 476 | location="Yakutsk", 477 | locales="ru_RU.UTF-8 UTF-8", 478 | ), 479 | locale( 480 | region="Asia", 481 | location="Yangon", 482 | locales="my_MM.UTF-8 UTF-8", 483 | ), 484 | locale( 485 | region="Asia", 486 | location="Yekaterinburg", 487 | locales="ru_RU.UTF-8 UTF-8", 488 | ), 489 | locale( 490 | region="Asia", 491 | location="Yerevan", 492 | locales="hy_AM.UTF-8 UTF-8", 493 | ), 494 | ] 495 | 496 | -------------------------------------------------------------------------------- /src/locales/atlantic.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | atlantic = [ 4 | locale( 5 | region="atlantic", 6 | location="Azores", 7 | locales="pt_PT.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="atlantic", 11 | location="Bermuda", 12 | locales="en_GB.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="atlantic", 16 | location="Canary", 17 | locales="es_ES.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="atlantic", 21 | location="Cape_Verde", 22 | locales="pt_PT.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="atlantic", 26 | location="Faeroe", 27 | locales="en_GB.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="atlantic", 31 | location="Faroe", 32 | locales="en_GB.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="atlantic", 36 | location="Jan_Mayen", 37 | locales="nb_NO.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="atlantic", 41 | location="Madeira", 42 | locales="pt_PT.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="atlantic", 46 | location="Reykjavik", 47 | locales="is_IS.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="atlantic", 51 | location="South_Georgia", 52 | locales="en_GB.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="atlantic", 56 | location="Stanley", 57 | locales="en_GB.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="atlantic", 61 | location="St_Helena", 62 | locales="en_GB.UTF-8 UTF-8", 63 | ), 64 | ] 65 | 66 | -------------------------------------------------------------------------------- /src/locales/australia.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | australia = [ 4 | locale( 5 | region="Australia", 6 | location="Adelaide", 7 | locales="en_AU.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Australia", 11 | location="Brisbane", 12 | locales="en_AU.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Australia", 16 | location="Broken_Hill", 17 | locales="en_AU.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Australia", 21 | location="Canberra", 22 | locales="en_AU.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Australia", 26 | location="Currie", 27 | locales="en_AU.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Australia", 31 | location="Darwin", 32 | locales="en_AU.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Australia", 36 | location="Eucla", 37 | locales="en_AU.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Australia", 41 | location="Hobart", 42 | locales="en_AU.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Australia", 46 | location="Lindeman", 47 | locales="en_AU.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Australia", 51 | location="Lord_Howe", 52 | locales="en_AU.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Australia", 56 | location="Melbourne", 57 | locales="en_AU.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Australia", 61 | location="Perth", 62 | locales="en_AU.UTF-8 UTF-8", 63 | ), 64 | locale( 65 | region="Australia", 66 | location="Queensland", 67 | locales="en_AU.UTF-8 UTF-8", 68 | ), 69 | locale( 70 | region="Australia", 71 | location="Sydney", 72 | locales="en_AU.UTF-8 UTF-8", 73 | ), 74 | locale( 75 | region="Australia", 76 | location="Tasmania", 77 | locales="en_AU.UTF-8 UTF-8", 78 | ), 79 | locale( 80 | region="Australia", 81 | location="Victoria", 82 | locales="en_AU.UTF-8 UTF-8", 83 | ), 84 | locale( 85 | region="Australia", 86 | location="Yancowinna", 87 | locales="en_AU.UTF-8 UTF-8", 88 | ), 89 | ] 90 | 91 | -------------------------------------------------------------------------------- /src/locales/brazil.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | brazil = [ 4 | locale( 5 | region="Brazil", 6 | location="Acre", 7 | locales="pt_BR.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Brazil", 11 | location="DeNoronha", 12 | locales="pt_BR.UTF-8 UTF-8", 13 | ), 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /src/locales/canada.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | canada = [ 4 | locale( 5 | region="canada", 6 | location="Atlantic", 7 | locales="en_CA.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="canada", 11 | location="Central", 12 | locales="en_CA.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="canada", 16 | location="Eastern", 17 | locales="en_CA.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="canada", 21 | location="Mountain", 22 | locales="en_CA.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="canada", 26 | location="Newfoundland", 27 | locales="en_CA.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="canada", 31 | location="Pacific", 32 | locales="en_CA.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="canada", 36 | location="Yukon", 37 | locales="en_CA.UTF-8 UTF-8", 38 | ), 39 | ] 40 | 41 | -------------------------------------------------------------------------------- /src/locales/chile.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | chile = [ 4 | locale( 5 | region="Chile", 6 | location="Continental", 7 | locales="es_CL.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Chile", 11 | location="EasterIsland", 12 | locales="es_CL.UTF-8 UTF-8", 13 | ), 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /src/locales/europe.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | europe = [ 4 | locale( 5 | region="Europe", 6 | location="Amsterdam", 7 | locales="nl_NL.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Europe", 11 | location="Andorra", 12 | locales="ca_ES.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Europe", 16 | location="Athens", 17 | locales="el_GR.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Europe", 21 | location="Belfast", 22 | locales="en_GB.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Europe", 26 | location="Belgrade", 27 | locales="sr_RS.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Europe", 31 | location="Berlin", 32 | locales="de_DE.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Europe", 36 | location="Bratislava", 37 | locales="sk_SK.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Europe", 41 | location="Brussels", 42 | locales="nl_BE.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Europe", 46 | location="Bucharest", 47 | locales="ro_RO.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Europe", 51 | location="Budapest", 52 | locales="hu_HU.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Europe", 56 | location="Busingen", 57 | locales="de_DE.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Europe", 61 | location="Chisinau", 62 | locales="ro_RO.UTF-8 UTF-8", 63 | ), 64 | locale( 65 | region="Europe", 66 | location="Copenhagen", 67 | locales="da_DK.UTF-8 UTF-8", 68 | ), 69 | locale( 70 | region="Europe", 71 | location="Dublin", 72 | locales="en_IE.UTF-8 UTF-8", 73 | ), 74 | locale( 75 | region="Europe", 76 | location="Gibraltar", 77 | locales="en_GB.UTF-8 UTF-8", 78 | ), 79 | locale( 80 | region="Europe", 81 | location="Guernsey", 82 | locales="en_GB.UTF-8 UTF-8", 83 | ), 84 | locale( 85 | region="Europe", 86 | location="Helsinki", 87 | locales="fi_FI.UTF-8 UTF-8", 88 | ), 89 | locale( 90 | region="Europe", 91 | location="Isle_of_Man", 92 | locales="en_IM.UTF-8 UTF-8", 93 | ), 94 | locale( 95 | region="Europe", 96 | location="Istanbul", 97 | locales="tr_TR.UTF-8 UTF-8", 98 | ), 99 | locale( 100 | region="Europe", 101 | location="Jersey", 102 | locales="en_GB.UTF-8 UTF-8", 103 | ), 104 | locale( 105 | region="Europe", 106 | location="Kaliningrad", 107 | locales="ru_RU.UTF-8 UTF-8", 108 | ), 109 | locale( 110 | region="Europe", 111 | location="Kiev", 112 | locales="uk_UA.UTF-8 UTF-8", 113 | ), 114 | locale( 115 | region="Europe", 116 | location="Kirov", 117 | locales="ru_RU.UTF-8 UTF-8", 118 | ), 119 | locale( 120 | region="Europe", 121 | location="Lisbon", 122 | locales="pt_PT.UTF-8 UTF-8", 123 | ), 124 | locale( 125 | region="Europe", 126 | location="Ljubljana", 127 | locales="sl_SI.UTF-8 UTF-8", 128 | ), 129 | locale( 130 | region="Europe", 131 | location="London", 132 | locales="en_GB.UTF-8 UTF-8", 133 | ), 134 | locale( 135 | region="Europe", 136 | location="Luxembourg", 137 | locales="fr_LU.UTF-8 UTF-8", 138 | ), 139 | locale( 140 | region="Europe", 141 | location="Madrid", 142 | locales="es_ES.UTF-8 UTF-8", 143 | ), 144 | locale( 145 | region="Europe", 146 | location="Malta", 147 | locales="en_GB.UTF-8 UTF-8", 148 | ), 149 | locale( 150 | region="Europe", 151 | location="Mariehamn", 152 | locales="sv_SE.UTF-8 UTF-8", 153 | ), 154 | locale( 155 | region="Europe", 156 | location="Minsk", 157 | locales="be_BY.UTF-8 UTF-8", 158 | ), 159 | locale( 160 | region="Europe", 161 | location="Monaco", 162 | locales="fr_FR.UTF-8 UTF-8", 163 | ), 164 | locale( 165 | region="Europe", 166 | location="Moscow", 167 | locales="ru_RU.UTF-8 UTF-8", 168 | ), 169 | locale( 170 | region="Europe", 171 | location="Nicosia", 172 | locales="el_GR.UTF-8 UTF-8", 173 | ), 174 | locale( 175 | region="Europe", 176 | location="Oslo", 177 | locales="no_NO.UTF-8 UTF-8", 178 | ), 179 | locale( 180 | region="Europe", 181 | location="Paris", 182 | locales="fr_FR.UTF-8 UTF-8", 183 | ), 184 | locale( 185 | region="Europe", 186 | location="Podgorica", 187 | locales="sr_RS.UTF-8 UTF-8", 188 | ), 189 | locale( 190 | region="Europe", 191 | location="Prague", 192 | locales="cs_CZ.UTF-8 UTF-8", 193 | ), 194 | locale( 195 | region="Europe", 196 | location="Riga", 197 | locales="lv_LV.UTF-8 UTF-8", 198 | ), 199 | locale( 200 | region="Europe", 201 | location="Rome", 202 | locales="it_IT.UTF-8 UTF-8", 203 | ), 204 | locale( 205 | region="Europe", 206 | location="Samara", 207 | locales="ru_RU.UTF-8 UTF-8", 208 | ), 209 | locale( 210 | region="Europe", 211 | location="San_Marino", 212 | locales="it_IT.UTF-8 UTF-8", 213 | ), 214 | locale( 215 | region="Europe", 216 | location="Sarajevo", 217 | locales="bs_BA.UTF-8 UTF-8", 218 | ), 219 | locale( 220 | region="Europe", 221 | location="Saratov", 222 | locales="ru_RU.UTF-8 UTF-8", 223 | ), 224 | locale( 225 | region="Europe", 226 | location="Simferopol", 227 | locales="ru_RU.UTF-8 UTF-8", 228 | ), 229 | locale( 230 | region="Europe", 231 | location="Skopje", 232 | locales="mk_MK.UTF-8 UTF-8", 233 | ), 234 | locale( 235 | region="Europe", 236 | location="Sofia", 237 | locales="bg_BG.UTF-8 UTF-8", 238 | ), 239 | locale( 240 | region="Europe", 241 | location="Stockholm", 242 | locales="sv_SE.UTF-8 UTF-8", 243 | ), 244 | locale( 245 | region="Europe", 246 | location="Tallinn", 247 | locales="et_EE.UTF-8 UTF-8", 248 | ), 249 | locale( 250 | region="Europe", 251 | location="Tirane", 252 | locales="sq_AL.UTF-8 UTF-8", 253 | ), 254 | locale( 255 | region="Europe", 256 | location="Tiraspol", 257 | locales="ro_RO.UTF-8 UTF-8", 258 | ), 259 | locale( 260 | region="Europe", 261 | location="Ulyanovsk", 262 | locales="ru_RU.UTF-8 UTF-8", 263 | ), 264 | locale( 265 | region="Europe", 266 | location="Uzhgorod", 267 | locales="uk_UA.UTF-8 UTF-8", 268 | ), 269 | locale( 270 | region="Europe", 271 | location="Vaduz", 272 | locales="de_AT.UTF-8 UTF-8", 273 | ), 274 | locale( 275 | region="Europe", 276 | location="Vatican", 277 | locales="it_IT.UTF-8 UTF-8", 278 | ), 279 | locale( 280 | region="Europe", 281 | location="Vienna", 282 | locales="de_AT.UTF-8 UTF-8", 283 | ), 284 | locale( 285 | region="Europe", 286 | location="Vilnius", 287 | locales="lt_LT.UTF-8 UTF-8", 288 | ), 289 | locale( 290 | region="Europe", 291 | location="Volgograd", 292 | locales="ru_RU.UTF-8 UTF-8", 293 | ), 294 | locale( 295 | region="Europe", 296 | location="Warsaw", 297 | locales="pl_PL.UTF-8 UTF-8", 298 | ), 299 | locale( 300 | region="Europe", 301 | location="Zagreb", 302 | locales="hr_HR.UTF-8 UTF-8", 303 | ), 304 | locale( 305 | region="Europe", 306 | location="Zaporozhye", 307 | locales="uk_UA.UTF-8 UTF-8", 308 | ), 309 | locale( 310 | region="Europe", 311 | location="Zurich", 312 | locales="de_CH.UTF-8 UTF-8", 313 | ), 314 | ] 315 | 316 | -------------------------------------------------------------------------------- /src/locales/indian.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | indian = [ 4 | locale( 5 | region="Indian", 6 | location="Antananarivo", 7 | locales="fr_MG.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Indian", 11 | location="Chagos", 12 | locales="en_IO.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Indian", 16 | location="Christmas", 17 | locales="en_CX.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Indian", 21 | location="Cocos", 22 | locales="en_CC.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Indian", 26 | location="Comoro", 27 | locales="fr_KM.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Indian", 31 | location="Kerguelen", 32 | locales="fr_TF.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Indian", 36 | location="Mahe", 37 | locales="en_SC.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Indian", 41 | location="Maldives", 42 | locales="en_MV.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Indian", 46 | location="Mauritius", 47 | locales="en_MU.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Indian", 51 | location="Mayotte", 52 | locales="fr_YT.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Indian", 56 | location="Reunion", 57 | locales="fr_RE.UTF-8 UTF-8", 58 | ), 59 | ] 60 | 61 | -------------------------------------------------------------------------------- /src/locales/locales_list.py: -------------------------------------------------------------------------------- 1 | # locales.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | from jade_gui.locales.africa import africa 20 | from jade_gui.locales.america import america 21 | from jade_gui.locales.antarctica import antarctica 22 | from jade_gui.locales.arctic import arctic 23 | from jade_gui.locales.asia import asia 24 | from jade_gui.locales.atlantic import atlantic 25 | from jade_gui.locales.australia import australia 26 | from jade_gui.locales.brazil import brazil 27 | from jade_gui.locales.canada import canada 28 | from jade_gui.locales.chile import chile 29 | from jade_gui.locales.europe import europe 30 | from jade_gui.locales.indian import indian 31 | from jade_gui.locales.mexico import mexico 32 | from jade_gui.locales.pacific import pacific 33 | 34 | locations = [ 35 | africa, 36 | america, 37 | antarctica, 38 | arctic, 39 | asia, 40 | atlantic, 41 | australia, 42 | brazil, 43 | canada, 44 | chile, 45 | europe, 46 | indian, 47 | mexico, 48 | pacific 49 | ] 50 | 51 | -------------------------------------------------------------------------------- /src/locales/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | localesdir = join_paths(pkgdatadir, 'jade_gui/locales') 3 | 4 | jade_gui_sources = [ 5 | '__init__.py', 6 | 'africa.py', 7 | 'america.py', 8 | 'antarctica.py', 9 | 'arctic.py', 10 | 'asia.py', 11 | 'atlantic.py', 12 | 'australia.py', 13 | 'brazil.py', 14 | 'canada.py', 15 | 'chile.py', 16 | 'europe.py', 17 | 'indian.py', 18 | 'mexico.py', 19 | 'pacific.py', 20 | 'locales_list.py', 21 | ] 22 | install_data(jade_gui_sources, install_dir: localesdir) -------------------------------------------------------------------------------- /src/locales/mexico.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | mexico = [ 4 | locale( 5 | region="Mexico", 6 | location="BajaNorte", 7 | locales="es_MX.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Mexico", 11 | location="BajaSur", 12 | locales="es_MX.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Mexico", 16 | location="General", 17 | locales="es_MX.UTF-8 UTF-8", 18 | ), 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /src/locales/pacific.py: -------------------------------------------------------------------------------- 1 | from jade_gui.classes.locale import locale 2 | 3 | pacific = [ 4 | locale( 5 | region="Pacific", 6 | location="Apia", 7 | locales="en_WS.UTF-8 UTF-8", 8 | ), 9 | locale( 10 | region="Pacific", 11 | location="Auckland", 12 | locales="en_NZ.UTF-8 UTF-8", 13 | ), 14 | locale( 15 | region="Pacific", 16 | location="Bougainville", 17 | locales="en_PG.UTF-8 UTF-8", 18 | ), 19 | locale( 20 | region="Pacific", 21 | location="Chatham", 22 | locales="en_NZ.UTF-8 UTF-8", 23 | ), 24 | locale( 25 | region="Pacific", 26 | location="Chuuk", 27 | locales="en_FM.UTF-8 UTF-8", 28 | ), 29 | locale( 30 | region="Pacific", 31 | location="Easter", 32 | locales="en_CL.UTF-8 UTF-8", 33 | ), 34 | locale( 35 | region="Pacific", 36 | location="Efate", 37 | locales="en_VU.UTF-8 UTF-8", 38 | ), 39 | locale( 40 | region="Pacific", 41 | location="Enderbury", 42 | locales="en_KI.UTF-8 UTF-8", 43 | ), 44 | locale( 45 | region="Pacific", 46 | location="Fakaofo", 47 | locales="en_TK.UTF-8 UTF-8", 48 | ), 49 | locale( 50 | region="Pacific", 51 | location="Fiji", 52 | locales="en_FJ.UTF-8 UTF-8", 53 | ), 54 | locale( 55 | region="Pacific", 56 | location="Funafuti", 57 | locales="en_TV.UTF-8 UTF-8", 58 | ), 59 | locale( 60 | region="Pacific", 61 | location="Galapagos", 62 | locales="en_EC.UTF-8 UTF-8", 63 | ), 64 | locale( 65 | region="Pacific", 66 | location="Gambier", 67 | locales="en_PF.UTF-8 UTF-8", 68 | ), 69 | locale( 70 | region="Pacific", 71 | location="Guadalcanal", 72 | locales="en_SB.UTF-8 UTF-8", 73 | ), 74 | locale( 75 | region="Pacific", 76 | location="Guam", 77 | locales="en_GU.UTF-8 UTF-8", 78 | ), 79 | locale( 80 | region="Pacific", 81 | location="Honolulu", 82 | locales="en_US.UTF-8 UTF-8", 83 | ), 84 | locale( 85 | region="Pacific", 86 | location="Johnston", 87 | locales="en_UM.UTF-8 UTF-8", 88 | ), 89 | locale( 90 | region="Pacific", 91 | location="Kiritimati", 92 | locales="en_KI.UTF-8 UTF-8", 93 | ), 94 | locale( 95 | region="Pacific", 96 | location="Kosrae", 97 | locales="en_FM.UTF-8 UTF-8", 98 | ), 99 | locale( 100 | region="Pacific", 101 | location="Kwajalein", 102 | locales="en_MH.UTF-8 UTF-8", 103 | ), 104 | locale( 105 | region="Pacific", 106 | location="Majuro", 107 | locales="en_MH.UTF-8 UTF-8", 108 | ), 109 | locale( 110 | region="Pacific", 111 | location="Marquesas", 112 | locales="en_PF.UTF-8 UTF-8", 113 | ), 114 | locale( 115 | region="Pacific", 116 | location="Midway", 117 | locales="en_UM.UTF-8 UTF-8", 118 | ), 119 | locale( 120 | region="Pacific", 121 | location="Nauru", 122 | locales="en_NR.UTF-8 UTF-8", 123 | ), 124 | locale( 125 | region="Pacific", 126 | location="Niue", 127 | locales="en_NU.UTF-8 UTF-8", 128 | ), 129 | locale( 130 | region="Pacific", 131 | location="Norfolk", 132 | locales="en_NF.UTF-8 UTF-8", 133 | ), 134 | locale( 135 | region="Pacific", 136 | location="Noumea", 137 | locales="en_NC.UTF-8 UTF-8", 138 | ), 139 | locale( 140 | region="Pacific", 141 | location="Pago_Pago", 142 | locales="en_AS.UTF-8 UTF-8", 143 | ), 144 | locale( 145 | region="Pacific", 146 | location="Palau", 147 | locales="en_PW.UTF-8 UTF-8", 148 | ), 149 | locale( 150 | region="Pacific", 151 | location="Pitcairn", 152 | locales="en_PN.UTF-8 UTF-8", 153 | ), 154 | locale( 155 | region="Pacific", 156 | location="Pohnpei", 157 | locales="en_FM.UTF-8 UTF-8", 158 | ), 159 | locale( 160 | region="Pacific", 161 | location="Ponape", 162 | locales="en_FM.UTF-8 UTF-8", 163 | ), 164 | locale( 165 | region="Pacific", 166 | location="Port_Moresby", 167 | locales="en_PG.UTF-8 UTF-8", 168 | ), 169 | locale( 170 | region="Pacific", 171 | location="Rarotonga", 172 | locales="en_CK.UTF-8 UTF-8", 173 | ), 174 | locale( 175 | region="Pacific", 176 | location="Saipan", 177 | locales="en_MP.UTF-8 UTF-8", 178 | ), 179 | locale( 180 | region="Pacific", 181 | location="Samoa", 182 | locales="en_AS.UTF-8 UTF-8", 183 | ), 184 | locale( 185 | region="Pacific", 186 | location="Tahiti", 187 | locales="en_PF.UTF-8 UTF-8", 188 | ), 189 | locale( 190 | region="Pacific", 191 | location="Tarawa", 192 | locales="en_KI.UTF-8 UTF-8", 193 | ), 194 | locale( 195 | region="Pacific", 196 | location="Tongatapu", 197 | locales="en_TO.UTF-8 UTF-8", 198 | ), 199 | locale( 200 | region="Pacific", 201 | location="Truk", 202 | locales="en_FM.UTF-8 UTF-8", 203 | ), 204 | locale( 205 | region="Pacific", 206 | location="Wake", 207 | locales="en_UM.UTF-8 UTF-8", 208 | ), 209 | locale( 210 | region="Pacific", 211 | location="Wallis", 212 | locales="en_WF.UTF-8 UTF-8", 213 | ), 214 | locale( 215 | region="Pacific", 216 | location="Yap", 217 | locales="en_FM.UTF-8 UTF-8", 218 | ), 219 | ] 220 | 221 | -------------------------------------------------------------------------------- /src/main.py: -------------------------------------------------------------------------------- 1 | # main.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | import sys 21 | import gi 22 | 23 | gi.require_version('Gtk', '4.0') 24 | gi.require_version('Adw', '1') 25 | 26 | from gi.repository import Gtk, Gio, Adw 27 | from jade_gui.window import JadeGuiWindow 28 | 29 | 30 | class Jade_guiApplication(Adw.Application): 31 | """The main application singleton class.""" 32 | 33 | def __init__(self): 34 | super().__init__(application_id='al.getcryst.jadegui', 35 | flags=Gio.ApplicationFlags.FLAGS_NONE) 36 | self.create_action('quit', self.quit, ['q']) 37 | self.create_action('about', self.on_about_action) 38 | self.create_action('preferences', self.on_preferences_action) 39 | 40 | def do_activate(self): 41 | """Called when the application is activated. 42 | 43 | We raise the application's main window, creating it if 44 | necessary. 45 | """ 46 | win = self.props.active_window 47 | if not win: 48 | win = JadeGuiWindow(application=self) 49 | win.present() 50 | 51 | def on_about_action(self, widget, _): 52 | """Callback for the app.about action.""" 53 | about = AboutDialog(self.props.active_window) 54 | about.present() 55 | 56 | def on_preferences_action(self, widget, _): 57 | """Callback for the app.preferences action.""" 58 | print('app.preferences action activated') 59 | 60 | def create_action(self, name, callback, shortcuts=None): 61 | """Add an application action. 62 | 63 | Args: 64 | name: the name of the action 65 | callback: the function to be called when the action is activated 66 | shortcuts: an optional list of accelerators 67 | """ 68 | action = Gio.SimpleAction.new(name, None) 69 | action.connect("activate", callback) 70 | self.add_action(action) 71 | if shortcuts: 72 | self.set_accels_for_action(f"app.{name}", shortcuts) 73 | 74 | 75 | def main(version): 76 | """The application's entry point.""" 77 | app = Jade_guiApplication() 78 | return app.run(sys.argv) 79 | -------------------------------------------------------------------------------- /src/manualpartitioning.py: -------------------------------------------------------------------------------- 1 | filesystems = [ 2 | "don't format", 3 | "bfs", 4 | "cramfs", 5 | "ext3", 6 | "fat", 7 | "msdos", 8 | "xfs", 9 | "btrfs", 10 | "ext2", 11 | "ext4", 12 | "minix", 13 | "vfat", 14 | "f2fs" 15 | ] 16 | 17 | mountpoints = [ 18 | "none", 19 | "/", 20 | "/boot", 21 | "/boot/efi", 22 | "/home", 23 | "/opt", 24 | "/tmp", 25 | "/usr", 26 | "/var" 27 | ] 28 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | moduledir = join_paths(pkgdatadir, 'jade_gui') 3 | gnome = import('gnome') 4 | 5 | gnome.compile_resources('jade_gui_resources', 6 | 'resources.gresource.xml', 7 | gresource_bundle: true, 8 | install: true, 9 | install_dir: pkgdatadir, 10 | ) 11 | 12 | 13 | gnome.compile_resources('jade_gui', 14 | 'jade_gui.gresource.xml', 15 | gresource_bundle: true, 16 | install: true, 17 | install_dir: pkgdatadir, 18 | ) 19 | 20 | python = import('python') 21 | 22 | conf = configuration_data() 23 | conf.set('PYTHON', python.find_installation('python3').full_path()) 24 | conf.set('VERSION', meson.project_version()) 25 | conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) 26 | conf.set('pkgdatadir', pkgdatadir) 27 | 28 | configure_file( 29 | input: 'jade_gui.in', 30 | output: 'jade-gui', 31 | configuration: conf, 32 | install: true, 33 | install_dir: get_option('bindir') 34 | ) 35 | 36 | subdir('widgets') 37 | subdir('functions') 38 | subdir('classes') 39 | subdir('locales') 40 | subdir('utils') 41 | subdir('scripts') 42 | 43 | jade_gui_sources = [ 44 | '__init__.py', 45 | 'main.py', 46 | 'window.py', 47 | 'keymaps.py', 48 | 'desktops.py', 49 | 'manualpartitioning.py' 50 | ] 51 | 52 | install_data(jade_gui_sources, install_dir: moduledir) 53 | -------------------------------------------------------------------------------- /src/pages/desktop_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/pages/finished_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 42 | 43 | -------------------------------------------------------------------------------- /src/pages/install_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 53 | 54 | -------------------------------------------------------------------------------- /src/pages/keyboard_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/pages/language_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/pages/misc_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 95 | 96 | -------------------------------------------------------------------------------- /src/pages/partition_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | view-refresh-symbolic 6 | 9 | 10 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /src/pages/summary_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 249 | 250 | 251 | -------------------------------------------------------------------------------- /src/pages/timezone_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/pages/user_screen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ../data/icons/padlock2-symbolic.svg 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/scripts/checkEFI.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS -------------------------------------------------------------------------------- /src/scripts/getDiskName.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host lsblk -pdbo MODEL $1 | grep -v MODEL -------------------------------------------------------------------------------- /src/scripts/getDiskSize.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host lsblk -pdbo SIZE $1 | grep -v SIZE -------------------------------------------------------------------------------- /src/scripts/getDiskType.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host lsblk -d -o rota $1 | grep -v ROTA -------------------------------------------------------------------------------- /src/scripts/getDisks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr -------------------------------------------------------------------------------- /src/scripts/getPartitions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host blkid -o device | grep -v zram | grep -v loop | grep -v sr -------------------------------------------------------------------------------- /src/scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | echo "Running reflector to sort for fastest mirrors" 3 | pkexec reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist 4 | pkexec jade config ~/.config/jade.json 5 | -------------------------------------------------------------------------------- /src/scripts/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | scriptsdir = join_paths(pkgdatadir, 'jade_gui/scripts') 3 | 4 | jade_gui_sources = [ 5 | 'getDisks.sh', 6 | 'getDiskSize.sh', 7 | 'checkEFI.sh', 8 | 'install.sh', 9 | 'savePrefs.sh', 10 | 'getDiskType.sh', 11 | 'getDiskName.sh', 12 | 'getPartitions.sh', 13 | 'reboot.sh', 14 | 'openBash.sh', 15 | 'openGparted.sh', 16 | ] 17 | install_data(jade_gui_sources, install_dir: scriptsdir) -------------------------------------------------------------------------------- /src/scripts/openBash.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host gnome-terminal -- bash -------------------------------------------------------------------------------- /src/scripts/openGparted.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host pkexec gparted -------------------------------------------------------------------------------- /src/scripts/reboot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host gnome-session-quit --reboot -------------------------------------------------------------------------------- /src/scripts/savePrefs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | flatpak-spawn --host echo $1 > /tmp/jade.json -------------------------------------------------------------------------------- /src/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/utils/__init__.py -------------------------------------------------------------------------------- /src/utils/command.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | 4 | 5 | class CommandUtils: 6 | 7 | @staticmethod 8 | def run_command(command: list, flatpak_spawn: bool = None, output: bool = False, decode: bool = True): 9 | """ 10 | Keep flatpak_spawn as None to automatically assume its value based on 11 | whether the app is running in a flatpak or not. Set it to True or False 12 | to override this behavior. 13 | """ 14 | if flatpak_spawn is None and "FLATPAK_ID" in os.environ: 15 | flatpak_spawn = True 16 | 17 | if flatpak_spawn: 18 | command = ["flatpak-spawn", "--host"] + command 19 | 20 | if output: 21 | res = subprocess.check_output(command) 22 | if decode: 23 | res = res.decode("utf-8").strip() 24 | return res 25 | 26 | return subprocess.Popen(command, stdout=subprocess.PIPE) 27 | 28 | @staticmethod 29 | def check_output(command: list, flatpak_spawn: bool = None, decode: bool = True): 30 | """Just a wrapper for convenience""" 31 | return CommandUtils.run_command(command, flatpak_spawn, output=True, decode=decode) 32 | -------------------------------------------------------------------------------- /src/utils/disks.py: -------------------------------------------------------------------------------- 1 | # exec.py 2 | # 3 | # Copyright 2022 axtlos 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # SPDX-License-Identifier: GPL-3.0-only 19 | 20 | import subprocess 21 | import math, shutil 22 | from jade_gui.utils.command import CommandUtils 23 | 24 | 25 | bash_bin = shutil.which("bash") 26 | 27 | def get_disks(): 28 | output = CommandUtils.check_output(['lsblk', '-pdo', 'name']) 29 | output = output.split() 30 | output = [x for x in output if 'zram' not in x] 31 | output = [x for x in output if 'NAME' not in x] 32 | output = [x for x in output if 'loop' not in x] 33 | output = [x for x in output if 'sr' not in x] 34 | output = [x for x in output if 'fd' not in x] 35 | return output 36 | 37 | def get_disk_size(disk: str): 38 | output = CommandUtils.check_output(['lsblk', '-pdbo', 'SIZE', disk]) 39 | output = output.split() 40 | output = [x for x in output if 'SIZE' not in x] 41 | 42 | if len(output) == 0: 43 | print(f"No disk found with name: {disk}, assuming zero.") 44 | size = "0" 45 | else: 46 | size = output[0] 47 | 48 | print(disk+":"+size) 49 | return str(math.floor(int(size)/1000**3))+" GB" 50 | 51 | def get_uefi(): 52 | command=subprocess.run(["bash", "-c", "[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS"], capture_output=True) 53 | isEfi=True if command.stdout.decode('utf-8').strip('\n') == "UEFI" else False 54 | return isEfi 55 | 56 | def get_disk_type(disk: str): 57 | output = CommandUtils.check_output(['lsblk', '-d', '-o', 'rota', disk]) 58 | output = output.split() 59 | output = [x for x in output if 'ROTA' not in x] 60 | 61 | if len(output) > 0: 62 | if output[0] == "0": 63 | return "Solid-State Drive (SSD)" 64 | elif output[0] == "1": 65 | return "Hard Disk (HDD)" # maybe Rotational Drive? 66 | 67 | print(f"No disk found with name: {disk}, assuming unknown.") 68 | return "Drive type unknown" 69 | 70 | def get_partitions(): 71 | output = CommandUtils.check_output(['blkid', '-o', 'device']) 72 | output = output.split() 73 | output = [x for x in output if 'zram' not in x] 74 | output = [x for x in output if 'loop' not in x] 75 | output = [x for x in output if 'sr' not in x] 76 | return output 77 | -------------------------------------------------------------------------------- /src/utils/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | utilsdir = join_paths(pkgdatadir, 'jade_gui/utils') 3 | 4 | jade_gui_sources = [ 5 | '__init__.py', 6 | 'disks.py', 7 | 'threading.py', 8 | 'command.py', 9 | ] 10 | install_data(jade_gui_sources, install_dir: utilsdir) -------------------------------------------------------------------------------- /src/utils/threading.py: -------------------------------------------------------------------------------- 1 | # This file was taken from bottles with the permission from brombinmirko 2 | # 3 | # threading.py 4 | # 5 | # Copyright 2022 brombinmirko 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, in version 3 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | import os 20 | import sys 21 | import threading 22 | import traceback 23 | 24 | from gettext import gettext as _ 25 | 26 | from gi.repository import GLib 27 | 28 | 29 | 30 | class RunAsync(threading.Thread): 31 | """ 32 | This class is used to execute a function asynchronously. 33 | It takes a function, a callback and a list of arguments as input. 34 | """ 35 | 36 | def __init__(self, task_func, callback=None, *args, **kwargs): 37 | if "DEBUG_MODE" in os.environ: 38 | import faulthandler 39 | faulthandler.enable() 40 | 41 | self.source_id = None 42 | assert threading.current_thread() is threading.main_thread() 43 | 44 | super(RunAsync, self).__init__( 45 | target=self.__target, args=args, kwargs=kwargs) 46 | 47 | self.task_func = task_func 48 | 49 | self.callback = callback if callback else lambda r, e: None 50 | self.daemon = kwargs.pop("daemon", True) 51 | 52 | self.start() 53 | 54 | def __target(self, *args, **kwargs): 55 | result = None 56 | error = None 57 | 58 | print(f"DEBUG: Running async job [{self.task_func}].") 59 | 60 | try: 61 | result = self.task_func(*args, **kwargs) 62 | except Exception as exception: 63 | print("ERROR: while running async job: " 64 | f"{self.task_func}\nException: {exception}") 65 | 66 | error = exception 67 | _ex_type, _ex_value, trace = sys.exc_info() 68 | traceback.print_tb(trace) 69 | traceback_info = '\n'.join(traceback.format_tb(trace)) 70 | 71 | print([str(exception), traceback_info]) 72 | self.source_id = GLib.idle_add(self.callback, result, error) 73 | return self.source_id 74 | 75 | -------------------------------------------------------------------------------- /src/widgets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystal-linux/jade-gui/35d61c79b007f5bb4284aa691ba10d56690bfc20/src/widgets/__init__.py -------------------------------------------------------------------------------- /src/widgets/desktop.py: -------------------------------------------------------------------------------- 1 | # desktop.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from gi.repository import Gtk, GLib, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/desktop.ui') 24 | class DesktopEntry(Adw.ActionRow): 25 | __gtype_name__ = 'DesktopEntry' 26 | 27 | select_button = Gtk.Template.Child() 28 | 29 | def __init__(self, window, desktop, button_group, application, **kwargs): 30 | super().__init__(**kwargs) 31 | self.window = window 32 | self.set_title(desktop) 33 | self.select_button.set_group(button_group) 34 | self.select_button.connect("toggled", self.toggled_cb) 35 | 36 | def toggled_cb(self, check_button): 37 | if check_button.props.active: 38 | row = check_button.get_ancestor(Gtk.ListBoxRow) 39 | row.activate() 40 | self.selected_partition = row.get_title() 41 | self.window.desktop_screen.selected_desktop(self, row) 42 | -------------------------------------------------------------------------------- /src/widgets/desktop.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /src/widgets/disk.py: -------------------------------------------------------------------------------- 1 | # disk.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from gi.repository import Gtk, GLib, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/disk.ui') 24 | class DiskEntry(Adw.ActionRow): 25 | __gtype_name__ = 'DiskEntry' 26 | 27 | size_label = Gtk.Template.Child() 28 | select_button = Gtk.Template.Child() 29 | 30 | def __init__(self, window, disk, disk_size, disk_type, button_group, application, **kwargs): 31 | super().__init__(**kwargs) 32 | self.window = window 33 | self.disk = disk 34 | self.disk_size = disk_size 35 | self.disk_type = disk_type 36 | self.set_title(disk[5:]) 37 | self.set_subtitle(disk_type) 38 | self.size_label.set_label("Disk Size: "+disk_size) 39 | if button_group is not None: 40 | self.select_button.set_group(button_group) 41 | else: 42 | self.select_button.set_active(True) 43 | self.select_button.connect("toggled", self.toggled_cb) 44 | 45 | def toggled_cb(self, check_button): 46 | row = check_button.get_ancestor(Gtk.ListBoxRow) 47 | if check_button.props.active and len(self.window.available_disks) != 1: 48 | row.emit('activate') 49 | self.window.partition_screen.selected_partition = self 50 | self.window.partition_screen.next_page_button.set_sensitive(True) 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/widgets/disk.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 35 | 36 | -------------------------------------------------------------------------------- /src/widgets/layout.py: -------------------------------------------------------------------------------- 1 | # layout.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from gi.repository import Gtk, GLib, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/layout.ui') 24 | class KeyboardLayout(Adw.ExpanderRow): 25 | __gtype_name__ = 'KeyboardLayout' 26 | 27 | variants=[] 28 | 29 | def __init__(self, window, country, country_shorthand, variants, application, **kwargs): 30 | super().__init__(**kwargs) 31 | self.window=window 32 | self.country = country 33 | self.country_shorthand = country_shorthand 34 | 35 | self.set_title(country) 36 | self.set_subtitle(country_shorthand) 37 | self.variants = variants 38 | self.connect("activate", self.selected) 39 | 40 | def selected(self, widget): 41 | print("selected") 42 | self.window.keyboard_screen.selected_layout(widget=widget, row=self) 43 | -------------------------------------------------------------------------------- /src/widgets/layout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /src/widgets/meson.build: -------------------------------------------------------------------------------- 1 | pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) 2 | widgetsdir = join_paths(pkgdatadir, 'jade_gui/widgets') 3 | 4 | jade_gui_sources = [ 5 | '__init__.py', 6 | 'timezone.py', 7 | 'layout.py', 8 | 'variant.py', 9 | 'desktop.py', 10 | 'disk.py', 11 | 'partition.py' 12 | ] 13 | install_data(jade_gui_sources, install_dir: widgetsdir) -------------------------------------------------------------------------------- /src/widgets/partition.py: -------------------------------------------------------------------------------- 1 | # partition.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3 of the License only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | from gi.repository import Gtk, GLib, Adw 20 | from gettext import gettext as _ 21 | from jade_gui.manualpartitioning import filesystems, mountpoints 22 | from jade_gui.classes.partition import Partition 23 | 24 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/partition.ui') 25 | class PartitionEntry(Adw.ActionRow): 26 | __gtype_name__ = 'PartitionEntry' 27 | 28 | filesystem_dropdown = Gtk.Template.Child() 29 | mountpoint_dropdown = Gtk.Template.Child() 30 | 31 | def __init__(self, window, partition: Partition, application, **kwargs): 32 | super().__init__(**kwargs) 33 | self.window = window 34 | self.partition = partition 35 | self.partition.filesystem = filesystems[0] 36 | self.partition.mountpoint = mountpoints[0] 37 | self.set_title(self.partition.partition) 38 | self.set_subtitle(self.partition.size) 39 | for filesystem in filesystems: 40 | self.filesystem_dropdown.append(filesystem, filesystem) 41 | self.filesystem_dropdown.set_active(0) 42 | for mountpoint in mountpoints: 43 | self.mountpoint_dropdown.append(mountpoint, mountpoint) 44 | self.mountpoint_dropdown.set_active(0) 45 | self.filesystem_dropdown.connect("changed", self.on_filesystem_select) 46 | self.mountpoint_dropdown.connect("changed", self.on_mountpoint_select) 47 | 48 | def on_filesystem_select(self, widget): 49 | print("here") 50 | print(self.filesystem_dropdown.get_active_text()) 51 | self.partition.filesystem = self.filesystem_dropdown.get_active_text() 52 | print("select "+self.partition.generate_jade_entry()) 53 | 54 | def on_mountpoint_select(self, widget): 55 | print("here") 56 | self.partition.mountpoint = self.mountpoint_dropdown.get_active_text() 57 | print("select "+self.partition.generate_jade_entry()) 58 | -------------------------------------------------------------------------------- /src/widgets/partition.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 37 | -------------------------------------------------------------------------------- /src/widgets/timezone.py: -------------------------------------------------------------------------------- 1 | # timezone.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from datetime import datetime 21 | import pytz 22 | from gi.repository import Gtk, GLib, Adw 23 | from gettext import gettext as _ 24 | 25 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/timezone.ui') 26 | class TimezoneEntry(Adw.ActionRow): 27 | __gtype_name__ = 'TimezoneEntry' 28 | 29 | time_label = Gtk.Template.Child() 30 | 31 | def __init__(self, window, region, location, locale, application, **kwargs): 32 | super().__init__(**kwargs) 33 | 34 | self.region = region 35 | self.location = location 36 | self.locale = locale 37 | 38 | self.set_title(region+"/"+location) 39 | self.time_label.set_text(self.calculate_time(location=location, region=region)) 40 | 41 | def calculate_time(self, location, region): 42 | timezone = pytz.timezone(region+"/"+location) 43 | datetime_timezone = datetime.now(timezone) 44 | return datetime_timezone.strftime('%H:%M') 45 | -------------------------------------------------------------------------------- /src/widgets/timezone.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | -------------------------------------------------------------------------------- /src/widgets/variant.py: -------------------------------------------------------------------------------- 1 | # variant.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | from gi.repository import Gtk, GLib, Adw 21 | from gettext import gettext as _ 22 | 23 | @Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/variant.ui') 24 | class KeyboardVariant(Adw.ActionRow): 25 | __gtype_name__ = 'KeyboardVariant' 26 | 27 | select_variant = Gtk.Template.Child() 28 | 29 | def __init__(self, window, variant, country, country_shorthand, button_group, application, **kwargs): 30 | super().__init__(**kwargs) 31 | self.window=window 32 | self.variant = variant 33 | self.country = country 34 | self.country_shorthand = country_shorthand 35 | 36 | self.set_title(variant) 37 | self.set_subtitle(country+" - "+country_shorthand) 38 | self.select_variant.set_group(button_group) 39 | self.select_variant.connect("toggled", self.selected) 40 | 41 | def selected(self, widget): 42 | self.window.keyboard_screen.variant=self 43 | self.window.keyboard_screen.next_page_button.set_sensitive(True) 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/widgets/variant.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /src/window.py: -------------------------------------------------------------------------------- 1 | # window.py 2 | 3 | # 4 | # Copyright 2022 user 5 | 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | 20 | import urllib.request 21 | import time 22 | from gi.repository import Gtk, Gdk, GLib, Adw 23 | from jade_gui.classes.partition import Partition 24 | from jade_gui.widgets.timezone import TimezoneEntry 25 | from jade_gui.widgets.layout import KeyboardLayout 26 | from jade_gui.widgets.variant import KeyboardVariant 27 | from jade_gui.widgets.desktop import DesktopEntry 28 | from jade_gui.widgets.disk import DiskEntry 29 | from jade_gui.widgets.partition import PartitionEntry 30 | from jade_gui.functions.keyboard_screen import KeyboardScreen 31 | from jade_gui.functions.timezone_screen import TimezoneScreen 32 | from jade_gui.functions.user_screen import UserScreen 33 | from jade_gui.functions.desktop_screen import DesktopScreen 34 | from jade_gui.functions.misc_screen import MiscScreen 35 | from jade_gui.functions.partition_screen import PartitionScreen 36 | from jade_gui.functions.summary_screen import SummaryScreen 37 | from jade_gui.functions.install_screen import InstallScreen 38 | from jade_gui.functions.finished_screen import FinishedScreen 39 | from jade_gui.locales.locales_list import locations 40 | from jade_gui.keymaps import keymaps 41 | from jade_gui.desktops import desktops 42 | from jade_gui.utils import disks 43 | from jade_gui.utils.threading import RunAsync 44 | 45 | @Gtk.Template(resource_path='/al/getcryst/jadegui/window.ui') 46 | class JadeGuiWindow(Gtk.ApplicationWindow): 47 | __gtype_name__ = 'JadeGuiWindow' 48 | 49 | event_controller = Gtk.EventControllerKey.new() 50 | carousel = Gtk.Template.Child() 51 | 52 | ### Page and widgets on welcome screen 53 | welcome_page = Gtk.Template.Child() 54 | # quit_button = Gtk.Template.Child() 55 | next_button = Gtk.Template.Child() 56 | back_button = Gtk.Template.Child() 57 | about_button = Gtk.Template.Child() 58 | no_internet = Gtk.Template.Child() 59 | 60 | 61 | def __init__(self, **kwargs): 62 | super().__init__(**kwargs) 63 | self.finished_screen = FinishedScreen(window=self, **kwargs) 64 | self.installer_screen = InstallScreen(window=self, main_carousel=self.carousel, next_page=self.finished_screen, **kwargs) 65 | self.summary_screen = SummaryScreen(window=self, main_carousel=self.carousel, next_page=self.installer_screen, **kwargs) 66 | self.partition_screen = PartitionScreen(window=self, main_carousel=self.carousel, next_page=self.summary_screen, **kwargs) 67 | self.misc_screen = MiscScreen(window=self, main_carousel=self.carousel, next_page=self.partition_screen, **kwargs) 68 | self.desktop_screen = DesktopScreen(window=self, main_carousel=self.carousel, next_page=self.misc_screen, **kwargs) 69 | self.user_screen = UserScreen(window=self, main_carousel=self.carousel, next_page=self.desktop_screen, **kwargs) 70 | self.keyboard_screen = KeyboardScreen(window=self, main_carousel=self.carousel, next_page=self.user_screen, **kwargs) 71 | self.timezone_screen = TimezoneScreen(window=self, main_carousel=self.carousel, next_page=self.keyboard_screen, **kwargs) 72 | self.carousel.append(self.timezone_screen) 73 | self.carousel.append(self.keyboard_screen) 74 | self.carousel.append(self.user_screen) 75 | self.carousel.append(self.desktop_screen) 76 | self.carousel.append(self.misc_screen) 77 | self.carousel.append(self.partition_screen) 78 | #self.carousel.append(self.manual_partition) 79 | self.carousel.append(self.summary_screen) 80 | self.carousel.append(self.installer_screen) 81 | self.carousel.append(self.finished_screen) 82 | ### Widgets for first page (welcome screen) 83 | #self.quit_button.connect("clicked", self.confirmQuit) 84 | #self.summary_screen.connect_buttons() 85 | self.next_button.connect("clicked", self.carousel_next) 86 | self.back_button.connect("clicked", self.previousPage) 87 | self.about_button.connect("clicked", self.show_about) 88 | self.partition_mode = "Auto" 89 | self.do_check_internet = True 90 | ### --------- 91 | self.previous_page = None 92 | self.set_previous_page(None) 93 | ### Test timezones 94 | for i in locations: 95 | for locale in i: 96 | self.timezone_screen.list_timezones.append(TimezoneEntry(window=self, region=locale.region, location=locale.location, locale=locale.locales, **kwargs)) 97 | ### --------- 98 | 99 | ### Test layouts 100 | for keymap in keymaps: 101 | layout = KeyboardLayout(window=self, country=keymap.layout, country_shorthand=keymap.backend_layout, variants=keymap.variant, **kwargs) 102 | firstvariant = KeyboardVariant(window=self, variant=keymap.variant[0], country=layout.country, country_shorthand=layout.country_shorthand, button_group=None, **kwargs) 103 | layout.add_row(firstvariant) 104 | for variant in keymap.variant: 105 | if variant != firstvariant.variant: 106 | layout.add_row(KeyboardVariant(window=self, country=layout.country, country_shorthand=layout.country_shorthand, variant=variant, button_group=firstvariant.select_variant, **kwargs)) 107 | self.keyboard_screen.layout_list.append(layout) 108 | ### --------- 109 | 110 | ### Test desktops 111 | firstdesktop = DesktopEntry(window=self, desktop=desktops[0], button_group=None, **kwargs) # Manually specifying onyx since the other entries need a button group to attach to 112 | self.desktop_screen.list_desktops.append(firstdesktop) 113 | self.desktop_screen.chosen_desktop = self.desktop_screen.list_desktops.get_row_at_index(0).get_title() 114 | self.desktop_screen.list_desktops.select_row(firstdesktop) 115 | for desktop in desktops: 116 | if desktop != desktops[0]: 117 | self.desktop_screen.list_desktops.append(DesktopEntry(window=self, desktop=desktop, button_group=firstdesktop.select_button, **kwargs)) 118 | ### --------- 119 | 120 | ### Test partitions 121 | self.available_disks = disks.get_disks() 122 | firstdisk = DiskEntry( 123 | window=self, 124 | disk=self.available_disks[0], 125 | disk_size=disks.get_disk_size(self.available_disks[0]), 126 | disk_type=disks.get_disk_type(self.available_disks[0]), 127 | #disk_model=disks.get_disk_model(available_disks[0]), 128 | button_group=None, 129 | **kwargs 130 | ) 131 | self.partition_screen.disk_list.append(firstdisk) 132 | firstdisk.toggled_cb(firstdisk.select_button) 133 | self.partition_screen.selected_partition=firstdisk 134 | for disk in self.available_disks: 135 | if disk != self.available_disks[0]: 136 | self.partition_screen.disk_list.append( 137 | DiskEntry( 138 | window=self, 139 | disk=disk, 140 | disk_size=disks.get_disk_size(disk), 141 | disk_type=disks.get_disk_type(disk), 142 | #disk_model=disks.get_disk_model(disk), 143 | button_group=firstdisk.select_button, 144 | **kwargs 145 | ) 146 | ) 147 | 148 | self.available_partitions = disks.get_partitions() 149 | for partition in self.available_partitions: 150 | self.partition_screen.partition_list.append( 151 | PartitionEntry( 152 | window=self, 153 | partition=Partition(partition=partition, mountpoint="", filesystem="", size=disks.get_disk_size(partition)), 154 | **kwargs 155 | ) 156 | ) 157 | ### --------- 158 | RunAsync(self.check_internet) 159 | 160 | 161 | def check_internet(self): 162 | while self.do_check_internet: 163 | try: 164 | urllib.request.urlopen("https://getcryst.al", timeout=1) 165 | GLib.idle_add(self.allow_continue, True) 166 | print("internet!") 167 | except: 168 | GLib.idle_add(self.allow_continue, False) 169 | print("no internet!") 170 | time.sleep(1) 171 | 172 | def allow_continue(self, allow): 173 | self.next_button.set_sensitive(allow) 174 | self.no_internet.set_visible(not allow) 175 | 176 | def set_previous_page(self, previous_page): 177 | if previous_page is None: 178 | self.back_button.set_visible(False) 179 | else: 180 | self.back_button.set_visible(True) 181 | self.previous_page = previous_page 182 | 183 | def previousPage(self, widget): 184 | if self.previous_page is not None: 185 | self.previous_page.carousel_next(widget) 186 | 187 | def carousel_next(self, widget): 188 | self.set_previous_page(None) 189 | self.do_check_internet = False 190 | self.carousel.scroll_to(self.timezone_screen, True) 191 | 192 | def confirmQuit(self, widget): 193 | 194 | def handle_response(_widget, response_id): 195 | if response_id == Gtk.ResponseType.YES: 196 | _widget.destroy() 197 | self.destroy() 198 | elif response_id == Gtk.ResponseType.NO: 199 | _widget.destroy() 200 | 201 | dialog = Gtk.MessageDialog( 202 | transient_for=self, 203 | modal=True, 204 | parent=self, 205 | text="Do you want to try\nCrystal without installing?", 206 | buttons=Gtk.ButtonsType.YES_NO 207 | ) 208 | dialog.connect("response", handle_response) 209 | dialog.present() 210 | 211 | def show_about(self, *args): 212 | builder = Gtk.Builder.new_from_resource("/al/getcryst/jadegui/about.ui") 213 | about_window = builder.get_object("aboutWindow") 214 | about_window.set_transient_for(self) 215 | about_window.present() 216 | -------------------------------------------------------------------------------- /src/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | vertical 11 | 6 12 | 6 13 | 6 14 | 6 15 | 16 | 17 | About Jade GUI 18 | 19 | 20 | 21 | 22 | 23 | 124 | 125 |
126 | 127 | Keyboard Shortcuts 128 | win.show-help-overlay 129 | 130 | 131 | About jade gui 132 | app.about 133 | 134 |
135 |
136 |
137 | --------------------------------------------------------------------------------