Update rustdesk.sh
This commit is contained in:
parent
5a6955c4b7
commit
913a3f3b73
1 changed files with 4 additions and 13 deletions
17
rustdesk.sh
17
rustdesk.sh
|
|
@ -3,6 +3,7 @@
|
||||||
# Variables
|
# Variables
|
||||||
RUSTDESK_URL="https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb"
|
RUSTDESK_URL="https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb"
|
||||||
RUSTDESK_DEB="rustdesk-1.2.3-x86_64.deb"
|
RUSTDESK_DEB="rustdesk-1.2.3-x86_64.deb"
|
||||||
|
ID_SERVER="172.232.132.62"
|
||||||
|
|
||||||
# Check for RustDesk installation and remove it if present
|
# Check for RustDesk installation and remove it if present
|
||||||
if dpkg -l | grep -qw rustdesk; then
|
if dpkg -l | grep -qw rustdesk; then
|
||||||
|
|
@ -40,19 +41,9 @@ fi
|
||||||
echo "Starting RustDesk..."
|
echo "Starting RustDesk..."
|
||||||
|
|
||||||
# Start RustDesk and attempt to bring its window to the foreground
|
# Start RustDesk and attempt to bring its window to the foreground
|
||||||
if ! pgrep -x "rustdesk" > /dev/null; then
|
rustdesk
|
||||||
rustdesk &
|
|
||||||
sleep 2 # Give RustDesk a moment to start
|
echo "$ID_SERVER" | xclip -selection clipboard
|
||||||
# Attempt to focus the RustDesk window. This method may need adjustment based on the desktop environment.
|
|
||||||
WINDOW_ID=$(xdotool search --onlyvisible --class rustdesk | head -1)
|
|
||||||
if [ ! -z "$WINDOW_ID" ]; then
|
|
||||||
xdotool windowactivate "$WINDOW_ID"
|
|
||||||
else
|
|
||||||
echo "RustDesk started but could not focus the window automatically."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "RustDesk is already running."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -f "$RUSTDESK_DEB"
|
rm -f "$RUSTDESK_DEB"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue