From 171d0cc9d5628fb2d305ceb0af56196e6f857705 Mon Sep 17 00:00:00 2001 From: Sourabh Sathe Date: Mon, 2 Oct 2023 21:37:35 +0530 Subject: [PATCH 1/5] Update README.md Grammatical changes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6fcd9ef..6569a99 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul - Custom status texts from external scripts - GPU VRAM usage - GPU power draw -- 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 +- 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 - If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature - Info if the Panes are synchronized From a486050c221bb8eec1601c32807e35219a6ee49c Mon Sep 17 00:00:00 2001 From: pspiagicw Date: Thu, 19 Oct 2023 15:48:43 +0530 Subject: [PATCH 2/5] feat: Added mpc plugin --- scripts/dracula.sh | 6 +++++- scripts/mpc.sh | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 scripts/mpc.sh diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 7639e63..6ba6f0c 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -148,7 +148,7 @@ main() IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-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") tmux set-option -g status-right-length 250 @@ -213,6 +213,10 @@ main() IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-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-spotify-tui-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") script="#($current_dir/spotify-tui.sh)" diff --git a/scripts/mpc.sh b/scripts/mpc.sh new file mode 100755 index 0000000..f75c261 --- /dev/null +++ b/scripts/mpc.sh @@ -0,0 +1,25 @@ +#!/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 + +current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +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) + + if ! command -v mpc &> /dev/null + then + exit 1 + fi + + # FORMAT=$(get_tmux_option "@dracula-spotify-tui-format" "%f %s %t - %a") + mpc_playback=$(mpc current) + echo ${mpc_playback} + +} + +# run the main driver +main From 187a57d1a2b18991a6deb0d3de19e2b6735ac49e Mon Sep 17 00:00:00 2001 From: pspiagicw Date: Thu, 19 Oct 2023 16:05:49 +0530 Subject: [PATCH 3/5] feat: Added MPC documentation --- INSTALL.md | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 8e04980..0196573 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -48,7 +48,7 @@ To enable plugins set up the `@dracula-plugins` option in you `.tmux.conf` file, 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, attached-clients, network-vpn, weather, time, spotify-tui, kubernetes-context, synchronize-panes +# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, attached-clients, network-vpn, weather, time, mpc, spotify-tui, kubernetes-context, synchronize-panes set -g @dracula-plugins "cpu-usage gpu-usage ram-usage" ``` diff --git a/README.md b/README.md index 6fcd9ef..3bbd6a1 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul - If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature - Info if the Panes are synchronized - Spotify playback (needs the tool spotify-tui installed) +- Music Player Daemon status (needs the tool mpc installed) - Current kubernetes context - Countdown to tmux-continuum save - Current working directory of tmux pane From 0fafe371977fe71de9d86e72a68115393d6308fe Mon Sep 17 00:00:00 2001 From: pspiagicw Date: Thu, 19 Oct 2023 16:09:27 +0530 Subject: [PATCH 4/5] feat: Added tmux.conf customizations --- scripts/dracula.sh | 2 +- scripts/mpc.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 6ba6f0c..9d78096 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -214,7 +214,7 @@ main() script="#($current_dir/attached_clients.sh)" elif [ $plugin = "mpc" ]; then - IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray") + IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-mpc-colors" "green dark_gray") script="#($current_dir/mpc.sh)" elif [ $plugin = "spotify-tui" ]; then diff --git a/scripts/mpc.sh b/scripts/mpc.sh index f75c261..6ee83ce 100755 --- a/scripts/mpc.sh +++ b/scripts/mpc.sh @@ -15,8 +15,8 @@ main() exit 1 fi - # FORMAT=$(get_tmux_option "@dracula-spotify-tui-format" "%f %s %t - %a") - mpc_playback=$(mpc current) + FORMAT=$(get_tmux_option "@dracula-mpc-format" "%title% - %artist%") + mpc_playback=$(mpc current -f "${FORMAT}") echo ${mpc_playback} } From a96c8255154758736f3d5fdac69fc29e08d0ae00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Tafla?= Date: Wed, 25 Oct 2023 14:38:54 -0700 Subject: [PATCH 5/5] Spell checked INSTALL.md Documented `hostname` option for @dracula-show-left-icon Added `shortname` option to @dracula-show-left-icon --- INSTALL.md | 4 ++-- scripts/dracula.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 8e04980..2313fab 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -75,7 +75,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  ``` @@ -95,7 +95,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 ``` diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 7639e63..544f736 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -56,6 +56,8 @@ main() left_icon="#W";; hostname) left_icon="#H";; + shortname) + left_icon="#h";; *) left_icon=$show_left_icon;; esac