Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ethancedwards8 authored Oct 18, 2024
2 parents 9211489 + 3f892b2 commit 1426e08
Show file tree
Hide file tree
Showing 31 changed files with 2,218 additions and 248 deletions.
166 changes: 160 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ 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 `@dracula-plugins` option in your `.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, network, network-bandwidth, network-ping, weather, time
# 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"
```

Expand All @@ -74,7 +74,7 @@ Switch powerline symbols
# for left
set -g @dracula-show-left-sep 

# for right symbol (can set any symbol you like as seperator)
# for right symbol (can set any symbol you like as separator)
set -g @dracula-show-right-sep 
```

Expand All @@ -94,7 +94,7 @@ set -g @dracula-refresh-rate 5
Switch the left smiley icon

```bash
# it can accept `session`, `smiley`, `window`, or any character.
# it can accept `hostname` (full hostname), `session`, `shortname` (short name), `smiley`, `window`, or any character.
set -g @dracula-show-left-icon session
```

Expand All @@ -111,6 +111,21 @@ Enable high contrast pane border
set -g @dracula-border-contrast true
```

Hide empty plugins

```bash
set -g @dracula-show-empty-plugins false
```

Make the powerline background transparent

```bash
set -g @dracula-powerline-bg-transparent true

# the left separator symbol is inversed with a transparent background, you can modify it with any symbol you like
set -g @dracula-inverse-divider 
```

#### cpu-usage options

Customize label
Expand Down Expand Up @@ -138,6 +153,8 @@ set -g @dracula-battery-label "Battery"

#### gpu-usage options

Note, currently only the Linux NVIDIA Proprietary drivers are supported. Nouveau and AMD Graphics Cards support are still under development.

Customize label

```bash
Expand All @@ -152,6 +169,26 @@ Customize label
set -g @dracula-ram-usage-label "RAM"
```

#### tmux-ram-usage options

Customize label

```bash
set -g @dracula-tmux-ram-usage-label "MEM"
```

#### network-bandwidth

You can configure which network interface you want to view the bandwidth,
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
```

#### network-ping options

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.
Expand All @@ -160,6 +197,13 @@ You can configure which server (hostname, IP) you want to ping and at which rate
set -g @dracula-ping-server "google.com"
set -g @dracula-ping-rate 5
```
### ssh-session options

Show SSH session port

```bash
set -g @dracula-show-ssh-session-port true
```

#### time options

Expand All @@ -181,6 +225,12 @@ Enable military time
set -g @dracula-military-time true
```

Set custom time format e.g (2023-01-01 14:00)
```bash
set -g @dracula-time-format "%F %R"
```
See [[this page]](https://man7.org/linux/man-pages/man1/date.1.html) for other format symbols.

#### git options

Hide details of git changes
Expand All @@ -190,13 +240,13 @@ set -g @dracula-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 !
# default is ✓. Avoid using non unicode characters that bash uses like $, * and !
set -g @dracula-git-show-current-symbol ✓
```

Set symbol to use for when branch diverges from HEAD
```bash
# default is unicode !. Avoid bash special characters
# default is unicode !. Avoid bash special characters
set -g @dracula-git-show-diff-symbol !
```

Expand All @@ -218,6 +268,37 @@ Show remote tracking branch together with diverge/sync state
set -g @dracula-git-show-remote-status true
```

#### hg options

Hide details of hg changes
```bash
set -g @dracula-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 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 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 ""
```

Hide untracked files from being displayed as local changes
```bash
#default is false
set -g @dracula-hg-no-untracked-files false
```

#### weather options

Switch from default fahrenheit to celsius
Expand All @@ -237,3 +318,76 @@ Hide your location
```bash
set -g @dracula-show-location false
```

#### synchronize-panes options

Customize label

```bash
set -g @dracula-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 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
```

#### Kubernetes options

Add prefix label before the context

```bash
set -g @dracula-kubernetes-context-label "Some Label"
```

Hide user from the context string

```
set -g @dracula-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
```

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
#### continuum options
Set the output mode. Options are:
- **countdown**: Show a T- countdown to the next save (default)
- **time**: Show the time since the last save
- **alert**: Hide output if no save has been performed recently
- **interval**: Show the continuum save interval
```bash
set -g @dracula-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
```

#### Playerctl format

Set the playerctl metadata format

```
set -g @dracula-playerctl-format "► {{ artist }} - {{ title }}"
```
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,36 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
- Day, date, time, timezone
- Current location based on network with temperature and forecast icon (if available)
- Network connection status, bandwidth and SSID
- SSH session user, hostname and port of active tmux pane
- Git branch and status
- Battery percentage and AC power connection status
- Refresh rate control
- CPU usage (percentage or load average)
- RAM usage
- RAM usage (system and/or tmux server)
- GPU usage
- Color code based on if prefix is active or not
- List of windows with current window highlighted
- When prefix is enabled smiley face turns from green to yellow
- Custom status texts from external scripts
- GPU VRAM usage
- GPU power draw
- Color code based on whether a prefix is active or not
- List of windows with the current window highlighted
- When prefix is enabled, a smiley face turns from green to yellow
- When charging, 'AC' is displayed
- Alternatively show battery level and whether its charging next to percentage by setting:
```
set -g @dracula-battery-label false
set -g @dracula-no-battery-label false
set -g @dracula-show-battery-status true
```
- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
- System temperature on Raspberry PI
- Spotify playback (needs the tool spotify-tui installed)
- Info if the Panes are synchronized
- Spotify playback (needs the tool spotify-tui installed). max-len can be configured.
- Music Player Daemon status (needs the tool mpc installed)
- Playerctl, get current track metadata
- Current kubernetes context
- Countdown to tmux-continuum save
- Current working directory of tmux pane
- Show your Libre Freestyle 3 readings [Setup instructions](./scripts/libre.sh)
## Compatibility
Expand Down
35 changes: 35 additions & 0 deletions scripts/attached_clients.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8

# configuration
# @dracula-clients-minimum 1
# @dracula-clients-singular client
# @dracula-clients-plural clients

current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $current_dir/utils.sh

count_clients() {
pane=$(tmux list-panes -F "#{session_name}" | head -n 1)
tmux list-clients -t $pane | wc -l | tr -d ' '
}

main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
clients_count=$(count_clients)
clients_minimum=$(get_tmux_option "@dracula-clients-minimum" 1)
if (( $clients_count >= $clients_minimum )); then
if (( $clients_count > 1 )); then
clients_label=$(get_tmux_option "@dracula-clients-plural" "clients")
else
clients_label=$(get_tmux_option "@dracula-clients-singular" "client")
fi
echo "$clients_count $clients_label"
fi
sleep $RATE
}

# run main driver
main
Loading

0 comments on commit 1426e08

Please sign in to comment.