pi clock & hyprland clean ups & skyg clean ups:
- Added the pi clock settings - cleaned up some of the fwbook lua - skyg build iso out file -- is now named
This commit is contained in:
1 parent
8dae12d16b
commit
0b0a2214f4
29 files changed
+715
-109
No files matched your search
+7
-10
@@ -85,20 +85,12 @@ export def "skyg update" [input_name: string = ""] {
|
||||
export def "skyg os" [
|
||||
cmd: string@remote-cmds,
|
||||
--build-host: string@remote_targets = "",
|
||||
# --max-jobs: int = 0,
|
||||
# --cores: int = -1,
|
||||
] {
|
||||
cd $REPO_ROOT
|
||||
mut runcmd = $"nh os ($cmd)"
|
||||
if $build_host != "" {
|
||||
$runcmd = $"($runcmd) --build-host ($build_host).lab.internal"
|
||||
}
|
||||
# if $max_jobs > 0 {
|
||||
# $runcmd = $"($runcmd) --max-jobs ($max_jobs)"
|
||||
# }
|
||||
# if $cores >= 0 {
|
||||
# $runcmd = $"($runcmd) --cores ($cores)"
|
||||
# }
|
||||
$runcmd | print
|
||||
bash -c $runcmd
|
||||
}
|
||||
@@ -319,8 +311,13 @@ export def "skyg build-image" [
|
||||
"pi2" => { config: "hl-pi2", out: "sd-image", attr: "sdImage" }
|
||||
_ => { error make { msg: $"Unknown image target '($target)'. Expected: iso, pi1, pi2" } }
|
||||
})
|
||||
nix build $".#nixosConfigurations.($spec.config).config.system.build.($spec.attr)"
|
||||
ls -l $"result/($spec.out)"
|
||||
let imageBuildTime = date now | format date "%Y.%m.%d_%H_%M_%S";
|
||||
let rootOutputFolder = $REPO_ROOT | path join "build" $spec.config;
|
||||
let outPutFolder = $rootOutputFolder | path join $imageBuildTime;
|
||||
rm -rf $rootOutputFolder;
|
||||
mkdir $rootOutputFolder;
|
||||
nix build $"#nixosConfigurations.($spec.config).config.system.build.($spec.attr)" -o $outPutFolder
|
||||
printf $outPutFolder
|
||||
}
|
||||
|
||||
# Home Manager operations
|
||||
|
||||
@@ -17,6 +17,8 @@ these cases where the source subdir and `~/.config` target differ.
|
||||
| `niri/` | Niri Wayland compositor config |
|
||||
| `fwbook/hypr/` | Hyprland config for `fwbook` (scrolling layout + noctalia); linked to `~/.config/hypr` |
|
||||
| `hl-fwdesk/hypr/` | Hyprland config for `hl-fwdesk` (Steam console); **baked into the build** via `mountAsSource`, linked to `~/.config/hypr` |
|
||||
| `hl-pi1/hypr/` | Hyprland config for `hl-pi1` (clock box); linked to `~/.config/hypr` |
|
||||
| `hl-pi1/quickshell/` | Quickshell configs for `hl-pi1` (full-screen clock + calendar); linked to `~/.config/quickshell` |
|
||||
| `fwbook/quickshell/` | Quickshell configs for `fwbook` (scrolling overview); linked to `~/.config/quickshell` |
|
||||
| `extra.nu` | Extra NuShell config sourced at shell startup |
|
||||
| `fwbook.knsv` | fwbook-specific Kanshi display profile |
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"formatter": {
|
||||
"external": {
|
||||
"command": "stylua",
|
||||
"arguments": ["--config-path", ".config/hypr/stylua.toml", "-"]
|
||||
"arguments": ["-"]
|
||||
}
|
||||
},
|
||||
"format_on_save": "on"
|
||||
|
||||
@@ -52,7 +52,6 @@ hypr/
|
||||
├── hyprland.lua # entry point; require()s conf/*.lua in order
|
||||
├── screen-record.sh # wf-recorder toggle (bound to Mod+R)
|
||||
├── xdph.conf # xdph screencopy workaround (force_shm); hyprlang, read by xdph itself
|
||||
├── stylua.toml # stylua formatter settings for the Lua files
|
||||
├── .luarc.json # lua-language-server config (uses types/ as library)
|
||||
├── dms/ # DMS-auto-generated Hyprland overrides (colors/layout/windowrules);
|
||||
│ # not loaded by default — require() them from hyprland.lua to enable
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
-- =========================
|
||||
-- General / Layout
|
||||
-- =========================
|
||||
-- Native scrolling layout (Hyprland 0.54+) — no plugins needed. This mirrors
|
||||
-- niri's scrollable-tiling model. Gaps/border/corner-radius mirror
|
||||
-- configs/niri/shared/layout.kdl (gaps 5, border 2, corner radius 12).
|
||||
|
||||
hl.config({
|
||||
general = {
|
||||
gaps_in = 5,
|
||||
gaps_out = 5,
|
||||
border_size = 2,
|
||||
gaps_in = 0,
|
||||
gaps_out = 1,
|
||||
border_size = 1,
|
||||
layout = "scrolling",
|
||||
resize_on_border = true,
|
||||
},
|
||||
@@ -20,29 +16,19 @@ hl.config({
|
||||
inactive_opacity = 0.9,
|
||||
},
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/
|
||||
scrolling = {
|
||||
-- Default column width as a fraction of the screen [0.1 - 1.0].
|
||||
column_width = 0.5,
|
||||
-- A lone column fills the screen (matches niri's single-column feel).
|
||||
column_width = 1,
|
||||
fullscreen_on_one_column = true,
|
||||
-- Center the focused column when it comes into view (niri-like).
|
||||
focus_fit_method = 0,
|
||||
follow_focus = true,
|
||||
explicit_column_widths = "0.333, 0.5, 0.667, 1.0",
|
||||
explicit_column_widths = "0.5, 1.0",
|
||||
},
|
||||
|
||||
-- Cursor: use the GTK (gsettings) cursor theme instead of Hyprcursor.
|
||||
-- sync_gsettings_theme makes Hyprland follow org.gnome.desktop.interface
|
||||
-- cursor-theme; enable_hyprcursor = false skips the hyprcursor backend
|
||||
-- entirely (no hyprcursor themes are installed) so the XCursor fallback
|
||||
-- with XCURSOR_THEME from conf/env.lua is used.
|
||||
cursor = {
|
||||
sync_gsettings_theme = true,
|
||||
enable_hyprcursor = false,
|
||||
},
|
||||
|
||||
-- Disable Hyprland's logo wallpaper (niri: hot-corners off has no analog).
|
||||
misc = {
|
||||
disable_hyprland_logo = true,
|
||||
focus_on_activate = true,
|
||||
|
||||
@@ -1,68 +1,19 @@
|
||||
-- =========================
|
||||
-- Input
|
||||
-- =========================
|
||||
-- Mirrors configs/niri/shared/general.kdl (touchpad tap + natural scroll)
|
||||
-- and kb_layout = us. `tap-to-click` is hyphenated in Hyprland, so it uses
|
||||
-- bracket-key notation.
|
||||
|
||||
hl.config({
|
||||
input = {
|
||||
kb_layout = "us",
|
||||
follow_mouse = 1,
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true,
|
||||
-- ["tap-to-click"] = true,
|
||||
disable_while_typing = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Match niri's touchpad axes: 3-finger horizontal scrolls through columns
|
||||
-- (scroll_move drives the scrolling-layout tape), vertical switches workspaces.
|
||||
hl.gesture({ fingers = 3, direction = "horizontal", action = "scroll_move" })
|
||||
hl.gesture({ fingers = 3, direction = "vertical", action = "workspace" })
|
||||
|
||||
-- niri moved a whole workspace to another monitor via Mod + touchpad scroll.
|
||||
-- Hyprland gestures take a `mods` mask, so mirror that with Mod + 3-finger
|
||||
-- swipes. Directions mirror niri's binds (swipe up -> monitor down, etc.);
|
||||
-- flip the monitor letters if the axis feels reversed on your hardware.
|
||||
hl.gesture({
|
||||
fingers = 3,
|
||||
direction = "up",
|
||||
mods = "SUPER",
|
||||
action = function()
|
||||
hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor d")
|
||||
end,
|
||||
})
|
||||
hl.gesture({
|
||||
fingers = 3,
|
||||
direction = "down",
|
||||
mods = "SUPER",
|
||||
action = function()
|
||||
hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor u")
|
||||
end,
|
||||
})
|
||||
hl.gesture({
|
||||
fingers = 3,
|
||||
direction = "left",
|
||||
mods = "SUPER",
|
||||
action = function()
|
||||
hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor r")
|
||||
end,
|
||||
})
|
||||
hl.gesture({
|
||||
fingers = 3,
|
||||
direction = "right",
|
||||
mods = "SUPER",
|
||||
action = function()
|
||||
hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor l")
|
||||
end,
|
||||
})
|
||||
|
||||
-- niri: toggle-overview via 4-finger swipe (mirrors Mod+Tab in keybindings.lua).
|
||||
-- Swipe up opens, swipe down closes; gestures are discrete triggers, no
|
||||
-- swipe-progress animation is possible via hl.gesture.
|
||||
hl.gesture({
|
||||
fingers = 4,
|
||||
direction = "up",
|
||||
|
||||
@@ -31,18 +31,58 @@ hl.bind(mod .. " + SHIFT + Tab", hl.dsp.focus({ monitor = "+1" }))
|
||||
-- hl.dispatch(hl.dsp.resize({x = 1, relative = true}))
|
||||
-- hl.dispatch(hl.dsp.layout("swapcol r"))
|
||||
-- end)
|
||||
hl.bind(mod .. " + CTRL + right", hl.dsp.layout("swapcol r"))
|
||||
hl.bind(mod .. " + CTRL + left", hl.dsp.layout("swapcol l"))
|
||||
-- hl.bind(mod .. " + CTRL + right", hl.dsp.window.move({ direction = "right" }))
|
||||
-- hl.bind(mod .. " + CTRL + left", hl.dsp.window.move({ direction = "left" }))
|
||||
hl.bind(mod .. " + CTRL + up", hl.dsp.window.move({ workspace = "r-1", follow = true }))
|
||||
hl.bind(mod .. " + CTRL + down", hl.dsp.window.move({ workspace = "r+1", follow = true }))
|
||||
-- hl.bind(mod .. " + SHIFT + right", hl.dsp.layout("swapcol r"))
|
||||
-- hl.bind(mod .. " + SHIFT + left", hl.dsp.layout("swapcol l"))
|
||||
hl.bind(
|
||||
mod .. " + SHIFT + right",
|
||||
hl.dsp.window.move({
|
||||
direction = "right",
|
||||
follow = true,
|
||||
group_aware = true,
|
||||
into_or_create_group = true,
|
||||
})
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + SHIFT + left",
|
||||
hl.dsp.window.move({
|
||||
direction = "left",
|
||||
follow = true,
|
||||
group_aware = true,
|
||||
into_or_create_group = true,
|
||||
})
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + SHIFT + up",
|
||||
hl.dsp.window.move({ workspace = "r-1", follow = true, group_aware = true })
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + SHIFT + down",
|
||||
hl.dsp.window.move({ workspace = "r+1", follow = true, group_aware = true })
|
||||
)
|
||||
hl.bind(mod .. " + F", hl.dsp.window.fullscreen({ mode = "maximized", action = "toggle" }))
|
||||
-- hl.bind(mod .. " + F", hl.dsp.layout("colresize +conf"))
|
||||
hl.bind(
|
||||
mod .. " + CTRL + right",
|
||||
hl.dsp.window.move({ direction = "right", into_or_create_group = "right" })
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + CTRL + left",
|
||||
hl.dsp.window.move({ direction = "left", into_or_create_group = "left" })
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + CTRL + up",
|
||||
hl.dsp.window.move({ direction = "up", into_or_create_group = "up" })
|
||||
)
|
||||
hl.bind(
|
||||
mod .. " + CTRL + down",
|
||||
hl.dsp.window.move({ direction = "down", into_or_create_group = "down" })
|
||||
)
|
||||
|
||||
hl.bind(mod .. " + G", hl.dsp.group.toggle())
|
||||
|
||||
hl.bind(mod .. " + SHIFT + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }))
|
||||
hl.bind(mod .. " + CTRL + F", hl.dsp.layout("fit_into_view"))
|
||||
hl.bind(mod .. " + V", hl.dsp.window.float({ action = "toggle" }))
|
||||
hl.bind(mod .. " + C", hl.dsp.layout("focus current"))
|
||||
hl.bind("ALT + TAB", hl.dsp.window.cycle_next())
|
||||
|
||||
-- =========================
|
||||
-- Resizing
|
||||
@@ -95,12 +135,12 @@ hl.bind(
|
||||
hl.bind(mod .. " + ALT + L", hl.dsp.exec_cmd("noctalia msg notification-clear-active"))
|
||||
|
||||
-- Media & brightness
|
||||
hl.bind(mod .. " + SHIFT + up", hl.dsp.exec_cmd("noctalia msg volume-up"))
|
||||
hl.bind(mod .. " + SHIFT + down", hl.dsp.exec_cmd("noctalia msg volume-down"))
|
||||
hl.bind(mod .. " + SHIFT + right", hl.dsp.exec_cmd("playerctl next"))
|
||||
hl.bind(mod .. " + SHIFT + left", hl.dsp.exec_cmd("playerctl previous"))
|
||||
hl.bind(mod .. " + SHIFT + Space", hl.dsp.exec_cmd("playerctl play-pause"))
|
||||
|
||||
hl.bind(mod .. " + M + up", hl.dsp.exec_cmd("noctalia msg volume-up"))
|
||||
hl.bind(mod .. " + M + down", hl.dsp.exec_cmd("noctalia msg volume-down"))
|
||||
hl.bind(mod .. " + M + right", hl.dsp.exec_cmd("playerctl next"))
|
||||
hl.bind(mod .. " + M + left", hl.dsp.exec_cmd("playerctl previous"))
|
||||
hl.bind(mod .. " + M + Space", hl.dsp.exec_cmd("playerctl play-pause"))
|
||||
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"))
|
||||
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("noctalia msg volume-up"), { locked = true })
|
||||
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("noctalia msg volume-down"), { locked = true })
|
||||
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("noctalia msg volume-mute"), { locked = true })
|
||||
|
||||
@@ -5,9 +5,33 @@
|
||||
-- mirroring the niri window-rule. Below: float the small control/dialog
|
||||
-- utilities so they don't tile.
|
||||
|
||||
hl.window_rule({ name = "float-pavucontrol", match = { class = "^(pavucontrol)$" }, float = true })
|
||||
hl.window_rule({ name = "float-blueman", match = { class = "^(blueman-manager)$" }, float = true })
|
||||
hl.window_rule({ name = "float-calculator", match = { class = "^(org.gnome.Calculator)$" }, float = true })
|
||||
hl.window_rule({ name = "float-portal-gtk", match = { class = "^(xdg-desktop-portal-gtk)$" }, float = true })
|
||||
hl.window_rule({ name = "float-open-file", match = { title = "^(Open File)$" }, float = true })
|
||||
hl.window_rule({ name = "float-save-file", match = { title = "^(Save File)$" }, float = true })
|
||||
hl.window_rule({
|
||||
name = "float-pavucontrol",
|
||||
match = { class = "^(pavucontrol)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
name = "float-blueman",
|
||||
match = { class = "^(blueman-manager)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
name = "float-calculator",
|
||||
match = { class = "^(org.gnome.Calculator)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
name = "float-portal-gtk",
|
||||
match = { class = "^(xdg-desktop-portal-gtk)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
name = "float-open-file",
|
||||
match = { title = "^(Open File)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
name = "float-save-file",
|
||||
match = { title = "^(Save File)$" },
|
||||
float = true,
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
column_width = 100
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "Always"
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"workspace.library": ["types"],
|
||||
"diagnostics.globals": ["hl"],
|
||||
"runtime.version": "Lua 5.4"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# hl-pi1/hypr
|
||||
|
||||
Minimal Hyprland config for `hl-pi1` (a small clock/calendar display box). It
|
||||
boots straight into Hyprland (`services.displayManager.autoLogin`) and
|
||||
auto-launches a single Quickshell shell (`configs/hl-pi1/quickshell/clock/`)
|
||||
that fills the screen with a big digital clock and a calendar — there is no
|
||||
noctalia shell, no Steam, and no desktop compositor panel.
|
||||
|
||||
Symlinked to `~/.config/hypr` by the `skyg.nixos.desktop.tiler.hyprland` module
|
||||
(`configName` defaults to the machine hostName).
|
||||
|
||||
## Files
|
||||
|
||||
| Path | Description |
|
||||
|---|---|
|
||||
| `hyprland.lua` | Entry point; `require`s the `conf/*.lua` files |
|
||||
| `conf/env.lua` | Wayland/Qt env vars |
|
||||
| `conf/general.lua` | Basic general/decoration settings |
|
||||
| `conf/monitors.lua` | Single (fallback) monitor config |
|
||||
| `conf/inputs.lua` | Keyboard layout |
|
||||
| `conf/window-rules.lua` | Float rules for utility dialogs |
|
||||
| `conf/keybindings.lua` | Minimal binds: `Super+Return` (foot), `Ctrl+Alt+Delete` (`uwsm stop`) |
|
||||
| `conf/autostart.lua` | Auto-launches the Quickshell clock (`qs -c clock`) on start |
|
||||
| `types/hl.lua` | Lua-language-server type stubs for the `hl` global |
|
||||
@@ -0,0 +1,9 @@
|
||||
-- =========================
|
||||
-- Autostart
|
||||
-- =========================
|
||||
-- Launch the Quickshell clock as the whole desktop. `setpriv --ambient-caps
|
||||
-- -all` drops capabilities inherited from the compositor; without it, D-Bus
|
||||
-- calls inside quickshell-based apps fail silently.
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- qs -c clock")
|
||||
end)
|
||||
@@ -0,0 +1,7 @@
|
||||
-- =========================
|
||||
-- Environment
|
||||
-- =========================
|
||||
hl.env("XCURSOR_SIZE", "24")
|
||||
hl.env("XCURSOR_THEME", "Adwaita")
|
||||
hl.env("QT_QPA_PLATFORM", "wayland")
|
||||
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
|
||||
@@ -0,0 +1,25 @@
|
||||
-- =========================
|
||||
-- General
|
||||
-- =========================
|
||||
hl.config({
|
||||
general = {
|
||||
gaps_in = 2,
|
||||
gaps_out = 2,
|
||||
border_size = 1,
|
||||
layout = "dwindle",
|
||||
},
|
||||
|
||||
decoration = {
|
||||
rounding = 4,
|
||||
active_opacity = 1.0,
|
||||
inactive_opacity = 1.0,
|
||||
},
|
||||
|
||||
cursor = {
|
||||
enable_hyprcursor = false,
|
||||
},
|
||||
|
||||
misc = {
|
||||
disable_hyprland_logo = true,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
-- =========================
|
||||
-- Input
|
||||
-- =========================
|
||||
hl.config({
|
||||
input = {
|
||||
kb_layout = "us",
|
||||
follow_mouse = 1,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
-- =========================
|
||||
-- Keybindings
|
||||
-- =========================
|
||||
-- Minimal: a terminal escape hatch and a way to shut the session down.
|
||||
local mod = "SUPER"
|
||||
|
||||
hl.bind(mod .. " + T", hl.dsp.exec_cmd("foot"))
|
||||
hl.bind("CTRL + ALT + Delete", hl.dsp.exec_cmd("uwsm stop"))
|
||||
@@ -0,0 +1,11 @@
|
||||
-- =========================
|
||||
-- Monitors
|
||||
-- =========================
|
||||
-- hl-pi1 is a headless-ish clock box. Fallback catches whatever display is
|
||||
-- attached (HDMI/DSI), preferred mode, auto position/scale.
|
||||
hl.monitor({
|
||||
output = "",
|
||||
mode = "preferred",
|
||||
position = "auto",
|
||||
scale = "auto",
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
-- =========================
|
||||
-- Window Rules
|
||||
-- =========================
|
||||
-- Float utility dialogs so they don't tile over the clock.
|
||||
hl.window_rule({ name = "float-pavucontrol", match = { class = "^(pavucontrol)$" }, float = true })
|
||||
hl.window_rule({ name = "float-open-file", match = { title = "^(Open File)$" }, float = true })
|
||||
hl.window_rule({ name = "float-save-file", match = { title = "^(Save File)$" }, float = true })
|
||||
@@ -0,0 +1,13 @@
|
||||
-- =========================
|
||||
-- Hyprland (hl-pi1)
|
||||
-- =========================
|
||||
-- Small desktop clock box: a single Quickshell shell (configs/hl-pi1/quickshell/clock)
|
||||
-- is auto-logged-in and fills the screen with a big clock + calendar.
|
||||
|
||||
require("conf/env")
|
||||
require("conf/general")
|
||||
require("conf/monitors")
|
||||
require("conf/inputs")
|
||||
require("conf/window-rules")
|
||||
require("conf/keybindings")
|
||||
require("conf/autostart")
|
||||
@@ -0,0 +1,181 @@
|
||||
-- =============================================================================
|
||||
-- Hyprland Lua API — EmmyLua type stubs (hl-fwdesk copy)
|
||||
-- =============================================================================
|
||||
-- This file is never executed by Hyprland. It exists solely to give
|
||||
-- lua-language-server type information for the `hl` global that Hyprland
|
||||
-- injects at runtime (0.55+).
|
||||
--
|
||||
-- Coverage is based on the API surface used in conf/*.lua. Extend as needed
|
||||
-- when new hl.* calls are added.
|
||||
-- =============================================================================
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Shared primitive types
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---@class hl.ConfigTable
|
||||
---@class hl.DispatcherValue
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.dsp — dispatcher factories
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---@class hl.dsp.FocusOpts
|
||||
---@field direction? "left"|"right"|"up"|"down"
|
||||
---@field workspace? string|integer
|
||||
---@field monitor? string
|
||||
---@field on_current_monitor? boolean
|
||||
|
||||
---@class hl.dsp.MoveOpts
|
||||
---@field direction? "left"|"right"|"up"|"down"
|
||||
---@field workspace? string
|
||||
---@field monitor? "l"|"r"|"u"|"d"|string
|
||||
---@field follow? boolean
|
||||
|
||||
---@class hl.dsp.FullscreenOpts
|
||||
---@field mode? "fullscreen"|"maximize"|"float"
|
||||
---@field action? "toggle"|"on"|"off"
|
||||
|
||||
---@class hl.dsp.FloatOpts
|
||||
---@field action? "toggle"|"on"|"off"
|
||||
|
||||
---@class hl.dsp
|
||||
local dsp = {}
|
||||
|
||||
---Execute a shell command.
|
||||
---@param cmd string
|
||||
---@return hl.DispatcherValue
|
||||
function dsp.exec_cmd(cmd) end
|
||||
|
||||
---Invoke a named scrolling-layout dispatcher.
|
||||
---@param action string
|
||||
---@return hl.DispatcherValue
|
||||
function dsp.layout(action) end
|
||||
|
||||
---Focus a window or workspace.
|
||||
---@param opts hl.dsp.FocusOpts
|
||||
---@return hl.DispatcherValue
|
||||
function dsp.focus(opts) end
|
||||
|
||||
---@class hl.dsp.window
|
||||
local dsp_window = {}
|
||||
|
||||
---Close the focused window.
|
||||
---@return hl.DispatcherValue
|
||||
function dsp_window.close() end
|
||||
|
||||
---Toggle/set fullscreen on the focused window.
|
||||
---@param opts? hl.dsp.FullscreenOpts
|
||||
---@return hl.DispatcherValue
|
||||
function dsp_window.fullscreen(opts) end
|
||||
|
||||
---Toggle/set floating on the focused window.
|
||||
---@param opts? hl.dsp.FloatOpts
|
||||
---@return hl.DispatcherValue
|
||||
function dsp_window.float(opts) end
|
||||
|
||||
---Begin an interactive mouse drag (move) on the focused window.
|
||||
---@return hl.DispatcherValue
|
||||
function dsp_window.drag() end
|
||||
|
||||
---Resize the focused window by a pixel delta.
|
||||
---@param opts? hl.dsp.ResizeOpts
|
||||
---@return hl.DispatcherValue
|
||||
function dsp_window.resize(opts) end
|
||||
|
||||
dsp.window = dsp_window
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.bind
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---@class hl.BindOpts
|
||||
---@field mouse? boolean
|
||||
---@field locked? boolean
|
||||
---@field repeating? boolean
|
||||
|
||||
---@param keys string
|
||||
---@param action hl.DispatcherValue | fun()
|
||||
---@param opts? hl.BindOpts
|
||||
function hl.bind(keys, action, opts) end
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.config / hl.env / hl.monitor
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---Apply a hyprlang config table.
|
||||
---@param cfg hl.ConfigTable
|
||||
function hl.config(cfg) end
|
||||
|
||||
---Set a Wayland/compositor environment variable.
|
||||
---@param name string
|
||||
---@param value string
|
||||
function hl.env(name, value) end
|
||||
|
||||
---@class hl.MonitorOpts
|
||||
---@field output string
|
||||
---@field mode string
|
||||
---@field position string
|
||||
---@field scale number|string
|
||||
---@field transform? number
|
||||
|
||||
---Configure a monitor/output.
|
||||
---@param opts hl.MonitorOpts
|
||||
function hl.monitor(opts) end
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.animation
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---@class hl.AnimationOpts
|
||||
---@field leaf string
|
||||
---@field enabled boolean
|
||||
---@field speed number
|
||||
---@field bezier? string
|
||||
---@field spring? string
|
||||
---@field style? string
|
||||
|
||||
---Configure an animation leaf.
|
||||
---@param opts hl.AnimationOpts
|
||||
function hl.animation(opts) end
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.window_rule
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---@class hl.WindowRuleMatchOpts
|
||||
---@field class? string
|
||||
---@field title? string
|
||||
---@field float? boolean
|
||||
---@field fullscreen? boolean
|
||||
---@field pin? boolean
|
||||
---@field xwayland? boolean
|
||||
---@field workspace? string
|
||||
|
||||
---@class hl.WindowRuleOpts
|
||||
---@field name string
|
||||
---@field match hl.WindowRuleMatchOpts
|
||||
---@field float? boolean
|
||||
---@field tile? boolean
|
||||
---@field pin? boolean
|
||||
---@field opacity? number
|
||||
---@field border_size? number
|
||||
---@field rounding? number
|
||||
---@field move? string
|
||||
|
||||
---Add a window rule.
|
||||
---@param opts hl.WindowRuleOpts
|
||||
function hl.window_rule(opts) end
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- hl.on / hl.exec_cmd
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
---Register a callback for a Hyprland event.
|
||||
---@param event string
|
||||
---@param callback fun()
|
||||
function hl.on(event, callback) end
|
||||
|
||||
---Execute a shell command immediately (not as a dispatcher).
|
||||
---@param cmd string
|
||||
function hl.exec_cmd(cmd) end
|
||||
@@ -0,0 +1,42 @@
|
||||
# configs/hl-pi1/quickshell/clock/
|
||||
|
||||
Standalone Quickshell config for `hl-pi1` — the entire desktop. It is symlinked
|
||||
to `~/.config/quickshell/clock` by the `skyg.nixos.desktop.tiler.quickshell`
|
||||
module and launched with `qs -c clock` from the Hyprland autostart
|
||||
(`configs/hl-pi1/hypr/conf/autostart.lua`). Because `hl-pi1` auto-logs into
|
||||
Hyprland, this clock is what fills the screen on boot.
|
||||
|
||||
## What it shows
|
||||
|
||||
A single full-screen `PanelWindow` on the **Background** layer (so it sits
|
||||
behind any tiled windows and effectively *is* the desktop background):
|
||||
|
||||
- **Left:** a big digital `HH:mm:ss` clock (thin monospace), with the long date
|
||||
(`Month D, YYYY`) beneath it.
|
||||
- **Right:** a simple current-month calendar — a weekday header row (Sun-first)
|
||||
and a 7-column day grid, with today outlined in the accent color.
|
||||
- **Background:** solid black.
|
||||
|
||||
## Files
|
||||
|
||||
| Path | Description |
|
||||
|---|---|
|
||||
| `shell.qml` | `ShellRoot` that instantiates the `ClockPanel` |
|
||||
| `ClockPanel.qml` | The full-screen window: clock (left) + calendar (right), plus the timers that tick the clock and roll the calendar over at midnight |
|
||||
| `CalendarCell.qml` | One day cell in the calendar grid (blank spacer for leading days, today outlined) |
|
||||
| `Theme.qml` | Colors, fonts, and calendar sizing |
|
||||
|
||||
## Notes
|
||||
|
||||
- The clock ticks once a second, re-synced to the second boundary.
|
||||
- A minute timer checks whether the day/month has rolled over and refreshes the
|
||||
date string, month header, and day grid (so "today" stays correct across
|
||||
midnight and month boundaries). The `refreshCount` bump forces the day-grid
|
||||
`Repeater` model to re-evaluate.
|
||||
- Same-directory `.qml` files are visible as types automatically (no `qmldir`).
|
||||
|
||||
## Testing without a rebuild
|
||||
|
||||
```
|
||||
qs -p ~/nixos-setup/configs/hl-pi1/quickshell/clock
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
import QtQuick
|
||||
|
||||
// One cell in the clock calendar grid. Empty label = blank spacer (leading
|
||||
// padding days); today is outlined in the accent color.
|
||||
Item {
|
||||
id: cell
|
||||
|
||||
property string label: ""
|
||||
property bool isToday: false
|
||||
property real cellSize: 44
|
||||
property color accent: "#ffffff"
|
||||
property string fontFamily: "DejaVu Sans Mono"
|
||||
property real fontSize: 20
|
||||
|
||||
width: cell.cellSize
|
||||
height: cell.cellSize
|
||||
|
||||
// Today gets a subtle accent border.
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: cell.cellSize - 4
|
||||
height: cell.cellSize - 4
|
||||
radius: 8
|
||||
color: cell.isToday ? "#1fffffff" : "transparent"
|
||||
border.width: cell.isToday ? 2 : 0
|
||||
border.color: cell.accent
|
||||
visible: cell.label !== ""
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
color: cell.isToday ? cell.accent : "#99ffffff"
|
||||
font.family: cell.fontFamily
|
||||
font.pixelSize: cell.fontSize
|
||||
text: cell.label
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
// Full-screen Background-layer window — the entire desktop for hl-pi1.
|
||||
// Big digital clock on the left, simple current-month calendar on the right.
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
color: theme.background
|
||||
visible: true
|
||||
|
||||
WlrLayershell.namespace: "quickshell:clock"
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
property Theme theme: Theme {}
|
||||
|
||||
// Monotonic bump used to force the calendar Repeater's model to be
|
||||
// re-evaluated (the model is a function of this value and today's date).
|
||||
property int refreshCount: 0
|
||||
property string lastDay: ""
|
||||
|
||||
// ------------------------------------------------ Clock (left) ---------
|
||||
Item {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: parent.width * 0.12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Text {
|
||||
id: timeText
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
color: theme.accent
|
||||
font.family: theme.fontFamily
|
||||
font.pixelSize: theme.clockFontSize
|
||||
font.weight: Font.Thin
|
||||
text: root.hhmmss()
|
||||
}
|
||||
|
||||
Text {
|
||||
id: dateText
|
||||
anchors.left: parent.left
|
||||
anchors.top: timeText.bottom
|
||||
anchors.topMargin: 24
|
||||
color: "#b3ffffff"
|
||||
font.family: theme.fontFamily
|
||||
font.pixelSize: theme.dateFontSize
|
||||
text: root.longDate()
|
||||
}
|
||||
}
|
||||
|
||||
// Tick the clock every second, re-synced to the second boundary.
|
||||
Timer {
|
||||
id: clockTimer
|
||||
interval: 1000 - (new Date().getTime() % 1000)
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
timeText.text = root.hhmmss();
|
||||
clockTimer.interval = 1000 - (new Date().getTime() % 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// Every minute, if the day (or month) has rolled over, refresh the date
|
||||
// string, the month header, and the day grid (so "today" stays correct).
|
||||
Timer {
|
||||
id: dayTimer
|
||||
interval: 60 * 1000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
if (root.todayKey() !== root.lastDay) {
|
||||
root.lastDay = root.todayKey();
|
||||
root.refreshDateAndCalendar();
|
||||
}
|
||||
}
|
||||
Component.onCompleted: root.lastDay = root.todayKey()
|
||||
}
|
||||
|
||||
// ------------------------------------------------ calendar (right) -----
|
||||
Item {
|
||||
id: calendarView
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: parent.width * 0.10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
// Month + year header.
|
||||
Text {
|
||||
id: monthHeader
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
color: theme.accent
|
||||
font.family: theme.fontFamily
|
||||
font.pixelSize: theme.headerFontSize
|
||||
text: root.calTitle()
|
||||
}
|
||||
|
||||
// Weekday header row (Sunday-first), one cell below the title.
|
||||
Repeater {
|
||||
model: root.weekdayModel()
|
||||
Text {
|
||||
required property var modelData
|
||||
required property int index
|
||||
x: index * (theme.cellSize + theme.cellSpacing)
|
||||
y: monthHeader.height + 18
|
||||
width: theme.cellSize
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
color: "#80ffffff"
|
||||
font.family: theme.fontFamily
|
||||
font.pixelSize: theme.calendarFontSize
|
||||
text: modelData
|
||||
}
|
||||
}
|
||||
|
||||
// 7-column day grid, Sunday-first, today highlighted.
|
||||
Repeater {
|
||||
model: root.buildCells(root.refreshCount)
|
||||
CalendarCell {
|
||||
required property var modelData
|
||||
required property int index
|
||||
x: (index % 7) * (theme.cellSize + theme.cellSpacing)
|
||||
y: monthHeader.height + 18 + (theme.cellSize + theme.cellSpacing) + Math.floor(index / 7) * (theme.cellSize + theme.cellSpacing)
|
||||
label: modelData.label
|
||||
isToday: modelData.isToday
|
||||
cellSize: theme.cellSize
|
||||
accent: theme.accent
|
||||
fontFamily: theme.fontFamily
|
||||
fontSize: theme.calendarFontSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- helpers ----------------------------------------------------------
|
||||
function todayKey(): string {
|
||||
const d = new Date();
|
||||
return d.getFullYear() + "-" + d.getMonth() + "-" + d.getDate();
|
||||
}
|
||||
|
||||
function hhmmss(): string {
|
||||
const d = new Date();
|
||||
const hh = String(d.getHours()).padStart(2, "0");
|
||||
const mm = String(d.getMinutes()).padStart(2, "0");
|
||||
const ss = String(d.getSeconds()).padStart(2, "0");
|
||||
return hh + ":" + mm + ":" + ss;
|
||||
}
|
||||
|
||||
function longDate(): string {
|
||||
const d = new Date();
|
||||
return theme.monthNames[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
|
||||
}
|
||||
|
||||
function calTitle(): string {
|
||||
const d = new Date();
|
||||
return theme.monthNames[d.getMonth()] + " " + d.getFullYear();
|
||||
}
|
||||
|
||||
function weekdayModel(): var {
|
||||
return theme.weekdayNames;
|
||||
}
|
||||
|
||||
function buildCells(_bump): var {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
const today = now.getDate();
|
||||
|
||||
const cells = [];
|
||||
const firstDow = new Date(year, month, 1).getDay();
|
||||
for (let i = 0; i < firstDow; i++) cells.push({ label: "", isToday: false });
|
||||
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
||||
for (let day = 1; day <= daysInMonth; day++) {
|
||||
cells.push({ label: String(day), isToday: day === today });
|
||||
}
|
||||
return cells;
|
||||
}
|
||||
|
||||
function refreshDateAndCalendar() {
|
||||
root.refreshCount++;
|
||||
dateText.text = root.longDate();
|
||||
monthHeader.text = root.calTitle();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
// Whole screen is black — the clock panel is the desktop.
|
||||
readonly property color background: "#000000"
|
||||
readonly property color accent: "#ffffff"
|
||||
|
||||
readonly property string fontFamily: "DejaVu Sans Mono"
|
||||
readonly property real clockFontSize: 96
|
||||
readonly property real dateFontSize: 28
|
||||
readonly property real calendarFontSize: 20
|
||||
readonly property real headerFontSize: 24
|
||||
readonly property real cellSize: 44
|
||||
readonly property real cellSpacing: 6
|
||||
|
||||
// Calendar grid: Sunday-first, common for a simple wall calendar.
|
||||
readonly property var weekdayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
|
||||
readonly property var monthNames: [
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import Quickshell
|
||||
|
||||
// Standalone clock shell for hl-pi1: a single full-screen overlay window
|
||||
// showing a big digital clock (left) and a simple calendar (right) on a black
|
||||
// background. Run with `qs -c clock`; autostarted from Hyprland and autologin
|
||||
// into Hyprland means it's the entire desktop.
|
||||
ShellRoot {
|
||||
ClockPanel {}
|
||||
}
|
||||
@@ -148,13 +148,13 @@
|
||||
default = pkgs.mkShell {
|
||||
name = "nixos-setup";
|
||||
packages = with pkgs; [
|
||||
kdePackages.qtdeclarative
|
||||
nixpkgs-fmt
|
||||
stylua
|
||||
nixd
|
||||
nh
|
||||
agenix.packages.${system}.default
|
||||
age
|
||||
# yq-go — YAML linting used by `skyg encrypt --yaml`
|
||||
yq
|
||||
home-manager.packages.${system}.home-manager
|
||||
rustc
|
||||
|
||||
+16
-2
@@ -1,4 +1,4 @@
|
||||
{ lib, pkgs, determinate, ... }:
|
||||
{ lib, pkgs, config, determinate, ... }:
|
||||
{
|
||||
skyg = {
|
||||
user.enable = true;
|
||||
@@ -13,7 +13,7 @@
|
||||
tiler = {
|
||||
enable = true;
|
||||
hyprland.enable = true;
|
||||
noctalia.enable = true;
|
||||
noctalia.enable = false;
|
||||
quickshell.enable = true;
|
||||
};
|
||||
};
|
||||
@@ -40,4 +40,18 @@
|
||||
|
||||
# SD image has no swap partition; use compressed RAM swap instead.
|
||||
zramSwap.enable = true;
|
||||
|
||||
programs.dank-material-shell.greeter = {
|
||||
enable = true;
|
||||
compositor.name = "hyprland";
|
||||
configHome = "/home/${config.skyg.user.name}";
|
||||
};
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = config.skyg.user.name;
|
||||
};
|
||||
services.displayManager.defaultSession = "hyprland";
|
||||
environment.systemPackages = with pkgs; [
|
||||
foot
|
||||
];
|
||||
}
|
||||
Binary file not shown.
@@ -4,3 +4,4 @@ indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "Always"
|
||||
collapse_simple_statement = "Never"
|
||||
Reference in new issue
Block a user