-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve customization #224
base: master
Are you sure you want to change the base?
Conversation
- Add padding & margin - Add customized color for prefix status - Remove too many if, and standardize the logic for enabling or disabling powerline. - status_bg -> variable
- Customize color - Customize separator (can invert left sep color) - Customize padding & margin - Remove color of flags (follow the fg) - The window tab will maintain a consistent width regardless of focus. (Zoom and flags will change the width)
- Customize each side padding (rightmost separately) - Fix the padding of the timezone string
- Add length limit (for integer) - Default align to right (number should align to right, align center makes right padding without control)
And my # dracula theme {
# general {
set -g @dracula-show-powerline true # Enable powerline symbols
# separator for left
set -g @dracula-show-left-sep # █
# separator for right symbol (can set any symbol you like as seperator)
set -g @dracula-show-right-sep # █
set -g @dracula-border-contrast true # pane edge highlight
set -g @dracula-status-bg 'gray'
# }
# left icon area {
set -g @dracula-show-left-icon '卵#S' # before window #S 🔍
# set -g @dracula-show-left-icon '卵#S #{?window_zoomed_flag, ,}' # before window #S 🔍
set -g @dracula-left-icon-padding-left 1
set -g @dracula-left-icon-padding-right 0
set -g @dracula-left-icon-margin-right 1
set -g @dracula-left-icon-bg 'pink'
set -g @dracula-left-icon-fg 'dark_gray'
set -g @dracula-left-icon-prefix-on-bg 'red'
set -g @dracula-left-icon-prefix-on-fg 'white'
# }
# window area{
set -g @dracula-show-flags false # marks of recent windows
# inactivty window
set -g @dracula-window-bg 'gray'
set -g @dracula-window-fg 'light_purple'
# activty window
set -g @dracula-window-current-bg 'green'
set -g @dracula-window-current-fg 'dark_gray'
# padding
set -g @dracula-window-padding-left 0
set -g @dracula-window-padding-right 0
set -g @dracula-window-margin-right 1
# separator mark, set to "" same as the show-sep
set -g @dracula-window-left-sep '' #
set -g @dracula-window-right-sep '' #
set -g @dracula-window-left-sep-invert false
# use customized window tag
set -g @dracula-window-disabled true
# Dracula Color Pallette{
white='#f8f8f2'
gray='#44475a'
dark_gray='#282a36'
light_purple='#bd93f9'
dark_purple='#6272a4'
cyan='#8be9fd'
green='#50fa7b'
orange='#ffb86c'
red='#ff5555'
pink='#ff79c6'
yellow='#f1fa8c'
# }
set-window-option -g window-status-format " \
#[fg=${green}]#I:#W#[fg=${dark_purple}]|>\
#[fg=${light_purple}]\
#{?window_zoomed_flag, ,}\
#(pwd=\"#{pane_current_path}\"; echo \${pwd####*/})\
"
set-window-option -g window-status-current-format "\
#[bg=${gray},fg=${green}]#[bg=${green},fg=${dark_gray}]#I:#W\
#[fg=${green},bg=${light_purple}] \
#[fg=${yellow}]#{?window_zoomed_flag, ,}\
#[fg=${dark_gray}]\
#(pwd=\"#{pane_current_path}\"; echo \${pwd####*/})\
#[fg=${light_purple},bg=${gray}] "
# }
# plugins{
set -g @dracula-show-empty-plugins false # hide empty plugin
# plugins padding
set -g @dracula-plugin-padding-left 0
set -g @dracula-plugin-padding-right 1
set -g @dracula-plugin-padding-rightmost 1
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, attached-clients, network-vpn, weather, time, spotify-tui, kubernetes-context
set -g @dracula-plugins "git network-ping ram-usage cpu-usage network-vpn weather battery time"
# available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
# set -g @dracula-[plugin-name]-colors "[background] [foreground]"
# git
set -g @dracula-git-colors "orange dark_gray"
# network
set -g @dracula-ping-server "baidu.com"
set -g @dracula-ping-rate 1
set -g @dracula-ping-label ""
set -g @dracula-network-ping-colors "dark_gray light_purple"
# set -g @dracula-network-bandwidth eth0
# set -g @dracula-network-bandwidth-interval 0
# set -g @dracula-network-bandwidth-show-interface false
# ram & cpu
set -g @dracula-ram-usage-label ""
set -g @dracula-ram-usage-colors "cyan gray"
set -g @dracula-cpu-usage-label "" #
set -g @dracula-cpu-display-load false # T:avg load, F:percent
set -g @dracula-cpu-usage-colors "red white"
# weather
set -g @dracula-show-fahrenheit false # use celsius
# set -g @dracula-fixed-location "Beijing"
set -g @dracula-show-location false
set -g @dracula-weather-colors "gray cyan"
# battery
set -g @dracula-battery-label "" #
set -g @dracula-battery-colors "dark_gray pink"
# time
set -g @dracula-time-colors "light_purple dark_gray"
set -g @dracula-military-time true # 24 hours format
set -g @dracula-show-timezone false # hide timezone
# }
# } |
This all looks really good. I would like some members of the community to review it, test it, try it out, etc. Does this change anything for users updating? I don't want it to break existing configs. |
I think all the user settings have a default value same as the previous version, but I do need more people to test it, there are so many changes. 😂 |
Oh, hey, I can help! I've actually been using Erimus' fork of tmux for about a week now, and I've gotta say that I love the customisability. I'm more than open to provide feedback, if you're interested. :) |
I'm glad you like it. Some parts I worry about:
|
I didn't find any difficulties in understanding the documentation you put for updating the appearance. It's easy to read and I didn't have any difficulty translating it into my .tmux.conf.
I replaced the original dracula.sh file in |
That sounds good. And I found there are some font problems with my And the font I use now is JetBrainsMono Nerd Font v3.0.2 My lastest conf 👇🏻
|
I essentially copied your tmux conf but changed the separators and colours. Here:
If I had to make one request, I wanted to ask if being able to implement an Regardless, this has my vote for being a really big improvement on the original tmux package's customisation. This is impressive work. :) |
I've used a plugin(prefix highlight color) that can display the Prefix status, and mode of the window or something. In my current version, I use color to know if Prefix activating and you can set the color of it. And I have an idea, you can set it as the left icon. set -g @dracula-show-left-icon ' #S #{?client_prefix,#{prefix},}' |
And I do also wonder where to find all the verbs and names of Tmux. I can't find I found it in the plugin(prefix highlight color)'s source code.
|
does this pr is still wip? |
I am waiting for this to be merged for the left icon color customization, etc! |
Currently, there are 70 commits behind and 7 other PRs waiting. While reordering the code may not be ideal, I need to add many options. If I don't establish a strong foundation from the start, it could lead to even more confusion later on. In an open-source project, reorganizing the code is still too difficult. (It may not be necessary.) In my opinion, the rules below still apply.
One rule is that the plugins can be sorted alphabetically from A-Z. It may be better for the owner to reorder the code, and then I can add my code to that version. |
Sorry, closed with wrong shortcut. |
I think I'm going to work on this PR this weekend. |
@Erimus-Koo , if you would like to reopen this PR without the structure changes while keeping #296 in mind, I would be happy to merge it. |
I've reviewed #296 and it seems reasonable. |
I started making changes and found some issues. Let's discuss them. About #296
Structure
I faced similar issues in the previous PR, which is why I considered adjusting the code structure. I'm curious, @ethancedwards8, about your thoughts. Which modification would you prefer? In frontend, CSS often uses sorting rules to organize layout and appearance/color sections. |
about your issues with #296:@dracula-colors is an option that per default is supposed to be doing nothing. hence, for development purposes and default usage, all variables are and stay in one place. any code that is written in dracula should exclusively use the variables defined in dracula.sh at there are places in which the color variable is not hard coded, like for all the plugins (using
regarding structureI'm personally not the biggest fan of the giant blob of options in the beginning as theyre kinda hard to navigate. if it was up to me, i would be ok with breaking it up in a sensible way, however id be interested in what @ethancedwards8 thinks about that. the color for the left icon is set in line 151 i hope this helps. if you have any questions, please let me know :D |
I took the liberty of rearranging the code and made a lot of changes at once. I hope these changes are useful and not too difficult to understand.
Because I work as an artist in a gaming company, the changes mainly focus on spacing, color, icons, etc.
Rearrange
The previous code may have gone through multiple additions, so after I made changes, the new code I added looked even more messy. So in the end, I adjusted the order of the code and its naming consistency. However, I did not adjust the name of tmux's options to ensure backward compatibility.
The new code follows the following rules.
Left Icon Area
Here is my configuration, and all default values that have not been changed.
Handling of show_powerline
In the previous version, there were many
if
statements used to handleshow_powerline
.However, I believe it is simply a marker. If
show_powerline
is not enabled, changing the marker to blank (""
) would suffice. Although there are still several color operations of the blank that need to be handled, it is better than duplicating everything.Window Area
The tab will not suddenly change while you switch between windows.
(Flags will change the width)
Disable dracula's window settings
If you turn
@dracula-window-disabled
to true, all the window settings indracula.sh
won't be rendered, and.tmux.conf
works. You can do some complex things as you wish.Plugins Area
If the timezone existed, add one space before the timezone. If not, there's nothing.
(Prev version always adds an extra space)
P.S.
In my daily work, I primarily write Python and front-end projects, and I rarely write Shell scripts. So, I am concerned about making errors and would greatly appreciate a review of my work.