feat: add configuration management and panel rendering
- Introduced a new `Config` struct for loading application configuration from a TOML file. - Added support for keybindings and panel configurations, including status widgets. - Implemented `PtyTerminal` for handling pseudo-terminal interactions. - Created a rendering module to manage the display of application windows, panels, and dropdowns. - Refactored the main application loop to utilize the new configuration and rendering logic. - Removed legacy code related to event handling and rendering from `main.rs`.
This commit is contained in:
27
dist/linux/config.toml
vendored
Normal file
27
dist/linux/config.toml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# TUI-WM konfiguration – Linux
|
||||
|
||||
[[panel]]
|
||||
position = "top"
|
||||
file = "panels/topbar.toml"
|
||||
|
||||
# ── Keybinds ──────────────────────────────────────────────────────────────────
|
||||
# scope = "global" → alltid aktiv, även när en terminal har fokus
|
||||
# scope = "wm" → bara aktiv när ingen terminal är fokuserad (default)
|
||||
|
||||
# Öppna Tui-run kommandodialog (global – funkar alltid)
|
||||
[[keybind]]
|
||||
key = "ctrl+space"
|
||||
scope = "global"
|
||||
action = { type = "spawn_run_dialog" }
|
||||
|
||||
# Starta ny terminal med Alt+Enter
|
||||
[[keybind]]
|
||||
key = "alt+enter"
|
||||
scope = "global"
|
||||
action = { type = "spawn_terminal" }
|
||||
|
||||
# Avsluta TUI-WM när skrivbordet är fokuserat
|
||||
[[keybind]]
|
||||
key = "ctrl+q"
|
||||
scope = "wm"
|
||||
action = { type = "exit" }
|
||||
23
dist/linux/panels/topbar.toml
vendored
Normal file
23
dist/linux/panels/topbar.toml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Topbar – Linux
|
||||
|
||||
[[item]]
|
||||
label = "Terminal"
|
||||
action = { type = "spawn_terminal" }
|
||||
|
||||
[[item]]
|
||||
label = "Exit"
|
||||
action = { type = "exit" }
|
||||
|
||||
# Klocka – uppdateras varje sekund
|
||||
[[status]]
|
||||
command = "date '+%H:%M:%S'"
|
||||
interval = 1
|
||||
width = 10
|
||||
align = "right"
|
||||
|
||||
# Datum – uppdateras varje minut
|
||||
[[status]]
|
||||
command = "date '+%Y-%m-%d'"
|
||||
interval = 60
|
||||
width = 12
|
||||
align = "right"
|
||||
Reference in New Issue
Block a user