]> git.r.bdr.sh - rbdr/dotfiles/blob - status-right.sh
Cleans gitmodules
[rbdr/dotfiles] / status-right.sh
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.
5 cwd=$(dirname $0)
6
7 # Source global configurations.
8 source "${cwd}/config.sh"
9
10 # Source lib functions.
11 source "${cwd}/lib.sh"
12
13 segments_path="${cwd}/${segments_dir}"
14
15 # Mute this statusbar?
16 mute_status_check "right"
17
18 # Segment
19 # Comment/uncomment the register function call to enable or disable a segment.
20
21 declare -A pwd
22 pwd+=(["script"]="${segments_path}/pwd.sh")
23 pwd+=(["foreground"]="colour211")
24 pwd+=(["background"]="colour89")
25 pwd+=(["separator"]="${separator_left_bold}")
26 #register_segment "pwd"
27
28 declare -A load
29 load+=(["script"]="${segments_path}/load.sh")
30 load+=(["foreground"]="colour7")
31 load+=(["background"]="colour0")
32 load+=(["separator"]="${separator_left_bold}")
33 register_segment "load"
34
35 declare -A battery
36 if [ "$PLATFORM" == "mac" ]; then
37 battery+=(["script"]="${segments_path}/battery_mac.sh")
38 else
39 battery+=(["script"]="${segments_path}/battery.sh")
40 fi
41 battery+=(["foreground"]="colour7")
42 battery+=(["background"]="colour1")
43 battery+=(["separator"]="${separator_left_bold}")
44 #register_segment "battery"
45
46 declare -A weather
47 weather+=(["script"]="${segments_path}/weather_yahoo.sh")
48 #weather+=(["script"]="${segments_path}/weather_google.sh")
49 weather+=(["foreground"]="colour7")
50 weather+=(["background"]="colour12")
51 weather+=(["separator"]="${separator_left_bold}")
52 register_segment "weather"
53
54 declare -A date_day
55 date_day+=(["script"]="${segments_path}/date_day.sh")
56 date_day+=(["foreground"]="colour0")
57 date_day+=(["background"]="colour7")
58 date_day+=(["separator"]="${separator_left_bold}")
59 register_segment "date_day"
60
61 declare -A date_full
62 date_full+=(["script"]="${segments_path}/date_full.sh")
63 date_full+=(["foreground"]="colour0")
64 date_full+=(["background"]="colour15")
65 date_full+=(["separator"]="${separator_left_thin}")
66 date_full+=(["separator_fg"]="colour0")
67 register_segment "date_full"
68
69 declare -A time
70 time+=(["script"]="${segments_path}/time.sh")
71 time+=(["foreground"]="colour0")
72 time+=(["background"]="colour7")
73 time+=(["separator"]="${separator_left_thin}")
74 time+=(["separator_fg"]="colour0")
75 register_segment "time"
76
77 # Print the status line in the order of registration above.
78 print_status_line_right
79
80 exit 0