-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitty-session.bash
63 lines (50 loc) · 1.06 KB
/
kitty-session.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
##
# Creates a kitty session with a few appropriately named
# tabs and windows.
#
# NOTE: Run this script from INSIDE kitty from the directory
# where this file is located.
#
# USAGE:
#
# $ cd /path/to/this/devhowto/directory
# $ bash ./kitty-session.bash
##
if [[ "$TERM" != xterm-kitty ]] ; then
cat 1>&2 <<-'EOF'
!! NOTE !!
This script can only be used from Kitty terminal emulator.'
Bailing out...
EOF
exit 1
fi
win_title='λ DOTFILES λ'
work_dir="$PWD"
kitty @ launch \
--type=tab \
--cwd "$work_dir" \
--tab-title vim \
--title "$win_title"
kitty @ launch \
--type=tab \
--cwd "$work_dir" \
--tab-title shell \
--title "$win_title"
kitty @ launch \
--type=window \
--cwd "$work_dir" \
--title "$win_title"
##
# Focus the shell tab on the right pane and run ‘git status’
# on it.
#
kitty @ focus-tab -m title:shell
kitty @ send-text -m num:1 'git status\n'
##
# Then close the first (original) tab/window that was open just
# so that we could launch the layout session.
kitty @ close-tab -m index:0
#
# vim: set tw=72:
#