We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e867e0 commit 00ddef7Copy full SHA for 00ddef7
segments/utc_time.sh
@@ -1,6 +1,23 @@
1
# Prints the current time in UTC.
2
3
+TMUX_POWERLINE_SEG_UTC_TIME_FORMAT_DEFAULT="%H:%M %Z"
4
+
5
+generate_segmentrc() {
6
+ read -d '' rccontents << EORC
7
+# date(1) format for the UTC time.
8
+export TMUX_POWERLINE_SEG_UTC_TIME_FORMAT="${TMUX_POWERLINE_SEG_UTC_TIME_FORMAT_DEFAULT}"
9
+EORC
10
+ echo "$rccontents"
11
+}
12
13
+__process_settings() {
14
+ if [ -z "$TMUX_POWERLINE_SEG_UTC_TIME_FORMAT" ]; then
15
+ export TMUX_POWERLINE_SEG_UTC_TIME_FORMAT="${TMUX_POWERLINE_SEG_UTC_TIME_FORMAT_DEFAULT}"
16
+ fi
17
18
19
run_segment() {
- date -u +"%H:%M"
20
+ __process_settings
21
+ date -u +"$TMUX_POWERLINE_SEG_UTC_TIME_FORMAT"
22
return 0
23
}
0 commit comments