1
1
#! /usr/bin/env bash
2
+ # Verify if the current session is the minimal session
3
+ MINIMAL_SESSION_NAME=$( tmux show-option -gv @tokyo-night-tmux_minimal_session 2> /dev/null)
4
+ TMUX_SESSION_NAME=$( tmux display-message -p ' #S' )
5
+
6
+ if [ " $MINIMAL_SESSION_NAME " = " $TMUX_SESSION_NAME " ]; then
7
+ exit 0
8
+ fi
2
9
3
10
# Imports
4
11
ROOT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /.."
5
12
. " ${ROOT_DIR} /lib/coreutils-compat.sh"
6
13
7
14
# Grab global variable for showing datetime widget, only hide if explicitly disabled
8
15
SHOW_DATETIME=$( tmux show-option -gv @tokyo-night-tmux_show_datetime 2> /dev/null)
16
+ " $MINIMAL_SESSION_NAME $TMUX_SESSION_NAME "
17
+ c
9
18
if [[ $SHOW_DATETIME == " 0" ]]; then
10
19
exit 0
11
20
fi
@@ -22,35 +31,38 @@ time_string=""
22
31
23
32
if [[ $date_format == " YMD" ]]; then
24
33
# Year Month Day date format
25
- date_string=" %Y-%m-%d"
34
+ date_string=" %Y-%m-%d"
26
35
elif [[ $date_format == " MDY" ]]; then
27
36
# Month Day Year date format
28
- date_string=" %m-%d-%Y"
37
+ date_string=" %m-%d-%Y"
29
38
elif [[ $date_format == " DMY" ]]; then
30
39
# Day Month Year date format
31
- date_string=" %d-%m-%Y"
40
+ date_string=" %d-%m-%Y"
32
41
elif [[ $date_format == " hide" ]]; then
33
42
# Day Month Year date format
34
43
date_string=" "
35
44
else
36
45
# Default to YMD date format if not specified
37
- date_string=" %Y-%m-%d"
46
+ date_string=" %Y-%m-%d"
38
47
fi
39
48
40
49
if [[ $time_format == " 12H" ]]; then
41
50
# 12-hour format with AM/PM
42
- time_string=" %I:%M %p "
51
+ time_string=" %I:%M %p"
43
52
elif [[ $time_format == " hide" ]]; then
44
53
# 24-hour format
45
54
time_string=" "
46
55
else
47
56
# Default to 24-hour format if not specified
48
- time_string=" %H:%M "
57
+ time_string=" %H:%M"
49
58
fi
50
59
51
60
separator=" "
52
61
if [[ $date_string && $time_string ]]; then
53
62
separator=" ❬ "
54
63
fi
55
64
56
- echo " $RESET #[fg=${THEME[foreground]} ,bg=${THEME[bblack]} ]$date_string $separator$time_string "
65
+ date_string=" $( date +" $date_string " ) "
66
+ time_string=" $( date +" $time_string " ) "
67
+
68
+ echo " $RESET #[fg=${THEME[foreground]} ,bg=${THEME[bblack]} ] $date_string $separator$time_string "
0 commit comments