Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded DISPLAY Variable Issues #127

Open
Friendliness opened this issue Oct 5, 2023 · 0 comments
Open

Hardcoded DISPLAY Variable Issues #127

Friendliness opened this issue Oct 5, 2023 · 0 comments

Comments

@Friendliness
Copy link

Friendliness commented Oct 5, 2023

          @bruno- alright, that should work. I will try to help! Regarding the DISPLAY variable, I am not a 100% sure. I know that my tmux systemd service works fine right now, on different Ubuntu systems with different gpus (AMD Vega, NVidia RTX, Intel built-in) and with different monitor configurations. But it might be that if we wait for the graphical target anyway, it might not be needed. I think I will need to test that. I'll update the PR after I checked that.

Originally posted by @nuclearglow in #107 (comment)

Heya,

I don't know if it this is directly related to the systemd service you've created in this pull request, but I was having an issue with restored tmux sessions and neovim. The $DISPLAY environment variable you've manually set in the service wasn't always :0 for me, after suspending and unsuspending my device, xclip was unable to copy anything inside of tmux to the clipboard, until I changed the DISPLAY variable manually in the session or opened up a new pane manually.

What I did which seemed to at least fix this for now was simply remove the following line:

[Unit]
Description=tmux default session (detached)
Documentation=man:tmux(1)

[Service]
Type=forking
- Environment=DISPLAY=:0
ExecStart=/usr/bin/tmux new-session -d

ExecStop=/home/friendliness/.config/tmux/plugins/tmux-resurrect/scripts/save.sh
ExecStop=/usr/bin/tmux kill-server
KillMode=control-group

RestartSec=2

[Install]
WantedBy=default.target

If the $DISPLAY variable not being set causes any issues I'm not currently aware of, I can modify the PR I opened to get the variable automatically and not hardcode it.

I'm not very knowledgeable about x11 so this is probably not the most ideal solution but it seemed to work for me.
I'm on a dual monitor setup with an NVIDIA RTX 2080 Ti on Pop_OS.

@Friendliness Friendliness changed the title @bruno- alright, that should work. I will try to help! Regarding the DISPLAY variable, I am not a 100% sure. I know that my tmux systemd service works fine right now, on different Ubuntu systems with different gpus (AMD Vega, NVidia RTX, Intel built-in) and with different monitor configurations. But it might be that if we wait for the graphical target anyway, it might not be needed. I think I will need to test that. I'll update the PR after I checked that. Hardcoded DISPLAY Variable Issues Oct 5, 2023
Friendliness added a commit to Friendliness/tmux-continuum that referenced this issue Oct 5, 2023
Removed the explicitly-set `DISPLAY` variable as described in the following [issue](tmux-plugins#127)

Fixes being unable to copy to clipboard with `xclip` after suspending / unsuspending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant