waybar2qs 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 waybar2qs contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: waybar2qs
3
+ Version: 0.1.0
4
+ Summary: Transpile Waybar (config.jsonc + style.css) into modular Quickshell (shell.qml) projects
5
+ Author: waybar2qs contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Prateek-squadron/waybar2qs
8
+ Project-URL: Repository, https://github.com/Prateek-squadron/waybar2qs
9
+ Keywords: waybar,quickshell,qml,hyprland,niri,omarchy,wayland,transpiler
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Desktop Environment
17
+ Classifier: Topic :: Utilities
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=7.0; extra == "dev"
23
+ Dynamic: license-file
24
+
25
+ # waybar2qs
26
+
27
+ Transpile Waybar configurations (`config.jsonc` + `style.css`) into modular [Quickshell](https://quickshell.outfoxxed.me/) (`shell.qml`) projects, accompanied by an honest migration audit report.
28
+
29
+ ## Why `waybar2qs`?
30
+
31
+ Wayland desktop ecosystems such as **Omarchy**, **Noctalia**, and **DankMaterialShell** are increasingly moving from Waybar + GTK CSS toward **Quickshell** (Qt 6 / QML) for native compositor IPC, smooth animations, and unified shell surfaces. Rebuilding an existing Waybar setup in QML from scratch means manually porting JSONC module layouts, `@define-color` palettes, interval/event scripts, and compositor bindings.
32
+
33
+ `waybar2qs` bridges that gap:
34
+
35
+ - Parses Waybar `config.jsonc` (including `//` / `/* */` comments, trailing commas, `include` directives, and multi-bar arrays).
36
+ - Extracts mappable GTK CSS design tokens (`@define-color`, colors, radii, fonts, padding, margins, state styles) into a centralized `Theme.qml` singleton.
37
+ - Generates modular QML components (`qmldir`, `shell.qml`, `Theme.qml`, and `components/*.qml`) tailored for **Hyprland** or **Niri**.
38
+ - Produces an explicit migration report (`--report`) calling out everything transpiled natively, everything backed by `Process`, and every unsupported CSS rule (`:hover`, `@keyframes`, `box-shadow`, gradients) with line numbers and QML hints.
39
+
40
+ Zero third-party Python runtime dependencies — uses only the Python >= 3.10 standard library.
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ # Editable install from a local clone
46
+ git clone https://github.com/Prateek-squadron/waybar2qs.git
47
+ cd waybar2qs
48
+ pip install -e .
49
+
50
+ # Or install as an isolated CLI tool with uv
51
+ uv tool install git+https://github.com/Prateek-squadron/waybar2qs.git
52
+ ```
53
+
54
+ ## CLI Usage
55
+
56
+ ```text
57
+ waybar2qs [CONFIG] [options]
58
+ ```
59
+
60
+ If `CONFIG` is omitted, `waybar2qs` auto-discovers `~/.config/waybar/config.jsonc` or `~/.config/waybar/config`. If `-s/--style` is omitted, it auto-discovers a sibling `style.css` next to `CONFIG`.
61
+
62
+ ### Options
63
+
64
+ | Option | Description |
65
+ | --- | --- |
66
+ | `CONFIG` | Path to Waybar `config.jsonc` / `config` (optional if `~/.config/waybar/` exists) |
67
+ | `-s, --style PATH` | Path to Waybar `style.css` |
68
+ | `-o, --output DIR` | Output directory for the generated Quickshell project (default: `./quickshell-bar`) |
69
+ | `--compositor {auto,hyprland,niri}` | Target compositor backend (default: `auto`, inferred from modules) |
70
+ | `--report` | Print the full Markdown migration report to stdout |
71
+ | `--report-file PATH` | Write the migration report to a file (e.g. `MIGRATION_REPORT.md`) |
72
+ | `--report-json` | Print the machine-readable JSON migration report to stdout |
73
+ | `--lint` | Run Qt 6 `qmllint` on generated `.qml` files and include results in the report |
74
+ | `--dry-run` | Parse, transpile, and report without writing files to disk |
75
+ | `--version` | Show the `waybar2qs` version and exit |
76
+
77
+ ### Examples
78
+
79
+ ```bash
80
+ # Convert your active ~/.config/waybar setup into ./quickshell-bar
81
+ waybar2qs --report
82
+
83
+ # Convert a specific config + style and verify with Qt 6 qmllint
84
+ waybar2qs fixtures/omarchy_hyprland/config.jsonc \
85
+ -s fixtures/omarchy_hyprland/style.css \
86
+ -o ./out-omarchy \
87
+ --lint \
88
+ --report-file ./out-omarchy/MIGRATION_REPORT.md
89
+
90
+ # Preview a Niri conversion without writing files
91
+ waybar2qs fixtures/niri_scrollable/config.jsonc --dry-run --report-json
92
+ ```
93
+
94
+ ## Supported Modules
95
+
96
+ | Waybar Module | Quickshell Backend | Support Level |
97
+ | --- | --- | --- |
98
+ | `hyprland/workspaces` | `Quickshell.Hyprland` (`Hyprland.workspaces`) | Native |
99
+ | `clock` | `Quickshell.SystemClock` / `Qt.formatDateTime` | Native |
100
+ | `pulseaudio` / `wireplumber` | `Quickshell.Services.Pipewire` (`PwObjectTracker`) | Native |
101
+ | `battery` | `Quickshell.Services.UPower` (`UPower.displayDevice`) | Native |
102
+ | `network` | `Quickshell.Networking` (`WifiDevice` / `WiredDevice`) | Native / Partial |
103
+ | `tray` | `Quickshell.Services.SystemTray` + `IconImage` + `QsMenuAnchor` | Native |
104
+ | `niri/workspaces` | `Quickshell.Io.Process` (`niri msg --json workspaces` + `event-stream`) | Process-backed |
105
+ | `custom/*` | `Quickshell.Io.Process` (`exec`, `interval`, `return-type: json`, `on-click*`, `on-scroll-*`) | Process-backed |
106
+ | Other modules | Placeholder QML component (`StubModuleWidget.qml`) | Stub |
107
+
108
+ ## How `--report` Works
109
+
110
+ GTK CSS and Waybar JSONC do not map 1:1 to Qt Quick / QML. Rather than silently dropping rules, `waybar2qs` records an audit trail in `ConversionReport`:
111
+
112
+ 1. **Summary**: Source paths, compositor target, bar count, and module counts broken down by `native`, `process-backed`, `partial`, and `stub`.
113
+ 2. **Mapped CSS Design Tokens**: Extracted `@define-color` palette entries and resolved bar/module tokens written to `Theme.qml`.
114
+ 3. **Module-by-Module Conversion**: Exact mapping from each Waybar module name to its generated `.qml` file, backend, and behavioral caveats (such as `format-alt` toggles or `states` thresholds).
115
+ 4. **Unsupported CSS Features**: Grouped by category (`Animations & Transitions`, `Pseudo-Selectors`, `Visual Effects`, `CSS At-Rules`, `Unsupported Properties`) with selector, line number, raw CSS snippet, and a concrete QML equivalent hint (for example, `MouseArea { hoverEnabled: true }` + `Behavior on color` for `:hover` transitions, or `SequentialAnimation` for `@keyframes`).
116
+ 5. **Config Warnings & `qmllint` Verification**: Non-fatal JSONC/module warnings and Qt 6 `qmllint` pass/fail output when `--lint` is enabled.
117
+
118
+ ## Running the Generated Bar
119
+
120
+ Launch the generated project directly with Quickshell:
121
+
122
+ ```bash
123
+ quickshell -p ./quickshell-bar
124
+ ```
125
+
126
+ Generated project layout:
127
+
128
+ ```text
129
+ quickshell-bar/
130
+ ├── qmldir # Registers Theme as a QML singleton
131
+ ├── shell.qml # ShellRoot + Variants + PanelWindow bar layouts
132
+ ├── Theme.qml # Extracted @define-color & style design tokens
133
+ └── components/ # Modular per-widget QML components
134
+ ```
@@ -0,0 +1,110 @@
1
+ # waybar2qs
2
+
3
+ Transpile Waybar configurations (`config.jsonc` + `style.css`) into modular [Quickshell](https://quickshell.outfoxxed.me/) (`shell.qml`) projects, accompanied by an honest migration audit report.
4
+
5
+ ## Why `waybar2qs`?
6
+
7
+ Wayland desktop ecosystems such as **Omarchy**, **Noctalia**, and **DankMaterialShell** are increasingly moving from Waybar + GTK CSS toward **Quickshell** (Qt 6 / QML) for native compositor IPC, smooth animations, and unified shell surfaces. Rebuilding an existing Waybar setup in QML from scratch means manually porting JSONC module layouts, `@define-color` palettes, interval/event scripts, and compositor bindings.
8
+
9
+ `waybar2qs` bridges that gap:
10
+
11
+ - Parses Waybar `config.jsonc` (including `//` / `/* */` comments, trailing commas, `include` directives, and multi-bar arrays).
12
+ - Extracts mappable GTK CSS design tokens (`@define-color`, colors, radii, fonts, padding, margins, state styles) into a centralized `Theme.qml` singleton.
13
+ - Generates modular QML components (`qmldir`, `shell.qml`, `Theme.qml`, and `components/*.qml`) tailored for **Hyprland** or **Niri**.
14
+ - Produces an explicit migration report (`--report`) calling out everything transpiled natively, everything backed by `Process`, and every unsupported CSS rule (`:hover`, `@keyframes`, `box-shadow`, gradients) with line numbers and QML hints.
15
+
16
+ Zero third-party Python runtime dependencies — uses only the Python >= 3.10 standard library.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ # Editable install from a local clone
22
+ git clone https://github.com/Prateek-squadron/waybar2qs.git
23
+ cd waybar2qs
24
+ pip install -e .
25
+
26
+ # Or install as an isolated CLI tool with uv
27
+ uv tool install git+https://github.com/Prateek-squadron/waybar2qs.git
28
+ ```
29
+
30
+ ## CLI Usage
31
+
32
+ ```text
33
+ waybar2qs [CONFIG] [options]
34
+ ```
35
+
36
+ If `CONFIG` is omitted, `waybar2qs` auto-discovers `~/.config/waybar/config.jsonc` or `~/.config/waybar/config`. If `-s/--style` is omitted, it auto-discovers a sibling `style.css` next to `CONFIG`.
37
+
38
+ ### Options
39
+
40
+ | Option | Description |
41
+ | --- | --- |
42
+ | `CONFIG` | Path to Waybar `config.jsonc` / `config` (optional if `~/.config/waybar/` exists) |
43
+ | `-s, --style PATH` | Path to Waybar `style.css` |
44
+ | `-o, --output DIR` | Output directory for the generated Quickshell project (default: `./quickshell-bar`) |
45
+ | `--compositor {auto,hyprland,niri}` | Target compositor backend (default: `auto`, inferred from modules) |
46
+ | `--report` | Print the full Markdown migration report to stdout |
47
+ | `--report-file PATH` | Write the migration report to a file (e.g. `MIGRATION_REPORT.md`) |
48
+ | `--report-json` | Print the machine-readable JSON migration report to stdout |
49
+ | `--lint` | Run Qt 6 `qmllint` on generated `.qml` files and include results in the report |
50
+ | `--dry-run` | Parse, transpile, and report without writing files to disk |
51
+ | `--version` | Show the `waybar2qs` version and exit |
52
+
53
+ ### Examples
54
+
55
+ ```bash
56
+ # Convert your active ~/.config/waybar setup into ./quickshell-bar
57
+ waybar2qs --report
58
+
59
+ # Convert a specific config + style and verify with Qt 6 qmllint
60
+ waybar2qs fixtures/omarchy_hyprland/config.jsonc \
61
+ -s fixtures/omarchy_hyprland/style.css \
62
+ -o ./out-omarchy \
63
+ --lint \
64
+ --report-file ./out-omarchy/MIGRATION_REPORT.md
65
+
66
+ # Preview a Niri conversion without writing files
67
+ waybar2qs fixtures/niri_scrollable/config.jsonc --dry-run --report-json
68
+ ```
69
+
70
+ ## Supported Modules
71
+
72
+ | Waybar Module | Quickshell Backend | Support Level |
73
+ | --- | --- | --- |
74
+ | `hyprland/workspaces` | `Quickshell.Hyprland` (`Hyprland.workspaces`) | Native |
75
+ | `clock` | `Quickshell.SystemClock` / `Qt.formatDateTime` | Native |
76
+ | `pulseaudio` / `wireplumber` | `Quickshell.Services.Pipewire` (`PwObjectTracker`) | Native |
77
+ | `battery` | `Quickshell.Services.UPower` (`UPower.displayDevice`) | Native |
78
+ | `network` | `Quickshell.Networking` (`WifiDevice` / `WiredDevice`) | Native / Partial |
79
+ | `tray` | `Quickshell.Services.SystemTray` + `IconImage` + `QsMenuAnchor` | Native |
80
+ | `niri/workspaces` | `Quickshell.Io.Process` (`niri msg --json workspaces` + `event-stream`) | Process-backed |
81
+ | `custom/*` | `Quickshell.Io.Process` (`exec`, `interval`, `return-type: json`, `on-click*`, `on-scroll-*`) | Process-backed |
82
+ | Other modules | Placeholder QML component (`StubModuleWidget.qml`) | Stub |
83
+
84
+ ## How `--report` Works
85
+
86
+ GTK CSS and Waybar JSONC do not map 1:1 to Qt Quick / QML. Rather than silently dropping rules, `waybar2qs` records an audit trail in `ConversionReport`:
87
+
88
+ 1. **Summary**: Source paths, compositor target, bar count, and module counts broken down by `native`, `process-backed`, `partial`, and `stub`.
89
+ 2. **Mapped CSS Design Tokens**: Extracted `@define-color` palette entries and resolved bar/module tokens written to `Theme.qml`.
90
+ 3. **Module-by-Module Conversion**: Exact mapping from each Waybar module name to its generated `.qml` file, backend, and behavioral caveats (such as `format-alt` toggles or `states` thresholds).
91
+ 4. **Unsupported CSS Features**: Grouped by category (`Animations & Transitions`, `Pseudo-Selectors`, `Visual Effects`, `CSS At-Rules`, `Unsupported Properties`) with selector, line number, raw CSS snippet, and a concrete QML equivalent hint (for example, `MouseArea { hoverEnabled: true }` + `Behavior on color` for `:hover` transitions, or `SequentialAnimation` for `@keyframes`).
92
+ 5. **Config Warnings & `qmllint` Verification**: Non-fatal JSONC/module warnings and Qt 6 `qmllint` pass/fail output when `--lint` is enabled.
93
+
94
+ ## Running the Generated Bar
95
+
96
+ Launch the generated project directly with Quickshell:
97
+
98
+ ```bash
99
+ quickshell -p ./quickshell-bar
100
+ ```
101
+
102
+ Generated project layout:
103
+
104
+ ```text
105
+ quickshell-bar/
106
+ ├── qmldir # Registers Theme as a QML singleton
107
+ ├── shell.qml # ShellRoot + Variants + PanelWindow bar layouts
108
+ ├── Theme.qml # Extracted @define-color & style design tokens
109
+ └── components/ # Modular per-widget QML components
110
+ ```
@@ -0,0 +1,42 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "waybar2qs"
7
+ version = "0.1.0"
8
+ description = "Transpile Waybar (config.jsonc + style.css) into modular Quickshell (shell.qml) projects"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "waybar2qs contributors"}
13
+ ]
14
+ requires-python = ">=3.10"
15
+ keywords = ["waybar", "quickshell", "qml", "hyprland", "niri", "omarchy", "wayland", "transpiler"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Environment :: Console",
19
+ "Intended Audience :: End Users/Desktop",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: POSIX :: Linux",
22
+ "Programming Language :: Python :: 3",
23
+ "Topic :: Desktop Environment",
24
+ "Topic :: Utilities",
25
+ ]
26
+
27
+ [project.optional-dependencies]
28
+ dev = ["pytest>=7.0"]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/Prateek-squadron/waybar2qs"
32
+ Repository = "https://github.com/Prateek-squadron/waybar2qs"
33
+
34
+ [project.scripts]
35
+ waybar2qs = "waybar2qs.cli:main"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
39
+
40
+ [tool.pytest.ini_options]
41
+ testpaths = ["tests"]
42
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ """waybar2qs: Waybar (config.jsonc + style.css) to Quickshell (shell.qml) transpiler."""
2
+
3
+ __version__ = "0.1.0"
4
+ __all__ = ["__version__"]