repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk

cb2ab56c4d8d23500de50579f301904998b979c6

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (4)

+52 / −62 text lines

Diff layout

bootstripper.java

Modified

+38 / −32 text lines

55import java.nio.file.Files;
66import java.nio.file.LinkOption;
77import java.nio.file.Path;
8import java.util.Comparator;
8import java.util.List;
9import java.util.function.BiFunction;
1011class bootstripper {
1112 public static void main(String[] arguments) throws Throwable {
5859 log("Creating symlinks as defined in {0} file.",
5960 emphasize_local(symlinks_file.getFileName().toString()));
6061 var lines = Files.readAllLines(symlinks_file);
61 String source = null;
62 String target = null;
63 for (String line : lines) {
64 if (line.isBlank())
65 continue;
66 if (source == null)
67 source = line;
68 else
69 target = line;
70 if (target != null) {
71 link(root, source, target);
72 source = null;
73 target = null;
74 }
75 }
62 for_each_mapping(lines, (source, target) -> link(root, source, target));
7663 }
7865 static void delete_symlinks(Path root, Path symlinks_file) throws Throwable {
7966 log("Deleting symlinks as defined in {0} file.",
8067 emphasize_local(symlinks_file.getFileName().toString()));
81 // TODO extract parse pattern into method
8268 var lines = Files.readAllLines(symlinks_file);
83 String source = null;
84 String target = null;
85 for (String line : lines) {
86 if (line.isBlank())
87 continue;
88 if (source == null)
89 source = line;
90 else
91 target = line;
92 if (target != null) {
93 delete(root, source, target);
94 source = null;
95 target = null;
96 }
97 }
69 for_each_mapping(lines, (source, target) -> delete(root, source, target));
9870 }
10072 static void delete(Path root, String source, String target) throws Throwable {
219191 static void log(String message, Object... arguments) {
220192 System.out.println(format(message, arguments));
221193 }
195 static interface ThrowUp<A, B> {
196 default Throwable gurgh(A a, B b) {
197 try {
198 apply(a, b);
199 return null;
200 } catch (Throwable vomit) {
201 return vomit;
202 }
203 }
205 void apply(A a, B b) throws Throwable;
206 }
208 static void for_each_mapping(List<String> lines, ThrowUp<String, String> block)
209 throws Throwable {
210 String source = null;
211 String target = null;
212 for (String line : lines) {
213 if (line.isBlank())
214 continue;
215 if (source == null)
216 source = line;
217 else
218 target = line;
219 if (target != null) {
220 var vomit = block.gurgh(source, target);
221 if (vomit != null)
222 throw vomit;
223 source = null;
224 target = null;
225 }
226 }
227 }

wezterm/bugabinga/key_binds.lua

Modified

+1 / −26 text lines

11local wez = require 'wezterm'
2local leader = { key = 'Grave', mods = 'CTRL' }
2local leader = { key = 'raw:255'}
44local resize_pane_mode = 'ﭕ Resize Pane Mode'
55local activate_pane_mode = ' Activate Pane Mode'
1515 one_shot = false,
1616 },
1717 },
18 {
19 key = 'Grave',
20 mods = 'LEADER|CTRL',
21 action = wez.action.ActivateKeyTable {
22 name = activate_pane_mode,
23 one_shot = false,
24 },
25 },
2618 {
2719 key = 'a',
2820 mods = 'LEADER',
156148 { key = 'Escape', action = 'PopKeyTable' },
157149 { key = 'Enter', action = 'PopKeyTable' },
158150 },
159 [activate_pane_mode] = {
160 { key = 'LeftArrow', action = wez.action.ActivatePaneDirection 'Left' },
161 { key = 'h', action = wez.action.ActivatePaneDirection 'Left' },
163 { key = 'RightArrow', action = wez.action.ActivatePaneDirection 'Right' },
164 { key = 'l', action = wez.action.ActivatePaneDirection 'Right' },
166 { key = 'UpArrow', action = wez.action.ActivatePaneDirection 'Up' },
167 { key = 'k', action = wez.action.ActivatePaneDirection 'Up' },
169 { key = 'DownArrow', action = wez.action.ActivatePaneDirection 'Down' },
170 { key = 'j', action = wez.action.ActivatePaneDirection 'Down' },
172 -- Cancel the mode
173 { key = 'Escape', action = 'PopKeyTable' },
174 { key = 'Enter', action = 'PopKeyTable' },
175 },
176151 [font_size_mode] = {
177152 { key = '+', action = wez.action.IncreaseFontSize },
178153 { key = '-', action = wez.action.DecreaseFontSize },

wezterm/bugabinga/status.lua

Modified

+5 / −3 text lines

55local zoomed = function(pane)
66 local tab = pane:tab()
77 local any_is_zoomed = false
8 for _, info in ipairs(tab:panes_with_info()) do
9 if info.is_zoomed then
10 any_is_zoomed = true
8 if tab then
9 for _, info in ipairs(tab:panes_with_info()) do
10 if info.is_zoomed then
11 any_is_zoomed = true
12 end
1113 end
1214 end
1315 return any_is_zoomed and '🔎 Zoomed Pane' .. DELIMITER or ''

wezterm/wezterm.lua

Modified

+8 / −1 text lines

2727return {
28 -- logs key presses
29 debug_key_events = true,
2831 font = font,
2932 font_size = font_size,
3033 warn_about_missing_glyphs = false,
3134 color_scheme = dark_mode,
3235 color_schemes = nugu,
36 window_background_opacity = 1.0,
37 -- nightly
38 -- win32_system_backdrop = 'Acrylic',
39 default_cwd = wez.home_dir,
3340 default_prog = { 'nu', '--login', '--interactive' },
3441 default_cursor_style = 'SteadyBlock',
3542 cursor_blink_rate = 0,
36 cursor_thickness = '1.0cell',
43 cursor_thickness = '0.6cell',
3744 window_decorations = window_decorations,
3845 enable_tab_bar = true,
3946 -- if this is hidden, we cannot see the right status area