chore: replace all dracula occurrences with kanagawa

This commit is contained in:
Nybkox 2023-12-21 03:32:56 +01:00 committed by Kevin Baensch
parent c2b1d67cbd
commit a5bee81d7a
No known key found for this signature in database
24 changed files with 213 additions and 205 deletions

View file

@ -23,9 +23,9 @@ programs.tmux = {
{
plugin = dracula;
extraConfig = ''
set -g @dracula-show-battery false
set -g @dracula-show-powerline true
set -g @dracula-refresh-rate 10
set -g @kanagawa-show-battery false
set -g @kanagawa-show-powerline true
set -g @kanagawa-refresh-rate 10
'';
}
];
@ -44,20 +44,20 @@ programs.tmux = {
#### Configuration
To enable plugins set up the `@dracula-plugins` option in you `.tmux.conf` file, separate plugin by space.
To enable plugins set up the `@kanagawa-plugins` option in you `.tmux.conf` file, separate plugin by space.
The order that you define the plugins will be the order on the status bar left to right.
```bash
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, playerctl, kubernetes-context, synchronize-panes
set -g @dracula-plugins "cpu-usage gpu-usage ram-usage"
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, kubernetes-context, synchronize-panes
set -g @kanagawa-plugins "cpu-usage gpu-usage ram-usage"
```
For each plugin is possible to customize background and foreground colors
```bash
# available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
# set -g @dracula-[plugin-name]-colors "[background] [foreground]"
set -g @dracula-cpu-usage-colors "pink dark_gray"
# set -g @kanagawa-[plugin-name]-colors "[background] [foreground]"
set -g @kanagawa-cpu-usage-colors "pink dark_gray"
```
#### Status bar options
@ -65,56 +65,56 @@ set -g @dracula-cpu-usage-colors "pink dark_gray"
Enable powerline symbols
```bash
set -g @dracula-show-powerline true
set -g @kanagawa-show-powerline true
```
Switch powerline symbols
```bash
# for left
set -g @dracula-show-left-sep 
set -g @kanagawa-show-left-sep 
# for right symbol (can set any symbol you like as separator)
set -g @dracula-show-right-sep 
set -g @kanagawa-show-right-sep 
```
Enable window flags
```bash
set -g @dracula-show-flags true
set -g @kanagawa-show-flags true
```
Adjust the refresh rate for the status bar
```bash
# the default is 5, it can accept any number
set -g @dracula-refresh-rate 5
set -g @kanagawa-refresh-rate 5
```
Switch the left smiley icon
```bash
# it can accept `hostname` (full hostname), `session`, `shortname` (short name), `smiley`, `window`, or any character.
set -g @dracula-show-left-icon session
set -g @kanagawa-show-left-icon session
```
Add padding to the left smiley icon
```bash
# default is 1, it can accept any number and 0 disables padding.
set -g @dracula-left-icon-padding 1
set -g @kanagawa-left-icon-padding 1
```
Enable high contrast pane border
```bash
set -g @dracula-border-contrast true
set -g @kanagawa-border-contrast true
```
Hide empty plugins
```bash
set -g @dracula-show-empty-plugins false
set -g @kanagawa-show-empty-plugins false
```
#### cpu-usage options
@ -122,13 +122,13 @@ set -g @dracula-show-empty-plugins false
Customize label
```bash
set -g @dracula-cpu-usage-label "CPU"
set -g @kanagawa-cpu-usage-label "CPU"
```
Show system load average instead of CPU usage percentage (default)
```bash
set -g @dracula-cpu-display-load true
set -g @kanagawa-cpu-display-load true
```
CPU usage percentage (default) - in percentage (output: %)
@ -139,7 +139,7 @@ Load average is the average system load calculated over a given period of ti
Customize label
```bash
set -g @dracula-battery-label "Battery"
set -g @kanagawa-battery-label "Battery"
```
#### gpu-usage options
@ -149,7 +149,7 @@ Note, currently only the Linux NVIDIA Proprietary drivers are supported. Nouveau
Customize label
```bash
set -g @dracula-gpu-usage-label "GPU"
set -g @kanagawa-gpu-usage-label "GPU"
```
#### ram-usage options
@ -157,7 +157,7 @@ set -g @dracula-gpu-usage-label "GPU"
Customize label
```bash
set -g @dracula-ram-usage-label "RAM"
set -g @kanagawa-ram-usage-label "RAM"
```
#### tmux-ram-usage options
@ -165,7 +165,7 @@ set -g @dracula-ram-usage-label "RAM"
Customize label
```bash
set -g @dracula-tmux-ram-usage-label "MEM"
set -g @kanagawa-tmux-ram-usage-label "MEM"
```
#### network-bandwidth
@ -175,9 +175,9 @@ Displaying of the interface name, The interval between each bandwidth update.
The most common interfaces name are `eth0` for a wired connection and `wlan0` for a wireless connection.
```bash
set -g @dracula-network-bandwidth eth0
set -g @dracula-network-bandwidth-interval 0
set -g @dracula-network-bandwidth-show-interface true
set -g @kanagawa-network-bandwidth eth0
set -g @kanagawa-network-bandwidth-interval 0
set -g @kanagawa-network-bandwidth-show-interface true
```
#### network-ping options
@ -185,15 +185,15 @@ set -g @dracula-network-bandwidth-show-interface true
You can configure which server (hostname, IP) you want to ping and at which rate (in seconds). Default is google.com at every 5 seconds.
```bash
set -g @dracula-ping-server "google.com"
set -g @dracula-ping-rate 5
set -g @kanagawa-ping-server "google.com"
set -g @kanagawa-ping-rate 5
```
### ssh-session options
Show SSH session port
```bash
set -g @dracula-show-ssh-session-port true
set -g @kanagawa-show-ssh-session-port true
```
#### time options
@ -201,24 +201,24 @@ set -g @dracula-show-ssh-session-port true
Disable timezone
```bash
set -g @dracula-show-timezone false
set -g @kanagawa-show-timezone false
```
Swap date to day/month
```bash
set -g @dracula-day-month true
set -g @kanagawa-day-month true
```
Enable military time
```bash
set -g @dracula-military-time true
set -g @kanagawa-military-time true
```
Set custom time format e.g (2023-01-01 14:00)
```bash
set -g @dracula-time-format "%F %R"
set -g @kanagawa-time-format "%F %R"
```
See [[this page]](https://man7.org/linux/man-pages/man1/date.1.html) for other format symbols.
@ -226,68 +226,68 @@ See [[this page]](https://man7.org/linux/man-pages/man1/date.1.html) for other f
Hide details of git changes
```bash
set -g @dracula-git-disable-status true
set -g @kanagawa-git-disable-status true
```
Set symbol to use for when branch is up to date with HEAD
```bash
# default is ✓. Avoid using non unicode characters that bash uses like $, * and !
set -g @dracula-git-show-current-symbol ✓
set -g @kanagawa-git-show-current-symbol ✓
```
Set symbol to use for when branch diverges from HEAD
```bash
# default is unicode !. Avoid bash special characters
set -g @dracula-git-show-diff-symbol !
set -g @kanagawa-git-show-diff-symbol !
```
Set symbol or message to use when the current pane has no git repo
```bash
# default is unicode no message
set -g @dracula-git-no-repo-message ""
set -g @kanagawa-git-no-repo-message ""
```
Hide untracked files from being displayed as local changes
```bash
# default is false
set -g @dracula-git-no-untracked-files true
set -g @kanagawa-git-no-untracked-files true
```
Show remote tracking branch together with diverge/sync state
```bash
# default is false
set -g @dracula-git-show-remote-status true
set -g @kanagawa-git-show-remote-status true
```
#### hg options
Hide details of hg changes
```bash
set -g @dracula-hg-disable-status true
set -g @kanagawa-hg-disable-status true
```
Set symbol to use for when branch is up to date with HEAD
```bash
#default is ✓.Avoid using non unicode characters that bash uses like $, * and !
set -g @dracula-hg-show-current-symbol ✓
set -g @kanagawa-hg-show-current-symbol ✓
```
Set symbol to use for when branch diverges from HEAD
```bash
#default is unicode !.Avoid bash special characters
set -g @dracula-hg-show-diff-symbol !
set -g @kanagawa-hg-show-diff-symbol !
```
Set symbol or message to use when the current pane has no hg repo
```bash
#default is unicode no message
set -g @dracula-hg-no-repo-message ""
set -g @kanagawa-hg-no-repo-message ""
```
Hide untracked files from being displayed as local changes
```bash
#default is false
set -g @dracula-hg-no-untracked-files false
set -g @kanagawa-hg-no-untracked-files false
```
#### weather options
@ -295,19 +295,19 @@ set -g @dracula-hg-no-untracked-files false
Switch from default fahrenheit to celsius
```bash
set -g @dracula-show-fahrenheit false
set -g @kanagawa-show-fahrenheit false
```
Set your location manually
```bash
set -g @dracula-fixed-location "Some City"
set -g @kanagawa-fixed-location "Some City"
```
Hide your location
```bash
set -g @dracula-show-location false
set -g @kanagawa-show-location false
```
#### synchronize-panes options
@ -315,21 +315,21 @@ set -g @dracula-show-location false
Customize label
```bash
set -g @dracula-synchronize-panes-label "Sync"
set -g @kanagawa-synchronize-panes-label "Sync"
```
#### attached-clients options
Set the minimum number of clients to show (otherwise, show nothing)
```bash
set -g @dracula-clients-minimum 1
set -g @kanagawa-clients-minimum 1
```
Set the label when there is one client, or more than one client
```bash
set -g @dracula-clients-singular client
set -g @dracula-clients-plural clients
set -g @kanagawa-clients-singular client
set -g @kanagawa-clients-plural clients
```
#### Kubernetes options
@ -337,25 +337,25 @@ set -g @dracula-clients-plural clients
Add prefix label before the context
```bash
set -g @dracula-kubernetes-context-label "Some Label"
set -g @kanagawa-kubernetes-context-label "Some Label"
```
Hide user from the context string
```
set -g @dracula-kubernetes-hide-user true
set -g @kanagawa-kubernetes-hide-user true
```
Hide ARN (show only cluster name) - Available for EKS only (only available for cluster names that are ARNs)
```
set -g @dracula-kubernetes-eks-hide-arn true
set -g @kanagawa-kubernetes-eks-hide-arn true
```
Extract the account as a prefix to the cluster name - Available for EKS only (only available for cluster names that are ARNs)
```
set -g @dracula-kubernetes-eks-extract-account true
set -g @kanagawa-kubernetes-eks-extract-account true
#### continuum options
@ -366,13 +366,13 @@ Set the output mode. Options are:
- **interval**: Show the continuum save interval
```bash
set -g @dracula-continuum-mode countdown
set -g @kanagawa-continuum-mode countdown
```
Show if the last save was performed less than 60 seconds ago (default threshold is 15 seconds)
```bash
set -g @dracula-continuum-time-threshold 60
set -g @kanagawa-continuum-time-threshold 60
```
#### Playerctl format

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
# source and run dracula theme
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$current_dir/scripts/dracula.sh

7
kanagawa.tmux Normal file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# source and run kanagawa theme
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
$current_dir/scripts/kanagawa.sh

View file

@ -3,9 +3,9 @@
export LC_ALL=en_US.UTF-8
# configuration
# @dracula-clients-minimum 1
# @dracula-clients-singular client
# @dracula-clients-plural clients
# @kanagawa-clients-minimum 1
# @kanagawa-clients-singular client
# @kanagawa-clients-plural clients
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $current_dir/utils.sh
@ -17,14 +17,14 @@ count_clients() {
main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
clients_count=$(count_clients)
clients_minimum=$(get_tmux_option "@dracula-clients-minimum" 1)
clients_minimum=$(get_tmux_option "@kanagawa-clients-minimum" 1)
if (( $clients_count >= $clients_minimum )); then
if (( $clients_count > 1 )); then
clients_label=$(get_tmux_option "@dracula-clients-plural" "clients")
clients_label=$(get_tmux_option "@kanagawa-clients-plural" "clients")
else
clients_label=$(get_tmux_option "@dracula-clients-singular" "client")
clients_label=$(get_tmux_option "@kanagawa-clients-singular" "client")
fi
echo "$clients_count $clients_label"
fi

View file

@ -111,7 +111,7 @@ battery_status()
main()
{
bat_label=$(get_tmux_option "@dracula-battery-label" "♥")
bat_label=$(get_tmux_option "@kanagawa-battery-label" "♥")
bat_stat=$(battery_status)
bat_perc=$(battery_percent)

View file

@ -3,13 +3,13 @@
export LC_ALL=en_US.UTF-8
# configuration
# @dracula-continuum-mode default (countdown|time|alert|interval)
# @dracula-continuum-time-threshold 15
# @kanagawa-continuum-mode default (countdown|time|alert|interval)
# @kanagawa-continuum-time-threshold 15
alert_mode="@dracula-continuum-mode"
time_threshold="@dracula-continuum-time-threshold"
alert_mode="@kanagawa-continuum-mode"
time_threshold="@kanagawa-continuum-time-threshold"
warn_threshold=360
first_save="@dracula-continuum-first-save"
first_save="@kanagawa-continuum-first-save"
# tmux-resurrect and tmux-continuum options
if [ -d "$HOME/.tmux/resurrect" ]; then

View file

@ -50,9 +50,9 @@ get_load() {
main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
cpu_load=$(get_tmux_option "@dracula-cpu-display-load" false)
cpu_label=$(get_tmux_option "@dracula-cpu-usage-label" "CPU")
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
cpu_load=$(get_tmux_option "@kanagawa-cpu-display-load" false)
cpu_label=$(get_tmux_option "@kanagawa-cpu-usage-label" "CPU")
if [ "$cpu_load" = true ]; then
echo "$cpu_label $(get_load)"
else

View file

@ -3,12 +3,12 @@
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $current_dir/utils.sh
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@dracula-fossil-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@dracula-fossil-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@dracula-fossil-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@dracula-fossil-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@dracula-fossil-no-untracked-files" "false")
IFS=' ' read -r -a show_remote_status <<< $(get_tmux_option "@dracula-fossil-show-remote-status" "false")
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@kanagawa-fossil-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@kanagawa-fossil-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@kanagawa-fossil-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@kanagawa-fossil-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@kanagawa-fossil-no-untracked-files" "false")
IFS=' ' read -r -a show_remote_status <<< $(get_tmux_option "@kanagawa-fossil-show-remote-status" "false")
# Get added, modified, updated and deleted files from git status
getChanges()
@ -48,7 +48,7 @@ for i in $(cd $path; fossil changes --differ|cut -f1 -d' ')
}
# getting the #{pane_current_path} from dracula.sh is no longer possible
# getting the #{pane_current_path} from kanagawa.sh is no longer possible
getPaneDir()
{
nextone="false"

View file

@ -3,12 +3,12 @@
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $current_dir/utils.sh
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@dracula-git-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@dracula-git-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@dracula-git-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@dracula-git-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@dracula-git-no-untracked-files" "false")
IFS=' ' read -r -a show_remote_status <<< $(get_tmux_option "@dracula-git-show-remote-status" "false")
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@kanagawa-git-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@kanagawa-git-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@kanagawa-git-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@kanagawa-git-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@kanagawa-git-no-untracked-files" "false")
IFS=' ' read -r -a show_remote_status <<< $(get_tmux_option "@kanagawa-git-show-remote-status" "false")
# Get added, modified, updated and deleted files from git status
getChanges()
@ -48,7 +48,7 @@ for i in $(git -C $path --no-optional-locks status -s)
}
# getting the #{pane_current_path} from dracula.sh is no longer possible
# getting the #{pane_current_path} from kanagawa.sh is no longer possible
getPaneDir()
{
nextone="false"

View file

@ -38,8 +38,8 @@ get_gpu()
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
gpu_label=$(get_tmux_option "@dracula-gpu-usage-label" "GPU")
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
gpu_label=$(get_tmux_option "@kanagawa-gpu-usage-label" "GPU")
gpu_usage=$(get_gpu)
echo "$gpu_label $gpu_usage"
sleep $RATE

View file

@ -37,8 +37,8 @@ get_gpu()
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
gpu_label=$(get_tmux_option "@dracula-gpu-usage-label" "VRAM")
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
gpu_label=$(get_tmux_option "@kanagawa-gpu-usage-label" "VRAM")
gpu_usage=$(get_gpu)
echo "$gpu_label $gpu_usage"
sleep $RATE

View file

@ -37,8 +37,8 @@ get_gpu()
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
gpu_label=$(get_tmux_option "@dracula-gpu-usage-label" "GPU")
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
gpu_label=$(get_tmux_option "@kanagawa-gpu-usage-label" "GPU")
gpu_usage=$(get_gpu)
echo "$gpu_label $gpu_usage"
sleep $RATE

View file

@ -3,11 +3,11 @@
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $current_dir/utils.sh
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@dracula-hg-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@dracula-hg-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@dracula-hg-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@dracula-hg-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@dracula-hg-no-untracked-files" "false")
IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@kanagawa-hg-disable-status" "false")
IFS=' ' read -r -a current_symbol <<< $(get_tmux_option "@kanagawa-hg-show-current-symbol" "✓")
IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@kanagawa-hg-show-diff-symbol" "!")
IFS=' ' read -r -a no_repo_message <<< $(get_tmux_option "@kanagawa-hg-no-repo-message" "")
IFS=' ' read -r -a no_untracked_files <<< $(get_tmux_option "@kanagawa-hg-no-untracked-files" "false")
# Get added, modified, and removed files from hg status
getChanges()
@ -51,7 +51,7 @@ for i in $(hg -R $path status -admru)
}
# getting the #{pane_current_path} from dracula.sh is no longer possible
# getting the #{pane_current_path} from kanagawa.sh is no longer possible
getPaneDir()
{
nextone="false"

View file

@ -2,38 +2,11 @@
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $current_dir/utils.sh
main()
{
main() {
# set configuration option variables
show_kubernetes_context_label=$(get_tmux_option "@dracula-kubernetes-context-label" "")
eks_hide_arn=$(get_tmux_option "@dracula-kubernetes-eks-hide-arn" false)
eks_extract_account=$(get_tmux_option "@dracula-kubernetes-eks-extract-account" false)
hide_kubernetes_user=$(get_tmux_option "@dracula-kubernetes-hide-user" false)
terraform_label=$(get_tmux_option "@dracula-terraform-label" "")
show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true)
show_location=$(get_tmux_option "@dracula-show-location" true)
fixed_location=$(get_tmux_option "@dracula-fixed-location")
show_powerline=$(get_tmux_option "@dracula-show-powerline" false)
show_flags=$(get_tmux_option "@dracula-show-flags" false)
show_left_icon=$(get_tmux_option "@dracula-show-left-icon" smiley)
show_left_icon_padding=$(get_tmux_option "@dracula-left-icon-padding" 1)
show_military=$(get_tmux_option "@dracula-military-time" false)
timezone=$(get_tmux_option "@dracula-set-timezone" "")
show_timezone=$(get_tmux_option "@dracula-show-timezone" true)
show_left_sep=$(get_tmux_option "@dracula-show-left-sep")
show_right_sep=$(get_tmux_option "@dracula-show-right-sep")
show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false)
show_day_month=$(get_tmux_option "@dracula-day-month" false)
show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5)
show_synchronize_panes_label=$(get_tmux_option "@dracula-synchronize-panes-label" "Sync")
time_format=$(get_tmux_option "@dracula-time-format" "")
show_ssh_session_port=$(get_tmux_option "@dracula-show-ssh-session-port" false)
IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather")
show_empty_plugins=$(get_tmux_option "@dracula-show-empty-plugins" true)
# Dracula Color Pallette
white='#f8f8f2'
gray='#44475a'
@ -46,21 +19,53 @@ main()
red='#ff5555'
pink='#ff79c6'
yellow='#f1fa8c'
show_kubernetes_context_label=$(get_tmux_option "@kanagawa-kubernetes-context-label" "")
eks_hide_arn=$(get_tmux_option "@kanagawa-kubernetes-eks-hide-arn" false)
eks_extract_account=$(get_tmux_option "@kanagawa-kubernetes-eks-extract-account" false)
hide_kubernetes_user=$(get_tmux_option "@kanagawa-kubernetes-hide-user" false)
terraform_label=$(get_tmux_option "@kanagawa-terraform-label" "")
show_fahrenheit=$(get_tmux_option "@kanagawa-show-fahrenheit" true)
show_location=$(get_tmux_option "@kanagawa-show-location" true)
fixed_location=$(get_tmux_option "@kanagawa-fixed-location")
show_powerline=$(get_tmux_option "@kanagawa-show-powerline" false)
show_flags=$(get_tmux_option "@kanagawa-show-flags" false)
show_left_icon=$(get_tmux_option "@kanagawa-show-left-icon" smiley)
show_left_icon_padding=$(get_tmux_option "@kanagawa-left-icon-padding" 1)
show_military=$(get_tmux_option "@kanagawa-military-time" false)
timezone=$(get_tmux_option "@kanagawa-set-timezone" "")
show_timezone=$(get_tmux_option "@kanagawa-show-timezone" true)
show_left_sep=$(get_tmux_option "@kanagawa-show-left-sep")
show_right_sep=$(get_tmux_option "@kanagawa-show-right-sep")
show_border_contrast=$(get_tmux_option "@kanagawa-border-contrast" false)
show_day_month=$(get_tmux_option "@kanagawa-day-month" false)
show_refresh=$(get_tmux_option "@kanagawa-refresh-rate" 5)
show_synchronize_panes_label=$(get_tmux_option "@kanagawa-synchronize-panes-label" "Sync")
time_format=$(get_tmux_option "@kanagawa-time-format" "")
show_ssh_session_port=$(get_tmux_option "@kanagawa-show-ssh-session-port" false)
IFS=' ' read -r -a plugins <<<$(get_tmux_option "@kanagawa-plugins" "battery network weather")
show_empty_plugins=$(get_tmux_option "@kanagawa-show-empty-plugins" true)
# Handle left icon configuration
case $show_left_icon in
smiley)
left_icon="☺";;
session)
left_icon="#S";;
window)
left_icon="#W";;
hostname)
left_icon="#H";;
shortname)
left_icon="#h";;
*)
left_icon=$show_left_icon;;
smiley)
left_icon="☺"
;;
session)
left_icon="#S"
;;
window)
left_icon="#W"
;;
hostname)
left_icon="#H"
;;
shortname)
left_icon="#h"
;;
*)
left_icon=$show_left_icon
;;
esac
# Handle left icon padding
@ -79,20 +84,24 @@ main()
# Set timezone unless hidden by configuration
if [[ -z "$timezone" ]]; then
case $show_timezone in
false)
timezone="";;
true)
timezone="#(date +%Z)";;
false)
timezone=""
;;
true)
timezone="#(date +%Z)"
;;
esac
fi
case $show_flags in
false)
flags=""
current_flags="";;
true)
flags="#{?window_flags,#[fg=${dark_purple}]#{window_flags},}"
current_flags="#{?window_flags,#[fg=${light_purple}]#{window_flags},}"
false)
flags=""
current_flags=""
;;
true)
flags="#{?window_flags,#[fg=${dark_purple}]#{window_flags},}"
current_flags="#{?window_flags,#[fg=${light_purple}]#{window_flags},}"
;;
esac
# sets refresh interval to every 5 seconds
@ -136,10 +145,10 @@ main()
for plugin in "${plugins[@]}"; do
if case $plugin in custom:*) true;; *) false;; esac; then
if case $plugin in custom:*) true ;; *) false ;; esac then
script=${plugin#"custom:"}
if [[ -x "${current_dir}/${script}" ]]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-custom-plugin-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-custom-plugin-colors" "cyan dark_gray")
script="#($current_dir/${script})"
else
colors[0]="red"
@ -148,80 +157,80 @@ main()
fi
elif [ $plugin = "cwd" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cwd-colors" "dark_gray white")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-cwd-colors" "dark_gray white")
tmux set-option -g status-right-length 250
script="#($current_dir/cwd.sh)"
elif [ $plugin = "fossil" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-fossil-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-fossil-colors" "green dark_gray")
tmux set-option -g status-right-length 250
script="#($current_dir/fossil.sh)"
elif [ $plugin = "git" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-git-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-git-colors" "green dark_gray")
tmux set-option -g status-right-length 250
script="#($current_dir/git.sh)"
elif [ $plugin = "hg" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-hg-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-hg-colors" "green dark_gray")
tmux set-option -g status-right-length 250
script="#($current_dir/hg.sh)"
elif [ $plugin = "battery" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-battery-colors" "pink dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-battery-colors" "pink dark_gray")
script="#($current_dir/battery.sh)"
elif [ $plugin = "gpu-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-usage-colors" "pink dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-gpu-usage-colors" "pink dark_gray")
script="#($current_dir/gpu_usage.sh)"
elif [ $plugin = "gpu-ram-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-ram-usage-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-gpu-ram-usage-colors" "cyan dark_gray")
script="#($current_dir/gpu_ram_info.sh)"
elif [ $plugin = "gpu-power-draw" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-power-draw-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-gpu-power-draw-colors" "green dark_gray")
script="#($current_dir/gpu_power.sh)"
elif [ $plugin = "cpu-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cpu-usage-colors" "orange dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-cpu-usage-colors" "orange dark_gray")
script="#($current_dir/cpu_info.sh)"
elif [ $plugin = "ram-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-ram-usage-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-ram-usage-colors" "cyan dark_gray")
script="#($current_dir/ram_info.sh)"
elif [ $plugin = "tmux-ram-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-tmux-ram-usage-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-tmux-ram-usage-colors" "cyan dark_gray")
script="#($current_dir/tmux_ram_info.sh)"
elif [ $plugin = "network" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-network-colors" "cyan dark_gray")
script="#($current_dir/network.sh)"
elif [ $plugin = "network-bandwidth" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-bandwidth-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-network-bandwidth-colors" "cyan dark_gray")
tmux set-option -g status-right-length 250
script="#($current_dir/network_bandwidth.sh)"
elif [ $plugin = "network-ping" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-ping-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-network-ping-colors" "cyan dark_gray")
script="#($current_dir/network_ping.sh)"
elif [ $plugin = "network-vpn" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-vpn-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-network-vpn-colors" "cyan dark_gray")
script="#($current_dir/network_vpn.sh)"
elif [ $plugin = "attached-clients" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-attached-clients-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-attached-clients-colors" "cyan dark_gray")
script="#($current_dir/attached_clients.sh)"
elif [ $plugin = "mpc" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-mpc-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-mpc-colors" "green dark_gray")
script="#($current_dir/mpc.sh)"
elif [ $plugin = "spotify-tui" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-spotify-tui-colors" "green dark_gray")
script="#($current_dir/spotify-tui.sh)"
elif [ $plugin = "playerctl" ]; then
@ -229,27 +238,27 @@ main()
script="#($current_dir/playerctl.sh)"
elif [ $plugin = "kubernetes-context" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-kubernetes-context-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-kubernetes-context-colors" "cyan dark_gray")
script="#($current_dir/kubernetes_context.sh $eks_hide_arn $eks_extract_account $hide_kubernetes_user $show_kubernetes_context_label)"
elif [ $plugin = "terraform" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-terraform-colors" "light_purple dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-terraform-colors" "light_purple dark_gray")
script="#($current_dir/terraform.sh $terraform_label)"
elif [ $plugin = "continuum" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-continuum-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-continuum-colors" "cyan dark_gray")
script="#($current_dir/continuum.sh)"
elif [ $plugin = "weather" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-weather-colors" "orange dark_gray")
script="#($current_dir/weather_wrapper.sh $show_fahrenheit $show_location '$fixed_location')"
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-weather-colors" "orange dark_gray")
script="#($current_dir/weather_wrapper.sh $show_fahrenheit $show_location $fixed_location)"
elif [ $plugin = "time" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-time-colors" "dark_purple white")
if [ -n "$time_format" ]; then
script=${time_format}
else
if $show_day_month && $show_military ; then # military time and dd/mm
if $show_day_month && $show_military; then # military time and dd/mm
script="%a %d/%m %R ${timezone} "
elif $show_military; then # only military time
script="%a %m/%d %R ${timezone} "
@ -260,11 +269,11 @@ main()
fi
fi
elif [ $plugin = "synchronize-panes" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-synchronize-panes-colors" "cyan dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-synchronize-panes-colors" "cyan dark_gray")
script="#($current_dir/synchronize_panes.sh $show_synchronize_panes_label)"
elif [ $plugin = "ssh-session" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-ssh-session-colors" "green dark_gray")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@kanagawa-ssh-session-colors" "green dark_gray")
script="#($current_dir/ssh_session.sh $show_ssh_session_port)"
else

View file

@ -32,7 +32,7 @@ fi
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
OUTPUT_STRING=""
if [ ! -z "$current_account_id" ]
then

View file

@ -8,14 +8,14 @@ source $current_dir/utils.sh
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
if ! command -v mpc &> /dev/null
then
exit 1
fi
FORMAT=$(get_tmux_option "@dracula-mpc-format" "%title% - %artist%")
FORMAT=$(get_tmux_option "@kanagawa-mpc-format" "%title% - %artist%")
mpc_playback=$(mpc current -f "${FORMAT}")
echo ${mpc_playback}

View file

@ -17,7 +17,7 @@ readonly SIZE=(
# interface_get try to automaticaly get the used interface if network_name is empty
interface_get() {
name="$(tmux show-option -gqv "@dracula-network-bandwidth")"
name="$(tmux show-option -gqv "@kanagawa-network-bandwidth")"
if [[ -z $name ]]; then
case "$(uname -s)" in
@ -96,8 +96,8 @@ main() {
bandwidth=()
network_name=""
show_interface="$(tmux show-option -gqv "@dracula-network-bandwidth-show-interface")"
interval_update="$(tmux show-option -gqv "@dracula-network-bandwidth-interval")"
show_interface="$(tmux show-option -gqv "@kanagawa-network-bandwidth-show-interface")"
interval_update="$(tmux show-option -gqv "@kanagawa-network-bandwidth-interval")"
if [[ -z $interval_update ]]; then
interval_update=0

View file

@ -3,8 +3,8 @@
export LC_ALL=en_US.UTF-8
# configuration
# @dracula-ping-server "example.com"
# @dracula-ping-rate 5
# @kanagawa-ping-server "example.com"
# @kanagawa-ping-rate 5
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $current_dir/utils.sh
@ -13,7 +13,7 @@ ping_function() {
case $(uname -s) in
Linux | Darwin)
# storing the hostname/IP in the variable PINGSERVER, default is google.com
pingserver=$(get_tmux_option "@dracula-ping-server" "google.com")
pingserver=$(get_tmux_option "@kanagawa-ping-server" "google.com")
pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{print $4}' | cut -d '/' -f 2)
echo "$pingtime ms"
;;
@ -27,7 +27,7 @@ ping_function() {
main() {
echo $(ping_function)
RATE=$(get_tmux_option "@dracula-ping-rate" 5)
RATE=$(get_tmux_option "@kanagawa-ping-rate" 5)
sleep $RATE
}

View file

@ -79,7 +79,7 @@ $(vmstat -s | grep "pages zeroed$" | sed -ne 's/^ *\([0-9]*\).*$/\1/p') +
main()
{
ram_label=$(get_tmux_option "@dracula-ram-usage-label" "RAM")
ram_label=$(get_tmux_option "@kanagawa-ram-usage-label" "RAM")
ram_ratio=$(get_ratio)
echo "$ram_label $ram_ratio"
}

View file

@ -8,14 +8,14 @@ source $current_dir/utils.sh
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
if ! command -v spt &> /dev/null
then
exit 1
fi
FORMAT=$(get_tmux_option "@dracula-spotify-tui-format" "%f %s %t - %a")
FORMAT=$(get_tmux_option "@kanagawa-spotify-tui-format" "%f %s %t - %a")
spotify_playback=$(spt playback -f "${FORMAT}")
echo ${spotify_playback}

View file

@ -15,7 +15,7 @@ get_synchronize_panes_status() {
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
synchronize_panes_label=$label
synchronize_panes_status=$(get_synchronize_panes_status)
echo "$synchronize_panes_label $synchronize_panes_status"

View file

@ -9,7 +9,7 @@ source $current_dir/utils.sh
main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
RATE=$(get_tmux_option "@kanagawa-refresh-rate" 5)
OUTPUT_STRING="N/A"
terraform_dir="$(tmux display-message -p '#{pane_current_path}')/.terraform"
if [ -d $terraform_dir ]; then

View file

@ -111,7 +111,7 @@ get_tmux_ram_usage()
main()
{
ram_label=$(get_tmux_option "@dracula-tmux-ram-usage-label" "MEM")
ram_label=$(get_tmux_option "@kanagawa-tmux-ram-usage-label" "MEM")
ram_usage=$(get_tmux_ram_usage)
echo "$ram_label $ram_usage"
}

View file

@ -8,8 +8,8 @@ fahrenheit=$1
location=$2
fixedlocation=$3
DATAFILE=/tmp/.dracula-tmux-data
LAST_EXEC_FILE="/tmp/.dracula-tmux-weather-last-exec"
DATAFILE=/tmp/.kanagawa-tmux-data
LAST_EXEC_FILE="/tmp/.kanagawa-tmux-weather-last-exec"
RUN_EACH=1200
TIME_NOW=$(date +%s)
TIME_LAST=$(cat "${LAST_EXEC_FILE}" 2>/dev/null || echo "0")