dotfiles/.bin/webdev

28 lines
653 B
Plaintext
Raw Normal View History

2022-12-17 12:11:20 +01:00
#!/bin/sh -x
session=webdev
2022-12-17 19:27:19 +01:00
socket=~/.tmux.sock
arg="$1"
2022-12-17 12:11:20 +01:00
if ! tmux att -t webdev >/dev/null 2>&1
then
# create session
tmux new-session -s $session -d
# window 1
window=1
tmux rename-window -t $session:$window 'edit'
2022-12-17 19:27:19 +01:00
tmux send-keys -t $session:$window 'cd ~/website/site' Enter
2022-12-23 08:01:00 +01:00
tmux send-keys -t $session:$window "nnn" Enter
2022-12-17 12:11:20 +01:00
2022-12-23 08:01:00 +01:00
tmux split-window -t $session:$window -v
tmux resize-pane -t $session:$window.1 -y 6
tmux send-keys -t $session:$window.1 'cd ~/website && make notify' Enter
tmux select-pane -U
2022-12-17 12:11:20 +01:00
2022-12-21 21:39:01 +01:00
luakit -n -u http://localhost >/dev/null 2>&1
2022-12-17 12:11:20 +01:00
# attach to session
tmux att -t webdev
fi