Skip to content

Instantly share code, notes, and snippets.

@641i130
Created March 11, 2024 21:07
Show Gist options
  • Save 641i130/3f1bf57659e8fb08dcc64a9749129aa1 to your computer and use it in GitHub Desktop.
Save 641i130/3f1bf57659e8fb08dcc64a9749129aa1 to your computer and use it in GitHub Desktop.
xpra-user.service
# cat ~/.config/systemd/user/xpra.service
[Unit]
Description=xpra user service
[Service]
Type=simple
ExecStart=/usr/bin/xpra start-desktop --no-daemon --resize-display="1920x1080" --start-child=cinnamon-session-cinnamon
[Install]
WantedBy=default.target
@641i130
Copy link
Author

641i130 commented Mar 11, 2024

Use this script to kill all xpra sessions:

# Get the PID(s) of the process(es) using ps and grep
pid=$(ps aux | grep '/usr/bin/xpra' | grep -v grep | awk '{print $2}')

# Check if pid is not empty
if [ -n "$pid" ]; then
    # Kill the process(es)
    kill $pid
    echo "Processes killed: $pid"
else
    echo "No processes found with the specified command."
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment