hyprshell_core_lib/binds/transfer.rs
1use crate::transfer::TransferType;
2use std::env;
3
4fn get_hyprshell_path() -> String {
5 env::current_exe()
6 .expect("Current executable not found")
7 .display()
8 .to_string()
9 .replace("(deleted)", "")
10}
11
12pub fn generate_transfer_socat(transfer: &TransferType) -> String {
13 format!(
14 r#"{} socat '{}'"#,
15 get_hyprshell_path(),
16 serde_json::to_string(transfer).expect("serialize transfer")
17 )
18}