From b915775f8ea4095f1a18f71b9c312c8780c6682e Mon Sep 17 00:00:00 2001 From: osmarks Date: Fri, 17 Jul 2026 18:47:21 +0100 Subject: [PATCH] fix buggy sandbox logic, rectify keyboard or something --- dotfiles/link_dots.py | 1 + dotfiles/project_jail.py | 29 ++++++++++++++++++++++------- dotfiles/sway_config | 13 +++++++++---- dotfiles/wezterm.lua | 2 ++ dotfiles/xkb_custom | 11 ++++++++++- dotfiles/xkb_ty_custom | 21 +++++++++++++++++++++ dotfiles/zed.json | 12 ++++++++++++ 7 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 dotfiles/xkb_ty_custom diff --git a/dotfiles/link_dots.py b/dotfiles/link_dots.py index 2655d21..de1a5fb 100644 --- a/dotfiles/link_dots.py +++ b/dotfiles/link_dots.py @@ -13,6 +13,7 @@ files = { "sway_config": "~/.config/sway/config", "zed.json": "~/.config/zed/settings.json", "xkb_custom": "~/.config/xkb/symbols/custom", + "xkb_ty_custom": "~/.config/xkb/types/custom", "sway_custom.desktop": "/usr/share/wayland-sessions/sway_custom.desktop", "take-screenshot": "~/.local/bin/take-screenshot", "take-screenshot-window": "~/.local/bin/take-screenshot-window", diff --git a/dotfiles/project_jail.py b/dotfiles/project_jail.py index 5d7cd9f..82f964f 100755 --- a/dotfiles/project_jail.py +++ b/dotfiles/project_jail.py @@ -22,18 +22,30 @@ PROFILES = { ("rw", "~/.cargo/bin"), ("rw", "~/.cargo/git"), ("rw", "~/.cargo/registry"), - ("ro", "~/.gitconfig"), ("ro", "~/.rustup") ], "node": [ ("rw", "~/.npm"), ("rw", "~/.cache/node-gyp"), - ("ro", "~/.gitconfig") ], - "python": [], + "python": [ + ("rw", "~/.cache/uv"), + ("rw", "~/.cache/pip"), + ], "gpu": [ # TODO: this is very broad ("rw", "/sys") - ] + ], + "codex": [ + ("rw", "~/.codex") + ], + "go": [ + ("rw", "~/go"), + ], + "git": [("ro", "~/.gitconfig")], + "claude": [ + ("rw", "~/.claude") + ], + "misc": [("ro", "~/.local/bin")] } def load_config() -> dict[str, dict]: @@ -77,7 +89,7 @@ def build_bwrap_command(entry: dict, cwd: Path, fd: int) -> list[str]: state_dir = Path(os.environ.get("XDG_STATE_HOME", home / ".local" / "state")) / "project-jails" sandbox_name = entry.get("name") or project_root.name - sandbox_home = state_dir / sandbox_name / os.path.expanduser("~") + sandbox_home = state_dir / sandbox_name / Path(os.path.expanduser("~")).relative_to("/") sandbox_tmp = state_dir / sandbox_name / "tmp" ensure_dir(sandbox_home) @@ -95,8 +107,11 @@ def build_bwrap_command(entry: dict, cwd: Path, fd: int) -> list[str]: dev_binds = [ "/dev/dri", # GPU "/dev/shm", # shared memory + "/dev/ipu0", "/dev/ipu0_ex", "/dev/ipu0_mem", "/dev/ipu0_p2p" ] + home = os.path.expanduser("~") + cmd = [ bwrap, "--unshare-all", @@ -105,8 +120,8 @@ def build_bwrap_command(entry: dict, cwd: Path, fd: int) -> list[str]: "--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", - "--dir", str(sandbox_home), - "--setenv", "HOME", str(sandbox_home), + "--bind", str(sandbox_home), home, + "--setenv", "HOME", home, "--setenv", "USER", os.environ.get("USER", ""), "--setenv", "LOGNAME", os.environ.get("LOGNAME", ""), "--setenv", MARKER_ENV, "1", diff --git a/dotfiles/sway_config b/dotfiles/sway_config index a99ccdd..5b20eb5 100644 --- a/dotfiles/sway_config +++ b/dotfiles/sway_config @@ -17,7 +17,8 @@ output * bg #000000 solid_color exec swayidle -w timeout 300 'lock' timeout 600 'wlopm --off \*' resume 'wlopm --on \*' before-sleep 'lock' exec dunst -exec arbtt_wayland_toplevel.py +#exec arbtt_wayland_toplevel.py +exec arbtt-sway exec sway_workspace_ctl.py exec fix_gnome.sh exec kanshi @@ -29,7 +30,7 @@ exec_always kanshictl reload input "type:keyboard" { xkb_layout custom - xkb_options compose:caps + xkb_options compose:caps,custom:types } #input "SYNA7DAB:00 06CB:CDF0 Touchpad" { @@ -53,8 +54,8 @@ for_window [app_id="firefox" title="Extension"] floating enable bindsym $mod+u exec $term start --class term-floating units bindsym $mod+p exec $term start --class term-floating python bindsym $mod+m exec pavucontrol - bindsym $mod+Ctrl+Return exec $term connect --class term-floating protagonism - bindsym $mod+Shift+Ctrl+Return exec $term connect --class term protagonism + bindsym $mod+Ctrl+Return exec $term connect --class term-floating straylight + bindsym $mod+Shift+Ctrl+Return exec $term connect --class term straylight bindsym $mod+Shift+Return exec $term start --class term bindsym $mod+i exec $term connect --class term-floating unix bindsym $mod+Shift+i exec $term connect --class term unix @@ -62,6 +63,8 @@ for_window [app_id="firefox" title="Extension"] floating enable bindsym Ctrl+space exec dunstctl close bindsym Print exec take-screenshot-window bindsym Ctrl+Print exec take-screenshot + bindsym F8 exec take-screenshot-window + bindsym Ctrl+F8 exec take-screenshot bindsym Ctrl+l exec lock bindsym XF86MonBrightnessUp exec light -A 10 bindsym XF86MonBrightnessDown exec light -U 10 @@ -230,3 +233,5 @@ client.focused_inactive #444460 #444460 #ffffff client.unfocused #101010 #101010 #909090 include /etc/sway/config.d/* + +xwayland force diff --git a/dotfiles/wezterm.lua b/dotfiles/wezterm.lua index 5eaefe7..b253644 100644 --- a/dotfiles/wezterm.lua +++ b/dotfiles/wezterm.lua @@ -27,4 +27,6 @@ config.keys = { {key="Enter", mods="SHIFT", action=wezterm.action{SendString="\x1b\r"}}, } +config.front_end = "OpenGL" + return config diff --git a/dotfiles/xkb_custom b/dotfiles/xkb_custom index 4a182a5..9673ba7 100644 --- a/dotfiles/xkb_custom +++ b/dotfiles/xkb_custom @@ -16,7 +16,16 @@ xkb_symbols "basic" { key { [ 4, dollar, EuroSign, onequarter ] }; key { [apostrophe, at, dead_circumflex, dead_caron] }; - key { [numbersign, asciitilde, backslash, bar ] }; + //key { [numbersign, asciitilde, backslash, bar ] }; +key { + type[Group1] = "FOUR_LEVEL_EITHER_ALT", + symbols[Group1] = [ + numbersign, + asciitilde, + backslash, + bar + ] +}; key { [ backslash, bar, bar, brokenbar ] }; key { [F2, backslash, F14, F14] }; diff --git a/dotfiles/xkb_ty_custom b/dotfiles/xkb_ty_custom new file mode 100644 index 0000000..f27509e --- /dev/null +++ b/dotfiles/xkb_ty_custom @@ -0,0 +1,21 @@ +default partial xkb_types "default" { + virtual_modifiers Alt, LevelThree; + + type "FOUR_LEVEL_EITHER_ALT" { + modifiers = Shift + Alt + LevelThree; + + map[None] = Level1; + map[Shift] = Level2; + map[Alt] = Level3; + map[LevelThree] = Level3; + map[Alt+LevelThree] = Level3; + map[Shift+Alt] = Level4; + map[Shift+LevelThree] = Level4; + map[Shift+Alt+LevelThree] = Level4; + + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Either Alt"; + level_name[Level4] = "Shift + Either Alt"; + }; +}; diff --git a/dotfiles/zed.json b/dotfiles/zed.json index adf00a4..64ca327 100644 --- a/dotfiles/zed.json +++ b/dotfiles/zed.json @@ -7,10 +7,22 @@ // custom settings, run `zed: open default settings` from the // command palette (cmd-shift-p / ctrl-shift-p) { + "cli_default_open_behavior": "new_window", + "outline_panel": { + "dock": "left" + }, + "collaboration_panel": { + "dock": "left" + }, + "git_panel": { + "dock": "left" + }, "project_panel": { + "dock": "left", "hide_hidden": true }, "agent": { + "dock": "right", "default_model": { "provider": "zed.dev", "model": "claude-3-5-sonnet-latest"