Jump to content

How to Set X Display?


squarebracket

Recommended Posts

squarebracket
Posted

synergy-core keeps trying to open my X display as :0. Unfortunately, my X display is actually located on :1.

I edited the systemd file to add DISPLAY=:1 to the environment, and that worked. But, I am wondering if there is some sort of unexposed config, like maybe in /var/lib/synergy/synergy-user.cfg ? Since editing the systemd file feels kind of.... icky.

  • Synergy Team
Posted
On 10/11/2017 at 6:15 PM, squarebracket said:

Since editing the systemd file feels kind of.... icky.

Icky indeed! This is something we're working on in 2.1, so people don't need to edit configs to get it working.

squarebracket
Posted

Alright, I'll keep my eyes open. Thanks for all your work!

Posted

IM NOT ALONE!!!

I honestly thought I was the only person stupid enough to have a problem with this, sadly the AUR package + moderating this forum is about all the time I have after school so I didn't even check if there was a global config.

if you don't want to change the global config you can manually run the synergy core using the command printed after sharing from your server.

this won't auto switch etc but it works for a oneway config.

squarebracket
Posted

By "global config" are you talking about the systemd file? If there's a legit config file I can add it to, that would be great -- I don't want to deal with conflicting files when upgrading. 

Posted
2 minutes ago, squarebracket said:

By "global config" are you talking about the systemd file? If there's a legit config file I can add it to, that would be great -- I don't want to deal with conflicting files when upgrading. 

haha whoops, my mind is doing weird things lately, I type completely different things then what I want to type.o.O

 

The_Vulpecula
Posted
On 11/10/2017 at 1:15 PM, squarebracket said:

synergy-core keeps trying to open my X display as :0. Unfortunately, my X display is actually located on :1.

I edited the systemd file to add DISPLAY=:1 to the environment, and that worked. But, I am wondering if there is some sort of unexposed config, like maybe in /var/lib/synergy/synergy-user.cfg ? Since editing the systemd file feels kind of.... icky.

If anyone is wondering how to add DISPLAY=:1 to the environement, here is my file (/usr/lib/systemd/system/synergy.service)

 

After=network.target

[Service]
Type=simple
Restart=always
RestartSec=0
SyslogLevel=err
Environment=DISPLAY=:1
ExecStart=/usr/bin/synergy-service

[Install]
WantedBy=multi-user.target

 

And finally: 

sudo systemctl daemon-reload 

 

  • 1 month later...
Posted

For the service file exist another possibility.

My Display jumpes around on every start... i don't know why... maybe of my crazy monitor configuration ;-D

After=network.target

[Service]
Type=simple
Restart=always
RestartSec=0
SyslogLevel=err
PassEnvironment=DISPLAY
ExecStart=/usr/bin/synergy-service

[Install]
WantedBy=multi-user.target

Environmet=DISPLAY=:1 just set the Environment variable DISPLAY to :1 for the service and only for the service. It dosn't check if the DISPLAY is :0 or :1 or :2
PassEnvironmet=DISPLAY gives the real current DISPLAY variable to the service. ( Imho more neat)

Greetings

  • 4 weeks later...
Posted

i told garbage in my last post :S

PassEnvironmet=DISPLAY only gives the enviroment variable DISPLAY from systemd
and this is not set. so it gives nothing... atm i don't know for what this command is usefull. Anoter way would be EnvironmetFile=/Path/to/self/created/file

but i found another solution:

You can add the service to your user systemd service manager...

first you need to deactivate the old one.

sudo systemctl disable synergy.service

you need to create an service file in

nano ~/.config/systemd/user/synergy.service

here is my synergy.service

[Unit]
Description=Synergy Service
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=0
SyslogLevel=err
ExecStart=/usr/bin/synergy-service

[Install]
WantedBy=default.target ### Important! not multi-user.target

So it will start after you login. So it will work only for the Server.

Greetings Fabian

Posted

I have noticed that sometimes the systemd synergy.service file can be located in different places. 

In my case it was located at 

     /lib/systemd/system/synergy.service

  • 2 weeks later...
Posted

Adding the display via environment in the service file worked on Fedora.

 

 

Posted

I tried the display and the target solution but I cannot seem to get it working on Ubuntu Xenial 16.04. I paid for the SynergyPro, but I feel that I paid for nothing.

Posted
36 minutes ago, AndresC said:

I tried the display and the target solution but I cannot seem to get it working on Ubuntu Xenial 16.04. I paid for the SynergyPro, but I feel that I paid for nothing.

I got it to work by using

sudo systemctl disable synergy.service

 

and then I had to reboot and then run

cd /usr/lib

sudo synergy-service

Is there any way to run the program without having to do this manually?

Posted
On 1/18/2018 at 8:23 PM, MadMe86 said:

i told garbage in my last post :S

PassEnvironmet=DISPLAY only gives the enviroment variable DISPLAY from systemd
and this is not set. so it gives nothing... atm i don't know for what this command is usefull. Anoter way would be EnvironmetFile=/Path/to/self/created/file

but i found another solution:

You can add the service to your user systemd service manager...

first you need to deactivate the old one.


sudo systemctl disable synergy.service

you need to create an service file in


nano ~/.config/systemd/user/synergy.service

here is my synergy.service


[Unit]
Description=Synergy Service
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=0
SyslogLevel=err
ExecStart=/usr/bin/synergy-service

[Install]
WantedBy=default.target ### Important! not multi-user.target

So it will start after you login. So it will work only for the Server.

Greetings Fabian

I forgot to mention how to enable the user service:

systemctl --user enable synergy.service

@AndresC: if you are using Linux, than that should be a solution for you

@Moderation: i can't edit my post (January 18.) could someone add the mentioned line?

 

Greetings Fabian

  • 2 months later...
Hans van den Akker
Posted

So I have this with 2.0.10 (just bought it) and my Ubuntu 17.10 and Mac OS Sierra machines. I have 6 workspaces running on Ubuntu (master station). 1 till 6. 

WARNING: secondary screen unavailable: unable to open screen

[ Core ] [2018-04-23T21:54:04] DEBUG: XOpenDisplay(":0.0")

Will you enable multi workspaces?

Posted

Hello Hans,

i assume that you are using the Unity look like gnome... the workspaces that you mean are the virtual Desktops, where you can sort your Applications.
Im Using Synergy without Problems with multiple workspaces.

Try

echo $DISPLAY

it shuld be ":0" and then it should work.

if it is someting like :1 then could the stuff in my last post do the trick for you... (if Linux is yout main OS)

A little bit more of the log would be nice.

Greetings MadMe

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...