Commit Graph

59 Commits

Author SHA1 Message Date
Friendliness
ac905ad286
Update systemd_enable.sh
Removed the explicitly-set `DISPLAY` variable as described in the following [issue](https://github.com/tmux-plugins/tmux-continuum/issues/127)

Fixes being unable to copy to clipboard with `xclip` after suspending / unsuspending.
2023-10-05 17:35:06 +02:00
Yevgeny Kuznetsov
fa60087d41
Fix syntax errors in auto-start osx iterm script
Fix AppleScript syntax errors in iterm automatic start osx script:

* 102:110: syntax error: Expected end of line but found identifier. (-2741)
* 60:64: syntax error: Expected end of line but found identifier. (-2741)
* 155:159: syntax error: Expected end of line but found identifier. (-2741)
2022-07-19 04:28:40 -04:00
Matt Katz
514093f429
Update systemd_enable.sh 2022-06-10 12:17:00 -04:00
Bruno Sutic
9329afa932
Add Sven Vowe @nuclearglow as a systemd maintainer 2022-06-03 10:57:42 +02:00
Bruno Sutic
0ad6174ec5
Style fixes 2022-05-30 08:45:23 +02:00
Paul Elliott
3d10915bfa Fix systemd unit install on clean system
If the .config/systemd/user directory did not exist, it would not get
created, as the mkdir command was inside the function
systemd_unit_file() which is piped into the target file. The shell
determined that file could not be created first (as the directory did
not exist), so never called the function.

Signed-off-by: Paul Elliott <paul@niburu.org>
2022-05-18 16:57:29 +01:00
mattkatz
280f9bdffb switch from which to command -v for tmux invoke
command -v is posix and on all systems, which isn't

Of course, this is probably a quibble as anything that has systemd on it
probably has which.
2022-01-20 18:28:17 -05:00
Bruno Sutic
912149820b
Merge pull request #27 from knopki/patch-1
systemd_enable.sh: is_enabled -> is-enabled
2021-12-02 09:01:08 +01:00
Bruno Sutic
c02b4ec711
Merge pull request #53 from andydna/andydna
don't overwrite systemd unit file if it already exists
2021-12-02 09:00:17 +01:00
Toni Müller
669c3cfcc3
different tmux installation paths for systemd 2021-12-01 15:16:27 +01:00
Adrian Haasler García
aaf3515048
Add option to set restore max delay
This enables the user to set a custom max delay time for the auto
restore process to trigger. When the .tmux.conf loads multiple or slow
plugins 10 seconds is not enough.
2021-06-05 14:49:32 +02:00
kqwyf
4c84c4062f enable user to set the path of tmux-resurrect's save.sh.
replace the hard-coded path by a more elegant one.
2021-04-28 13:58:44 +08:00
Dale Sedivec
f32dd4e093
Delete stray lines at end of script
I'm not using this script, and I haven't looked very far into it, but based on the other scripts in this directory, I am guessing this line (which, I think, references a function that doesn't exist) was left in by accident.  This commit removes it.
2021-03-10 03:36:32 -06:00
Bruno Sutic
113826b161
Merge pull request #87 from evandroforks/master
Fixed scripts/handle_tmux_automatic_start/README.md symlink
2020-12-19 14:45:22 +01:00
evandrocoan
7d9d43b8a5 Fixed scripts/handle_tmux_automatic_start/README.md symlink
GitHub Pages failed to build your site.
https://github.com/evandrocoan/dotfiles/runs/1504131690

The symbolic link
/scripts/tmux-continuum/scripts/handle_tmux_automatic_start/README.md
targets a file which does not exist within your site's repository.
2020-12-05 15:05:38 -03:00
Chris Minton
154e386bbe
feat: add alacritty to the list of auto start terminals 2020-12-01 00:07:20 +00:00
Bruno Sutic
b84edbcb11
Rename variable and function names 2020-07-08 09:10:46 +02:00
Dillon Lees
cf5715d5fa
chore: use tabs instead of spaces for formatting 2020-07-08 09:02:00 +02:00
Dillon Lees
9f0cf6581b feat: add kitty to the list of supported terminals for automatic start 2020-07-06 02:00:50 -04:00
v9v
1531b3770a
Fix for multiple users on the same machine
The issue and fix are described in https://github.com/tmux-plugins/tmux-continuum/issues/16 .

Without this change, tmux-continuum works only for one tmux server on the machine. In a multi-user environment (e.g. a shared server), when multiple users are running their own tmux servers, this means that tmux-continuum works only for one of the users.

This change enables tmux-continuum for one tmux server per user instead of one tmux server per machine.
2020-02-29 01:37:58 +01:00
v9v
ff63f86678
continuum_save.sh: Improvements to locking code
* moved the locking to a separate function "acquire_lock"
* changed $[ ] to $(( )), for consistency with the rest of the file
* taking the lock only after checking all other preconditions (they are non-mutating and thread-safe)
2019-07-13 14:16:42 +02:00
v9v
3917404668
Fix race condition in saving lock
Two consecutive calls to "date +%s" can return different values. Call "date" only once and reuse the result.
2019-07-09 10:46:56 +02:00
v9v
800488ca6f
Replace flock with mkdir
flock is not supported on MacOS.

`mkdir` locks have a drawback: they are not cleaned up automatically. If the lock owner crashed before cleaning up the lock, the directory will stay in the filesystem and the lock will be never acquired by someone else. To avoid that, we create temporary locks (the lockdir name changes every 100 seconds). We grab two lock (N and N+1) to avoid the case where process A grabs lock N and process B grabs lock N+1 and both enter the critical section.
2019-07-08 15:58:42 +02:00
v9v
10e612d72c
Handle missing flock
If flock is not installed, fall back to the thread-unsafe version.
2019-07-05 19:33:12 +02:00
v9v
721890d22f Fix race condition in autosave
Fixes the case where multiple tmux sessions call auto-save at the same time, which occasionally results in multiple instances of save_all() running in parallel and causing issues like #3 and tmux-plugins/tmux-resurrect#294.

The sequence in main() is:
1. Check enough_time_since_last_run_passed
2. Save
3. Update last_save_timestamp.

The race here is:
* process A finishes step 1 and is busy with step 2. The timestamp is not updated yet.
* process B comes to step 1, sees the old timestamp and proceeds to step 2, too.
2019-07-04 20:21:02 +02:00
andydna
f1197ab2d2 don't overwrite systemd unit file if it already exists 2018-11-28 11:11:12 -06:00
neynt
6ed3078f47 Make user systemd dir if it doesn't exist 2017-10-14 11:25:00 -04:00
Sergey Korolev
bbe707ec3d systemd_enable.sh: is_enabled -> is-enabled
Typo in systemctl check prevents tmux service to autostart.
2016-09-17 03:23:28 +03:00
Jim Rosser
438e50d54f replaced hardcoded home directory in Systemd ExecStop with HOME variable 2016-01-23 09:39:06 -06:00
Pete Peteches McCabe
3ed7db77f2
Re-named tmux variable to maintain consistency. 2016-01-09 16:28:48 +01:00
Pete Peteches McCabe
328d070787
Removing debug opts. 2016-01-09 16:28:47 +01:00
Pete Peteches McCabe
53853713eb
Swiched default command to new-session -d
- need the -d to start the server correctly as it does not have an emulator to
  attach the session to.
2016-01-09 16:28:45 +01:00
Pete Peteches McCabe
fb52a173b8
Switched to forking to better represent server nature of tmux.
- Also added RestartSec option to fix minor issues with restarts trying to
  start the server before it had fully shutdown.
2016-01-09 16:28:44 +01:00
Pete Peteches McCabe
b495ea2912
set default tmux start command to new-session 2016-01-09 16:28:44 +01:00
Pete Peteches McCabe
65d627af30
Removed automatic restore as screwed pane organisation.
- this caused issues with the restore missing some processes and putting
  others in the wrong place.

- I think this may need some work with the tmux-resurrect plugin to fix if auto
  restore is to be used.
2016-01-09 16:28:41 +01:00
Pete Peteches McCabe
a9cbf68546
Added defaults for tmux start command variable. 2016-01-09 16:28:40 +01:00
Pete Peteches McCabe
05a4a827e5
initial stab at systemd support for tmux-continuum 2016-01-09 16:28:39 +01:00
Bruno Sutic
d0cebe0804
Continuum status 2015-11-29 18:36:13 +01:00
Bruno Sutic
186c2b9e9b
Move all docs to 'docs/' dir 2015-10-08 18:44:32 +02:00
Bruno Sutic
d6ac017d1d
Bugfix: do not count tmux source-file as tmux process
Do not count `tmux source-file .tmux.conf` as a tmux process when checking if
other tmux server is running.

Previously, this caused interpolation command not to be inserted into
`status-right` because `tmux source-file` was falsely detected as another tmux
server.
2015-03-14 15:55:00 +01:00
Bruno Sutic
bdc47273d3
Properly quote scripts 2015-02-20 15:48:36 +01:00
Bruno Sutic
20a83738c0
Rename the plugin to 'tmux-continuum' 2015-02-20 13:38:09 +01:00
Bruno Sutic
e384ce1040
Document tmux multi-server behavior in the readme 2015-02-20 02:59:15 +01:00
Bruno Sutic
fb641881c2
Don't start auto-saving if another tmux server is running 2015-02-20 02:05:58 +01:00
Bruno Sutic
ab3e951cfa
Do not auto-restore tmux env if there's another tmux server already running 2015-02-20 00:34:01 +01:00
Bruno Sutic
4939459f33 Improve 'tmux auto start' readme 2015-02-19 22:58:10 +01:00
Bruno Sutic
1acd25cff2
Change restore script function name 2015-02-19 13:53:23 +01:00
Bruno Sutic
061f024c0a
Bugfixes for Terminal.app and iTerm tmux start scripts 2015-02-19 13:43:41 +01:00
Bruno Sutic
57226cfb97
Docs for tmux auto start feature 2015-02-18 16:52:14 +01:00
Bruno Sutic
b82aa1d343
Bugfixes for launchd plist on OS X 2015-02-18 16:24:01 +01:00