@@ -63,6 +63,12 @@ | |||||
dest: ~/.config/systemd/user/barrierc@.service | dest: ~/.config/systemd/user/barrierc@.service | ||||
notify: systemd daemon-reload | notify: systemd daemon-reload | ||||
- name: barrier unlock lockscreen service | |||||
template: | |||||
src: barrier/barrier-unlock-lockscreen.service.j2 | |||||
dest: ~/.config/systemd/user/barrier-unlock-lockscreen.service | |||||
notify: systemd daemon-reload | |||||
- name: barrier ssh conection user service | - name: barrier ssh conection user service | ||||
template: | template: | ||||
src: barrier/barrier-ssh-connection@.service.j2 | src: barrier/barrier-ssh-connection@.service.j2 | ||||
@@ -7,10 +7,8 @@ PartOf=graphical-session.target | |||||
[Service] | [Service] | ||||
Type=simple | Type=simple | ||||
ExecStart=sh -c "sleep infinity | ssh $@" ssh -R 24800:localhost:24800 %i\ | ExecStart=sh -c "sleep infinity | ssh $@" ssh -R 24800:localhost:24800 %i\ | ||||
systemctl --user stop lockscreen.service;\ | |||||
systemctl --user start barrierc@localhost.service;\ | |||||
systemd-run --user -u lockscreen-barrier-unlock sh -c "\"cat < lock > /dev/null; systemctl --user start lockscreen.service; systemctl --user stop barrierc@localhost.service;\"";\ | |||||
exec cat > lock | |||||
systemctl --user --wait restart barrier-unlock-lockscreen.service;\ | |||||
exec cat > .barrier-unlock-lockscreen.fifo | |||||
[Install] | [Install] | ||||
WantedBy=graphical-session.target | WantedBy=graphical-session.target |
@@ -0,0 +1,17 @@ | |||||
{{ ansible_managed | comment }} | |||||
[Unit] | |||||
Description=barrier unlock lockscreen until pipe is closed | |||||
PartOf=graphical-session.target | |||||
[Service] | |||||
Type=simple | |||||
ExecStartPre=fish -c "not test -p .barrier-unlock-lockscreen.fifo && mkfifo .barrier-unlock-lockscreen.fifo; test -p .barrier-unlock-lockscreen.fifo" | |||||
ExecStartPost=systemctl --user stop lockscreen.service | |||||
ExecStartPost=systemctl --user start barrierc@localhost.service | |||||
ExecStart=sh -c "cat < .barrier-unlock-lockscreen.fifo" | |||||
ExecStopPost=systemctl --user start lockscreen.service | |||||
ExecStopPost=systemctl --user stop barrierc@localhost.service | |||||
[Install] | |||||
WantedBy=graphical-session.target |