Skip to content

Hardcoded DISPLAY Variable Issues #127

Open
@Friendliness

Description

@Friendliness
          @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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions