-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/tray menu/shortcut recording #552
base: main
Are you sure you want to change the base?
Feat/tray menu/shortcut recording #552
Conversation
Signed-off-by: David Anyatonwu <[email protected]>
Signed-off-by: David Anyatonwu <[email protected]>
Signed-off-by: David Anyatonwu <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@onyedikachi-david great work!
|
Signed-off-by: David Anyatonwu <[email protected]>
Screen.Recording.2024-10-22.at.14.55.44.movHow do you see this method? @louis030195 |
nice, dream would be same UX as obsidian: Screen.Recording.2024-10-22.at.08.20.34.movcan you make it like this? then make same UX for the other shortcut setting, solve conflict and can merge 🙏 |
Signed-off-by: David Anyatonwu <[email protected]>
is this okay @louis030195 |
Signed-off-by: David Anyatonwu <[email protected]>
@onyedikachi-david good! why is written super? it should be the cmd icon on mac and ctrl on windows i guess also the shortcut does not work for me i checked out the PR, did pressing the shortcut nothing happen saving does not work (e.g. changing shortcut, leaving settings page and coming back does not save) can you fix these and we can merge then |
Signed-off-by: David Anyatonwu <[email protected]>
Everything should be working well now. @louis030195 |
@onyedikachi-david just changed slightly |
Just did :) |
@onyedikachi-david saving still does not work, nor the shortcut itself, nothing happen, no notification and not starting the recording |
Wow, that's odd, but can you see these logs? 2024-10-25T16:20:50.929120Z DEBUG screenpipe_app::commands: Registering shortcuts - Show: Meta+Ctrl+Y, Record: Meta+Alt+T
2024-10-25T16:20:50.931642Z DEBUG screenpipe_app::commands: Successfully unregistered existing shortcuts
2024-10-25T16:20:50.931653Z DEBUG screenpipe_app::commands: Parsing show screenpipe shortcut
2024-10-25T16:20:50.931709Z DEBUG screenpipe_app::commands: Starting to parse shortcut: Meta+Ctrl+Y
2024-10-25T16:20:50.934688Z DEBUG screenpipe_app::commands: Split shortcut into parts: ["Meta", "Ctrl", "Y"]
2024-10-25T16:20:50.934735Z DEBUG screenpipe_app::commands: Modifiers: ["Meta", "Ctrl"], Key: ["Y"]
2024-10-25T16:20:50.936304Z DEBUG screenpipe_app::commands: Processing modifier: Meta
2024-10-25T16:20:50.938026Z DEBUG screenpipe_app::commands: Adding META modifier
2024-10-25T16:20:50.938115Z DEBUG screenpipe_app::commands: Processing modifier: Ctrl
2024-10-25T16:20:50.938128Z DEBUG screenpipe_app::commands: Adding CONTROL modifier
2024-10-25T16:20:50.938135Z DEBUG screenpipe_app::commands: Final modifier flags: Modifiers(CONTROL | META)
2024-10-25T16:20:50.945071Z DEBUG screenpipe_app::commands: Attempting to parse key code: KeyY
2024-10-25T16:20:50.945101Z DEBUG screenpipe_app::commands: Successfully parsed key code: KeyY
2024-10-25T16:20:50.946724Z DEBUG screenpipe_app::commands: Parsing recording shortcut
2024-10-25T16:20:50.946732Z DEBUG screenpipe_app::commands: Starting to parse shortcut: Meta+Alt+T
2024-10-25T16:20:50.946777Z DEBUG screenpipe_app::commands: Split shortcut into parts: ["Meta", "Alt", "T"]
2024-10-25T16:20:50.946790Z DEBUG screenpipe_app::commands: Modifiers: ["Meta", "Alt"], Key: ["T"]
2024-10-25T16:20:50.946797Z DEBUG screenpipe_app::commands: Processing modifier: Meta
2024-10-25T16:20:50.946804Z DEBUG screenpipe_app::commands: Adding META modifier
2024-10-25T16:20:50.946817Z DEBUG screenpipe_app::commands: Processing modifier: Alt
2024-10-25T16:20:50.946825Z DEBUG screenpipe_app::commands: Adding ALT modifier
2024-10-25T16:20:50.946831Z DEBUG screenpipe_app::commands: Final modifier flags: Modifiers(ALT | META)
2024-10-25T16:20:50.946840Z DEBUG screenpipe_app::commands: Attempting to parse key code: KeyT
2024-10-25T16:20:50.946846Z DEBUG screenpipe_app::commands: Successfully parsed key code: KeyT
2024-10-25T16:20:50.946880Z DEBUG screenpipe_app::commands: Registering show screenpipe shortcut
2024-10-25T16:20:50.952000Z DEBUG screenpipe_app::commands: Registering recording shortcut
2024-10-25T16:20:50.952119Z DEBUG screenpipe_app::commands: Successfully registered all shortcuts |
yes i do but the ui settings does not update, some issue with the typescript code, also meta key crash my app:
isn't it "Super" ? or idk |
Signed-off-by: David Anyatonwu <[email protected]>
Okay. I'll see to it. But it should just work, I just moved the function call. 🙂. |
Signed-off-by: David Anyatonwu <[email protected]>
Screen.Recording.2024-11-01.at.09.32.08.movIt is fixed now sir. apologies for the stress. |
Signed-off-by: David Anyatonwu <[email protected]>
Signed-off-by: David Anyatonwu <[email protected]>
@onyedikachi-david
IMG.5897.mov |
Yes, for the twice stuff, i noticed it myself, i'm using a boolean flag to check if the sidecar is running so i can either start or stop, it is supposed to return Some if running or None if not, but it doesn't, so I have to find a way around it (please see the comment in the code snippet). } else if normalized_shortcut == normalized_toggle_shortcut {
tokio::task::block_in_place(move || {
Handle::current().block_on(async move {
let state = app.state::<SidecarState>();
let mut sidecar = state.0.lock().await;
debug!("sidecar state: {:?}", sidecar.is_some());
// Drop the lock before performing actions
let is_running = sidecar.is_some(); // This was always returning false even when it is running.
*sidecar = None; // Adding this made it work as it does now.
drop(sidecar);
if is_running {
debug!("Stopping screenpipe via shortcut");
if let Err(err) = kill_all_sreenpipes(state.clone(), app.clone()).await {
error!("Failed to stop recording: {}", err);
let _ = app.notification().builder()
.title("Screenpipe")
.body("Failed to stop recording")
.show();
let _ = app.emit("recording_failed", "Failed to stop recording");
} else {
let _ = app.notification().builder()
.title("Screenpipe")
.body("Recording stopped")
.show();
let _ = app.emit("recording_stopped", "Recording stopped");
}
} |
|
||
show_main_window(&app_handle, true); | ||
} else if normalized_shortcut == normalized_toggle_shortcut { | ||
tokio::task::block_in_place(move || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably use tauri::async stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tauri::async_runtime::spawn(async move {
@@ -204,6 +325,48 @@ async fn main() { | |||
println!("quit clicked"); | |||
app_handle.exit(0); | |||
} | |||
"start_recording" => { | |||
tokio::task::block_in_place(move || { | |||
Handle::current().block_on(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tauri::async_runtime::spawn(async move {
might be better (not sure why we used tokio before)
use tracing::info; | ||
use tracing::{debug, error}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure there are no duplicate keys or shortcuts added, that might cause issues (use set, or things like this)
Signed-off-by: David Anyatonwu <[email protected]>
@onyedikachi-david it would be great to make this work and merge today, i need this for the timeline UI shortcut |
okay. apologies for the delay. |
any news on this? |
I have a fix, will push soon, apologies for the delay. |
Signed-off-by: David Anyatonwu <[email protected]>
Screen.Recording.2024-11-13.at.14.35.02.mov |
@louis030195 Hi, i don't know if you've gotten time to review this? |
same issue, i need to press twice the shortcut to work |
I'm just at lost on how and why this is happening. It happens only for the overlay shortcut. I'll try to figure it out. |
Fixes: #515
/claim #515