Use EnvironmentFile for tmux service
This commit is contained in:
parent
bed0959126
commit
93f4b81fb9
3 changed files with 25 additions and 2 deletions
|
|
@ -14,16 +14,29 @@
|
|||
|
||||
- name: Copy tmux service
|
||||
ansible.builtin.template:
|
||||
src: "templates/tmux.j2"
|
||||
src: "templates/tmux/service.j2"
|
||||
dest: "{{ xdg_config_dir }}/systemd/user/tmux.service"
|
||||
mode: "0644"
|
||||
notify:
|
||||
- User daemon-reload
|
||||
- Restart tmux service
|
||||
|
||||
- name: Create tmux configuration directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ xdg_config_dir }}/tmux"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy tmux startup script
|
||||
ansible.builtin.copy:
|
||||
src: "files/tmux_start"
|
||||
dest: "{{ ansible_env.HOME }}/.local/bin/tmux_start"
|
||||
mode: "0740"
|
||||
force: false
|
||||
|
||||
- name: Copy tmux environment file
|
||||
ansible.builtin.template:
|
||||
src: "templates/tmux/env.j2"
|
||||
dest: "{{ xdg_config_dir }}/tmux/env"
|
||||
mode: "0755"
|
||||
force: false
|
||||
|
|
|
|||
10
templates/tmux/env.j2
Normal file
10
templates/tmux/env.j2
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
WAYLAND_DISPLAY=wayland-0
|
||||
XDG_CONFIG_DIRS=/home/sonny/.config/kdedefaults:/etc/xdg
|
||||
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
|
||||
XDG_MENU_PREFIX=plasma-
|
||||
XDG_SEAT=seat0
|
||||
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
|
||||
XDG_SESSION_CLASS=user
|
||||
XDG_VTNR=2
|
||||
XDG_SESSION_ID=2
|
||||
XDG_DATA_DIRS=/home/sonny/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
Description=Tmux startup script
|
||||
|
||||
[Service]
|
||||
Environment=WAYLAND_DISPLAY=wayland-0
|
||||
EnvironmentFile={{ xdg_config_dir }}/tmux/env
|
||||
ExecStart=/home/sonny/.local/bin/tmux_start
|
||||
Type=forking
|
||||
RemainAfterExit=yes
|
||||
Loading…
Add table
Add a link
Reference in a new issue