Extract bos-settings to its own repo; add breadhelp; JSON-driven Hyprland config
bos-settings moves to git.breadway.dev/Breadway/bos-settings (full history preserved via git-filter-repo) so its release cadence is decoupled from BOS's own. breadhelp takes its place as this repo's workspace member: a GTK4 onboarding/help center replacing the old bos-welcome/bos-keybinds bash scripts with searchable guides, an interactive keybind viewer (sourced from the new keybinds.toml, not parsed out of hyprland.lua or hardcoded), a troubleshooting wizard with one-click fixes, and a proper first-run tour. bos-netcheck extracts bos-welcome's network-check half, which still needs to run every login independent of breadhelp's own first-run gating. hyprland.lua's keybinds/settings/monitors/autostart are now JSON-driven (binds.json/settings.json/monitors.json/autostart.json) with every loader pcall-wrapped and falling back to hardcoded defaults per field on bad or missing config, so bread* apps (bos-settings' new editors, and breadhelp's keybind viewer) can read/write this config without ever being able to leave the compositor unable to start. CI's package.yml now builds breadhelp instead of bos-settings on tag push; bos-settings needs its own equivalent workflow in its new repo (not yet set up).
This commit is contained in:
parent
434efcea22
commit
664298b6b4
105 changed files with 3280 additions and 5149 deletions
|
|
@ -0,0 +1,16 @@
|
|||
-- breadhelp-suggest — nudge breadhelp's Home tab banner when a bread event
|
||||
-- suggests a relevant guide (e.g. a newly connected monitor -> breadmon
|
||||
-- setup). Auto-discovered by breadd. If breadhelp isn't already running,
|
||||
-- `--suggest <id>` launches it straight to Home with the banner focused; if
|
||||
-- it's already running, the banner just updates silently (see
|
||||
-- breadhelp's services/breadd.rs) rather than stealing focus on every event.
|
||||
|
||||
local M = bread.module({ name = "breadhelp-suggest", version = "1.0.0" })
|
||||
|
||||
function M.on_load()
|
||||
bread.on("bread.monitor.connected", function(event)
|
||||
bread.exec("breadhelp --suggest monitor-setup")
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
8
iso/airootfs/etc/skel/.config/hypr/autostart.json
Normal file
8
iso/airootfs/etc/skel/.config/hypr/autostart.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"extra": [
|
||||
{ "command": "breadbar", "label": "Bar (breadbar)", "enabled": true },
|
||||
{ "command": "hypridle", "label": "Idle / lock daemon (hypridle)", "enabled": true },
|
||||
{ "command": "bos-netcheck", "label": "Network connectivity check", "enabled": true },
|
||||
{ "command": "breadhelp --autostart", "label": "BOS Help (first-run onboarding)", "enabled": true }
|
||||
]
|
||||
}
|
||||
88
iso/airootfs/etc/skel/.config/hypr/binds.json
Normal file
88
iso/airootfs/etc/skel/.config/hypr/binds.json
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"default_mods": ["SUPER"],
|
||||
"bindings": [
|
||||
{ "action": "exec", "command": "kitty", "key": "RETURN", "label": "Open a terminal", "category": "apps" },
|
||||
{ "action": "close", "key": "BACKSPACE", "label": "Close the focused window", "category": "windows" },
|
||||
{ "action": "exec", "command": "breadbox", "key": "SPACE", "label": "Open the app launcher (breadbox)", "category": "apps", "demo_cmd": "breadbox" },
|
||||
{ "action": "exec", "command": "nautilus", "key": "E", "label": "Open files (nautilus)", "category": "apps" },
|
||||
{ "action": "exec", "command": "zen-browser", "key": "B", "label": "Open the browser (zen)", "category": "apps" },
|
||||
{ "action": "exec", "command": "breadpad", "key": "U", "label": "Notes / reminders (breadpad)", "category": "apps", "demo_cmd": "breadpad" },
|
||||
{ "action": "exec", "command": "breadman", "key": "M", "label": "Notes / task manager (breadman)", "category": "apps" },
|
||||
{ "action": "exec", "command": "bos-settings", "key": "comma", "label": "Open BOS Settings", "category": "apps", "demo_cmd": "bos-settings" },
|
||||
{ "action": "exec", "command": "breadhelp", "key": "slash", "label": "Show this keybind cheatsheet", "category": "apps" },
|
||||
{ "action": "exec", "command": "loginctl lock-session", "key": "L", "label": "Lock screen", "category": "apps" },
|
||||
{ "action": "fullscreen", "key": "F", "label": "Toggle fullscreen", "category": "windows" },
|
||||
{ "action": "float", "key": "I", "label": "Toggle floating", "category": "windows" },
|
||||
{ "action": "pseudo", "key": "P", "label": "Toggle pseudotile", "category": "windows" },
|
||||
{ "action": "resize", "key": "R", "label": "Resize mode", "category": "windows" },
|
||||
|
||||
{ "action": "exec", "command": "breadclip", "key": "V", "label": "Clipboard history (breadclip)", "category": "apps", "demo_cmd": "breadclip" },
|
||||
{ "action": "exec", "command": "breadclip", "key": "V", "mods": ["SUPER", "SHIFT"], "label": "Clipboard history (breadclip) — same as SUPER + V", "category": "apps" },
|
||||
|
||||
{ "action": "layout", "layout": "togglesplit", "key": "T", "label": "Toggle split direction", "category": "windows" },
|
||||
{ "action": "focus_last", "key": "Tab", "label": "Focus last window", "category": "windows" },
|
||||
{ "action": "exit", "key": "N", "label": "Exit Hyprland (log out)", "category": "windows" },
|
||||
|
||||
{ "action": "exec", "command": "breadshot region -o ~/Pictures/Screenshots", "key": "S", "mods": ["SUPER", "SHIFT"], "label": "Screenshot: select region -> file", "category": "screenshots" },
|
||||
{ "action": "exec", "command": "breadshot region --clipboard-only", "key": "C", "mods": ["SUPER", "SHIFT"], "label": "Screenshot: select region -> clipboard", "category": "screenshots" },
|
||||
{ "action": "exec", "command": "breadshot active-output -o ~/Pictures/Screenshots", "key": "P", "mods": ["SUPER", "SHIFT"], "label": "Screenshot: whole active screen -> file", "category": "screenshots" },
|
||||
|
||||
{ "action": "focus", "direction": "left", "key": "left", "label": "Move focus left", "category": "focus" },
|
||||
{ "action": "focus", "direction": "right", "key": "right", "label": "Move focus right", "category": "focus" },
|
||||
{ "action": "focus", "direction": "up", "key": "up", "label": "Move focus up", "category": "focus" },
|
||||
{ "action": "focus", "direction": "down", "key": "down", "label": "Move focus down", "category": "focus" },
|
||||
|
||||
{ "action": "move_dir", "direction": "left", "key": "h", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window left", "category": "focus" },
|
||||
{ "action": "move_dir", "direction": "down", "key": "j", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window down", "category": "focus" },
|
||||
{ "action": "move_dir", "direction": "up", "key": "k", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window up", "category": "focus" },
|
||||
{ "action": "move_dir", "direction": "right", "key": "l", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window right", "category": "focus" },
|
||||
|
||||
{ "action": "resize_dir", "x": 30, "y": 0, "key": "right", "mods": ["SUPER", "SHIFT"], "options": { "repeating": true }, "label": "Resize the focused window (grow right)", "category": "focus" },
|
||||
{ "action": "resize_dir", "x": -30, "y": 0, "key": "left", "mods": ["SUPER", "SHIFT"], "options": { "repeating": true }, "label": "Resize the focused window (grow left)", "category": "focus" },
|
||||
{ "action": "resize_dir", "x": 0, "y": -30, "key": "up", "mods": ["SUPER", "SHIFT"], "options": { "repeating": true }, "label": "Resize the focused window (grow up)", "category": "focus" },
|
||||
{ "action": "resize_dir", "x": 0, "y": 30, "key": "down", "mods": ["SUPER", "SHIFT"], "options": { "repeating": true }, "label": "Resize the focused window (grow down)", "category": "focus" },
|
||||
|
||||
{ "action": "focus", "workspace": 1, "key": "1", "label": "Switch to workspace 1", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 2, "key": "2", "label": "Switch to workspace 2", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 3, "key": "3", "label": "Switch to workspace 3", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 4, "key": "4", "label": "Switch to workspace 4", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 5, "key": "5", "label": "Switch to workspace 5", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 6, "key": "6", "label": "Switch to workspace 6", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 7, "key": "7", "label": "Switch to workspace 7", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 8, "key": "8", "label": "Switch to workspace 8", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 9, "key": "9", "label": "Switch to workspace 9", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": 10, "key": "0", "label": "Switch to workspace 10", "category": "workspaces" },
|
||||
|
||||
{ "action": "move", "workspace": 1, "key": "1", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 1", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 2, "key": "2", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 2", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 3, "key": "3", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 3", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 4, "key": "4", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 4", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 5, "key": "5", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 5", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 6, "key": "6", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 6", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 7, "key": "7", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 7", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 8, "key": "8", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 8", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 9, "key": "9", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 9", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": 10, "key": "0", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to workspace 10", "category": "workspaces" },
|
||||
|
||||
{ "action": "focus", "workspace": "e+1", "key": "bracketright", "label": "Next workspace", "category": "workspaces" },
|
||||
{ "action": "focus", "workspace": "e-1", "key": "bracketleft", "label": "Previous workspace", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": "e+1", "key": "bracketright", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to the next workspace", "category": "workspaces" },
|
||||
{ "action": "move", "workspace": "e-1", "key": "bracketleft", "mods": ["SUPER", "SHIFT"], "label": "Move the focused window to the previous workspace", "category": "workspaces" },
|
||||
|
||||
{ "action": "focus", "workspace": "e+1", "key": "mouse_down", "label": "Cycle to the next workspace (scroll)", "category": "mouse" },
|
||||
{ "action": "focus", "workspace": "e-1", "key": "mouse_up", "label": "Cycle to the previous workspace (scroll)", "category": "mouse" },
|
||||
{ "action": "drag", "key": "mouse:272", "options": { "mouse": true }, "label": "Move a window (drag)", "category": "mouse" },
|
||||
{ "action": "resize", "key": "mouse:273", "options": { "mouse": true }, "label": "Resize a window (drag)", "category": "mouse" },
|
||||
|
||||
{ "action": "exec", "command": "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+", "key": "XF86AudioRaiseVolume", "mods": [], "options": { "locked": true, "repeating": true }, "label": "Volume up", "category": "media" },
|
||||
{ "action": "exec", "command": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-", "key": "XF86AudioLowerVolume", "mods": [], "options": { "locked": true, "repeating": true }, "label": "Volume down", "category": "media" },
|
||||
{ "action": "exec", "command": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", "key": "XF86AudioMute", "mods": [], "options": { "locked": true }, "label": "Mute", "category": "media" },
|
||||
{ "action": "exec", "command": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle", "key": "XF86AudioMicMute", "mods": [], "options": { "locked": true }, "label": "Mic mute", "category": "media" },
|
||||
{ "action": "exec", "command": "brightnessctl -e4 -n2 set 5%+", "key": "XF86MonBrightnessUp", "mods": [], "options": { "locked": true, "repeating": true }, "label": "Brightness up", "category": "media" },
|
||||
{ "action": "exec", "command": "brightnessctl -e4 -n2 set 5%-", "key": "XF86MonBrightnessDown", "mods": [], "options": { "locked": true, "repeating": true }, "label": "Brightness down", "category": "media" },
|
||||
{ "action": "exec", "command": "playerctl next", "key": "XF86AudioNext", "mods": [], "options": { "locked": true }, "label": "Next track", "category": "media" },
|
||||
{ "action": "exec", "command": "playerctl previous", "key": "XF86AudioPrev", "mods": [], "options": { "locked": true }, "label": "Previous track", "category": "media" },
|
||||
{ "action": "exec", "command": "playerctl play-pause", "key": "XF86AudioPlay", "mods": [], "options": { "locked": true }, "label": "Play / pause", "category": "media" },
|
||||
{ "action": "exec", "command": "gnome-calculator", "key": "XF86Calculator", "mods": [], "label": "Open the calculator", "category": "media" }
|
||||
]
|
||||
}
|
||||
|
|
@ -1,61 +1,30 @@
|
|||
-- BOS Hyprland configuration — native Lua config (Hyprland 0.55+).
|
||||
-- hyprlang (.conf) is deprecated; this uses the built-in `hl` API.
|
||||
-- Single-file and non-modular by design. Reference: https://wiki.hypr.land/
|
||||
|
||||
local mod = "SUPER"
|
||||
-- Mostly single-file by design (reference: https://wiki.hypr.land/) — the
|
||||
-- exceptions are keybinds, appearance settings, monitor layout, and the
|
||||
-- extra autostart list, each loaded from a JSON file (binds.json,
|
||||
-- settings.json, monitors.json, autostart.json) so bread* apps can read/edit
|
||||
-- them as structured data instead of parsing this Lua file.
|
||||
--
|
||||
-- Every loader below is wrapped in `pcall`: this file is loaded as a single
|
||||
-- Lua chunk, so an uncaught error partway through would abort everything
|
||||
-- *after* it too (no keybinds, no window rules, no autostart) — a bad or
|
||||
-- hand-edited JSON file must degrade to that one section's hardcoded
|
||||
-- defaults, never take down the rest of the session.
|
||||
local script_dir = os.getenv("HOME") .. "/.config/hypr/scripts/"
|
||||
local config_home = os.getenv("HOME") .. "/.config/hypr/"
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Monitors — generic default that works on any hardware.
|
||||
-- Monitors — from monitors.json, always falls back to a generic
|
||||
-- any-hardware default (see scripts/display/monitors.lua).
|
||||
-- ---------------------------------------------------------------------------
|
||||
hl.monitor({ output = "", mode = "preferred", position = "auto", scale = "auto" })
|
||||
pcall(dofile, script_dir .. "display/monitors.lua")
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Core settings.
|
||||
-- Core appearance/input settings — from settings.json (see
|
||||
-- scripts/ui/settings.lua).
|
||||
-- ---------------------------------------------------------------------------
|
||||
hl.config({
|
||||
general = {
|
||||
gaps_in = 5,
|
||||
gaps_out = 10,
|
||||
border_size = 2,
|
||||
col = {
|
||||
active_border = "rgba(88c0d0ff)",
|
||||
inactive_border = "rgba(4c566aff)",
|
||||
},
|
||||
layout = "dwindle",
|
||||
resize_on_border = true,
|
||||
},
|
||||
decoration = {
|
||||
rounding = 8,
|
||||
active_opacity = 1.0,
|
||||
inactive_opacity = 1.0,
|
||||
blur = {
|
||||
enabled = true,
|
||||
size = 6,
|
||||
passes = 2,
|
||||
new_optimizations = true,
|
||||
},
|
||||
shadow = {
|
||||
enabled = true,
|
||||
range = 12,
|
||||
render_power = 3,
|
||||
},
|
||||
},
|
||||
input = {
|
||||
kb_layout = "us",
|
||||
follow_mouse = 1,
|
||||
touchpad = { natural_scroll = true },
|
||||
},
|
||||
dwindle = {
|
||||
preserve_split = true,
|
||||
},
|
||||
animations = {
|
||||
enabled = true,
|
||||
},
|
||||
misc = {
|
||||
disable_hyprland_logo = true,
|
||||
disable_splash_rendering = true,
|
||||
},
|
||||
})
|
||||
pcall(dofile, script_dir .. "ui/settings.lua")
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Animations — snappy curves + per-leaf speeds (matches the reference laptop;
|
||||
|
|
@ -86,10 +55,12 @@ for _, animation in ipairs(animations) do
|
|||
end
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Window rules — float + centre the onboarding popups (kitty --class …).
|
||||
-- Window rules — float + centre the onboarding/help popups.
|
||||
-- breadhelp replaces the old bos-welcome/bos-keybinds kitty+less popups.
|
||||
-- bos-netsetup (nmtui, from bos-netcheck) is unrelated to breadhelp and
|
||||
-- still floats the same way.
|
||||
-- ---------------------------------------------------------------------------
|
||||
hl.window_rule({ name = "bos-keybinds", match = { class = "^(bos-keybinds)$" }, float = true, size = { 760, 720 } })
|
||||
hl.window_rule({ name = "bos-welcome", match = { class = "^(bos-welcome)$" }, float = true, size = { 700, 560 } })
|
||||
hl.window_rule({ name = "breadhelp", match = { class = "^(com\\.breadway\\.breadhelp)$" }, float = true, size = { 880, 600 } })
|
||||
hl.window_rule({ name = "bos-netsetup", match = { class = "^(bos-netsetup)$" }, float = true, size = { 700, 560 } })
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
|
@ -110,94 +81,31 @@ hl.env("_JAVA_AWT_WM_NONREPARENTING", "1")
|
|||
-- above blurs behind the terminal while keeping text fully opaque.
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Standard BOS keybinds (SUPER = mod).
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Apps / window management
|
||||
hl.bind(mod .. " + RETURN", hl.dsp.exec_cmd("kitty"))
|
||||
hl.bind(mod .. " + BACKSPACE", hl.dsp.window.close())
|
||||
hl.bind(mod .. " + SPACE", hl.dsp.exec_cmd("breadbox"))
|
||||
hl.bind(mod .. " + E", hl.dsp.exec_cmd("nautilus"))
|
||||
hl.bind(mod .. " + B", hl.dsp.exec_cmd("zen-browser"))
|
||||
hl.bind(mod .. " + U", hl.dsp.exec_cmd("breadpad"))
|
||||
hl.bind(mod .. " + M", hl.dsp.exec_cmd("breadman"))
|
||||
hl.bind(mod .. " + comma", hl.dsp.exec_cmd("bos-settings"))
|
||||
hl.bind(mod .. " + slash", hl.dsp.exec_cmd("bos-keybinds"))
|
||||
hl.bind(mod .. " + L", hl.dsp.exec_cmd("loginctl lock-session"))
|
||||
hl.bind(mod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" }))
|
||||
hl.bind(mod .. " + I", hl.dsp.window.float({ action = "toggle" }))
|
||||
hl.bind(mod .. " + P", hl.dsp.window.pseudo({ action = "toggle" }))
|
||||
hl.bind(mod .. " + R", hl.dsp.window.resize())
|
||||
-- breadclip (its own gtk4-layer-shell popup — not a TUI, so no terminal
|
||||
-- needed). Previously piped cliphist through fzf directly from the
|
||||
-- compositor with no terminal attached, which was a silent no-op.
|
||||
-- Bound on both V (breadclip's own suggested default, freed up now that
|
||||
-- float toggle moved to I) and SHIFT+V (kept for muscle memory).
|
||||
hl.bind(mod .. " + V", hl.dsp.exec_cmd("breadclip"))
|
||||
hl.bind(mod .. " + SHIFT + V", hl.dsp.exec_cmd("breadclip"))
|
||||
hl.bind(mod .. " + T", hl.dsp.layout("togglesplit"))
|
||||
hl.bind(mod .. " + Tab", hl.dsp.focus({ urgent_or_last = true }))
|
||||
hl.bind(mod .. " + N", hl.dsp.exit())
|
||||
|
||||
-- Screenshots (grim + slurp + wl-clipboard)
|
||||
hl.bind(mod .. " + SHIFT + S", hl.dsp.exec_cmd([[bash -c 'mkdir -p ~/Pictures/Screenshots && grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y%m%d-%H%M%S).png']]))
|
||||
hl.bind(mod .. " + SHIFT + C", hl.dsp.exec_cmd([[bash -c 'grim -g "$(slurp)" - | wl-copy']]))
|
||||
hl.bind(mod .. " + SHIFT + P", hl.dsp.exec_cmd([[bash -c 'mkdir -p ~/Pictures/Screenshots && grim ~/Pictures/Screenshots/$(date +%Y%m%d-%H%M%S).png']]))
|
||||
|
||||
-- Focus (directional)
|
||||
hl.bind(mod .. " + left", hl.dsp.focus({ direction = "left" }))
|
||||
hl.bind(mod .. " + right", hl.dsp.focus({ direction = "right" }))
|
||||
hl.bind(mod .. " + up", hl.dsp.focus({ direction = "up" }))
|
||||
hl.bind(mod .. " + down", hl.dsp.focus({ direction = "down" }))
|
||||
|
||||
-- Move window (directional, vim keys)
|
||||
hl.bind(mod .. " + SHIFT + h", hl.dsp.window.move({ direction = "left" }))
|
||||
hl.bind(mod .. " + SHIFT + j", hl.dsp.window.move({ direction = "down" }))
|
||||
hl.bind(mod .. " + SHIFT + k", hl.dsp.window.move({ direction = "up" }))
|
||||
hl.bind(mod .. " + SHIFT + l", hl.dsp.window.move({ direction = "right" }))
|
||||
|
||||
-- Resize active window (arrows)
|
||||
hl.bind(mod .. " + SHIFT + right", hl.dsp.window.resize({ x = 30, y = 0, relative = true }), { repeating = true })
|
||||
hl.bind(mod .. " + SHIFT + left", hl.dsp.window.resize({ x = -30, y = 0, relative = true }), { repeating = true })
|
||||
hl.bind(mod .. " + SHIFT + up", hl.dsp.window.resize({ x = 0, y = -30, relative = true }), { repeating = true })
|
||||
hl.bind(mod .. " + SHIFT + down", hl.dsp.window.resize({ x = 0, y = 30, relative = true }), { repeating = true })
|
||||
|
||||
-- Workspaces 1–10 (0 = workspace 10)
|
||||
for i = 1, 10 do
|
||||
local key = tostring(i % 10)
|
||||
hl.bind(mod .. " + " .. key, hl.dsp.focus({ workspace = i }))
|
||||
hl.bind(mod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
|
||||
end
|
||||
|
||||
-- Workspace cycling
|
||||
hl.bind(mod .. " + bracketright", hl.dsp.focus({ workspace = "e+1" }))
|
||||
hl.bind(mod .. " + bracketleft", hl.dsp.focus({ workspace = "e-1" }))
|
||||
hl.bind(mod .. " + SHIFT + bracketright", hl.dsp.window.move({ workspace = "e+1" }))
|
||||
hl.bind(mod .. " + SHIFT + bracketleft", hl.dsp.window.move({ workspace = "e-1" }))
|
||||
|
||||
-- Mouse
|
||||
hl.bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
|
||||
hl.bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
|
||||
hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
|
||||
hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
|
||||
|
||||
-- Media / hardware keys (work locked, i.e. on the lock screen too)
|
||||
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
|
||||
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
|
||||
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true })
|
||||
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
|
||||
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
|
||||
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
|
||||
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
|
||||
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
|
||||
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
|
||||
hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"))
|
||||
-- Standard BOS keybinds — data-driven from binds.json (apps, windows,
|
||||
-- screenshots, focus/move/resize, workspaces, mouse, media keys), loaded via
|
||||
-- scripts/input/{binds,keybinds}.lua. breadhelp's keybind viewer reads
|
||||
-- binds.json directly as its source of truth (no separately-maintained
|
||||
-- cheatsheet to keep in sync), and a future bos-settings editor can
|
||||
-- read/write the same file.
|
||||
pcall(function()
|
||||
local binds = dofile(script_dir .. "input/binds.lua")(config_home .. "binds.json")
|
||||
dofile(script_dir .. "input/keybinds.lua")({
|
||||
default_mods = binds.default_mods,
|
||||
bindings = binds.bindings,
|
||||
})
|
||||
end)
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Autostart. polkit agent + the bread ecosystem + idle daemon + wallpaper.
|
||||
-- Autostart. Core bootstrap sequence (polkit agent, dark theme, wallpaper
|
||||
-- daemon, breadd's Wayland-env fix, breadclipd) stays hardcoded here — it's
|
||||
-- timing/order-sensitive infrastructure, not something a settings UI should
|
||||
-- expose for a user to disable or reorder. The extra, genuinely toggleable
|
||||
-- apps (breadbar, hypridle, bos-netcheck, breadhelp) come from
|
||||
-- autostart.json via scripts/system/autostart.lua, appended after.
|
||||
-- (bos-live-setup appends the live-installer launch below this on the ISO.)
|
||||
-- ---------------------------------------------------------------------------
|
||||
hl.on("hyprland.start", function()
|
||||
local startup = {
|
||||
local core_startup = {
|
||||
-- Generate the shared bread GUI stylesheet first, so breadbar/breadbox/
|
||||
-- bos-settings load it on start (they also live-reload if it changes).
|
||||
"bread-theme generate",
|
||||
|
|
@ -239,16 +147,24 @@ hl.on("hyprland.start", function()
|
|||
-- Start it directly instead. If more graphical-session.target
|
||||
-- services show up later, add them here too.
|
||||
"systemctl --user start breadclipd.service",
|
||||
"breadbar",
|
||||
-- breadbox-sync is a Type=oneshot systemd --user service
|
||||
-- (WantedBy=default.target, no Hyprland IPC dependency) — it
|
||||
-- already runs on login via the unit baked into skel; exec'ing it
|
||||
-- again here would just start it twice.
|
||||
"hypridle",
|
||||
-- first-boot onboarding (self-gates after the first run)
|
||||
"bos-welcome",
|
||||
}
|
||||
for _, cmd in ipairs(startup) do
|
||||
for _, cmd in ipairs(core_startup) do
|
||||
hl.dispatch(hl.dsp.exec_cmd(cmd))
|
||||
end
|
||||
|
||||
-- breadbox-sync is a Type=oneshot systemd --user service
|
||||
-- (WantedBy=default.target, no Hyprland IPC dependency) — it already
|
||||
-- runs on login via the unit baked into skel, independent of this list.
|
||||
local ok, extra = pcall(function()
|
||||
return dofile(script_dir .. "system/autostart.lua")()
|
||||
end)
|
||||
if not ok or type(extra) ~= "table" then
|
||||
-- autostart.json/its loader broke — fall back to the same apps BOS
|
||||
-- has always started, so a bad JSON edit degrades to "normal
|
||||
-- desktop" rather than "no bar, no idle lock, no onboarding".
|
||||
extra = { "breadbar", "hypridle", "bos-netcheck", "breadhelp --autostart" }
|
||||
end
|
||||
for _, cmd in ipairs(extra) do
|
||||
hl.dispatch(hl.dsp.exec_cmd(cmd))
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
5
iso/airootfs/etc/skel/.config/hypr/monitors.json
Normal file
5
iso/airootfs/etc/skel/.config/hypr/monitors.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"monitors": [
|
||||
{ "output": "", "mode": "preferred", "position": "auto", "scale": "auto" }
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
-- scripts/display/monitors.lua — loads monitors.json (an array of monitor
|
||||
-- rules) and applies each via hl.monitor(). Failsafe: an empty or entirely
|
||||
-- invalid monitors.json is treated the same as a missing one — falling back
|
||||
-- to the single generic wildcard rule — because applying *zero* monitor
|
||||
-- rules risks an unconfigured/black-screen session, unlike settings.json or
|
||||
-- autostart.json where "apply nothing extra" is a legitimate user choice.
|
||||
local json = dofile(os.getenv("HOME") .. "/.config/hypr/scripts/lib/json.lua")
|
||||
|
||||
local DEFAULT_MONITORS = {
|
||||
{ output = "", mode = "preferred", position = "auto", scale = "auto" },
|
||||
}
|
||||
|
||||
local function valid_entry(e)
|
||||
return type(e) == "table" and type(e.output) == "string"
|
||||
end
|
||||
|
||||
local function load_monitors()
|
||||
local path = os.getenv("HOME") .. "/.config/hypr/monitors.json"
|
||||
local parsed = json.load(path)
|
||||
if type(parsed) ~= "table" or type(parsed.monitors) ~= "table" then
|
||||
return DEFAULT_MONITORS
|
||||
end
|
||||
|
||||
local valid = {}
|
||||
for _, entry in ipairs(parsed.monitors) do
|
||||
if valid_entry(entry) then
|
||||
valid[#valid + 1] = {
|
||||
output = entry.output,
|
||||
mode = (type(entry.mode) == "string" and entry.mode) or "preferred",
|
||||
position = (type(entry.position) == "string" and entry.position) or "auto",
|
||||
scale = entry.scale ~= nil and entry.scale or "auto",
|
||||
mirror = type(entry.mirror) == "string" and entry.mirror or nil,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if #valid == 0 then
|
||||
return DEFAULT_MONITORS
|
||||
end
|
||||
return valid
|
||||
end
|
||||
|
||||
local monitors = load_monitors()
|
||||
local applied_any = false
|
||||
for _, m in ipairs(monitors) do
|
||||
if pcall(hl.monitor, m) then
|
||||
applied_any = true
|
||||
end
|
||||
end
|
||||
|
||||
-- Every entry failed to apply (e.g. Hyprland rejected values that still
|
||||
-- passed our type checks) — guarantee a usable session rather than leaving
|
||||
-- every monitor unconfigured.
|
||||
if not applied_any then
|
||||
pcall(hl.monitor, DEFAULT_MONITORS[1])
|
||||
end
|
||||
35
iso/airootfs/etc/skel/.config/hypr/scripts/input/binds.lua
Normal file
35
iso/airootfs/etc/skel/.config/hypr/scripts/input/binds.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
-- scripts/input/binds.lua — loads binds.json into { default_mods, bindings }.
|
||||
-- Simpler than the multi-keyboard-layout version some personal configs use
|
||||
-- (BOS ships one fixed layout, no per-layout bind switching needed): just
|
||||
-- reads `default_mods` + the flat `bindings` array.
|
||||
|
||||
local json = dofile(os.getenv("HOME") .. "/.config/hypr/scripts/lib/json.lua")
|
||||
|
||||
local function normalize_mods(value, fallback)
|
||||
local mods = {}
|
||||
if type(value) == "table" then
|
||||
for _, item in ipairs(value) do
|
||||
if type(item) == "string" and item ~= "" then
|
||||
mods[#mods + 1] = item
|
||||
end
|
||||
end
|
||||
end
|
||||
if #mods == 0 then
|
||||
for _, mod in ipairs(fallback or {}) do
|
||||
mods[#mods + 1] = mod
|
||||
end
|
||||
end
|
||||
return mods
|
||||
end
|
||||
|
||||
return function(configPath)
|
||||
local parsed = json.load(configPath)
|
||||
if type(parsed) ~= "table" then
|
||||
return { default_mods = { "SUPER" }, bindings = {} }
|
||||
end
|
||||
|
||||
return {
|
||||
default_mods = normalize_mods(parsed.default_mods, { "SUPER" }),
|
||||
bindings = type(parsed.bindings) == "table" and parsed.bindings or {},
|
||||
}
|
||||
end
|
||||
124
iso/airootfs/etc/skel/.config/hypr/scripts/input/keybinds.lua
Normal file
124
iso/airootfs/etc/skel/.config/hypr/scripts/input/keybinds.lua
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
-- scripts/input/keybinds.lua — turns binds.json entries into real hl.bind()
|
||||
-- calls. Ported from a personal modular Hyprland config using the same
|
||||
-- `hl` API; action_builders covers every dispatcher shape BOS's keybinds
|
||||
-- actually use (exec, window management, focus/move/resize, workspaces,
|
||||
-- mouse, media keys).
|
||||
return function(ctx)
|
||||
local function split_mods(value)
|
||||
local mods = {}
|
||||
for raw_mod in tostring(value):gmatch("[^+]+") do
|
||||
local mod = raw_mod:gsub("^%s+", ""):gsub("%s+$", "")
|
||||
if mod ~= "" then
|
||||
mods[#mods + 1] = mod
|
||||
end
|
||||
end
|
||||
return mods
|
||||
end
|
||||
|
||||
-- `allow_empty`: an explicit `"mods": []` in binds.json (media keys,
|
||||
-- which must bind with no modifier at all) must NOT fall back to
|
||||
-- default_mods — only an *omitted* `mods` field should.
|
||||
local function normalize_mods(value, fallback, allow_empty)
|
||||
if value == nil then
|
||||
return fallback
|
||||
end
|
||||
if type(value) ~= "table" then
|
||||
return fallback
|
||||
end
|
||||
if #value == 0 then
|
||||
return allow_empty and {} or fallback
|
||||
end
|
||||
local mods = {}
|
||||
for _, item in ipairs(value) do
|
||||
if type(item) == "string" then
|
||||
for _, mod in ipairs(split_mods(item)) do
|
||||
mods[#mods + 1] = mod
|
||||
end
|
||||
end
|
||||
end
|
||||
if #mods == 0 then
|
||||
return fallback
|
||||
end
|
||||
return mods
|
||||
end
|
||||
|
||||
local defaultMods = normalize_mods(ctx.default_mods, { "SUPER" }, false)
|
||||
local bindings = ctx.bindings or {}
|
||||
|
||||
local function bind_string(mods, key)
|
||||
if type(key) ~= "string" or key == "" then
|
||||
return nil
|
||||
end
|
||||
if #mods == 0 then
|
||||
return key
|
||||
end
|
||||
return table.concat(mods, " + ") .. " + " .. key
|
||||
end
|
||||
|
||||
local action_builders = {
|
||||
exec = function(entry)
|
||||
return hl.dsp.exec_cmd(entry.command)
|
||||
end,
|
||||
close = function()
|
||||
return hl.dsp.window.close()
|
||||
end,
|
||||
exit = function()
|
||||
return hl.dsp.exit()
|
||||
end,
|
||||
float = function()
|
||||
return hl.dsp.window.float({ action = "toggle" })
|
||||
end,
|
||||
fullscreen = function()
|
||||
return hl.dsp.window.fullscreen({ action = "toggle" })
|
||||
end,
|
||||
pseudo = function()
|
||||
return hl.dsp.window.pseudo({ action = "toggle" })
|
||||
end,
|
||||
layout = function(entry)
|
||||
return hl.dsp.layout(entry.layout)
|
||||
end,
|
||||
focus = function(entry)
|
||||
return hl.dsp.focus({ direction = entry.direction, workspace = entry.workspace })
|
||||
end,
|
||||
focus_last = function()
|
||||
return hl.dsp.focus({ urgent_or_last = true })
|
||||
end,
|
||||
move = function(entry)
|
||||
return hl.dsp.window.move({ workspace = entry.workspace })
|
||||
end,
|
||||
move_dir = function(entry)
|
||||
return hl.dsp.window.move({ direction = entry.direction })
|
||||
end,
|
||||
resize = function()
|
||||
return hl.dsp.window.resize()
|
||||
end,
|
||||
resize_dir = function(entry)
|
||||
return hl.dsp.window.resize({ x = entry.x or 0, y = entry.y or 0, relative = true })
|
||||
end,
|
||||
drag = function()
|
||||
return hl.dsp.window.drag()
|
||||
end,
|
||||
}
|
||||
|
||||
-- One bad entry (unknown action, missing field a builder needs) must
|
||||
-- never take down every other bind — skip it and keep going instead of
|
||||
-- asserting/erroring, which would abort binds.json loading entirely.
|
||||
for _, entry in ipairs(bindings) do
|
||||
local builder = action_builders[entry.action]
|
||||
if builder then
|
||||
local ok, result = pcall(function()
|
||||
local mods = normalize_mods(entry.mods, defaultMods, true)
|
||||
local bind = bind_string(mods, entry.key)
|
||||
local action = builder(entry)
|
||||
if bind and action then
|
||||
hl.bind(bind, action, entry.options)
|
||||
end
|
||||
end)
|
||||
if not ok then
|
||||
print("breadhelp/hyprland: skipping bad bind entry (" .. tostring(entry.action) .. "/" .. tostring(entry.key) .. "): " .. tostring(result))
|
||||
end
|
||||
else
|
||||
print("breadhelp/hyprland: skipping bind entry with unknown action: " .. tostring(entry.action))
|
||||
end
|
||||
end
|
||||
end
|
||||
180
iso/airootfs/etc/skel/.config/hypr/scripts/lib/json.lua
Normal file
180
iso/airootfs/etc/skel/.config/hypr/scripts/lib/json.lua
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
-- scripts/lib/json.lua
|
||||
local M = {}
|
||||
|
||||
function M.parse(str)
|
||||
local s = str
|
||||
local pos = 1
|
||||
local len = #s
|
||||
|
||||
local function skipws()
|
||||
while pos <= len and s:sub(pos,pos):match('%s') do pos = pos + 1 end
|
||||
end
|
||||
|
||||
local function parse_string()
|
||||
if s:sub(pos,pos) ~= '"' then error('expected string') end
|
||||
pos = pos + 1
|
||||
local out = {}
|
||||
while pos <= len do
|
||||
local c = s:sub(pos,pos)
|
||||
if c == '"' then pos = pos + 1; return table.concat(out) end
|
||||
if c == '\\' then
|
||||
local n = s:sub(pos+1,pos+1)
|
||||
if n == '"' then out[#out+1] = '"'; pos = pos + 2
|
||||
elseif n == '\\' then out[#out+1] = '\\'; pos = pos + 2
|
||||
elseif n == '/' then out[#out+1] = '/'; pos = pos + 2
|
||||
elseif n == 'b' then out[#out+1] = '\b'; pos = pos + 2
|
||||
elseif n == 'f' then out[#out+1] = '\f'; pos = pos + 2
|
||||
elseif n == 'n' then out[#out+1] = '\n'; pos = pos + 2
|
||||
elseif n == 'r' then out[#out+1] = '\r'; pos = pos + 2
|
||||
elseif n == 't' then out[#out+1] = '\t'; pos = pos + 2
|
||||
elseif n == 'u' then
|
||||
local hex = s:sub(pos+2, pos+5)
|
||||
local code = tonumber(hex, 16)
|
||||
if code then out[#out+1] = utf8.char(code) end
|
||||
pos = pos + 6
|
||||
else
|
||||
pos = pos + 2
|
||||
end
|
||||
else
|
||||
out[#out+1] = c
|
||||
pos = pos + 1
|
||||
end
|
||||
end
|
||||
error('unclosed string')
|
||||
end
|
||||
|
||||
local function parse_value()
|
||||
skipws()
|
||||
local c = s:sub(pos,pos)
|
||||
if c == '"' then return parse_string()
|
||||
elseif c == '{' then
|
||||
return parse_object()
|
||||
elseif c == '[' then
|
||||
return parse_array()
|
||||
elseif c:match('[%d%-]') then
|
||||
local start = pos
|
||||
while s:sub(pos,pos):match('[%d+%-.eE]') do pos = pos + 1 end
|
||||
local num = tonumber(s:sub(start, pos-1))
|
||||
return num
|
||||
elseif s:sub(pos,pos+3) == 'null' then pos = pos + 4; return nil
|
||||
elseif s:sub(pos,pos+3) == 'true' then pos = pos + 4; return true
|
||||
elseif s:sub(pos,pos+4) == 'false' then pos = pos + 5; return false
|
||||
else
|
||||
error('unexpected value at ' .. pos)
|
||||
end
|
||||
end
|
||||
|
||||
function parse_array()
|
||||
if s:sub(pos,pos) ~= '[' then error('expected [') end
|
||||
pos = pos + 1
|
||||
skipws()
|
||||
local arr = {}
|
||||
if s:sub(pos,pos) == ']' then pos = pos + 1; return arr end
|
||||
while true do
|
||||
skipws()
|
||||
local val = parse_value()
|
||||
table.insert(arr, val)
|
||||
skipws()
|
||||
local c = s:sub(pos,pos)
|
||||
if c == ']' then pos = pos + 1; break
|
||||
elseif c == ',' then pos = pos + 1; skipws()
|
||||
else error('expected , or ]') end
|
||||
end
|
||||
return arr
|
||||
end
|
||||
|
||||
function parse_object()
|
||||
if s:sub(pos,pos) ~= '{' then error('expected {') end
|
||||
pos = pos + 1
|
||||
skipws()
|
||||
local obj = {}
|
||||
if s:sub(pos,pos) == '}' then pos = pos + 1; return obj end
|
||||
while true do
|
||||
skipws()
|
||||
local key = parse_string()
|
||||
skipws()
|
||||
if s:sub(pos,pos) ~= ':' then error('expected :') end
|
||||
pos = pos + 1
|
||||
skipws()
|
||||
local val = parse_value()
|
||||
obj[key] = val
|
||||
skipws()
|
||||
local c = s:sub(pos,pos)
|
||||
if c == '}' then pos = pos + 1; break
|
||||
elseif c == ',' then pos = pos + 1; skipws()
|
||||
else error('expected , or }') end
|
||||
end
|
||||
return obj
|
||||
end
|
||||
|
||||
skipws()
|
||||
return parse_value()
|
||||
end
|
||||
|
||||
function M.load(path)
|
||||
local ok, fh = pcall(io.open, path, "r")
|
||||
if not ok or not fh then
|
||||
return nil, "unable to open file"
|
||||
end
|
||||
|
||||
local content = fh:read("*a")
|
||||
fh:close()
|
||||
|
||||
local success, parsed = pcall(M.parse, content)
|
||||
if not success then
|
||||
return nil, parsed
|
||||
end
|
||||
|
||||
return parsed
|
||||
end
|
||||
|
||||
function M.encode(value, indent)
|
||||
indent = indent or 0
|
||||
local indent_str = string.rep(" ", indent)
|
||||
local next_indent_str = string.rep(" ", indent + 1)
|
||||
|
||||
if value == nil then
|
||||
return "null"
|
||||
elseif type(value) == "boolean" then
|
||||
return value and "true" or "false"
|
||||
elseif type(value) == "number" then
|
||||
return tostring(value)
|
||||
elseif type(value) == "string" then
|
||||
return '"' .. value:gsub('\\', '\\\\'):gsub('"', '\\"'):gsub('\n', '\\n'):gsub('\r', '\\r'):gsub('\t', '\\t') .. '"'
|
||||
elseif type(value) == "table" then
|
||||
local is_array = true
|
||||
local max_idx = 0
|
||||
for k in pairs(value) do
|
||||
if type(k) ~= "number" then
|
||||
is_array = false
|
||||
break
|
||||
end
|
||||
max_idx = math.max(max_idx, k)
|
||||
end
|
||||
|
||||
if is_array and max_idx == #value then
|
||||
if max_idx == 0 then
|
||||
return "[]"
|
||||
end
|
||||
local items = {}
|
||||
for i = 1, max_idx do
|
||||
table.insert(items, next_indent_str .. M.encode(value[i], indent + 1))
|
||||
end
|
||||
return "[\n" .. table.concat(items, ",\n") .. "\n" .. indent_str .. "]"
|
||||
else
|
||||
local items = {}
|
||||
for k, v in pairs(value) do
|
||||
table.insert(items, next_indent_str .. M.encode(tostring(k), 0) .. ": " .. M.encode(v, indent + 1))
|
||||
end
|
||||
if #items == 0 then
|
||||
return "{}"
|
||||
end
|
||||
table.sort(items)
|
||||
return "{\n" .. table.concat(items, ",\n") .. "\n" .. indent_str .. "}"
|
||||
end
|
||||
else
|
||||
return "null"
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
-- scripts/system/autostart.lua — loads the *extra* (user-toggleable)
|
||||
-- autostart list from autostart.json. Returns just the enabled commands, in
|
||||
-- order. The core bootstrap sequence (theme generation, dark-mode gsettings,
|
||||
-- polkit agent, wallpaper daemon, breadd's Wayland-env fix, breadclipd) is
|
||||
-- deliberately NOT exposed here — it's timing/order-sensitive infrastructure,
|
||||
-- not something a settings UI should let a user disable, so it stays
|
||||
-- hardcoded in hyprland.lua itself.
|
||||
--
|
||||
-- Failsafe: unlike monitors.json, an empty or all-disabled result here is a
|
||||
-- legitimate user choice (they don't want breadbar/hypridle/etc), so this
|
||||
-- only falls back to defaults on a missing/malformed file — never just
|
||||
-- because the valid result happens to be empty.
|
||||
local json = dofile(os.getenv("HOME") .. "/.config/hypr/scripts/lib/json.lua")
|
||||
|
||||
local DEFAULT_EXTRA = {
|
||||
{ command = "breadbar", enabled = true },
|
||||
{ command = "hypridle", enabled = true },
|
||||
{ command = "bos-netcheck", enabled = true },
|
||||
{ command = "breadhelp --autostart", enabled = true },
|
||||
}
|
||||
|
||||
return function()
|
||||
local path = os.getenv("HOME") .. "/.config/hypr/autostart.json"
|
||||
local parsed = json.load(path)
|
||||
local entries
|
||||
if type(parsed) ~= "table" or type(parsed.extra) ~= "table" then
|
||||
entries = DEFAULT_EXTRA
|
||||
else
|
||||
entries = parsed.extra
|
||||
end
|
||||
|
||||
local commands = {}
|
||||
for _, entry in ipairs(entries) do
|
||||
if type(entry) == "table" and type(entry.command) == "string" and entry.command ~= "" then
|
||||
local enabled = entry.enabled
|
||||
if type(enabled) ~= "boolean" then
|
||||
enabled = true
|
||||
end
|
||||
if enabled then
|
||||
commands[#commands + 1] = entry.command
|
||||
end
|
||||
end
|
||||
end
|
||||
return commands
|
||||
end
|
||||
121
iso/airootfs/etc/skel/.config/hypr/scripts/ui/settings.lua
Normal file
121
iso/airootfs/etc/skel/.config/hypr/scripts/ui/settings.lua
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
-- scripts/ui/settings.lua — loads settings.json over hardcoded defaults and
|
||||
-- applies via hl.config(). Failsafe in two layers:
|
||||
-- 1. every leaf value is type-checked against its default individually, so
|
||||
-- one bad field (wrong type, typo) falls back to just that field, not
|
||||
-- the whole file;
|
||||
-- 2. the actual hl.config() application is pcall'd — if Hyprland itself
|
||||
-- rejects a well-typed-but-semantically-bad value, we fall back to
|
||||
-- re-applying pure hardcoded defaults, so the session always comes up
|
||||
-- with a normal, usable layout instead of erroring out mid-config-load.
|
||||
local json = dofile(os.getenv("HOME") .. "/.config/hypr/scripts/lib/json.lua")
|
||||
|
||||
local DEFAULTS = {
|
||||
gaps_in = 5,
|
||||
gaps_out = 10,
|
||||
border_size = 2,
|
||||
active_border = "rgba(88c0d0ff)",
|
||||
inactive_border = "rgba(4c566aff)",
|
||||
layout = "dwindle",
|
||||
resize_on_border = true,
|
||||
rounding = 8,
|
||||
blur_enabled = true,
|
||||
blur_size = 6,
|
||||
blur_passes = 2,
|
||||
shadow_enabled = true,
|
||||
shadow_range = 12,
|
||||
shadow_render_power = 3,
|
||||
kb_layout = "us",
|
||||
follow_mouse = 1,
|
||||
natural_scroll = true,
|
||||
}
|
||||
|
||||
local function num(v, fallback)
|
||||
if type(v) == "number" then return v end
|
||||
return fallback
|
||||
end
|
||||
|
||||
local function bool(v, fallback)
|
||||
if type(v) == "boolean" then return v end
|
||||
return fallback
|
||||
end
|
||||
|
||||
local function str(v, fallback)
|
||||
if type(v) == "string" and v ~= "" then return v end
|
||||
return fallback
|
||||
end
|
||||
|
||||
local function load_overrides()
|
||||
local path = os.getenv("HOME") .. "/.config/hypr/settings.json"
|
||||
local parsed = json.load(path)
|
||||
if type(parsed) ~= "table" then
|
||||
return {}
|
||||
end
|
||||
return parsed
|
||||
end
|
||||
|
||||
local o = load_overrides()
|
||||
|
||||
local merged = {
|
||||
gaps_in = num(o.gaps_in, DEFAULTS.gaps_in),
|
||||
gaps_out = num(o.gaps_out, DEFAULTS.gaps_out),
|
||||
border_size = num(o.border_size, DEFAULTS.border_size),
|
||||
active_border = str(o.active_border, DEFAULTS.active_border),
|
||||
inactive_border = str(o.inactive_border, DEFAULTS.inactive_border),
|
||||
layout = str(o.layout, DEFAULTS.layout),
|
||||
resize_on_border = bool(o.resize_on_border, DEFAULTS.resize_on_border),
|
||||
rounding = num(o.rounding, DEFAULTS.rounding),
|
||||
blur_enabled = bool(o.blur_enabled, DEFAULTS.blur_enabled),
|
||||
blur_size = num(o.blur_size, DEFAULTS.blur_size),
|
||||
blur_passes = num(o.blur_passes, DEFAULTS.blur_passes),
|
||||
shadow_enabled = bool(o.shadow_enabled, DEFAULTS.shadow_enabled),
|
||||
shadow_range = num(o.shadow_range, DEFAULTS.shadow_range),
|
||||
shadow_render_power = num(o.shadow_render_power, DEFAULTS.shadow_render_power),
|
||||
kb_layout = str(o.kb_layout, DEFAULTS.kb_layout),
|
||||
follow_mouse = num(o.follow_mouse, DEFAULTS.follow_mouse),
|
||||
natural_scroll = bool(o.natural_scroll, DEFAULTS.natural_scroll),
|
||||
}
|
||||
|
||||
local function build_hl_config(v)
|
||||
return {
|
||||
general = {
|
||||
gaps_in = v.gaps_in,
|
||||
gaps_out = v.gaps_out,
|
||||
border_size = v.border_size,
|
||||
col = {
|
||||
active_border = v.active_border,
|
||||
inactive_border = v.inactive_border,
|
||||
},
|
||||
layout = v.layout,
|
||||
resize_on_border = v.resize_on_border,
|
||||
},
|
||||
decoration = {
|
||||
rounding = v.rounding,
|
||||
active_opacity = 1.0,
|
||||
inactive_opacity = 1.0,
|
||||
blur = {
|
||||
enabled = v.blur_enabled,
|
||||
size = v.blur_size,
|
||||
passes = v.blur_passes,
|
||||
new_optimizations = true,
|
||||
},
|
||||
shadow = {
|
||||
enabled = v.shadow_enabled,
|
||||
range = v.shadow_range,
|
||||
render_power = v.shadow_render_power,
|
||||
},
|
||||
},
|
||||
input = {
|
||||
kb_layout = v.kb_layout,
|
||||
follow_mouse = v.follow_mouse,
|
||||
touchpad = { natural_scroll = v.natural_scroll },
|
||||
},
|
||||
dwindle = { preserve_split = true },
|
||||
animations = { enabled = true },
|
||||
misc = { disable_hyprland_logo = true, disable_splash_rendering = true },
|
||||
}
|
||||
end
|
||||
|
||||
local ok = pcall(hl.config, build_hl_config(merged))
|
||||
if not ok then
|
||||
pcall(hl.config, build_hl_config(DEFAULTS))
|
||||
end
|
||||
19
iso/airootfs/etc/skel/.config/hypr/settings.json
Normal file
19
iso/airootfs/etc/skel/.config/hypr/settings.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"gaps_in": 5,
|
||||
"gaps_out": 10,
|
||||
"border_size": 2,
|
||||
"active_border": "rgba(88c0d0ff)",
|
||||
"inactive_border": "rgba(4c566aff)",
|
||||
"layout": "dwindle",
|
||||
"resize_on_border": true,
|
||||
"rounding": 8,
|
||||
"blur_enabled": true,
|
||||
"blur_size": 6,
|
||||
"blur_passes": 2,
|
||||
"shadow_enabled": true,
|
||||
"shadow_range": 12,
|
||||
"shadow_render_power": 3,
|
||||
"kb_layout": "us",
|
||||
"follow_mouse": 1,
|
||||
"natural_scroll": true
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Show the BOS keybind cheatsheet in a floating terminal (bound to SUPER+/).
|
||||
# The bos-keybinds window class is floated/centred by a Hyprland window rule.
|
||||
exec kitty --class bos-keybinds --title "BOS Keybinds" -- less -R /usr/share/bos/keybinds.txt
|
||||
35
iso/airootfs/usr/local/bin/bos-netcheck
Executable file
35
iso/airootfs/usr/local/bin/bos-netcheck
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
# Every-login network connectivity check. Split out of the old bos-welcome
|
||||
# script, which conflated this with one-time onboarding (now breadhelp's
|
||||
# job) — this half must keep running unconditionally on every login, before
|
||||
# any GUI toolkit is worth spinning up, and must never be gated by a marker.
|
||||
set -u
|
||||
|
||||
# Never run in the live/installer session — only on an installed system.
|
||||
[[ "$(id -un)" == "liveuser" ]] && exit 0
|
||||
|
||||
# A fresh install usually boots with no connection (Wi-Fi isn't configured
|
||||
# during install), and the first `bos-update`/pacman run then fails with
|
||||
# confusing DNS/"could not resolve host" errors. If NetworkManager reports
|
||||
# we're not fully online, open nmtui so the user can join a network before
|
||||
# anything else. Best-effort: missing nmcli/nmtui/kitty, or the user quitting
|
||||
# nmtui, must never block the rest of login.
|
||||
command -v nmcli &>/dev/null || exit 0
|
||||
|
||||
conn="$(nmcli networking connectivity check 2>/dev/null)"
|
||||
# NetworkManager may still be associating right at compositor start — give it
|
||||
# a few short retries before concluding we're actually offline, so a machine
|
||||
# with working Wi-Fi doesn't get a spurious nmtui popup.
|
||||
tries=0
|
||||
while [[ "$conn" != "full" && "$tries" -lt 3 ]]; do
|
||||
sleep 1
|
||||
conn="$(nmcli networking connectivity check 2>/dev/null)"
|
||||
tries=$((tries + 1))
|
||||
done
|
||||
|
||||
if [[ "$conn" != "full" ]]; then
|
||||
notify-send -u normal "BOS" "No internet yet — opening network setup so updates work." 2>/dev/null || true
|
||||
if command -v nmtui &>/dev/null; then
|
||||
kitty --class bos-netsetup --title "Connect to a network" -- nmtui connect 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
# First-run welcome + first-run/every-login network check. Launched from the
|
||||
# Hyprland autostart; the bos-welcome window class is floated/centred by a
|
||||
# Hyprland window rule.
|
||||
set -u
|
||||
|
||||
# Never run in the live/installer session — only on an installed system.
|
||||
[[ "$(id -un)" == "liveuser" ]] && exit 0
|
||||
|
||||
welcomed_marker="${XDG_CONFIG_HOME:-$HOME/.config}/bos/.welcomed"
|
||||
mkdir -p "$(dirname "$welcomed_marker")"
|
||||
|
||||
# Network check. A fresh install usually boots with no connection (Wi-Fi
|
||||
# isn't configured during install), and the first `bos-update`/pacman run
|
||||
# then fails with confusing DNS/"could not resolve host" errors. If
|
||||
# NetworkManager reports we're not fully online, open nmtui so the user can
|
||||
# join a network before anything else. This runs on EVERY login, not just
|
||||
# the first, and isn't gated by any marker — it keeps re-prompting until the
|
||||
# machine is actually online, then naturally stops (the "full" check below
|
||||
# short-circuits). Best-effort: missing nmcli/nmtui/kitty, or the user
|
||||
# quitting nmtui, must never block the welcome text below.
|
||||
if command -v nmcli &>/dev/null; then
|
||||
conn="$(nmcli networking connectivity check 2>/dev/null)"
|
||||
# NetworkManager may still be associating right at compositor start —
|
||||
# give it a few short retries before concluding we're actually offline,
|
||||
# so a machine with working Wi-Fi doesn't get a spurious nmtui popup.
|
||||
tries=0
|
||||
while [[ "$conn" != "full" && "$tries" -lt 3 ]]; do
|
||||
sleep 1
|
||||
conn="$(nmcli networking connectivity check 2>/dev/null)"
|
||||
tries=$((tries + 1))
|
||||
done
|
||||
|
||||
if [[ "$conn" != "full" ]]; then
|
||||
notify-send -u normal "BOS" "No internet yet — opening network setup so updates work." 2>/dev/null || true
|
||||
if command -v nmtui &>/dev/null; then
|
||||
kitty --class bos-netsetup --title "Connect to a network" -- nmtui connect 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Welcome text: shown once ever, independent of network status above (an
|
||||
# offline machine still gets useful onboarding text — it just also keeps
|
||||
# getting the network prompt on future logins until it connects).
|
||||
[[ -f "$welcomed_marker" ]] && exit 0
|
||||
touch "$welcomed_marker"
|
||||
|
||||
exec kitty --class bos-welcome --title "Welcome to BOS" -- less -R /usr/share/bos/welcome.txt
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
|
||||
██████ ██████ ███████ keyboard shortcuts
|
||||
██ ██ ██ ██ ██ SUPER is the Windows/Cmd key
|
||||
██████ ██ ██ ███████
|
||||
══════════════════════════════════════════════════════════
|
||||
|
||||
APPS & WINDOWS
|
||||
SUPER + Return terminal (kitty)
|
||||
SUPER + Space app launcher (breadbox)
|
||||
SUPER + E files (nautilus)
|
||||
SUPER + B browser (zen)
|
||||
SUPER + U notes / reminders (breadpad)
|
||||
SUPER + M notes / task manager (breadman)
|
||||
SUPER + , BOS Settings
|
||||
SUPER + / this keybind cheatsheet
|
||||
SUPER + L lock screen
|
||||
SUPER + Backspace close window
|
||||
SUPER + F fullscreen
|
||||
SUPER + I toggle floating
|
||||
SUPER + P toggle pseudotile
|
||||
SUPER + R resize mode
|
||||
SUPER + V / Shift + V clipboard history (breadclip)
|
||||
SUPER + T toggle split direction
|
||||
SUPER + Tab last window
|
||||
SUPER + N exit Hyprland (log out)
|
||||
|
||||
SCREENSHOTS
|
||||
SUPER + Shift + S select region -> file
|
||||
SUPER + Shift + C select region -> clipboard
|
||||
SUPER + Shift + P whole screen -> file
|
||||
|
||||
FOCUS & MOVE
|
||||
SUPER + arrows move focus
|
||||
SUPER + Shift + h/j/k/l move window
|
||||
SUPER + Shift + arrows resize window
|
||||
|
||||
WORKSPACES
|
||||
SUPER + 1..0 switch to workspace 1..10
|
||||
SUPER + Shift + 1..0 move window to workspace
|
||||
SUPER + [ / ] previous / next workspace
|
||||
SUPER + Shift + [ / ] move window prev / next workspace
|
||||
SUPER + scroll cycle workspaces
|
||||
|
||||
MOUSE
|
||||
SUPER + left-drag move window
|
||||
SUPER + right-drag resize window
|
||||
|
||||
MEDIA & HARDWARE KEYS
|
||||
volume / brightness / play-pause / next / prev (work on lock screen)
|
||||
calculator key opens gnome-calculator
|
||||
|
||||
──────────────────────────────────────────────────────────
|
||||
Press q to close. Configure everything in BOS Settings (SUPER + ,).
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
Welcome to BOS — the Bread Operating System
|
||||
══════════════════════════════════════════════════════════
|
||||
|
||||
You're running a complete Hyprland desktop with the bread
|
||||
ecosystem preinstalled. A few things to get you started:
|
||||
|
||||
• SUPER + / show the keybind cheatsheet (any time)
|
||||
• SUPER + , open BOS Settings — configure bread, the
|
||||
bar, launcher, Wi-Fi profiles, notes,
|
||||
snapshots and package updates, all in one
|
||||
place (no config files needed)
|
||||
• SUPER + Space the app launcher (breadbox)
|
||||
• SUPER + Return a terminal
|
||||
|
||||
The bar at the top (breadbar) shows workspaces, the clock,
|
||||
system stats, and your tray. Notifications appear top-right.
|
||||
|
||||
Your system is snapshotted on every package change — if an
|
||||
update breaks something, roll back from BOS Settings or pick
|
||||
a snapshot from the GRUB menu at boot.
|
||||
|
||||
──────────────────────────────────────────────────────────
|
||||
Press q to close. This message won't show again.
|
||||
|
|
@ -187,9 +187,10 @@ yay-bin
|
|||
# networkmanager, openssl, zlib, systemd-libs) — keep those even though no bread
|
||||
# package depends on them.
|
||||
#
|
||||
# bos-settings is a BOS-specific pacman package (not part of the bakery index),
|
||||
# so it stays here, served from the [breadway] repo.
|
||||
# bos-settings and breadhelp are BOS-specific pacman packages (not part of the
|
||||
# bakery index), so they stay here, served from the [breadway] repo.
|
||||
bos-settings
|
||||
breadhelp
|
||||
|
||||
# Input / screen utilities
|
||||
brightnessctl
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ file_permissions=(
|
|||
["/usr/local/bin/bos-copy-kernel"]="0:0:755"
|
||||
["/usr/local/bin/bos-resolve-airootfs"]="0:0:755"
|
||||
["/usr/local/bin/bos-session"]="0:0:755"
|
||||
["/usr/local/bin/bos-keybinds"]="0:0:755"
|
||||
["/usr/local/bin/bos-welcome"]="0:0:755"
|
||||
["/usr/local/bin/bos-netcheck"]="0:0:755"
|
||||
["/usr/local/bin/bos-update"]="0:0:755"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue