Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

nugu/justfile

Raw
set shell := [ "nu", "--commands" ]

default:
	@just --list

lint:
	taplo lint
	open nugu.nu | nu-check --as-module --debug nugu.nu
	open site.nu | nu-check --as-module --debug site.nu
	open helix.nu | nu-check --as-module --debug helix.nu
	open wezterm.nu | nu-check --as-module --debug wezterm.nu
	open ghostty.nu | nu-check --as-module --debug ghostty.nu
	open zed.nu | nu-check --as-module --debug zed.nu
	open linux_console.nu | nu-check --as-module --debug linux_console.nu
	open hypr.nu | nu-check --as-module --debug hypr.nu
	open aerc.nu | nu-check --as-module --debug aerc.nu
	open neovim.nu | nu-check --as-module --debug neovim.nu
	open niri.nu | nu-check --as-module --debug niri.nu
	open termux.nu | nu-check --as-module --debug termux.nu
	open mermaid.nu | nu-check --as-module --debug mermaid.nu

fmt: lint
	taplo fmt

check: fmt
	use nugu.nu; nugu check

output := 'output'

show THEME:
	use nugu.nu; nugu print-colors (nugu {{THEME}})

build: fmt
	rm --force --recursive {{output}}
	mkdir {{output}}
	use nugu.nu; nugu dark  | to toml | save --raw {{output}}/dark.toml
	use nugu.nu; nugu light | to toml | save --raw {{output}}/light.toml

html: build
	use site.nu; site html light | save --raw {{output}}/site-light.html
	use site.nu; site html dark  | save --raw {{output}}/site-dark.html

open: html
	start {{output}}/site-dark.html
	start {{output}}/site-light.html

helix: build
	rm --force --recursive {{output}}/helix
	mkdir {{output}}/helix
	use helix.nu; helix theme dark  | save --raw {{output}}/helix/nugu-dark.toml
	use helix.nu; helix theme light | save --raw {{output}}/helix/nugu-light.toml
	mkdir ../helix/themes
	cp {{output}}/helix/nugu-dark.toml ../helix/themes/nugu-dark.toml
	cp {{output}}/helix/nugu-light.toml ../helix/themes/nugu-light.toml

wezterm: build
	rm --force --recursive {{output}}/wezterm
	mkdir {{output}}/wezterm
	use wezterm.nu; wezterm theme dark | save --raw {{output}}/wezterm/palette_dark.lua
	use wezterm.nu; wezterm theme light | save --raw {{output}}/wezterm/palette_light.lua
	mkdir ../wezterm/bugabinga/nugu
	cp {{output}}/wezterm/palette_dark.lua ../wezterm/bugabinga/nugu/palette_dark.lua
	cp {{output}}/wezterm/palette_light.lua ../wezterm/bugabinga/nugu/palette_light.lua

nvim: build
	use neovim.nu; neovim theme | save --force --raw ../neovim/lua/bugabinga/nugu/palette.lua

ghostty: build
	rm --force --recursive {{output}}/ghostty
	mkdir {{output}}/ghostty
	use ghostty.nu; ghostty theme dark | save --raw {{output}}/ghostty/nugu-dark
	use ghostty.nu; ghostty theme light | save --raw {{output}}/ghostty/nugu-light
	mkdir ../ghostty/themes
	cp {{output}}/ghostty/nugu-dark ../ghostty/themes/nugu-dark
	cp {{output}}/ghostty/nugu-light ../ghostty/themes/nugu-light

zed: build
	rm --force --recursive {{output}}/zed
	mkdir {{output}}/zed
	use zed.nu; zed file | save --raw {{output}}/zed/nugu.json
	mkdir ../zed/themes
	cp {{output}}/zed/nugu.json ../zed/themes/nugu.json

# Generate both modes without changing Termux's active colors.properties.
termux:
	mkdir {{output}}/termux
	use termux.nu; termux theme dark | save --force --raw {{output}}/termux/nugu-dark.properties
	use termux.nu; termux theme light | save --force --raw {{output}}/termux/nugu-light.properties
	mkdir ../termux/themes
	cp {{output}}/termux/nugu-dark.properties ../termux/themes/nugu-dark.properties
	cp {{output}}/termux/nugu-light.properties ../termux/themes/nugu-light.properties

# Generate and install both modes; Niri's config selects one via include.
niri:
	mkdir {{output}}/niri
	use niri.nu; niri theme dark | save --force --raw {{output}}/niri/nugu-dark.kdl
	use niri.nu; niri theme light | save --force --raw {{output}}/niri/nugu-light.kdl
	mkdir ../niri/themes
	cp {{output}}/niri/nugu-dark.kdl ../niri/themes/nugu-dark.kdl.tmp; mv --force ../niri/themes/nugu-dark.kdl.tmp ../niri/themes/nugu-dark.kdl
	cp {{output}}/niri/nugu-light.kdl ../niri/themes/nugu-light.kdl.tmp; mv --force ../niri/themes/nugu-light.kdl.tmp ../niri/themes/nugu-light.kdl

hypr: build
	rm --force --recursive {{output}}/hypr
	mkdir {{output}}/hypr
	use hypr.nu; hypr json | save --raw {{output}}/hypr/nugu.json
	use hypr.nu; hypr lua | save --raw {{output}}/hypr/nugu.lua
	mkdir ../hypr/generated
	cp {{output}}/hypr/nugu.json ../hypr/generated/nugu.json
	cp {{output}}/hypr/nugu.lua ../hypr/generated/nugu.lua

linux-console: build
	rm --force --recursive {{output}}/linux-console
	mkdir {{output}}/linux-console
	mkdir ../bash/linux-console
	use linux_console.nu; linux_console theme dark | save --raw --force {{output}}/linux-console/nugu-dark.sh
	use linux_console.nu; linux_console theme light | save --raw --force {{output}}/linux-console/nugu-light.sh
	cp {{output}}/linux-console/nugu-dark.sh ../bash/linux-console/nugu-dark.sh
	cp {{output}}/linux-console/nugu-light.sh ../bash/linux-console/nugu-light.sh

yazi: build
	rm --force --recursive {{output}}/yazi
	mkdir {{output}}/yazi
	mkdir {{output}}/yazi/nugu-dark.yazi
	mkdir {{output}}/yazi/nugu-light.yazi
	use yazi.nu; yazi flavor dark | save --raw {{output}}/yazi/nugu-dark.yazi/flavor.toml
	use yazi.nu; yazi flavor light | save --raw {{output}}/yazi/nugu-light.yazi/flavor.toml
	mkdir ../yazi/flavors
	mkdir ../yazi/flavors/nugu-dark.yazi
	mkdir ../yazi/flavors/nugu-light.yazi
	cp {{output}}/yazi/nugu-dark.yazi/flavor.toml ../yazi/flavors/nugu-dark.yazi/flavor.toml
	cp {{output}}/yazi/nugu-light.yazi/flavor.toml ../yazi/flavors/nugu-light.yazi/flavor.toml

mermaid: build
	rm --force --recursive {{output}}/mermaid
	mkdir {{output}}/mermaid
	use mermaid.nu; mermaid palette | save --force --raw {{output}}/mermaid/palette.json
	mkdir ../pi/agent/skills/mermaid/references
	cp {{output}}/mermaid/palette.json ../pi/agent/skills/mermaid/references/palette.json

aerc: build
	rm --force --recursive {{output}}/aerc
	mkdir {{output}}/aerc
	use aerc.nu; aerc theme dark | save --raw {{output}}/aerc/nugu-dark
	use aerc.nu; aerc theme light | save --raw {{output}}/aerc/nugu-light
	mkdir ../aerc/stylesets
	cp {{output}}/aerc/nugu-dark ../aerc/stylesets/nugu-dark
	cp {{output}}/aerc/nugu-light ../aerc/stylesets/nugu-light

install: helix wezterm ghostty zed linux-console hypr aerc yazi mermaid nvim niri termux