Add wl-backdrop (WIP) --bg-color option
This commit is contained in:
parent
38a96b79b3
commit
a7fe813f17
5 changed files with 61 additions and 3 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
muvm,
|
muvm,
|
||||||
sidebus-broker,
|
sidebus-broker,
|
||||||
wl-cross-domain-proxy,
|
wl-cross-domain-proxy,
|
||||||
|
wl-backdrop,
|
||||||
pkgs,
|
pkgs,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
@ -34,6 +35,7 @@ mkShell {
|
||||||
bubblewrap
|
bubblewrap
|
||||||
sidebus-broker
|
sidebus-broker
|
||||||
wl-cross-domain-proxy
|
wl-cross-domain-proxy
|
||||||
|
wl-backdrop
|
||||||
]
|
]
|
||||||
++ (with pkgs; [
|
++ (with pkgs; [
|
||||||
meson
|
meson
|
||||||
|
|
|
||||||
28
flake.lock
generated
28
flake.lock
generated
|
|
@ -76,7 +76,8 @@
|
||||||
"libkrun-src": "libkrun-src",
|
"libkrun-src": "libkrun-src",
|
||||||
"muvm-src": "muvm-src",
|
"muvm-src": "muvm-src",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"sidebus": "sidebus"
|
"sidebus": "sidebus",
|
||||||
|
"wl-backdrop": "wl-backdrop"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidebus": {
|
"sidebus": {
|
||||||
|
|
@ -103,6 +104,31 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.clan.lol/clan/sidebus"
|
"url": "https://git.clan.lol/clan/sidebus"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"wl-backdrop": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772781884,
|
||||||
|
"narHash": "sha256-epVLmAHnJi4EoZea5DUmxB3r6SPSMu3Nzki7JzbK0sA=",
|
||||||
|
"ref": "main",
|
||||||
|
"rev": "20e3910ef60aa627933a5d750b60cc3dcd0653cf",
|
||||||
|
"shallow": true,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.clan.lol/valpackett/wl-backdrop"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
|
"shallow": true,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.clan.lol/valpackett/wl-backdrop"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@
|
||||||
sidebus.inputs.nixpkgs.follows = "nixpkgs";
|
sidebus.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
sidebus.inputs.flake-parts.follows = "flake-parts";
|
sidebus.inputs.flake-parts.follows = "flake-parts";
|
||||||
|
|
||||||
|
wl-backdrop.url = "git+https://git.clan.lol/valpackett/wl-backdrop?shallow=1&ref=main";
|
||||||
|
wl-backdrop.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
wl-backdrop.inputs.flake-parts.follows = "flake-parts";
|
||||||
|
|
||||||
# To override with local checkouts during development, use the --override-input CLI flag!
|
# To override with local checkouts during development, use the --override-input CLI flag!
|
||||||
muvm-src = {
|
muvm-src = {
|
||||||
url = "github:valpackett/muvm/c68742bcedb96deb6f23ed5a83188022d1cdf71d"; # v0.5.0+custom-init+dbus
|
url = "github:valpackett/muvm/c68742bcedb96deb6f23ed5a83188022d1cdf71d"; # v0.5.0+custom-init+dbus
|
||||||
|
|
@ -35,6 +39,7 @@
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
sidebus,
|
sidebus,
|
||||||
|
wl-backdrop,
|
||||||
muvm-src,
|
muvm-src,
|
||||||
libkrun-src,
|
libkrun-src,
|
||||||
# libkrunfw-src,
|
# libkrunfw-src,
|
||||||
|
|
@ -122,6 +127,7 @@
|
||||||
mesa = self'.packages.mesa;
|
mesa = self'.packages.mesa;
|
||||||
muvm = self'.packages.muvm;
|
muvm = self'.packages.muvm;
|
||||||
wl-cross-domain-proxy = self'.packages.wl-cross-domain-proxy;
|
wl-cross-domain-proxy = self'.packages.wl-cross-domain-proxy;
|
||||||
|
wl-backdrop = wl-backdrop.packages.${system}.wl-backdrop;
|
||||||
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -132,6 +138,7 @@
|
||||||
libkrun = self'.packages.libkrun;
|
libkrun = self'.packages.libkrun;
|
||||||
muvm = self'.packages.muvm;
|
muvm = self'.packages.muvm;
|
||||||
wl-cross-domain-proxy = self'.packages.wl-cross-domain-proxy;
|
wl-cross-domain-proxy = self'.packages.wl-cross-domain-proxy;
|
||||||
|
wl-backdrop = wl-backdrop.packages.${system}.wl-backdrop;
|
||||||
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
23
munix
23
munix
|
|
@ -3,6 +3,7 @@ SCRIPT_PATH=$(dirname $(realpath -s $0))
|
||||||
MUVM_PATH=$(dirname $(which muvm))
|
MUVM_PATH=$(dirname $(which muvm))
|
||||||
PASST_PATH=$(dirname $(which passt))
|
PASST_PATH=$(dirname $(which passt))
|
||||||
WL_PROXY_PATH=$(dirname $(which wl-cross-domain-proxy))
|
WL_PROXY_PATH=$(dirname $(which wl-cross-domain-proxy))
|
||||||
|
WL_BACKDROP_PATH=$(dirname $(which wl-backdrop))
|
||||||
HOST_OPENGL_DRIVER=/run/opengl-driver
|
HOST_OPENGL_DRIVER=/run/opengl-driver
|
||||||
: "${MICROVM_DEFAULT_COMMAND:=bash}"
|
: "${MICROVM_DEFAULT_COMMAND:=bash}"
|
||||||
: "${MUNIX_SYSTEMD_UNITS:="${SCRIPT_PATH}/systemd"}"
|
: "${MUNIX_SYSTEMD_UNITS:="${SCRIPT_PATH}/systemd"}"
|
||||||
|
|
@ -25,6 +26,22 @@ if [ ! -e "$HOST_OPENGL_DRIVER" ]; then
|
||||||
HOST_OPENGL_DRIVER="$FALLBACK_OPENGL_DRIVER"
|
HOST_OPENGL_DRIVER="$FALLBACK_OPENGL_DRIVER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# A little bit cursed: pre-pass to relaunch with new env var..
|
||||||
|
BG_COLOR=
|
||||||
|
pargs=()
|
||||||
|
while [ "$#" -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--bg-color) BG_COLOR="$2"; shift 2;;
|
||||||
|
--wl-backdrop-bin-dir) WL_BACKDROP_PATH="$2"; shift 2;;
|
||||||
|
*) pargs+=("$1"); shift;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if [ "$BG_COLOR" = "" ]; then
|
||||||
|
set -- "${pargs[@]}"
|
||||||
|
else
|
||||||
|
exec "$WL_BACKDROP_PATH/wl-backdrop" --background "$BG_COLOR" -- "$(readlink -f "$0")" "${pargs[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-u|--uid) MICROVM_UID="$2"; shift 2;;
|
-u|--uid) MICROVM_UID="$2"; shift 2;;
|
||||||
|
|
@ -44,6 +61,7 @@ while [ "$#" -gt 0 ]; do
|
||||||
--muvm-bin-dir) MUVM_PATH="$2"; shift 2;;
|
--muvm-bin-dir) MUVM_PATH="$2"; shift 2;;
|
||||||
--passt-bin-dir) PASST_PATH="$2"; shift 2;;
|
--passt-bin-dir) PASST_PATH="$2"; shift 2;;
|
||||||
--wl-proxy-bin-dir) WL_PROXY_PATH="$2"; shift 2;;
|
--wl-proxy-bin-dir) WL_PROXY_PATH="$2"; shift 2;;
|
||||||
|
--wl-backdrop-bin-dir) shift 2;;
|
||||||
--) shift 1; MICROVM_COMMAND+=("$@"); break;;
|
--) shift 1; MICROVM_COMMAND+=("$@"); break;;
|
||||||
-*) echo "munix: unknown option: $1" >&2; exit 1;;
|
-*) echo "munix: unknown option: $1" >&2; exit 1;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -76,6 +94,11 @@ if [ "$WL_PROXY_PATH" = "" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$WL_BACKDROP_PATH" = "" ]; then
|
||||||
|
echo "munix: wl-backdrop not found, provide a --wl-backdrop-bin-dir or fix \$PATH" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e "$HOST_OPENGL_DRIVER" ]; then
|
if [ ! -e "$HOST_OPENGL_DRIVER" ]; then
|
||||||
echo "munix: host graphics driver not found, provide a --host-opengl-driver" >&2
|
echo "munix: host graphics driver not found, provide a --host-opengl-driver" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, writeScriptBin, symlinkJoin, makeWrapper, muvm, passt, bubblewrap, sidebus-broker, wl-cross-domain-proxy, mesa, rustc }:
|
{ stdenv, writeScriptBin, symlinkJoin, makeWrapper, muvm, passt, bubblewrap, sidebus-broker, wl-cross-domain-proxy, wl-backdrop, mesa, rustc }:
|
||||||
|
|
||||||
let
|
let
|
||||||
munixScript = (writeScriptBin "munix" (builtins.readFile ../../munix)).overrideAttrs(old: {
|
munixScript = (writeScriptBin "munix" (builtins.readFile ../../munix)).overrideAttrs(old: {
|
||||||
|
|
@ -28,7 +28,7 @@ let
|
||||||
};
|
};
|
||||||
in symlinkJoin {
|
in symlinkJoin {
|
||||||
name = "munix";
|
name = "munix";
|
||||||
paths = [ munixScript microActivate muvm passt bubblewrap sidebus-broker wl-cross-domain-proxy ];
|
paths = [ munixScript microActivate muvm passt bubblewrap sidebus-broker wl-cross-domain-proxy wl-backdrop ];
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/munix --prefix PATH : $out/bin --set FALLBACK_OPENGL_DRIVER ${mesa} --set MUNIX_SYSTEMD_UNITS ${munixSystemd}
|
wrapProgram $out/bin/munix --prefix PATH : $out/bin --set FALLBACK_OPENGL_DRIVER ${mesa} --set MUNIX_SYSTEMD_UNITS ${munixSystemd}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue