mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 22:59:15 +00:00
ref(fish): simplified scripts
- removed sd as dependency (use sed instead) - simplified tmux_sessionizer's logic (turned out that primeagen did some redundant stuff)
This commit is contained in:
parent
4af2cf013d
commit
ac817d08fb
4 changed files with 25 additions and 42 deletions
|
|
@ -1,28 +1,20 @@
|
|||
function tmux_home
|
||||
|
||||
set session_name "home"
|
||||
set tmux_running (pgrep tmux)
|
||||
|
||||
# create and attach first session
|
||||
if [ -z "$TMUX" ] && [ -z "$tmux_running" ]
|
||||
# create session if doesn't exist
|
||||
if ! tmux has-session -t=$session_name 2> /dev/null
|
||||
tmux \
|
||||
new-session -s $session_name \; \
|
||||
new-session -ds $session_name \; \
|
||||
new-window -t $session_name \; \
|
||||
select-window -t $session_name:1 \;
|
||||
select-window -t $session_name:1
|
||||
end
|
||||
|
||||
# attach or switch
|
||||
if [ -z $TMUX ]
|
||||
tmux attach-session -t $session_name
|
||||
else
|
||||
# create session is doesn't exist
|
||||
if ! tmux has-session -t=$session_name 2> /dev/null
|
||||
tmux \
|
||||
new-session -ds $session_name \; \
|
||||
new-window -t $session_name \; \
|
||||
select-window -t $session_name:1 \;
|
||||
end
|
||||
# attach or switch
|
||||
if [ -z $TMUX ]
|
||||
tmux attach-session -t $session_name
|
||||
else
|
||||
tmux switch-client -t $session_name
|
||||
end
|
||||
tmux switch-client -t $session_name
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue