tenseleyflow/hyprkvm / ee18322

Browse files

feat: GUI as default command, bump to v0.6.0

- Running 'hyprkvm' without arguments now launches GUI (when built with --features gui)
- Shows helpful message with available commands when GUI not available
- Bump version to 0.6.0 for release
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
ee18322549d69fe7cfdc65f43b68d7949e8abfd3
Parents
1042579
Tree
afc7982

4 changed files

StatusFile+-
M Cargo.lock 3 3
M Cargo.toml 1 1
M flake.nix 2 2
M hyprkvm-daemon/src/main.rs 19 4
Cargo.lockmodified
@@ -1636,7 +1636,7 @@ dependencies = [
16361636
 
16371637
 [[package]]
16381638
 name = "hyprkvm-cli"
1639
-version = "0.5.1"
1639
+version = "0.6.0"
16401640
 dependencies = [
16411641
  "anyhow",
16421642
  "clap",
@@ -1648,7 +1648,7 @@ dependencies = [
16481648
 
16491649
 [[package]]
16501650
 name = "hyprkvm-common"
1651
-version = "0.5.1"
1651
+version = "0.6.0"
16521652
 dependencies = [
16531653
  "serde",
16541654
  "serde_json",
@@ -1657,7 +1657,7 @@ dependencies = [
16571657
 
16581658
 [[package]]
16591659
 name = "hyprkvm-daemon"
1660
-version = "0.5.1"
1660
+version = "0.6.0"
16611661
 dependencies = [
16621662
  "anyhow",
16631663
  "base64",
Cargo.tomlmodified
@@ -7,7 +7,7 @@ members = [
77
 ]
88
 
99
 [workspace.package]
10
-version = "0.5.1"
10
+version = "0.6.0"
1111
 edition = "2021"
1212
 authors = ["tenseleyFlow"]
1313
 license = "MIT"
flake.nixmodified
@@ -161,7 +161,7 @@
161161
           # Package (without GUI for smaller binary)
162162
           packages.default = pkgs.rustPlatform.buildRustPackage {
163163
             pname = "hyprkvm";
164
-            version = "0.5.1";
164
+            version = "0.6.0";
165165
             src = ./.;
166166
 
167167
             cargoLock = {
@@ -191,7 +191,7 @@
191191
           # Package with GUI support
192192
           packages.gui = pkgs.rustPlatform.buildRustPackage {
193193
             pname = "hyprkvm";
194
-            version = "0.5.1";
194
+            version = "0.6.0";
195195
             src = ./.;
196196
 
197197
             cargoLock = {
hyprkvm-daemon/src/main.rsmodified
@@ -62,7 +62,7 @@ struct Cli {
6262
     verbose: u8,
6363
 
6464
     #[command(subcommand)]
65
-    command: Commands,
65
+    command: Option<Commands>,
6666
 }
6767
 
6868
 #[derive(Subcommand)]
@@ -144,19 +144,34 @@ fn main() -> anyhow::Result<()> {
144144
             .join("hyprkvm.toml")
145145
     });
146146
 
147
-    // Handle GUI command outside of async runtime (Iced manages its own runtime)
147
+    // Handle GUI: either explicit `gui` command OR no command (default)
148148
     #[cfg(feature = "gui")]
149
-    if matches!(cli.command, Commands::Gui) {
149
+    if cli.command.is_none() || matches!(cli.command, Some(Commands::Gui)) {
150150
         info!("Starting HyprKVM GUI...");
151151
         return gui::run_gui(&config_path);
152152
     }
153153
 
154
+    // If GUI feature not enabled and no command given, show helpful message
155
+    #[cfg(not(feature = "gui"))]
156
+    if cli.command.is_none() {
157
+        eprintln!("No command specified. Available commands:");
158
+        eprintln!("  hyprkvm daemon   - Start the KVM daemon");
159
+        eprintln!("  hyprkvm status   - Show daemon status");
160
+        eprintln!("  hyprkvm config   - Configuration management");
161
+        eprintln!();
162
+        eprintln!("To enable the GUI, rebuild with: cargo build --features gui");
163
+        std::process::exit(1);
164
+    }
165
+
154166
     // Run async commands in tokio runtime
167
+    // At this point we know command is Some(...) because None cases are handled above
168
+    let command = cli.command.expect("command should be Some at this point");
169
+
155170
     tokio::runtime::Builder::new_multi_thread()
156171
         .enable_all()
157172
         .build()?
158173
         .block_on(async {
159
-            match cli.command {
174
+            match command {
160175
                 Commands::Daemon => {
161176
                     info!("Starting HyprKVM daemon...");
162177
                     run_daemon(&config_path).await