diff --git a/README.md b/README.md index e28be8e..a481031 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Summit Unfiltered view: compact list grouped by source with the reason each entry was detected

-

Real renders of the Slint GUI, made on a KDE neon test VM (X11) from its real Steam account: cover art from Steam's own cache, real playtime. Nothing is installed on that VM, so every game shows "Not installed". No game was running; the in-game overlay is not built yet.

+

Real renders of the Slint GUI, made on a KDE neon test VM (X11) from its real Steam account: cover art from Steam's own cache, real playtime. Steam is not logged in there, so no Steam game is installed and they show "Not installed". The one installed entry is Voidrunner, added by hand with summit add, pinned, with custom artwork (a screenshot, cropped to fit the cover). No game was running; the in-game overlay is not built yet.

> [!NOTE] > **Pre-alpha.** What works today is the command-line core: library scanning with detection reasons, playtime tracking, Home pins, custom artwork, and per-game display profiles applied at launch. The launcher GUI, Steam shortcut export, in-game overlay and upscaling/frame-gen backends are planned and are **not built yet**. Nothing below is marked as working unless it is. @@ -58,6 +58,7 @@ cargo build --release ./target/release/summit scan --why -p ~/Games # everything found, with reasons ./target/release/summit home # most played ./target/release/summit run my-game -- ./game.sh # applies the profile, runs it, tracks the time +./target/release/summit add "My Game" ~/Games/mygame/run.sh # add anything by hand (--software for apps) ./target/release/summit pin steam:620 # show on Home ./target/release/summit art steam:620 cover.png # custom artwork ./target/release/summit doctor my-game # Wayland or X11? what would run? diff --git a/crates/summit-cli/src/main.rs b/crates/summit-cli/src/main.rs index 258756b..74b87d4 100644 --- a/crates/summit-cli/src/main.rs +++ b/crates/summit-cli/src/main.rs @@ -21,6 +21,8 @@ enum Cmd { Home { #[arg(short, default_value_t = 10)] n: usize }, /// Launch an entry: apply its display profile, run it, track the time played Run { id: String, #[arg(last = true)] cmd: Vec }, + /// Add a game or app by hand + Add { title: String, path: std::path::PathBuf, #[arg(long)] software: bool }, /// Add an entry to the Home screen Pin { id: String }, /// Remove an entry from the Home screen @@ -83,6 +85,14 @@ fn main() -> Result<()> { let n = summit_core::names::fetch_missing(&ids, limit, 1500, |id, n| println!("{id}: {} ({})", if n.name.is_empty() { "?" } else { &n.name }, n.kind))?; println!("resolved {n}"); } + Cmd::Add { title, path, software } => { + anyhow::ensure!(path.exists(), "{} does not exist", path.display()); + let id = format!("custom:{}", title.to_lowercase().replace(' ', "-")); + let mut st = state::load(); + st.custom.retain(|c| c.id != id); + st.custom.push(state::Custom { id: id.clone(), title, path: path.canonicalize()?.to_string_lossy().into_owned(), software }); + state::save(&st)?; println!("added {id}"); + } Cmd::Pin { id } => { let mut st = state::load(); st.pin(&id); state::save(&st)?; println!("pinned {id}"); } Cmd::Unpin { id } => { let mut st = state::load(); st.unpin(&id); state::save(&st)?; println!("unpinned {id}"); } Cmd::Art { id, image } => { diff --git a/crates/summit-core/src/model.rs b/crates/summit-core/src/model.rs index a707018..b0d947b 100644 --- a/crates/summit-core/src/model.rs +++ b/crates/summit-core/src/model.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Hash)] #[serde(rename_all = "lowercase")] -pub enum Source { Steam, Heroic, Lutris, Heuristic } +pub enum Source { Steam, Heroic, Lutris, Heuristic, Custom } #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] diff --git a/crates/summit-core/src/scan.rs b/crates/summit-core/src/scan.rs index 1e6795b..0277762 100644 --- a/crates/summit-core/src/scan.rs +++ b/crates/summit-core/src/scan.rs @@ -91,6 +91,7 @@ pub fn full(extra: &[std::path::PathBuf], depth: usize) -> Vec { let mut all = crate::steam::scan(); all.extend(crate::epic::heroic()); all.extend(crate::epic::lutris()); + all.extend(crate::state::custom_entries(&crate::state::load())); let known: Vec = all.iter().filter_map(|e| e.path.clone()).collect(); let mut found = Vec::new(); for r in extra { walk(r, depth, &mut found); } diff --git a/crates/summit-core/src/state.rs b/crates/summit-core/src/state.rs index 551efb4..21125c3 100644 --- a/crates/summit-core/src/state.rs +++ b/crates/summit-core/src/state.rs @@ -8,9 +8,14 @@ use std::path::PathBuf; #[serde(default)] pub struct Tracked { pub seconds: u64, pub sessions: u32, pub last_played: u64 } +/// A game or app the user added by hand. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Custom { pub id: String, pub title: String, pub path: String, pub software: bool } + #[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] #[serde(default)] pub struct State { + pub custom: Vec, pub pinned: Vec, pub artwork: HashMap, pub tracked: HashMap, @@ -40,6 +45,17 @@ impl State { } } +pub fn custom_entries(st: &State) -> Vec { + use crate::model::*; + st.custom.iter().map(|c| Entry { + id: c.id.clone(), title: c.title.clone(), source: Source::Custom, + kind: if c.software { Kind::Software } else { Kind::Game }, + installed: std::path::Path::new(&c.path).exists(), path: Some(c.path.clone()), steam_app_id: None, + playtime_minutes: 0, last_played: None, + reasons: vec![format!("added by you: {}", c.path)], + }).collect() +} + /// Steam keeps its own authoritative count for Steam games, so those use Steam's number. /// Everything else (Heroic, Lutris, software, .exe) uses Summit's tracked sessions. /// Never summed: that would double count Steam titles launched through Summit. diff --git a/crates/summit-gui/src/main.rs b/crates/summit-gui/src/main.rs index aafcaef..557bd47 100644 --- a/crates/summit-gui/src/main.rs +++ b/crates/summit-gui/src/main.rs @@ -11,7 +11,7 @@ fn accent(title: &str) -> Color { Color::from_rgb_u8(r, g, b) } fn hours(m: u64) -> String { if m == 0 { "Never played".into() } else if m < 60 { format!("{m} min") } else { format!("{:.1} h", m as f64 / 60.0) } } -fn src_name(s: Source) -> &'static str { match s { Source::Steam => "STEAM", Source::Heroic => "HEROIC / EPIC / GOG", Source::Lutris => "LUTRIS", Source::Heuristic => "FOUND ON DISK" } } +fn src_name(s: Source) -> &'static str { match s { Source::Steam => "STEAM", Source::Heroic => "HEROIC / EPIC / GOG", Source::Lutris => "LUTRIS", Source::Heuristic => "FOUND ON DISK", Source::Custom => "ADDED BY YOU" } } fn card(e: &Entry, pinned: bool, art: &std::collections::HashMap) -> Card { let cover_path = art.get(&e.id).map(std::path::PathBuf::from).or_else(|| e.steam_app_id.and_then(steam::cover)); @@ -37,7 +37,7 @@ fn main() { lib.sort_by(|a, b| b.installed.cmp(&a.installed).then(b.playtime_minutes.cmp(&a.playtime_minutes))); let mut unf: Vec = vec![]; - for src in [Source::Steam, Source::Heroic, Source::Lutris, Source::Heuristic] { + for src in [Source::Steam, Source::Heroic, Source::Lutris, Source::Custom, Source::Heuristic] { for (kind, label) in [(Kind::Game, "GAMES"), (Kind::Software, "SOFTWARE"), (Kind::Tool, "TOOLS")] { let mut items: Vec<&Entry> = all.iter().filter(|e| e.source == src && e.kind == kind && e.installed).collect(); if items.is_empty() { continue; } diff --git a/docs/media/summit-home.png b/docs/media/summit-home.png index 813d9a5..47df791 100644 Binary files a/docs/media/summit-home.png and b/docs/media/summit-home.png differ diff --git a/docs/media/summit-library.png b/docs/media/summit-library.png index b9dddba..26c608a 100644 Binary files a/docs/media/summit-library.png and b/docs/media/summit-library.png differ diff --git a/docs/media/summit-unfiltered.png b/docs/media/summit-unfiltered.png index 05ca7f8..4a9312f 100644 Binary files a/docs/media/summit-unfiltered.png and b/docs/media/summit-unfiltered.png differ