mirror of
https://github.com/osmarks/random-stuff
synced 2026-07-29 07:08:51 +00:00
fix buggy sandbox logic, rectify keyboard or something
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,4 +27,6 @@ config.keys = {
|
||||
{key="Enter", mods="SHIFT", action=wezterm.action{SendString="\x1b\r"}},
|
||||
}
|
||||
|
||||
config.front_end = "OpenGL"
|
||||
|
||||
return config
|
||||
|
||||
+10
-1
@@ -16,7 +16,16 @@ xkb_symbols "basic" {
|
||||
key <AE04> { [ 4, dollar, EuroSign, onequarter ] };
|
||||
|
||||
key <AC11> { [apostrophe, at, dead_circumflex, dead_caron] };
|
||||
key <BKSL> { [numbersign, asciitilde, backslash, bar ] };
|
||||
//key <BKSL> { [numbersign, asciitilde, backslash, bar ] };
|
||||
key <BKSL> {
|
||||
type[Group1] = "FOUR_LEVEL_EITHER_ALT",
|
||||
symbols[Group1] = [
|
||||
numbersign,
|
||||
asciitilde,
|
||||
backslash,
|
||||
bar
|
||||
]
|
||||
};
|
||||
|
||||
key <LSGT> { [ backslash, bar, bar, brokenbar ] };
|
||||
key <FK02> { [F2, backslash, F14, F14] };
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user