Skip to content

Commit ba395a0

Browse files
complete refactoring
1 parent 371db2f commit ba395a0

180 files changed

Lines changed: 6103 additions & 3258 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**/__pycache__/
2+
*.old
3+
*/*.old
4+
*.bkp
5+
*/*.bkp
6+
**/old
7+
.venv/
8+
.mypy_cache/
9+
.ruff_cache/
10+
.pytest_cache/
11+
PLANNING.md

LICENSE

Lines changed: 358 additions & 495 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<h1 align="center">BigLinux Browser Selector</h1>
2+
<img width="1050" height="830" alt="image" src="https://github.com/user-attachments/assets/d8c7452c-f876-4a03-9544-58e5e8af78f0" />
3+
4+
<p align="center">
5+
<a href="#features">Features</a> •
6+
<a href="#installation">Installation</a> •
7+
<a href="#project-structure">Project Structure</a> •
8+
<a href="#contributing">Contributing</a> •
9+
<a href="#license">License</a>
10+
</p>
11+
12+
<p align="center">
13+
<img src="https://img.shields.io/badge/GTK-4-blue?logo=gnome&logoColor=white" alt="GTK4">
14+
<img src="https://img.shields.io/badge/Python-3.10%2B-yellow?logo=python&logoColor=white" alt="Python 3.10+">
15+
<img src="https://img.shields.io/badge/Adwaita-libadwaita-purple" alt="Adwaita">
16+
<img src="https://img.shields.io/badge/license-GPL-green" alt="License GPL">
17+
</p>
18+
19+
---
20+
21+
## About
22+
23+
**BigLinux Browser Selector** is a modern, GTK4-based application for [BigLinux](https://www.biglinux.com.br) that allows users to choose and install their preferred web browser with an intuitive interface. It features real-time installation progress, integrated installer support, and accessibility for screen readers.
24+
25+
## Features
26+
27+
- **Modern GTK4/libadwaita interface** — Clean, native look and feel
28+
- **Browser selection & install** — Choose from 10 supported browsers; install missing ones with real-time progress display
29+
- **Real-time installation feedback** — Live log output during browser installation
30+
- **Set default browser** — Configure your chosen browser as the system default
31+
- **Accessibility support** — Screen reader compatible with ARIA roles and focus indicators
32+
- **Multiple installation sources** — Supports both native packages and Flatpak installations
33+
34+
## Installation
35+
36+
### From BigLinux repositories (recommended)
37+
38+
```bash
39+
sudo pacman -S biglinux-browser-selector
40+
```
41+
42+
### Manual build (Arch-based distros)
43+
44+
```bash
45+
cd pkgbuild
46+
makepkg -si
47+
```
48+
49+
### Dependencies
50+
51+
| Package | Purpose |
52+
|----------------|----------------------------|
53+
| `gtk4` | UI toolkit |
54+
| `python` | Runtime (≥ 3.10) |
55+
| `python-yaml` | YAML page configuration |
56+
| `python-gobject`| GTK4 Python bindings |
57+
| `polkit` | Privilege elevation |
58+
| `zenity` | Auxiliary dialogs |
59+
60+
## Project Structure
61+
62+
```
63+
biglinux-browser-selector/
64+
├── usr/
65+
│ ├── bin/
66+
│ │ └── biglinux-browser-selector # launcher script
67+
│ ├── share/
68+
│ │ ├── applications/
69+
│ │ │ └── org.biglinux.browser-selector.desktop
70+
│ │ ├── browser_selector/
71+
│ │ │ ├── main.py # entry point
72+
│ │ │ ├── app.py # Adw.Application + CSS
73+
│ │ │ ├── window.py # main window & browser logic
74+
│ │ │ ├── widgets.py # custom GTK4 widgets (BrowserCard, InstallPanel)
75+
│ │ │ ├── utils.py # shared utilities
76+
│ │ │ ├── style.css # Adwaita-based styles
77+
│ │ │ ├── pages.yaml # browser configuration
78+
│ │ │ └── scripts/
79+
│ │ │ ├── browser.sh # browser management script
80+
│ │ │ └── browserInstall.sh # installation script (runs as root)
81+
│ │ └── icons/hicolor/scalable/apps/
82+
│ │ └── biglinux-browser-selector.svg
83+
├── pkgbuild/
84+
│ ├── PKGBUILD # Arch package build
85+
├── README.md
86+
└── LICENSE
87+
```
88+
89+
## Supported Browsers
90+
91+
- Brave
92+
- Chromium
93+
- Chrome (Google)
94+
- Falkon
95+
- Firefox
96+
- Librewolf
97+
- Opera
98+
- Vivaldi
99+
- Edge (Microsoft)
100+
- Zen Browser
101+
102+
Each browser supports both native package installation and Flatpak variants where available.
103+
104+
## Development
105+
106+
### Running locally
107+
108+
```bash
109+
cd usr/share/biglinux/browser_selector
110+
python main.py
111+
```
112+
113+
### Code quality
114+
115+
```bash
116+
pip install ruff
117+
ruff check usr/share/biglinux/browser_selector/
118+
ruff format usr/share/biglinux/browser_selector/
119+
```
120+
121+
## Contributing
122+
123+
Contributions are welcome! Please:
124+
125+
1. Fork the repository
126+
2. Create a feature branch (`git checkout -b feature/my-feature`)
127+
3. Make your changes
128+
4. Run tests and code quality checks
129+
5. Commit and push
130+
6. Open a Pull Request
131+
132+
## Community
133+
134+
- 🌐 **Website:** [biglinux.com.br](https://www.biglinux.com.br)
135+
- 💬 **Forum:** [forum.biglinux.com.br](https://forum.biglinux.com.br)
136+
- 📺 **YouTube:** [@BigLinuxx](https://www.youtube.com/@BigLinuxx)
137+
- ✈️ **Telegram:** [t.me/biglinux](https://t.me/biglinux)
138+
- ❤️ **Donate:** [biglinux.com.br/doacao-financeira](https://www.biglinux.com.br/doacao-financeira/)
139+
140+
## License
141+
142+
This project is licensed under the **GPL** license. See the [PKGBUILD](pkgbuild/PKGBUILD) for details.

etc/skel/.config/falkon/profiles/default/settings.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

generate_strings.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
import sys
5+
import yaml
6+
import argparse
7+
from pathlib import Path
8+
9+
# The keys in the YAML file whose string values should be translated.
10+
TRANSLATABLE_KEYS = {"title", "subtitle", "label"}
11+
12+
HEADER = """# -*- coding: utf-8 -*-
13+
#
14+
# DO NOT EDIT THIS FILE MANUALLY.
15+
#
16+
# This file is automatically generated by the 'generate_strings.py' script
17+
# from the content of a YAML file. It is used by gettext to extract
18+
# translatable strings from data files.
19+
#
20+
import gettext
21+
_ = gettext.gettext
22+
23+
# --- Strings from data file ---
24+
"""
25+
26+
27+
def extract_strings_from_data(data):
28+
"""
29+
Recursively finds all strings from the data structure
30+
that have a key present in TRANSLATABLE_KEYS.
31+
"""
32+
strings = set()
33+
if isinstance(data, dict):
34+
for key, value in data.items():
35+
if key in TRANSLATABLE_KEYS and isinstance(value, str):
36+
strings.add(value)
37+
else:
38+
strings.update(extract_strings_from_data(value))
39+
elif isinstance(data, list):
40+
for item in data:
41+
strings.update(extract_strings_from_data(item))
42+
return strings
43+
44+
45+
def main():
46+
"""Main function to generate the translatable strings file."""
47+
parser = argparse.ArgumentParser(
48+
description="Extract translatable strings from a YAML file into a Python file for gettext."
49+
)
50+
parser.add_argument("input_yaml", type=Path, help="Path to the input YAML file.")
51+
parser.add_argument("output_py", type=Path, help="Path for the output Python file.")
52+
args = parser.parse_args()
53+
54+
input_file: Path = args.input_yaml
55+
output_file: Path = args.output_py
56+
57+
if not input_file.is_file():
58+
print(f"Error: Input file not found at {input_file}")
59+
sys.exit(1)
60+
61+
print(f"Reading strings from: {input_file}")
62+
with open(input_file, "r", encoding="utf-8") as f:
63+
try:
64+
data = yaml.safe_load(f)
65+
except yaml.YAMLError as e:
66+
print(f"Error parsing YAML file: {e}")
67+
sys.exit(1)
68+
69+
translatable_strings = extract_strings_from_data(data)
70+
71+
if not translatable_strings:
72+
print("Warning: No translatable strings found.")
73+
# Still create the file so the build process doesn't fail
74+
with open(output_file, "w", encoding="utf-8") as f:
75+
f.write(HEADER)
76+
return
77+
78+
# Sort for deterministic output, which is good for version control
79+
sorted_strings = sorted(list(translatable_strings))
80+
81+
print(f"Writing {len(sorted_strings)} strings to: {output_file}")
82+
with open(output_file, "w", encoding="utf-8") as f:
83+
f.write(HEADER)
84+
for s in sorted_strings:
85+
# Use repr() to correctly handle quotes and special characters
86+
f.write(f"_({repr(s)})\n")
87+
88+
print("Done.")
89+
90+
91+
if __name__ == "__main__":
92+
main()

locale/bg.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/bg.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

locale/biglinux-browser-selector.pot

Lines changed: 0 additions & 30 deletions
This file was deleted.

locale/cs.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

locale/cs.po

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)