mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-08 15:31:27 +03:00
fix: replace sh with CMD_SH (#12173)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ use super::capturable::{Capturable, Recorder};
|
|||||||
use super::remote_desktop_portal::OrgFreedesktopPortalRemoteDesktop as remote_desktop_portal;
|
use super::remote_desktop_portal::OrgFreedesktopPortalRemoteDesktop as remote_desktop_portal;
|
||||||
use super::request_portal::OrgFreedesktopPortalRequestResponse;
|
use super::request_portal::OrgFreedesktopPortalRequestResponse;
|
||||||
use super::screencast_portal::OrgFreedesktopPortalScreenCast as screencast_portal;
|
use super::screencast_portal::OrgFreedesktopPortalScreenCast as screencast_portal;
|
||||||
|
use hbb_common::platform::linux::CMD_SH;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
@@ -880,7 +881,7 @@ pub fn get_capturables() -> Result<Vec<PipeWireCapturable>, Box<dyn Error>> {
|
|||||||
// `remote_desktop_portal` does not support restore_token and persist_mode.
|
// `remote_desktop_portal` does not support restore_token and persist_mode.
|
||||||
fn is_server_running() -> bool {
|
fn is_server_running() -> bool {
|
||||||
let app_name = config::APP_NAME.read().unwrap().clone().to_lowercase();
|
let app_name = config::APP_NAME.read().unwrap().clone().to_lowercase();
|
||||||
let output = match Command::new("sh")
|
let output = match Command::new(CMD_SH.as_str())
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg(&format!("ps aux | grep {}", app_name))
|
.arg(&format!("ps aux | grep {}", app_name))
|
||||||
.output()
|
.output()
|
||||||
|
|||||||
@@ -427,7 +427,8 @@ impl ClipboardContext {
|
|||||||
// It's not correct in the server process.
|
// It's not correct in the server process.
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let is_kde_x11 = {
|
let is_kde_x11 = {
|
||||||
let is_kde = std::process::Command::new("sh")
|
use hbb_common::platform::linux::CMD_SH;
|
||||||
|
let is_kde = std::process::Command::new(CMD_SH.as_str())
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg("ps -e | grep -E kded[0-9]+ | grep -v grep")
|
.arg("ps -e | grep -E kded[0-9]+ | grep -v grep")
|
||||||
.stdout(std::process::Stdio::piped())
|
.stdout(std::process::Stdio::piped())
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use hbb_common::{allow_err, platform::linux::DISTRO};
|
use hbb_common::{
|
||||||
|
allow_err,
|
||||||
|
platform::linux::{CMD_SH, DISTRO},
|
||||||
|
};
|
||||||
use scrap::{is_cursor_embedded, set_map_err, Capturer, Display, Frame, TraitCapturer};
|
use scrap::{is_cursor_embedded, set_map_err, Capturer, Display, Frame, TraitCapturer};
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::process::{Command, Output};
|
use std::process::{Command, Output};
|
||||||
@@ -109,7 +112,7 @@ pub(super) fn is_inited() -> Option<Message> {
|
|||||||
|
|
||||||
fn get_max_desktop_resolution() -> Option<String> {
|
fn get_max_desktop_resolution() -> Option<String> {
|
||||||
// works with Xwayland
|
// works with Xwayland
|
||||||
let output: Output = Command::new("sh")
|
let output: Output = Command::new(CMD_SH.as_str())
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg("xrandr | awk '/current/ { print $8,$9,$10 }'")
|
.arg("xrandr | awk '/current/ { print $8,$9,$10 }'")
|
||||||
.output()
|
.output()
|
||||||
|
|||||||
Reference in New Issue
Block a user