commit 095bed5248926aa136dbd54cfff3762abe953089
Author: Jan Palus <[email protected]>
Date:   Wed May 6 11:20:56 2020 +0200

    add systemd unit for autostarting tmux session
    
    inspired by arch's wiki page

 tmux.spec     |  4 ++++
 [email protected] | 11 +++++++++++
 2 files changed, 15 insertions(+)
---
diff --git a/tmux.spec b/tmux.spec
index 43bbee1..a83903d 100644
--- a/tmux.spec
+++ b/tmux.spec
@@ -16,6 +16,7 @@ Source2:      
https://raw.githubusercontent.com/keith/tmux.vim/master/syntax/tmux.vim
 # Source2-md5: cd1169a1757b515b5c57816d339c6f72
 Source3:       
https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux
 # Source3-md5: 6d65c0f42c74f61602a399d7bb04a85c
+Source4:       [email protected]
 URL:           http://tmux.github.io/
 BuildRequires: libevent-devel
 BuildRequires: libutempter-devel
@@ -91,6 +92,8 @@ install %{SOURCE1} 
$RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/ftdetect/tmux.vim
 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/syntax
 install -d $RPM_BUILD_ROOT%{bash_compdir}
 sed -e '1s,#!/usr/bin/env bash,#!/bin/bash,' %{SOURCE3} > 
$RPM_BUILD_ROOT%{bash_compdir}/%{name}
+install -d $RPM_BUILD_ROOT%{systemdunitdir}
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -100,6 +103,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc CHANGES COPYING README
 %attr(755,root,root) %{_bindir}/tmux
 %{_mandir}/man1/tmux.1*
+%{systemdunitdir}/[email protected]
 
 %files -n vim-syntax-tmux
 %defattr(644,root,root,755)
diff --git a/[email protected] b/[email protected]
new file mode 100644
index 0000000..0234a2d
--- /dev/null
+++ b/[email protected]
@@ -0,0 +1,11 @@
+[Unit]
+Description=Start tmux in detached session
+
+[Service]
+Type=forking
+User=%I
+ExecStart=/usr/bin/tmux new-session -s %u -d
+ExecStop=/usr/bin/tmux kill-session -t %u
+
+[Install]
+WantedBy=multi-user.target
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tmux.git/commitdiff/095bed5248926aa136dbd54cfff3762abe953089

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to