feat(cli): add permissions prompts to quickstart

This commit is contained in:
LGUG2Z committed 2025-09-27 13:06:22 -07:00
1 parent 400cb63c6a
commit cd5f660455
4 files changed
+39 -14

No files matched your search

+11 -1
View File
@@ -16,7 +16,17 @@ the example files have been downloaded. For most new users this will be in the
komorebic quickstart
```
With the example configurations downloaded, you can now start `komorebi`
### Granting Permissions
The `quickstart` command will also prompt you to grant komorebi the permissions
it requires to run, and will open the following System Settings tabs for you:
* Settings -> Privacy & Security -> Accessibility
* Settings -> Privacy & Security -> Screen & System Audio Recording
With the example configurations downloaded and permissions granted, you can now
start `komorebi`
```powershell
komorebic start
+2 -10
View File
@@ -33,16 +33,8 @@ cargo +stable install --path komorebic --locked --target-dir ~/.cargo/bin
If the binaries have been built and added to your `$PATH` correctly, you should
see some output when running `komorebi --help` and `komorebic --help`
## Granting Permissions
Users will need to manually add `~/.cargo/bin/komorebi` to:
* Settings -> Privacy & Security -> Accessibility
* Settings -> Privacy & Security -> Screen & System Audio Recording
Once komorebi is installed, and these permissions have been granted, proceed to
get the [example
configurations](example-configurations.md).
Once komorebi is installed, proceed to get
the [example configurations](example-configurations.md).
## Uninstallation
+1 -1
View File
@@ -86,7 +86,7 @@ lazy_static! {
assert!(
home.is_dir(),
"$KOMOREBI_CONFIG_HOME is set to '{home_path}', which is not a valid directory"
"$KOMOREBI_CONFIG_HOME is set to \"{home_path}\", which is not a valid directory"
);
home
+25 -2
View File
@@ -47,7 +47,7 @@ lazy_static! {
home
} else {
panic!(
"$KOMOREBI_CONFIG_HOME is set to '{home_path}', which is not a valid directory",
"$KOMOREBI_CONFIG_HOME is set to \"{home_path}\", which is not a valid directory",
);
}
},
@@ -1244,7 +1244,30 @@ fn main() -> eyre::Result<()> {
written_files.join("\n")
);
}
println!("\nYou can now run: komorebic start");
let mut current_exe = std::env::current_exe().expect("unable to get exec path");
current_exe.pop();
let komorebi_exe = current_exe.join("komorebi");
println!("\nPlease grant Accessibility permissions to \"{}\"", komorebi_exe.display());
println!("Accessibility permissions are required for komorebi to to manage windows");
Command::new("open").arg("x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility").spawn()?;
println!("\nHit return when done...");
std::io::stdout().flush()?;
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;
println!("Please grant Screen Recording permissions to \"{}\"", komorebi_exe.display());
println!("Screen Recording permissions are required to for komorebi to read window titles");
Command::new("open").arg("x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture").spawn()?;
println!("\nHit return when done...");
std::io::stdout().flush()?;
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;
println!("You can now run: komorebic start");
println!(
"\nIf you have skhd hotkey daemon installed, you can also run: skhd --config {}",
skhdrc_path.display()