]> git.r.bdr.sh - rbdr/dotfiles/blame - status-right.sh
Ignore logs, stuff
[rbdr/dotfiles] / status-right.sh
CommitLineData
30a7092f
BB
1#!/usr/bin/env bash
2# This script prints a string will be evaluated for text attributes (but not shell commands) by tmux. It consists of a bunch of segments that are simple shell scripts/programs that output the information to show. For each segment the desired foreground and background color can be specified as well as what separator to use. The script the glues together these segments dynamically so that if one script suddenly does not output anything (= nothing should be shown) the separator colors will be nicely handled.
3
4# The powerline root directory.
5cwd=$(dirname $0)
6
7# Source global configurations.
8source "${cwd}/config.sh"
9
10# Source lib functions.
11source "${cwd}/lib.sh"
12
13segments_path="${cwd}/${segments_dir}"
14
15# Mute this statusbar?
16mute_status_check "right"
17
18# Segment
19# Comment/uncomment the register function call to enable or disable a segment.
20
21declare -A pwd
22pwd+=(["script"]="${segments_path}/pwd.sh")
23pwd+=(["foreground"]="colour211")
24pwd+=(["background"]="colour89")
25pwd+=(["separator"]="${separator_left_bold}")
26#register_segment "pwd"
27
28declare -A load
29load+=(["script"]="${segments_path}/load.sh")
30load+=(["foreground"]="colour7")
31load+=(["background"]="colour0")
32load+=(["separator"]="${separator_left_bold}")
33register_segment "load"
34
35declare -A battery
36if [ "$PLATFORM" == "mac" ]; then
37 battery+=(["script"]="${segments_path}/battery_mac.sh")
38else
39 battery+=(["script"]="${segments_path}/battery.sh")
40fi
41battery+=(["foreground"]="colour7")
42battery+=(["background"]="colour1")
43battery+=(["separator"]="${separator_left_bold}")
44#register_segment "battery"
45
46declare -A weather
47weather+=(["script"]="${segments_path}/weather_yahoo.sh")
48#weather+=(["script"]="${segments_path}/weather_google.sh")
49weather+=(["foreground"]="colour7")
50weather+=(["background"]="colour12")
51weather+=(["separator"]="${separator_left_bold}")
52register_segment "weather"
53
54declare -A date_day
55date_day+=(["script"]="${segments_path}/date_day.sh")
56date_day+=(["foreground"]="colour0")
57date_day+=(["background"]="colour7")
58date_day+=(["separator"]="${separator_left_bold}")
59register_segment "date_day"
60
61declare -A date_full
62date_full+=(["script"]="${segments_path}/date_full.sh")
63date_full+=(["foreground"]="colour0")
64date_full+=(["background"]="colour15")
65date_full+=(["separator"]="${separator_left_thin}")
66date_full+=(["separator_fg"]="colour0")
67register_segment "date_full"
68
69declare -A time
70time+=(["script"]="${segments_path}/time.sh")
71time+=(["foreground"]="colour0")
72time+=(["background"]="colour7")
73time+=(["separator"]="${separator_left_thin}")
74time+=(["separator_fg"]="colour0")
75register_segment "time"
76
77# Print the status line in the order of registration above.
78print_status_line_right
79
80exit 0