|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
3 | 3 | # Colors |
4 | | -COLOR_PRIMARY="99" # Purpleish |
5 | | -COLOR_SECONDARY="212" # Pinkish |
6 | | -COLOR_ACCENT="50" # Cyan/Teal |
7 | | -COLOR_MUTED="240" # Grey |
| 4 | +export COLOR_PRIMARY="99" # Purpleish |
| 5 | +export COLOR_SECONDARY="212" # Pinkish |
| 6 | +export COLOR_ACCENT="50" # Cyan/Teal |
| 7 | +export COLOR_MUTED="240" # Grey |
8 | 8 |
|
9 | 9 | # Layout Constants |
10 | | -SIDEBAR_WIDTH=25 |
| 10 | +export SIDEBAR_WIDTH=25 |
11 | 11 |
|
12 | 12 | # @description Draw the Tabbed Header |
13 | 13 | # @arg $1 active_tab Name of the active tab (cleanup|updates|maintenance|info) |
14 | 14 | draw_header() { |
15 | 15 | local active_tab=$1 |
16 | | - local tab_cleanup="Cleanup" |
| 16 | + |
| 17 | + # Responsive width check |
| 18 | + local label_cleanup="Cleanup" |
| 19 | + if [[ $(tput cols) -lt 80 ]]; then |
| 20 | + label_cleanup="Clean" |
| 21 | + fi |
| 22 | + |
| 23 | + local tab_cleanup="$label_cleanup" |
17 | 24 | local tab_updates="Updates menu" |
18 | 25 | local tab_maint="Maintenance" |
19 | 26 | local tab_info="Stats" |
20 | 27 |
|
21 | 28 | # Highlight active |
22 | 29 | case $active_tab in |
23 | | - "cleanup") tab_cleanup=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Cleanup ] ") ;; |
| 30 | + "cleanup") tab_cleanup=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ $label_cleanup ] ") ;; |
24 | 31 | "updates") tab_updates=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Updates ] ") ;; |
25 | 32 | "maintenance") tab_maint=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Maintenance ] ") ;; |
26 | 33 | "info") tab_info=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Stats ] ") ;; |
27 | 34 | esac |
28 | 35 |
|
29 | | - # Responsive width check |
30 | | - local clean_label="System Cleanup" |
31 | | - if [[ $(tput cols) -lt 80 ]]; then |
32 | | - clean_label="Clean" |
33 | | - fi |
34 | | - |
35 | 36 | local header_text |
36 | 37 | header_text=$(gum join --horizontal " $tab_cleanup" " $tab_updates" " $tab_maint" " $tab_info") |
37 | 38 |
|
|
0 commit comments