-
Notifications
You must be signed in to change notification settings - Fork 8
/
srcery.tmux
executable file
·45 lines (38 loc) · 1.35 KB
/
srcery.tmux
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
#!/bin/sh
########################################################################
# File name: srcery.tmux
# Project: srcery color scheme for tmux
# Version: 0.0.2
# Copyright: Birger J. Nordølum <[email protected]>
#
# This is the main file for the tmux color scheme. This file loads the
# theme files, and run throug the options by the user.
#
########################################################################
SRCERY_TMUX_COLOR_THEME_FILE=themes/srcery.conf
SRCERY_TMUX_STATUS_PATCHED_FILE=themes/srcery_patched.conf
SRCERY_TMUX_STATUS_NO_PATCHED_FILE=themes/srcery_no_patched.conf
SRCERY_TMUX_PATCHED_FONT_OPTION="@srcery_tmux_patched_font"
CURRENT_DIR="$(cd "$(dirname "${0}")" && pwd)"
__cleanup() {
unset -v SRCERY_TMUX_COLOR_THEME_FILE SRCERY_TMUX_VERSION
unset -v SRCERY_TMUX_STATUS_PATCHED_FILE
unset -v SRCERY_TMUX_STATUS_NO_PATCHED_FILE
unset -v SRCERY_TMUX_PATCHED_FONT_OPTION
unset -v CURRENT_DIR
unset -v patched_font
unset -f __load __cleanup
}
__load() {
tmux source-file "$CURRENT_DIR/$SRCERY_TMUX_COLOR_THEME_FILE"
patched_font=$(tmux show-option -gqv \
"$SRCERY_TMUX_PATCHED_FONT_OPTION")
if [ "$patched_font" != "1" ]; then
tmux source-file "$CURRENT_DIR/$SRCERY_TMUX_STATUS_NO_PATCHED_FILE"
else
tmux source-file "$CURRENT_DIR/$SRCERY_TMUX_STATUS_PATCHED_FILE"
fi
}
__load
__cleanup
# vim: filetype=sh:formatoptions-=t: