dotfiles
bugabingas dorkfiles
owned by bugabinga
wezterm: vendored in workspace_switcher
wezterm: codefonts on keybind instead on startup now
wezterm: fix status colors
bf804874b8d47849eba004c7b184e4970e2e6972
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (15)
helix/config.toml
Modified 4 4 shell = [
"nu",
"--commands"]
wezterm/bugabinga/code_font.lua
Modified 8 8 for line
in code_fonts:lines()
do 9 - local weight, font_name
= line:match(csv_line_pattern)
9 + local weight, font_name
= line:match( csv_line_pattern )
10 10 if not weight
or not font_name
then 11 11 wez.log_error
'Could not parse code_fonts.csv. Borked?' 74 74 local selected
= 'JetBrains Mono' 75 75 local font_names
= {}
77 - local total_weight
= 1 77 + local total_weight
= 1 78 78 local code_fonts
= io.
open( wez.config_dir
.. '/bugabinga/code_fonts.csv',
'r' )
81 81 for line
in code_fonts:lines()
do 82 - local weight, font_name
= line:match(csv_line_pattern)
82 + local weight, font_name
= line:match( csv_line_pattern )
83 83 if not weight
or not font_name
then 84 84 wez.log_error
'Could not parse code_fonts.csv. Borked?' wezterm/bugabinga/code_fonts.csv
Modified 1 -10,
Bitstream Vera Sans Mono 7 -22,
Monaspace Krypton Var wezterm/bugabinga/dotfiles_workspace.lua
Modified19 19 args
= {
'nvim',
'wezterm',
'-c',
'lua vim.api.nvim_set_current_dir("' .. dotfiles_path
.. '/wezterm' .. '")', },
21 - neovim_pane:activate()
21 + command_pane:activate()
22 22 wez.mux.set_active_workspace
'dotfiles' 23 23 window:gui_window():maximize()
wezterm/bugabinga/fonts.lua
Modified1 1 local wez
= require 'wezterm' 2 +local codefont
= require 'bugabinga.code_font' 4 +wez.on(
'inc-font-size',
function ( window )
5 + local size
= window:effective_config().font_size
+ 1 6 + local overrides
= window:get_config_overrides()
or {}
7 + overrides.font_size
= size
8 + window:set_config_overrides( overrides )
11 +wez.on(
'dec-font-size',
function ( window )
12 + local size
= window:effective_config().font_size
- 1 13 + local overrides
= window:get_config_overrides()
or {}
14 + overrides.font_size
= size
15 + window:set_config_overrides( overrides )
18 +wez.on(
'reset-font-size',
function ( window )
20 + local overrides
= window:get_config_overrides()
or {}
21 + overrides.font_size
= size
22 + window:set_config_overrides( overrides )
25 +wez.on(
'random-codefont',
function ( window )
26 + local random_font
= codefont.random()
27 + local overrides
= window:get_config_overrides()
or {}
28 + overrides.font
= random_font
29 + window:set_config_overrides( overrides )
32 +wez.on(
'change-font-size',
function ( window, pane )
33 + local font_sizes
= {}
35 + table.
insert( font_sizes, {
id =
tostring( size ),
label =
' ' .. size, } )
38 + window:perform_action(
39 + wez.action.InputSelector {
40 + action = wez.action_callback(
function ( win, _, id, label )
41 + if not id
and not label
then 42 + window:toast_notification(
'font',
'Cancelled font size selection!',
nil,
500 )
45 + local overrides
= win:get_config_overrides()
or {}
46 + overrides.font_size
= tonumber( id )
47 + window:set_config_overrides( overrides )
48 + window:toast_notification(
'font',
'Font set to size ' .. label,
nil,
500 )
50 + title =
'Select font size',
51 + choices = font_sizes,
52 + alphabet =
'1234567890',
53 + description =
'Pick the font size to apply to wezterm.',
3 58 return function ( cfg )
4 59 local font_size
= 16.0 wezterm/bugabinga/hosts/NB-00718.lua
Modified1 -local code_font
= require 'bugabinga.code_font' 1 +local wez
= require 'wezterm' 3 3 return function ( cfg )
5 - cfg.font
= code_font.random();
5 + cfg.font
= wez.font
'Generic Mono II' 7 7 cfg.window_decorations
= 'RESIZE' wezterm/bugabinga/hosts/fedora.lua
Modified1 -local code_font
= require 'bugabinga.code_font' 1 +local wez
= require 'wezterm' 3 2 return function ( cfg )
4 3 cfg.window_decorations
= 'NONE' 5 - cfg.font
= code_font.random();
4 + cfg.font
= wez.font
'IBM Plex Mono';
wezterm/bugabinga/hosts/x230.lua
Modified1 -local code_font
= require 'bugabinga.code_font' 1 +local wez
= require'wezterm' 3 3 return function ( cfg )
4 4 cfg.window_decorations
= 'NONE' 6 - cfg.font
= code_font.random();
8 -||||||| parent of
3a7673c (wezterm: adjust to more readable colors)
6 + cfg.font
= wez.font
'M+ 2m' wezterm/bugabinga/key_binds.lua
Modified 1 1 local wez
= require 'wezterm' 3 -local workspace_switcher
= wez.plugin.require
'https://github.com/MLFlexer/smart_workspace_switcher.wezterm' 2 +local workspace_switcher
= require 'bugabinga.workspace_switcher' 5 4 local custom_action = function ( _ )
6 5 local id
= 'custom-action-' .. tostring( wez.time.now() )
12 11 if wez.target_triple:find
'windows' then 13 12 leader
= {
key =
'raw:255', }
15 -local font_mode
= ' Font mode (-=🠙🠛␡)' 14 +local font_mode
= ' Font mode (-=0🠙🠛␡⎆ )' 16 15 local pane_mode
= ' Pane (hjklqr)' 17 16 local resize_pane_mode
= 'ﭕ Resize Pane (hjkl)' 19 -wez.on(
'inc-font-size',
function ( window )
20 - local size
= window:effective_config().font_size
+ 1 21 - local overrides
= window:get_config_overrides()
or {}
22 - overrides.font_size
= size
23 - window:set_config_overrides( overrides )
26 -wez.on(
'dec-font-size',
function ( window )
27 - local size
= window:effective_config().font_size
- 1 28 - local overrides
= window:get_config_overrides()
or {}
29 - overrides.font_size
= size
30 - window:set_config_overrides( overrides )
33 18 local key_tables
= {
34 19 [resize_pane_mode] = {
35 20 {
key =
'h',
action = wez.action.AdjustPaneSize {
'Left',
1, }, },
44 29 {
key =
'-',
action = wez.action.EmitEvent
'dec-font-size', },
45 30 {
key =
'=',
action = wez.action.EmitEvent
'inc-font-size', },
46 - {
key =
'0',
action = wez.action.ResetFontSize, },
31 + {
key =
'0',
action = wez.action.EmitEvent
'reset-font-size', },
38 + {
key =
'Enter',
action = wez.action.EmitEvent
'change-font-size', },
39 + {
key =
'Space',
action = wez.action.EmitEvent
'random-codefont', },
48 41 {
key =
'UpArrow',
action = wez.action.EmitEvent
'like-current-font', },
49 42 {
key =
'DownArrow',
action = wez.action.EmitEvent
'dislike-current-font', },
78 - action = wez.action.ActivateKeyTable {
name = font_mode,
one_shot =
false, },
71 + action = wez.action.ActivateKeyTable {
name = font_mode,
one_shot =
true, },
119 112 {
Foreground = {
AnsiColor =
'Purple', }, },
120 113 {
Text =
'New workspace:', },
123 115 action
= wez.action_callback(
function ( window, pane, line )
125 117 window:perform_action(
192 184 action
= workspace_switcher.switch_workspace(),
189 + action = wez.action.SwitchToWorkspace {
name =
'dotfiles', },
207 204 action
= wez.action.QuitApplication,
212 - action = wez.action.SwitchToWorkspace {
name =
'dotfiles', },
wezterm/bugabinga/mouse_binds.lua
Modified 3 3 local wez
= require 'wezterm' 7 7 event = {
Down = {
streak =
3,
button =
'Left', }, },
9 9 action = wez.action.SelectTextAtMouseCursor
'SemanticZone',
wezterm/bugabinga/status.lua
Modified35 35 {
Attribute = {
Intensity =
'Bold', }, },
36 36 {
Text =
table.
concat( fonts,
', ' ), },
40 39 local pane_domain
= pane:get_domain_name()
55 54 {
Attribute = {
Intensity =
'Bold', }, },
56 55 {
Text = pane_domain, },
59 57 table.
insert( status, context )
63 61 window:set_right_status(
65 - {
Foreground = {
AnsiColor =
'White', }, },
66 63 {
Text =
table.
concat( status, DELIMITER ), },
70 66 window:set_left_status(
72 - {
Foreground = {
AnsiColor =
'White', }, },
wezterm/bugabinga/title.lua
Deleteddeleted file mode 100644 1 -local wez
= require 'wezterm' 15 -wez.on(
'format-window-title',
function(tab, pane, tabs, panes, config)
17 - if tab.active_pane.is_zoomed
then 23 - index
= string.
format(
'[%d/%d] ', tab.tab_index
+ 1,
#tabs)
26 - return zoomed
.. index
.. tab.active_pane.title
wezterm/bugabinga/window.lua
Modified 4 4 return function ( cfg )
5 5 cfg.window_background_opacity
= 1.0 6 6 cfg.window_decorations
= 'NONE' 7 7 cfg.enable_wayland
= true 8 8 cfg.use_resize_increments
= true 9 9 cfg.window_padding
= {
wezterm/bugabinga/workspace_switcher.lua
Addednew file mode 100644 3 +local wezterm
= require 'wezterm' 4 +local act
= wezterm.action
5 +local mux
= wezterm.mux
7 +local zoxide_path
= 'zoxide' 9 +local is_windows
= string.
find( wezterm.target_triple,
'windows' )
~= nil 11 +local function workspace_formatter( label )
12 + return wezterm.format {
13 + {
Text =
' : ' .. label, },
17 +local run_child_process = function ( cmd )
18 + local process_args
= {
os.
getenv 'SHELL',
'-c', cmd, }
20 + process_args
= {
'cmd',
'/c', cmd, }
22 + local success, stdout, stderr
= wezterm.run_child_process( process_args )
25 + wezterm.log_error(
"Child process '" .. cmd
.. "' failed with stderr: '" .. stderr
.. "'" )
30 +local function get_workspace_elements( choice_table )
31 + local workspace_ids
= {}
32 + for _, workspace
in ipairs( mux.get_workspace_names() )
do 33 + table.
insert( choice_table, {
35 + label = workspace_formatter( workspace ),
37 + workspace_ids[workspace]
= true 39 + return choice_table, workspace_ids
42 +local function get_zoxide_elements( choice_table, workspace_ids )
43 + local stdout
= run_child_process( zoxide_path
.. ' query -l ' )
45 + for _, path
in ipairs( wezterm.split_by_newlines( stdout ) )
do 46 + local updated_path
= string.
gsub( path, wezterm.home_dir,
'~' )
47 + if not workspace_ids[updated_path]
then 48 + table.
insert( choice_table, {
50 + label = updated_path,
57 +local function get_choices()
59 + local workspace_ids
= get_workspace_elements( choices )
60 + get_zoxide_elements( choices, workspace_ids )
64 +local function zoxide_chosen( window, pane, path, label_path )
65 + window:perform_action(
66 + act.SwitchToWorkspace {
69 + label =
'Workspace: ' .. label_path,
76 + run_child_process( zoxide_path
.. ' add ' .. path )
79 +local function workspace_chosen( window, pane, workspace )
80 + window:perform_action(
81 + act.SwitchToWorkspace {
88 +local function workspace_exists( workspace )
89 + for _, workspace_name
in ipairs( mux.get_workspace_names() )
do 90 + if workspace
== workspace_name
then 97 +local function switch_workspace()
98 + return wezterm.action_callback(
function ( window, pane )
99 + wezterm.emit(
'smart_workspace_switcher.workspace_switcher.start', window, pane )
100 + local choices
= get_choices()
102 + window:perform_action(
103 + act.InputSelector {
104 + action = wezterm.action_callback(
function ( inner_window, inner_pane, id, label )
105 + if id
and label
then 106 + if workspace_exists( id )
then 108 + workspace_chosen( inner_window, inner_pane, id )
111 + zoxide_chosen( inner_window, inner_pane, id, label )
114 + wezterm.emit(
'smart_workspace_switcher.workspace_switcher.canceled', window, pane )
117 + title =
'Choose Workspace',
118 + description =
'Select a workspace and press Enter = accept, Esc = cancel, / = filter',
119 + fuzzy_description =
'Workspace to switch: ',
129 + switch_workspace = switch_workspace,
wezterm/wezterm.lua
Modified 2 2 local wez
= require 'wezterm' 3 3 local cfg
= wez.config_builder()
5 5 require 'bugabinga.theme' ( cfg )
6 +require 'bugabinga.startup' ( cfg )
6 7 require 'bugabinga.options' ( cfg )
7 8 require 'bugabinga.key_binds' ( cfg )
8 9 require 'bugabinga.mouse_binds' ( cfg )
9 10 require 'bugabinga.fonts' ( cfg )
10 11 require 'bugabinga.window' ( cfg )
11 -require 'bugabinga.startup' ( cfg )
12 12 require 'bugabinga.status' ( cfg )
13 13 require 'bugabinga.titles' ( cfg )
14 14 require 'bugabinga.launch' ( cfg )
15 15 require 'bugabinga.neovim_zen_mode' (cfg)
16 -require 'bugabinga.hosts' ( cfg )
17 16 require 'bugabinga.dotfiles_workspace' ( cfg )
17 +require 'bugabinga.hosts' ( cfg )