Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,994 changes: 2,832 additions & 162 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"crates/shell-theme",
"crates/shell-ui-gpui",
"crates/shell-app",
"crates/modules/*",
]
resolver = "3"

Expand All @@ -25,6 +26,13 @@ shell-linux = { path = "crates/shell-linux" }
shell-config = { path = "crates/shell-config" }
shell-theme = { path = "crates/shell-theme" }
shell-ui-gpui = { path = "crates/shell-ui-gpui" }
luna-module-launcher = { path = "crates/modules/launcher" }
luna-module-calendar = { path = "crates/modules/calendar" }
luna-module-player = { path = "crates/modules/player" }
luna-module-theme = { path = "crates/modules/theme" }
luna-module-resources = { path = "crates/modules/resources" }
luna-module-clock = { path = "crates/modules/clock" }
luna-module-settings = { path = "crates/modules/settings" }

tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
Expand Down
2 changes: 1 addition & 1 deletion config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ startup_delay_ms = 0
backend = "hyprland"

[modules]
bar = true
bar = false
notch = true
dock = false
launcher = true
Expand Down
2 changes: 1 addition & 1 deletion config/theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ slow_ms = 360

[typography]
body_size = 14
label_size = 13
label_size = 14
title_size = 16
2 changes: 1 addition & 1 deletion context/modules/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Purpose

Provide date/calendar information inside the Notch, with room for future agenda integration without coupling the shell to a specific calendar provider.
Provide date/calendar information inside the Notch, with room for future agenda integration (SQLite) without coupling the shell to a specific calendar provider.

## Responsibilities

Expand Down
5 changes: 2 additions & 3 deletions context/modules/clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

## Purpose

Provide time/date presentation and clock-specific interaction inside the Notch while remaining independent from panel placement.
Provide time presentation and clock-specific interaction inside the Notch while remaining independent from panel placement.

## Responsibilities

```text
current time
current date
12h/24h formatting
timezone display
optional timer/alarm expansion later
Expand All @@ -33,7 +32,7 @@ optional expanded clock state

## Notch behavior

The module may expose compact and expanded clock views; the Notch owns host resizing and animation.
The module may expose compact and expanded clock views, when user clicks him opens calendar mode with date and calendar; the Notch owns host resizing and animation.

## MVP

Expand Down
10 changes: 10 additions & 0 deletions crates/modules/calendar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "luna-module-calendar"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
shell-core.workspace = true
shell-ui-gpui.workspace = true
26 changes: 26 additions & 0 deletions crates/modules/calendar/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Calendar module boundary. Calendar state/navigation will be added here as
//! the shared date model is introduced.

use shell_core::NotchConfig;
use shell_ui_gpui::{ModuleContext, ModuleId, ModuleMetadata, ModuleSize, ModuleView, NotchModule};

#[derive(Default)]
pub struct CalendarModule;

impl NotchModule for CalendarModule {
fn metadata(&self) -> ModuleMetadata {
ModuleMetadata {
id: ModuleId::Calendar,
title: "Calendar",
aliases: &[],
}
}

fn preferred_size(&self, config: &NotchConfig) -> ModuleSize {
ModuleSize::from_config(config, false)
}

fn render(&mut self, context: ModuleContext) -> ModuleView {
shell_ui_gpui::primitives::module_label("Calendar", &context.tokens)
}
}
11 changes: 11 additions & 0 deletions crates/modules/clock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "luna-module-clock"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
gpui.workspace = true
shell-core.workspace = true
shell-ui-gpui.workspace = true
25 changes: 25 additions & 0 deletions crates/modules/clock/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! Compact clock module.

use shell_core::NotchConfig;
use shell_ui_gpui::{ModuleContext, ModuleId, ModuleMetadata, ModuleSize, ModuleView, NotchModule};

#[derive(Default)]
pub struct ClockModule;

impl NotchModule for ClockModule {
fn metadata(&self) -> ModuleMetadata {
ModuleMetadata {
id: ModuleId::Clock,
title: "Clock",
aliases: &[],
}
}

fn preferred_size(&self, config: &NotchConfig) -> ModuleSize {
ModuleSize::from_config(config, false)
}

fn render(&mut self, context: ModuleContext) -> ModuleView {
shell_ui_gpui::primitives::module_label(context.clock, &context.tokens)
}
}
11 changes: 11 additions & 0 deletions crates/modules/launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "luna-module-launcher"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
gpui.workspace = true
shell-core.workspace = true
shell-ui-gpui.workspace = true
134 changes: 134 additions & 0 deletions crates/modules/launcher/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
//! Launcher module hosted by the Notch.

use gpui::{FontWeight, div, prelude::*, px, rgb, rgba};
use shell_core::NotchConfig;
use shell_ui_gpui::{ModuleContext, ModuleId, ModuleMetadata, ModuleSize, ModuleView, NotchModule};

const ITEMS: &[(&str, &str, &str)] = &[
(
"◉",
"About Xfce",
"Information about the Xfce Desktop Environment",
),
(
"▣",
"Advanced Network Configuration",
"Manage and change network connection settings",
),
("△", "Alacritty", "Terminal"),
(
"◌",
"AsusCtlTray",
"A tray icon to switch asusctl profiles on the fly",
),
(
"✣",
"auto-cpufreq",
"Automatic CPU frequency and power optimizer",
),
(
"◈",
"Avahi SSH Server Browser",
"Browse for Zeroconf-enabled SSH Servers",
),
];

#[derive(Default)]
pub struct LauncherModule;

impl NotchModule for LauncherModule {
fn metadata(&self) -> ModuleMetadata {
ModuleMetadata {
id: ModuleId::Launcher,
title: "Launcher",
aliases: &[],
}
}

fn preferred_size(&self, config: &NotchConfig) -> ModuleSize {
ModuleSize::from_config(config, true)
}

fn render(&mut self, context: ModuleContext) -> ModuleView {
let tokens = context.tokens;
let query_lower = context.query.to_lowercase();
let rows = ITEMS
.iter()
.filter(|(_, name, description)| {
query_lower.is_empty()
|| name.to_lowercase().contains(&query_lower)
|| description.to_lowercase().contains(&query_lower)
})
.map(|(icon, name, description)| {
div()
.w_full()
.h(px(44.0))
.px(px(tokens.spacing.sm as f32))
.rounded(px(tokens.radius.sm as f32))
.flex()
.items_center()
.gap(px(tokens.spacing.sm as f32))
.bg(rgba(0x242424e8))
.text_color(rgb(tokens.colors.foreground))
.child(
div()
.w(px(28.0))
.h(px(28.0))
.rounded(px(tokens.radius.sm as f32))
.flex()
.items_center()
.justify_center()
.bg(rgba(0x3b3b3bf0))
.text_size(px(tokens.typography.title_size as f32 - 2.0))
.child(*icon),
)
.child(
div()
.flex()
.flex_col()
.gap(px(1.0))
.child(
div()
.text_size(px(tokens.typography.body_size as f32))
.font_weight(FontWeight::BOLD)
.child(*name),
)
.child(
div()
.text_size(px(tokens.typography.label_size as f32 - 1.0))
.text_color(rgba(0xaaa6a6e6))
.child(*description),
),
)
});

div()
.w(px(context.notch.width as f32))
.h(px(context.notch.expanded_height as f32))
.p(px(tokens.spacing.md as f32))
.flex()
.flex_col()
.gap(px(tokens.spacing.sm as f32))
.text_color(rgb(tokens.colors.foreground))
.child(
div()
.w_full()
.h(px(40.0))
.px(px(tokens.spacing.sm as f32))
.flex()
.items_center()
.gap(px(tokens.spacing.sm as f32))
.border_b(px(1.0))
.border_color(rgba(0x8b8b8b66))
.text_size(px(tokens.typography.body_size as f32))
.child("⌕")
.child(if context.query.is_empty() {
"Search...".to_string()
} else {
context.query
}),
)
.child(div().flex().flex_col().gap(px(2.0)).children(rows))
.into_any_element()
}
}
10 changes: 10 additions & 0 deletions crates/modules/player/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "luna-module-player"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
shell-core.workspace = true
shell-ui-gpui.workspace = true
26 changes: 26 additions & 0 deletions crates/modules/player/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Player module boundary. Media state is expected to arrive through a
//! MediaPort/MPRIS adapter owned by the application composition root.

use shell_core::NotchConfig;
use shell_ui_gpui::{ModuleContext, ModuleId, ModuleMetadata, ModuleSize, ModuleView, NotchModule};

#[derive(Default)]
pub struct PlayerModule;

impl NotchModule for PlayerModule {
fn metadata(&self) -> ModuleMetadata {
ModuleMetadata {
id: ModuleId::Player,
title: "Player",
aliases: &[],
}
}

fn preferred_size(&self, config: &NotchConfig) -> ModuleSize {
ModuleSize::from_config(config, false)
}

fn render(&mut self, context: ModuleContext) -> ModuleView {
shell_ui_gpui::primitives::module_label("Player", &context.tokens)
}
}
12 changes: 12 additions & 0 deletions crates/modules/resources/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "luna-module-resources"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
gpui.workspace = true
shell-core.workspace = true
shell-ui-gpui.workspace = true
tracing.workspace = true
Loading
Loading