Skip to content

Commit a3c9ec3

Browse files
committed
feat: add improved zellij status bar
- add CPU and GPU temperatures to status bar - clean up colors and rely on terminal color scheme - add script for getting current CPU temperature
1 parent ed9336a commit a3c9ec3

File tree

11 files changed

+255
-23
lines changed

11 files changed

+255
-23
lines changed

.chezmoiexternal.toml.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
url = "https://github.com/storj/storj/releases/latest/download/uplink_{{ .chezmoi.os }}_{{ .chezmoi.arch }}.zip"
1313
refreshPeriod = "168h"
1414
path = "uplink"
15+
16+
[".local/bin/zjstatus.wasm"]
17+
type = "file"
18+
url = "https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm"
19+
refreshPeriod = "24h"

.editorconfig

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ end_of_line = lf
55
insert_final_newline = true
66
charset = utf-8
77
indent_style = space
8-
9-
[*.{sh,bash}]
108
indent_size = 2
119

12-
[*.{toml,py,toml.tmpl}]
10+
[*.{kdl,toml,py,toml.tmpl,kdl.tmpl}]
1311
indent_size = 4

dot_profile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
export PATH="${HOME}.local/share/JetBrains/Toolbox/scripts:${PATH}"
55

66
if [ -f "${HOME}/.bashrc" ]; then
7-
source "${HOME}/.bashrc"
7+
# shellcheck disable=SC1091
8+
source "${HOME}/.bashrc"
89
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
bind 'set show-all-if-ambiguous on'
4+
bind 'set completion-ignore-case on'
5+
bind 'set colored-stats on'
6+
bind 'set colored-completion-prefix on'
7+
bind 'set history-size 0'
8+
bind 'TAB:menu-complete'
9+
bind '"\e[Z":menu-complete-backward'

exact_private_dot_bashrc.d/40-flox.bash

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
if command -v flox &>/dev/null; then
44
alias dev='flox activate --dir=${HOME}'
5+
alias fa='flox activate'
56
fi
+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# -*-mode:toml-*- vim:ft=toml
2+
# -*-mode:go-template-*- vim:ft=toml
3+
4+
# ~/.local/share/chezmoi/.chezmoiexternal.toml.tmpl
5+
# =============================================================================
6+
# Used to download external dependencies.{{- /*
7+
#
8+
# This file supports Go's text/template language. */}}
9+
10+
## where to store your database, default is your system data directory
11+
## linux/mac: ~/.local/share/atuin/history.db
12+
## windows: %USERPROFILE%/.local/share/atuin/history.db
13+
# db_path = "~/.history.db"
14+
15+
## where to store your encryption key, default is your system data directory
16+
## linux/mac: ~/.local/share/atuin/key
17+
## windows: %USERPROFILE%/.local/share/atuin/key
18+
# key_path = "~/.key"
19+
20+
## where to store your auth session token, default is your system data directory
21+
## linux/mac: ~/.local/share/atuin/session
22+
## windows: %USERPROFILE%/.local/share/atuin/session
23+
# session_path = "~/.session"
24+
25+
## date format used, either "us" or "uk"
26+
dialect = "us"
27+
28+
## enable or disable automatic sync
29+
auto_sync = true
30+
31+
## enable or disable automatic update checks
32+
update_check = true
33+
34+
## address of the sync server
35+
# sync_address = "https://api.atuin.sh"
36+
sync_address = {{ onepasswordRead "op://Private/atuin/sync_address" | quote }}
37+
38+
## how often to sync history. note that this is only triggered when a command
39+
## is ran, so sync intervals may well be longer
40+
## set it to 0 to sync after every command
41+
sync_frequency = 0
42+
43+
## which search mode to use
44+
## possible values: prefix, fulltext, fuzzy, skim
45+
# search_mode = "fuzzy"
46+
search_mode = "fuzzy"
47+
48+
## which filter mode to use
49+
## possible values: global, host, session, directory
50+
# filter_mode = "global"
51+
52+
## With workspace filtering enabled, Atuin will filter for commands executed
53+
## in any directory within a git repositiry tree (default: false)
54+
# workspaces = false
55+
56+
## which filter mode to use when atuin is invoked from a shell up-key binding
57+
## the accepted values are identical to those of "filter_mode"
58+
## leave unspecified to use same mode set in "filter_mode"
59+
# filter_mode_shell_up_key_binding = "global"
60+
61+
## which search mode to use when atuin is invoked from a shell up-key binding
62+
## the accepted values are identical to those of "search_mode"
63+
## leave unspecified to use same mode set in "search_mode"
64+
# search_mode_shell_up_key_binding = "fuzzy"
65+
66+
## which style to use
67+
## possible values: auto, full, compact
68+
# style = "auto"
69+
style = "auto"
70+
71+
## the maximum number of lines the interface should take up
72+
## set it to 0 to always go full screen
73+
# inline_height = 0
74+
75+
## Invert the UI - put the search bar at the top , Default to `false`
76+
# invert = false
77+
78+
## enable or disable showing a preview of the selected command
79+
## useful when the command is longer than the terminal width and is cut off
80+
# show_preview = false
81+
show_preview = true
82+
83+
## what to do when the escape key is pressed when searching
84+
## possible values: return-original, return-query
85+
# exit_mode = "return-original"
86+
87+
## possible values: emacs, subl
88+
# word_jump_mode = "emacs"
89+
90+
## characters that count as a part of a word
91+
# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
92+
93+
## number of context lines to show when scrolling by pages
94+
# scroll_context_lines = 1
95+
96+
## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts
97+
## alt-0 .. alt-9
98+
# ctrl_n_shortcuts = false
99+
100+
## prevent commands matching any of these regexes from being written to history.
101+
## Note that these regular expressions are unanchored, i.e. if they don't start
102+
## with ^ or end with $, they'll match anywhere in the command.
103+
## For details on the supported regular expression syntax, see
104+
## https://docs.rs/regex/latest/regex/#syntax
105+
# history_filter = [
106+
# "^secret-cmd",
107+
# "^innocuous-cmd .*--secret=.+"
108+
# ]
109+
110+
## prevent commands run with cwd matching any of these regexes from being written
111+
## to history. Note that these regular expressions are unanchored, i.e. if they don't
112+
## start with ^ or end with $, they'll match anywhere in CWD.
113+
## For details on the supported regular expression syntax, see
114+
## https://docs.rs/regex/latest/regex/#syntax
115+
# cwd_filter = [
116+
# "^/very/secret/area"
117+
# ]
118+
119+
## Configure the maximum height of the preview to show.
120+
## Useful when you have long scripts in your history that you want to distinguish
121+
## by more than the first few lines.
122+
# max_preview_height = 4
123+
124+
## Configure whether or not to show the help row, which includes the current Atuin
125+
## version (and whether an update is available), a keymap hint, and the total
126+
## amount of commands in your history.
127+
# show_help = true
128+
129+
## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include
130+
## 1. AWS key id
131+
## 2. Github pat (old and new)
132+
## 3. Slack oauth tokens (bot, user)
133+
## 4. Slack webhooks
134+
## 5. Stripe live/test keys
135+
# secrets_filter = true
136+
137+
## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit.
138+
# This applies for new installs. Old installs will keep the old behaviour unless configured otherwise.
139+
enter_accept = true
140+
141+
## Defaults to false. Enable this, and Atuin will reduce motion in the TUI as much as possible. Users with motion sensitivity can find
142+
# the live-updating timestamps distracting. Alternatively, set env var NO_MOTION
143+
prefers_reduced_motion = true
144+
145+
## Configures commands where we should consider the subcommand as part of the statistics.
146+
# For example, consider kubectl get rather than just kubectl.
147+
common_subcommands = [
148+
"apt",
149+
"aws",
150+
"bun",
151+
"cargo",
152+
"composer",
153+
"dnf",
154+
"docker",
155+
"git",
156+
"go",
157+
"ip",
158+
"kubectl",
159+
"nix",
160+
"nmcli",
161+
"npm",
162+
"pecl",
163+
"pnpm",
164+
"podman",
165+
"port",
166+
"systemctl",
167+
"terraform",
168+
"terragrunt",
169+
"tmux",
170+
"tofu",
171+
"yarn",
172+
]
173+
174+
## Configures commands that should be totally stripped from stats calculations. For example, ‘sudo’ should be ignored.
175+
common_prefix = [
176+
"sudo",
177+
]

private_dot_config/zellij/config.kdl.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,6 @@ copy_clipboard "system"
204204
ui {
205205
pane_frames {
206206
rounded_corners true
207-
hide_session_name false
207+
hide_session_name true
208208
}
209209
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// -*-mode:kdl-*- vim:ft=kdl.gotexttmpl
2+
layout {
3+
default_tab_template {
4+
children
5+
pane size=1 borderless=true {
6+
plugin location="file:~/.local/bin/zjstatus.wasm" {
7+
format_left "{mode} #[fg=magenta,bold]{session}"
8+
format_center "{tabs}"
9+
format_right "{command_git_branch} #[fg=blue]CPU {command_cpu} #[fg=green]GPU {command_gpu} {datetime}"
10+
format_space ""
11+
12+
border_enabled "false"
13+
border_char "─"
14+
border_format "#[fg=magenta]{char}"
15+
border_position "top"
16+
17+
hide_frame_for_single_pane "true"
18+
19+
mode_normal "#[bg=magenta] "
20+
mode_tmux "#[bg=red] "
21+
22+
tab_normal "#[fg=white] {name} "
23+
tab_normal_fullscreen "#[fg=white] {name} {fullscreen_indicator}"
24+
tab_normal_sync "#[fg=white] {name} {sync_indicator}"
25+
tab_active "#[fg=yellow,bold,italic] {name} "
26+
tab_active_fullscreen "#[fg=yellow,bold,italic] {name} {fullscreen_indicator}"
27+
tab_active_fullscreen "#[fg=yellow,bold,italic] {name} {sync_indicator}"
28+
29+
// indicators
30+
tab_sync_indicator "<> "
31+
tab_fullscreen_indicator "[] "
32+
tab_floating_indicator "⬚ "
33+
34+
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
35+
command_git_branch_format "#[fg=blue] {stdout} "
36+
command_git_branch_interval "10"
37+
command_git_branch_rendermode "static"
38+
39+
command_cpu_command "{{ .chezmoi.homeDir }}/.local/bin/cpu-temp.sh"
40+
command_cpu_format "#[fg=blue,bold]{stdout}°C"
41+
command_cpu_rendermode "static"
42+
command_cpu_interval "3"
43+
44+
command_gpu_command "nvidia-smi --query-gpu temperature.gpu --format='csv,noheader,nounits'"
45+
command_gpu_format "#[fg=green,bold]{stdout}°C"
46+
command_gpu_rendermode "static"
47+
command_gpu_interval "3"
48+
49+
datetime "#[fg=black,bold] {format} "
50+
datetime_format "%a %d/%m %H:%M"
51+
datetime_timezone "America/New_York"
52+
}
53+
}
54+
}
55+
}

private_dot_config/zellij/exact_layouts/editor-and-shell.kdl

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default.kdl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
sensors k10temp-pci-00c3 -A -j -n | jq -r '.[].Tctl.temp1_input | round' -

0 commit comments

Comments
 (0)