hyprshell_core_lib/binds/
transfer.rs1use crate::transfer::TransferType;
2use std::env;
3
4#[must_use]
7pub fn get_hyprshell_path() -> String {
8 env::current_exe()
9 .expect("Current executable not found")
10 .display()
11 .to_string()
12 .replace("(deleted)", "")
13}
14
15#[must_use]
18pub fn generate_transfer_socat(transfer: &TransferType) -> String {
19 format!(
20 r"{} socat '{}'",
21 get_hyprshell_path(),
22 generate_transfer(transfer)
23 )
24}
25
26#[must_use]
29pub fn generate_transfer(transfer: &TransferType) -> String {
30 serde_json::to_string(transfer).expect("serialize transfer")
31}