Closed davebooi closed 1 month ago
Hi @davebooi
The current implementation supports only X11, as Wayland uses a different protocol for rendering GUI windows.
I will try to implement a terminal-based approach on Linux to avoid issues with GUIs.
I will update it in README
Hi @davebooi
Can you run it without using sudo?
python3 main.py
Hi @davebooi, Here are some potential solutions:
sudo
with -E
optionThe -E
option preserves the environment variables, including DISPLAY
. Run your command like this:
sudo -E python3 main.py
DISPLAY
variableManually set the DISPLAY
variable before running the script:
export DISPLAY=:0
sudo python3 main.py
xhost
to allow accessTemporarily allow the root
user access to the X server:
xhost +SI:localuser:root
sudo python3 main.py
After running your script, revoke the access:
xhost -SI:localuser:root
sudo
If your script doesn't need elevated privileges, consider running it without sudo
:
python3 main.py
.Xauthority
fileEnsure that the .Xauthority
file is correctly set up. Check its existence and permissions:
ls -l ~/.Xauthority
If it’s missing, you might need to regenerate it or make sure your user has access.
If you're running this on a headless server (no GUI), consider using a virtual display like Xvfb
:
sudo apt-get install xvfb
Xvfb :1 -screen 0 1024x768x16 &
export DISPLAY=:1
python3 main.py
Hi @davebooi
Can you run it without using sudo?
python3 main.py
nope, error is "no module named gi"
Hi @davebooi, Here are some potential solutions:
1. Use
sudo
with-E
optionThe
-E
option preserves the environment variables, includingDISPLAY
. Run your command like this:sudo -E python3 main.py
2. Set the
DISPLAY
variableManually set the
DISPLAY
variable before running the script:export DISPLAY=:0 sudo python3 main.py
3. Use
xhost
to allow accessTemporarily allow the
root
user access to the X server:xhost +SI:localuser:root sudo python3 main.py
After running your script, revoke the access:
xhost -SI:localuser:root
4. Run without
sudo
If your script doesn't need elevated privileges, consider running it without
sudo
:python3 main.py
5. Check for a
.Xauthority
fileEnsure that the
.Xauthority
file is correctly set up. Check its existence and permissions:ls -l ~/.Xauthority
If it’s missing, you might need to regenerate it or make sure your user has access.
6. Use a virtual display
If you're running this on a headless server (no GUI), consider using a virtual display like
Xvfb
:sudo apt-get install xvfb Xvfb :1 -screen 0 1024x768x16 & export DISPLAY=:1 python3 main.py
Error message is the same with the E flag.
xfvb is not applicable (I think since I don't have any X11 componends in my setup
Most built-in modules rely on X11, which has been around since 1987. To implement support for Wayland, core modules need to be compatible with Wayland, as it was released later, in 2012. Therefore, the best option in my case is to build a terminal version specifically for Wayland users or to use Wayland GUI libraries. This is why Linux does not have a single executable that can run on all systems.
I will be developing a terminal-based version and will announce it soon.
Thank you!
Hi @davebooi
I am happy to announce that a terminal/non-GUI-based implementation has been released. see here
Thank you!
Thank you so much for the update, appreciate it! Just tested the new version. Using a reverse proxy setup.
This is the error message I get upon starting the terminal version
Server is running in a cloudflare tunnel, reverse proxy setting is used as per screenshot. I can connect to the server just fine from android as well as the linux non-GUI version.
However, the clipboard isn't shared between the devices.
Attaching the server logfiles _clipcascade-server-clipcascade-1_logs.txt
Happy to share more logs if required!
Hi @davebooi,
The Step 3: Install Gtk 3.0 for Clipboard Sharing has not been done properly because you are using a virtual environment (venv).
To install GTK and GDK libraries, please use the following command:
sudo pacman -S gtk3 gdk-pixbuf2
Edit: If the issue still exist I will try on Arch Linux
Thanks again for your help on this, appreciated.
All the necessary packages are installed. In Arch I need to create a virtual environment to install the pip requirements, hence the use of venv.
Hi @davebooi
Please remove the existing ClipCascade code from your machine and reinstall the ClipCascade_Linux_Terminal.zip
file.
Then, follow these instructions (there's no need to create a virtual environment)
sudo pacman -Syu --noconfirm python python-pip python-gobject xclip
sudo pacman -S --noconfirm python-xxhash python-pyperclip python-requests python-websocket-client python-pycryptodome python-pyfiglet
sudo pacman -S --noconfirm python-gobject gtk3
sudo python3 main.py
I followed the description step by step, uninstalled previous versions and am using it without a virtual environment at the moment. The error message is still present upon start:
I tested it on Arch, and it worked fine for me.
In your case, it seems GTK couldn't access the clipboard for the current display, likely because no valid display was detected. Is the program running in a headless environment or a virtual machine?
can you share the output for echo $DISPLAY
strange indeed, I'm using Hyprland as a Window Manager.
The output of echo $DISPLAY is :0
Hi @davebooi
I’ll reinstall it once I have some free time and will keep you updated.
Hi @davebooi,
I apologize for the delay. The new terminal app has been released, and it now works on all Linux distros.
Thank you!
I can indeed confirm that the latest version is working as intended! Clipboard sync works on mobile & laptop with
arch Hyprland 0.4.5 ClipCascade version 1.1.0
Appreciate the time you took to fix this - thanks!
Description
App won't start on Wayland without X11 backend. Details as per below
Steps to Reproduce
Expected Behavior
App should start
Actual Behavior
App is crashing with an error message: `
Environment
/label ~bug ~needs-investigation