Compare commits
No commits in common. "master" and "v1.5.4" have entirely different histories.
4 changed files with 0 additions and 201 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
|
@ -1,11 +0,0 @@
|
||||||
# Binaries
|
|
||||||
remote-touchpad
|
|
||||||
|
|
||||||
# Systemd service state
|
|
||||||
.remote-touchpad.service.state
|
|
||||||
|
|
||||||
# Logs and run files
|
|
||||||
.rts-log
|
|
||||||
|
|
||||||
# Environment files
|
|
||||||
.env
|
|
||||||
29
README.md
29
README.md
|
|
@ -23,35 +23,6 @@ Supports Flatpak's RemoteDesktop portal (for Wayland), Windows and X11.
|
||||||
go install github.com/unrud/remote-touchpad@latest
|
go install github.com/unrud/remote-touchpad@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Linux User Service Installation
|
|
||||||
|
|
||||||
To install remote-touchpad as a user-specific systemd service (no root access required):
|
|
||||||
|
|
||||||
1. Clone the repository and navigate to the project directory:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/Unrud/remote-touchpad.git
|
|
||||||
cd remote-touchpad
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Install the service using the provided wrapper script (no sudo required):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./rts install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Access the service:
|
|
||||||
|
|
||||||
* View service status: `./rts status`
|
|
||||||
* Get URL: `./rts url`
|
|
||||||
* View logs: `./rts log`
|
|
||||||
* Stop service: `./rts stop`
|
|
||||||
* Start service: `./rts start`
|
|
||||||
* Restart service: `./rts restart`
|
|
||||||
* Uninstall: `./rts uninstall`
|
|
||||||
|
|
||||||
The service will run in the background and maintain a persistent connection with URL and QR code accessible via the `url` command.
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Remote Touchpad Service
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=%h/.local/bin/remote-touchpad
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5s
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
149
rts
149
rts
|
|
@ -1,149 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Remote Touchpad CLI Wrapper
|
|
||||||
# Provides easy access to remote-touchpad service
|
|
||||||
|
|
||||||
SERVICE_NAME="remote-touchpad"
|
|
||||||
SERVICE_USER="$USER"
|
|
||||||
|
|
||||||
install() {
|
|
||||||
echo "Installing remote-touchpad as a user systemd service..."
|
|
||||||
|
|
||||||
# Check if Go is installed
|
|
||||||
if ! command -v go &> /dev/null; then
|
|
||||||
echo "Error: Go is not installed. Please install Go first."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building remote-touchpad binary..."
|
|
||||||
go build -tags portal,uinput,x11 -o remote-touchpad
|
|
||||||
|
|
||||||
if [ ! -f "remote-touchpad" ]; then
|
|
||||||
echo "Error: Failed to build remote-touchpad binary"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setup directories
|
|
||||||
mkdir -p ~/.local/bin ~/.config/systemd/user
|
|
||||||
|
|
||||||
echo "Installing service files..."
|
|
||||||
cp remote-touchpad ~/.local/bin/ || echo "Error: cp to ~/.local/bin failed"
|
|
||||||
cp remote-touchpad.service ~/.config/systemd/user/ || echo "Error: cp to ~/.config/systemd/user failed"
|
|
||||||
|
|
||||||
echo "Enabling and starting service..."
|
|
||||||
systemctl --user daemon-reload
|
|
||||||
systemctl --user enable --now ${SERVICE_NAME}.service
|
|
||||||
|
|
||||||
echo "✓ remote-touchpad user service installed and started"
|
|
||||||
echo ""
|
|
||||||
echo "Use './rts status' to check the service"
|
|
||||||
echo "Use './rts url' to get the connection URL"
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
systemctl --user start ${SERVICE_NAME}.service
|
|
||||||
echo "Started remote-touchpad service"
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
systemctl --user stop ${SERVICE_NAME}.service
|
|
||||||
echo "Stopped remote-touchpad service"
|
|
||||||
}
|
|
||||||
|
|
||||||
status() {
|
|
||||||
systemctl --user status ${SERVICE_NAME}.service --no-pager
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
|
||||||
systemctl --user restart ${SERVICE_NAME}.service
|
|
||||||
echo "Restarted remote-touchpad service"
|
|
||||||
}
|
|
||||||
|
|
||||||
url() {
|
|
||||||
# Extract URL from service logs
|
|
||||||
echo "Fetching remote-touchpad URL..."
|
|
||||||
local url=$(journalctl --user -u ${SERVICE_NAME}.service -n 100 --no-pager 2>/dev/null | grep -oE "http://[^ ]+|https://[^ ]+" | tail -1)
|
|
||||||
if [ -n "$url" ]; then
|
|
||||||
echo "Remote Touchpad URL: $url"
|
|
||||||
# Generate QR code if qrencode is available
|
|
||||||
if command -v qrencode &> /dev/null; then
|
|
||||||
echo "Generating QR code..."
|
|
||||||
echo "$url" | qrencode -t ansiutf8
|
|
||||||
else
|
|
||||||
echo "QR code generation requires qrencode. Install it with:"
|
|
||||||
echo " sudo apt-get install qrencode # Debian/Ubuntu"
|
|
||||||
echo " sudo dnf install qrencode # Fedora"
|
|
||||||
echo " brew install qrencode # macOS"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Could not find URL in service logs. Is the service running?"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
log() {
|
|
||||||
echo "Viewing remote-touchpad service logs..."
|
|
||||||
journalctl --user -u ${SERVICE_NAME}.service --no-pager
|
|
||||||
}
|
|
||||||
|
|
||||||
uninstall() {
|
|
||||||
echo "Uninstalling remote-touchpad..."
|
|
||||||
systemctl --user stop ${SERVICE_NAME}.service
|
|
||||||
systemctl --user disable ${SERVICE_NAME}.service
|
|
||||||
rm -f ~/.config/systemd/user/${SERVICE_NAME}.service
|
|
||||||
rm -f ~/.local/bin/remote-touchpad
|
|
||||||
systemctl --user daemon-reload
|
|
||||||
echo "✓ remote-touchpad uninstalled"
|
|
||||||
}
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo "Remote Touchpad CLI Wrapper"
|
|
||||||
echo ""
|
|
||||||
echo "Usage: rts [command]"
|
|
||||||
echo ""
|
|
||||||
echo "Commands:"
|
|
||||||
echo " install - Install remote-touchpad as a systemd user service"
|
|
||||||
echo " start - Start the remote-touchpad service"
|
|
||||||
echo " stop - Stop the remote-touchpad service"
|
|
||||||
echo " status - Check service status"
|
|
||||||
echo " restart - Restart the service"
|
|
||||||
echo " url - Show the remote-touchpad URL"
|
|
||||||
echo " log - View service logs"
|
|
||||||
echo " uninstall - Uninstall the service"
|
|
||||||
echo " help - Show this help message"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Main command handler
|
|
||||||
case "$1" in
|
|
||||||
install)
|
|
||||||
install
|
|
||||||
;;
|
|
||||||
start)
|
|
||||||
start
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
stop
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
url)
|
|
||||||
url
|
|
||||||
;;
|
|
||||||
log)
|
|
||||||
log
|
|
||||||
;;
|
|
||||||
uninstall)
|
|
||||||
uninstall
|
|
||||||
;;
|
|
||||||
help|--help|-h|"")
|
|
||||||
help
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unknown command: $1"
|
|
||||||
help
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue