Giter VIP home page Giter VIP logo

tmux's Introduction

Dracula for tmux

A dark theme for tmux

Screenshot

Install

All instructions can be found at draculatheme.com/tmux.

Configuration

Configuration and options can be found at draculatheme.com/tmux.

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
  • 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 (system and/or tmux server)
  • GPU usage
  • 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
  • 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)
  • Playerctl, get current track metadata
  • Current kubernetes context
  • Countdown to tmux-continuum save
  • Current working directory of tmux pane

Compatibility

Compatible with macOS and Linux. Tested on tmux 3.1b FreeBSD compatibility is in development

Team

This theme is maintained by the following person(s) and a bunch of awesome contributors.

Dane Williams Ethan Edwards
Dane Williams Ethan Edwards

Community

  • Twitter - Best for getting updates about themes and new stuff.
  • GitHub - Best for asking questions and discussing issues.
  • Discord - Best for hanging out with the community.

License

MIT License

tmux's People

Contributors

aaronkollasch avatar abelanaya avatar adrianmihalko avatar danerwilliams avatar dormunis avatar drasbeck avatar emmagamma avatar ethancedwards8 avatar foxtrot avatar gdkrmr avatar hugoliconv avatar iglou-eu avatar imperadorsid avatar jannotjarks avatar joeperri95 avatar jonathanforhan avatar memije avatar nunojsa avatar o0th avatar osdamv avatar pataquets avatar pele1410 avatar playonverbs avatar pspiagicw avatar reagentx avatar rodrigocnascimento avatar ucchiee avatar uttarayan21 avatar xiao0yy avatar yzenati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmux's Issues

Rewrite weather module for international support

Rewrite the weather module to scrape a site which supports countries outside of US.

Requirements:

  • Continue using ipinfo.io for keyless api access to current location
  • Scrape weather site (do not use an API key)
  • Continue getting forecast to produce appropriate emoji
  • Continue getting temperature (option of F or C)

Currently thinking the best site to scrape is wunderground.com because they have a simple url structure: wunderground.com/weather/region_code/city. It looks like in the US it takes region_code as the two letter code of your state. Otherwise, it seems to expect your country code.

For example, Vancouver, British Columbia, Canada is:
wunderground.com/weather/ca/vancouver

whereas Seattle, Washington, United States is:
wunderground.com/weather/us/wa/seattle

I think this would work, the only challenge I see is that ipinfo.io doesn't seem to give region code, only the full region name and then the country code. However, currently I am getting the state/region code by scraping another website. Since it is only the US it might be worth just making a look up table to translate them.

If anyone has any other thoughts on this let me know!

Enhancement: Moving over the POSIX compliant shell for other OS compatibility

Describe the feature you'd like

Moving over to a POSIX compliant shell syntax

Describe risks you've considered

This may be hard to achieve, we may have to significantly rewrite some modules

Why is this important

I recently encountered an issue of some modules not working because bash syntax is different on BSD systems and Linux systems, I believe switching to a POSIX compliant shell may fix this, or clean up the existing codebase to still use bash but make it POSIX compliant.

Some resources: wikipedia, stackoverflow post explaining POSIX, some reference

Enhancement: Allow status-right customization

It would be great to be able to override and have a custom status-right. For example I'd like to customize the datetime format to a one that currently reflects how we read date (day/month/year instead of month/day/year).

Also i'd like to add my custom scripts to display desired info.

I've found no way to even disable dracula's theme info.

Enhancement: Handle Multiple Batteries

Describe the feature you'd like

User should be able to select which batter they want displayed if the system has multiple.

Describe risks you've considered

Batter code will be a bit more complicated.

Describe alternatives you've considered

Filter out "invalid" batteries.

weather doesn't work

I live in Vietnam. Does the weather only work with the US?
Thanks for the help!

Screenshots

Screenshot from 2020-07-04 00-50-55

System

  • OS: Ubuntu 20.4
  • Tmux Version: 3.0a

Enhancement: [CPU usage fixed width]

Describe the feature you'd like

Right now the CPU usage width is not fixed but it changes due to the number of digits:
CPU 0% (6 chars)
vs
CPU 11.1% (9 chars).
It seems distracting to me that all right functionalities change position consequently every 5 seconds.
It would be possible to fix the position, or to have an option to do that?

Bug: False AC charging status

Describe the bug

Even though charger is unplugged this plugin still reports "AC"

To Reproduce

Steps to reproduce the behaviour:

On Macs sometimes the command used to get charging/not-charging status is this: pmset -g batt | sed -n 2p | cut -d ';' -f 2 This can sometimes give whitespace in beginning like " discharging" which can cause case matching to fail in following line in battery.sh:

	case $status in
		discharging|Discharging)

Expected behavior

plugin should not report AC when there's no charger attached.

System

  • OS: Mac OS Big Sur
  • Tmux Version: 3.1c

Bug: [window variable is not left justified]

Describe the bug

The window variable in the status line is floating in the middle which makes powerline theming awkward. Please provide a setting to allow justification of medules.

To Reproduce

Steps to reproduce the behavior:

  1. Install dracula/tmux
  2. Open a terminal
  3. Window variable is floating in the center

Expected behavior

Provide documentation and a method to control the justification of modules.

Screenshots

2021-03-14_08-49

System

  • OS: ArcoLinux (Arch)
  • Tmux Version: 3.1_c-1

MinGW and MSYS compatibility: battery and network

Add compatibility for retrieving battery and network information on MinGW / MSYS. See scripts/battery.sh and scripts/network.sh for code details. There are multiple spots that look something like the code block below where compatibility would be added:

CYGWIN*|MINGW32*|MSYS*|MINGW*)
	# leaving empty - TODO - windows compatability
;;

Really this just consists of adding a pipeline to retrieve the battery charging status, current percentage, and network SSID in each instance.

Enhancement: display CPU & memory usage

Describe the feature you'd like

It'd be nice to have dracula tmux include the option to enable the display of CPU & memory usage meters within the statusline similar to tmux-mem-cpu-load.

Describe risks you've considered

I'm really unsure.

Describe alternatives you've considered

I've tried installing tmux-mem-cpu-load, but because I am using dracula theme, it will not display.

Enhancement: [add this functionality] Uk date format

Describe the feature you'd like

would it be possible to add an option to change the date format or even use locale? Will look to see if I can add it myself but I'll be honest, haven't used shell much!

Describe risks you've considered

Describe alternatives you've considered

Enhancement: Git status module

Describe the feature you'd like

A git status in the bar, displaying the current branch, if there are modifications, etc.

Describe risks you've considered

Might be slow in large code bases?

Any extra details

I've found an API that could be of use #{pane_current_path} here

Bug: Battery indicator showing AC even when unplugged

Describe the bug

Battery indicator not working on laptop

More details

When in tmux session, the battery status bar shows AC, like its plugged in, but it's actually not plugged in and should show the battery percentage.

System

  • OS: Linux 5.4.28-gentoo-x86_64 (per uame -sr)
  • Tmux Version: tmux 2.9a

Enhancement: show username and hostname

Describe the feature you'd like

Is it possible to add a setting that can show the current username and hostname

Describe risks you've considered

I think it wouldn't have much risk.

Describe alternatives you've considered

I can use echo user and hostname to show this, but can I show it in the bottom status bar. I often login the remote machine. So if I can see which host I am current in, it would be nice!

image

I think it can be achieved by edit the script.sh, but I am not sure how to do it.

Bug: Incorrect RAM values

Describe the bug

The values for RAM and CPU on my don't match with what's displayed the acitivity monitor (Macbook Pro 2015 / macOS Catalina - 10.15.6) and in general just don't feel right.

I mean the RAM always stays under 8GB and rarely gets into something different like 5 or 6 while when I look at my RAM usage from the activity monitor it's never under 13GB.

The CPU usage is usually higher than what's displayed on the activity monitor and often times get above 100% (How?). Showing numbers like 400%-500%... :(

This is what's in my config:

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
#set -g @plugin "arcticicestudio/nord-tmux"

# Dracula settings
set -g @dracula-show-weather false
set -g @dracula-show-network false
set -g @dracula-cpu-usage true
set -g @dracula-ram-usage true
set -g @dracula-border-contrast true
set -g @dracula-show-powerline true
set -g @dracula-refresh-rate 1
set -g @dracula-show-timezone false
# Tmux better mouse settings
set -g @scroll-speed-num-lines-per-scroll 1

# Setting the delay between prefix and command
set -s escape-time 5
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
# splitting panes with | and -
bind | split-window -h
bind - split-window -v
# Enable mouse
set-option -g mouse on

# Tell Tmux that outside terminal supports true color
set -ga terminal-overrides ",xterm-256color*:Tc"
set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

To Reproduce

Steps to reproduce the behavior:
Just install this plugin and enable CPU/RAM display

Expected behavior

Correct CPU/RAM display

Screenshots

Screen Shot 2020-09-12 at 02 39 05

Screen Shot 2020-09-12 at 02 39 20

System

  • OS: macOS Catalina - 10.15.6
  • Tmux Version: 3.1b (Installed via brew)

Bug: Enabling Weather plugin causes my MBP fans to increase globle warming

Describe the bug

Hi Devs - When using the weather plugin the fans on my '19 MBP (using Catalina/zsh/oh-my-zsh) spin up and don't stop until I shut down tmux. A couple of things seem to have helped.

Setting the refresh to something more that 5 seems to help:
set -g @dracula-refresh-rate 30

It looks like this statement in sleep_weather.sh produces an error because grep doesn't find anything. I can see that extra processes aren't getting killed:
[ -f $LOCKFILE ] && ps -p "$(cat $LOCKFILE)" -o cmd= | grep -F " ${BASH_SOURCE[0]}" && kill "$(cat $LOCKFILE)"

Removing the leading space in " ${BASH_SOURCE[0]}" seems to produce the desired result on my system.

To Reproduce

Starting tmux with Dracula enable and using the weather/location plugin.

Expected behavior

I run tmux and my machine is quiet as a mouse.

System

  • OS: 19 MBP (using Catalina/zsh/oh-my-zsh)
  • Tmux Version: tmux 3.1c

Enhancement: [Theme existing plugins]

Describe the feature you'd like

First mentioned here
There are innumerable possible features that someone could want as part of their tmux theme. We can accommodate this much more effectively by relying on the many existing plugins for the tmux ecosystem rather than writing new modules to add each of these features. #42 will probably need to be completed first in order to achieve this.

Move to Dracula organization

Hey @danerwilliams, would you like to move this repository to the Dracula organization?

You would continue to be the maintainer and everything else, but we would consider it an official theme and also add a page on draculatheme.com.

Let me know what you think ;)

Add custom ping site option

Condition ping to github.com don't work correctly on network.sh.
It's always show Offline. Maybe github.com won't response for ICMP.

if ping -q -c 1 -W 1 github.com &>/dev/null; then
    echo "$(get_ssid)"
else
    echo ' Offline'
fi

change dns to fix this.

ping -q -c 1 -W 1 google.com

Enhancement: Rename git repo to "dracula-tmux" to avoid creating nondescript "tmux" plugin dir

Describe the feature you'd like

Because the repo is currently named "dracula/tmux", installing the plugin creates a "tmux" plugin directory. This fails to identify itself as dracula related when listing plugins:
image

An easy fix is to rename the repo to "dracula/dracula-tmux". The plugin directory will then be "dracula-tmux".

Describe risks you've considered

The upgrade path for existing users may not be impacted. After renaming a repo, the original repo path is still accessible and redirects to the new name. Existing users will continue to function when running tpm update (prefix + U).

See: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/renaming-a-repository

Describe alternatives you've considered

N/A

Bug: ram_info reports negative memory use on Darwin

This line:

used_mem=$(top -l 1 -s 0 | grep PhysMem | sed 's/[a-z]//g; s/[A-Z]//g; s/[()]//g' | awk '{printf "%d\n", $2-$3-$5}')

โฏ top -l 1 -s 0 | grep PhysMem | sed 's/[a-z]//g; s/[A-Z]//g; s/[()]//g' | awk '{printf "%d\n", $2-$3-$5}'
-3442

Describe the bug

Memory shows as negative instead of positive

To Reproduce

  1. Add set -g @dracula-ram-usage true to .tmux.conf

Expected behavior

Used memory shows correctly

Screenshots

image

System

  • OS: MacOS 10.14.6 (18G6020)
  • Tmux Version: tmux 3.1b (installed viabrew)

Bug: git pull failed due to weather.txt chnages

Describe the bug

The sleep_weather script writes to weather.txt which is tracked by git. This file being changed means that git pulls fail due to upstaged changes (at least on my system, I have the default pull stagey as rebase). Either way, have the script write to a checked in file isn't a good idea.

To Reproduce

  1. Run tmux with with the weather plugin enabled
    1.5 (might be needed) Set the repo or global config to rebase on pull instead of merge
  2. Try to run git pull on the plugin

Expected behavior

The plugin shouldn't write to checked in files.

System

  • OS: Linux (Manjaro)
  • Tmux Version: 3.1b

Bug: [gpu detection picks up non-gpu devices]

lspci -v | grep VGA in the gpu script picks up devices classified as Non-VGA

โฏ lspci -v | grep VGA
00:13.0 Non-VGA unclassified device: Intel Corporation 100 Series/C230 Series Chipset Family Integrated Sensor Hub (rev 31)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon Pro WX 5100] (prog-if 00 [VGA controller])

This results in GPU unknown in the status bar.

Not sure what the best solution here is. Maybe grep 'VGA '? Based on my system grep 'VGA compatible controller' would be the way to go, but I don't know if that's consistent across all hardware/linux.

Powerline symbol support

Add support for using powerline symbols in the tmux status bar. An example of this can be found on the nord tmux theme:

if [ "$no_patched_font" != "1" ]; then
      tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_FILE"
else
      tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE"
fi

The approach used here basically has two files, one of which is "no patched font file", which would look as it does currently with out powerline font. The other file would include the powerline font symbols for users that have powerline installed and wish to use it.

Enhancement: Add network upload/download speed

Describe the feature you'd like

To the status bar, add an option for network up/down. Showing CPU, RAM, GPU usage is amazing, with network usage this theme would be perfect.

Describe risks you've considered

none.

Describe alternatives you've considered

Forking this repository, using a different theme

Enhancement: Set the refresh rate

Describe the feature you'd like

A way to set the refresh rate in the .tmux.conf file, reasoning is a higher refresh rate can provide more recent info, but the downside is on a laptop this may effect battery life. Adding a way to lower the rate could improve battery life while using the theme

Describe risks you've considered

This could be complicated

I'll try and submit a PR to solve this issue time permitting

Bug: [this doesn't work]

show_left_icon_padding does nothing because this seq command fails in dracula.sh:

 padding="$(seq -f " " -s '' $show_left_icon_padding)"

A suitable alternative is:

padding="$(printf '%*s' $show_left_icon_padding)"

Tested in Arch Linux and macOS.

Bug: Weather uses incorrect unit

Describe the bug

I don't think switching to celcius works!

I tried the following:

set -g @dracula-show-fahrenheit false

in .tmux.conf, but it doesn't appear to have an effect.

P.S.: config is hilariously American. Fahrenheit by default, month/day in reverse order and calls 24h clock 'military' time. Great theme though =)

Handle ipinfo.io request limit error gracefully

If the user manages to reach the daily request limit from ipinfo.io (this shouldn't happen), then catch this and display an error message gracefully rather than raw json which fills the tmux status bar.

Enhancement: Make status bar modules / color more configurable

Describe the feature you'd like

Instead of just having enable / disable for the various modules (cpu, weather, battery, etc.) have a configuration option which accepts a list specifying the desired modules in the desired order for them to appear. There should also be a configuration option which specifies the corresponding dracula colors for these modules.

Describe risks you've considered

The user may not set this configuration option

Describe alternatives you've considered

If not specified, default to make dracula theme look like it does in the screenshot

Bug: Dracula theme causes MBP fans to go crazy

Describe the bug

If the theme is active, my MBP's fans go nuts.

To Reproduce

Steps to reproduce the behavior:

  1. Follow instructions to install Dracula theme to tux
  2. Run tmux
  3. Wait

Expected behavior

tmux with Dracula theme without killing the laptop

Screenshots

Screen Shot 2020-05-27 at 3 01 14 PM

System

  • OS: macOS 10.15.3
  • Tmux Version: 3.1b from homebrew

The screenshot shows tmux fully occupying the CPU for a couple seconds about once a minute. My fans, however, never let up once they start spinning. Disabling the theme is enough to keep my laptop quiet while using tmux. I have also tried disabling the weather, wifi, and power status, but my laptop will continue to ramp up the fans.

Here's my current tmux.conf:

# List TPM plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'dracula/tmux'

# Customize Plugins
## Dracula
# set -g @dracula-show-weather false
# set -g @dracula-show-network false

#Initialize TMUX Plugin Manager. Keep this line at the very bottom
run -b '~/.tmux/plugins/tpm/tpm'

Enhancement: GPU usage

Describe the feature you'd like

GPU usage, in the bar

Describe risks you've considered

None

Describe alternatives you've considered

I have some code that works, I just haven't fixed all the issues yet, I will finish it when I have some time.

Enhancement: Weather Module: Zip Code override

I'm having an issue with the weather applet. To me it seems the weather is being pulled from a city that's over 100 miles away from me? I see the code in ~/.tmux/plugins/tmux/scripts/weather.sh and I guess I could tweak that, but it'd be nice if I could simply put a zip code preference in my .tmux.conf file to override any magic IP location gathering bits:

set -g @dracula-show-weather 31211

Risks: Folks not in the US don't have zip codes.

Not really sure about alternatives internationally, but I'm sure someone has done this logic somewhere on plugins for different windowmanagers.

Cygwin compatibility: battery and network

Add compatibility for retrieving battery and network information on cygwin. See scripts/battery.sh and scripts/network.sh for code details. There are multiple spots that look something like the code block below where compatibility would be added:

CYGWIN*|MINGW32*|MSYS*|MINGW*)
	# leaving empty - TODO - windows compatability
;;

Really this just consists of adding a pipeline to retrieve the battery charging status, current percentage, and network SSID in each instance.

Bug: Window Flags not showing after setting @dracula-show-flags

Describe the bug

I cannot seem to get the window flags to show despite having set set -g @dracula-show-flags true.

I suspect that there might be a conflict with this setting I have (to show directory name), but would love to get someone more experienced to confirm/deny this hypothesis:

# Show directory as window name
set-option -g status-interval 10
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'

Expected behavior

I expected similar behavior to what #75 introduced -- a window flag indicator next to each window name.

Screenshots

Here, I'm zoomed into the second pane in window # 1 (second window); no flag:

image

System

  • OS: macOS 10.15.7
  • Tmux Version: 3.1c

Enhancement: *BSD support

Describe the feature you'd like

Adding support for the *BSD systems

Describe risks you've considered

May be hard to add more support

Describe alternatives you've considered

None

Enhancement: Adding to the battery

Describe the feature you'd like

Fixing the battery component

Describe ideas that you may have

I think using a method similar to neofetch would be helpful, I find the method it uses is very consistent and I've never had a problem with it. I wouldn't know how to do this just throwing an idea out there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.