From bb92bb5e645c05bdc4296cda1367bd5270751c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20de=20Fran=C3=A7a?= Date: Sun, 20 Mar 2022 22:37:01 -0300 Subject: [PATCH 1/8] :memo: Update readme --- README.md | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f4b3c51..409e56e 100644 --- a/README.md +++ b/README.md @@ -14,21 +14,21 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul ## Features -* Support for powerline -* Day, date, time, timezone -* Current location based on network with temperature and forecast icon (if available) -* Network connection status, bandwidth and SSID -* Git branch and status -* Battery percentage and AC power connection status -* Refresh rate control -* CPU usage (percentage or load average) -* RAM usage -* 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 -* When charging, 'AC' is displayed -* If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature +- Support for powerline +- Day, date, time, timezone +- Current location based on network with temperature and forecast icon (if available) +- Network connection status, bandwidth and SSID +- Git branch and status +- Battery percentage and AC power connection status +- Refresh rate control +- CPU usage (percentage or load average) +- RAM usage +- 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 +- When charging, 'AC' is displayed +- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature ## Compatibility @@ -39,9 +39,15 @@ FreeBSD compatibility is in development This theme is maintained by the following person(s) and a bunch of [awesome contributors](https://github.com/dracula/tmux/graphs/contributors). -[![Dane Williams](https://avatars2.githubusercontent.com/u/22798229?s=70&v=4",)](https://github.com/danerwilliams) | [![Ethan Edwards](https://avatars1.githubusercontent.com/u/60861925?s=70&v=4)](https://github.com/ethancedwards8) | ---- | --- | -[Dane Williams](https://github.com/danerwilliams) | [Ethan Edwards](https://github.com/ethancedwards8) | +| [![Dane Williams](https://avatars2.githubusercontent.com/u/22798229?s=70&v=4",)](https://github.com/danerwilliams) | [![Ethan Edwards](https://avatars1.githubusercontent.com/u/60861925?s=70&v=4)](https://github.com/ethancedwards8) | +| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | +| [Dane Williams](https://github.com/danerwilliams) | [Ethan Edwards](https://github.com/ethancedwards8) | + +## Community + +- [Twitter](https://twitter.com/draculatheme) - Best for getting updates about themes and new stuff. +- [GitHub](https://github.com/dracula/dracula-theme/discussions) - Best for asking questions and discussing issues. +- [Discord](https://draculatheme.com/discord-invite) - Best for hanging out with the community. ## License From 77069707413597ca8aad1bb1ce10cab47646f284 Mon Sep 17 00:00:00 2001 From: Rojo Date: Sun, 27 Mar 2022 23:28:41 +0200 Subject: [PATCH 2/8] Update docs to include weather options --- INSTALL.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index e9d092b..92cc66f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -201,9 +201,20 @@ set -g @dracula-git-no-repo-message "" #### weather options -Switch from default fahrenheit to celsius +Switch from default fahrenheit to celsius (default: Fahrenheit) ```bash set -g @dracula-show-fahrenheit false ``` +Set your location manually (default: it tries to guess your location with your IP) + +```bash +set -g @dracula-fixed-location "Some City" +``` + +Hide your location (default: true) + +```bash +set -g @dracula-show-location false +``` From 42eaf7a950511ed0f791ddf9435d82dca7d2a3f4 Mon Sep 17 00:00:00 2001 From: Rojo Date: Sun, 27 Mar 2022 23:31:33 +0200 Subject: [PATCH 3/8] No defaults --- INSTALL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 92cc66f..96f987c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -201,19 +201,19 @@ set -g @dracula-git-no-repo-message "" #### weather options -Switch from default fahrenheit to celsius (default: Fahrenheit) +Switch from default fahrenheit to celsius ```bash set -g @dracula-show-fahrenheit false ``` -Set your location manually (default: it tries to guess your location with your IP) +Set your location manually ```bash set -g @dracula-fixed-location "Some City" ``` -Hide your location (default: true) +Hide your location ```bash set -g @dracula-show-location false From 49f212207e05cf06f19598cbfc61d6c71e681f6b Mon Sep 17 00:00:00 2001 From: Pholawat <82935610+pholawat-tle@users.noreply.github.com> Date: Wed, 11 May 2022 15:53:37 +0700 Subject: [PATCH 4/8] import utils.sh in battery.sh --- scripts/battery.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/battery.sh b/scripts/battery.sh index c9d96d7..65211bf 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -2,6 +2,9 @@ # 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 + linux_acpi() { arg=$1 BAT=$(ls -d /sys/class/power_supply/BAT* | head -1) From 95d3aa81448894b1806905c98ef36f1974380e52 Mon Sep 17 00:00:00 2001 From: Pholawat <82935610+pholawat-tle@users.noreply.github.com> Date: Wed, 11 May 2022 15:58:58 +0700 Subject: [PATCH 5/8] include @dracula-battery-label option in INSTALL.md --- INSTALL.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index e9d092b..f62a08d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -128,6 +128,14 @@ set -g @dracula-cpu-display-load true CPU usage percentage (default) - in percentage (output: %) Load average – is the average system load calculated over a given period of time of 1, 5 and 15 minutes (output: x.x x.x x.x) +#### battery options + +Customize label + +```bash +set -g @dracula-battery-label "Battery" +``` + #### gpu-usage options Customize label From 8012d2164a3a143e8ac9c8aecb2ff4b9d0d83784 Mon Sep 17 00:00:00 2001 From: Jihed Mastouri <25284659+jihedmastouri@users.noreply.github.com> Date: Wed, 10 Aug 2022 14:14:17 +0100 Subject: [PATCH 6/8] Battery Status for Fedora 36 --- scripts/battery.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/battery.sh b/scripts/battery.sh index 65211bf..86b9ac0 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -89,10 +89,10 @@ battery_status() discharging|Discharging) echo '' ;; - high) + high|Full) echo '' ;; - charging) + charging|Charging) echo 'AC' ;; *) From 135637745daef7bd8f6f62e1a4c75aad4b0bbb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20S=C3=A1?= Date: Mon, 5 Sep 2022 15:47:55 +0200 Subject: [PATCH 7/8] scripts: git: add option for untracked files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default 'git status' will look for untracked files and the script will always detect that the local tree has changes if untracked files are present. That is not always optimal since sometimes we might have, for example, some custom build scripts (for some project) that is always present and we don't want the status bar to always indicate changes. Hence, add an option to disable this behavior by adding the '-uno' flag to 'git status'. The default behavior is still maintained. Signed-off-by: Nuno Sá --- INSTALL.md | 5 +++++ scripts/git.sh | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index e1b6587..ebeae4e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -206,6 +206,11 @@ Set symbol or message to use when the current pane has no git repo set -g @dracula-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 +``` #### weather options diff --git a/scripts/git.sh b/scripts/git.sh index 3dba4e9..5dd8a2f 100755 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -7,6 +7,7 @@ IFS=' ' read -r -a hide_status <<< $(get_tmux_option "@dracula-git-disable-statu 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") # Get added, modified, updated and deleted files from git status getChanges() @@ -77,8 +78,9 @@ checkEmptySymbol() # check to see if the current repo is not up to date with HEAD checkForChanges() { + [ $no_untracked_files == "false" ] && no_untracked="" || no_untracked="-uno" if [ "$(checkForGitDir)" == "true" ]; then - if [ "$(git -C $path status -s)" != "" ]; then + if [ "$(git -C $path status -s $no_untracked)" != "" ]; then echo "true" else echo "false" From e9f46f76ca4eff782d3883645971585741720efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20S=C3=A1?= Date: Mon, 5 Sep 2022 15:57:11 +0200 Subject: [PATCH 8/8] scripts: git: add '--no-optional-locks' option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As stated in 'git status --help': "By default, git status will automatically refresh the index, updating the cached stat information from the working tree and writing out the result. Writing out the updated index is an optimization that isn’t strictly necessary (status computes the values for itself, but writing them out is just to save subsequent programs from repeating our computation). When status is run in the background, the lock held during the write may conflict with other simultaneous processes, causing them to fail. Scripts running status in the background should consider using git --no-optional-locks status (see git(1) for details)." This was actually happen during rebasing whith the following error: "error: Unable to create '/home/nsa/work/linux/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue." This change fixes the above... Signed-off-by: Nuno Sá --- scripts/git.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/git.sh b/scripts/git.sh index 5dd8a2f..235c44e 100755 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -17,7 +17,7 @@ getChanges() declare -i updated=0; declare -i deleted=0; -for i in $(git -C $path status -s) +for i in $(git -C $path --no-optional-locks status -s) do case $i in @@ -80,7 +80,7 @@ checkForChanges() { [ $no_untracked_files == "false" ] && no_untracked="" || no_untracked="-uno" if [ "$(checkForGitDir)" == "true" ]; then - if [ "$(git -C $path status -s $no_untracked)" != "" ]; then + if [ "$(git -C $path --no-optional-locks status -s $no_untracked)" != "" ]; then echo "true" else echo "false"