moby: lift background into sway config

This commit is contained in:
Colin 2023-09-05 16:13:23 +00:00
parent c3e37f7864
commit 409baf0321
7 changed files with 35 additions and 8 deletions

View File

@ -9,13 +9,6 @@
# - <https://itsfoss.com/content/images/2023/04/nixos-tutorials.png>
{ lib, pkgs, sane-lib, ... }:
let
# TODO: generate this from the .svg
# bg = ./nixos-bg-02.png;
bg = pkgs.runCommand "nixos-bg.png" { nativeBuildInputs = [ pkgs.inkscape ]; } ''
inkscape ${./nixos-bg-02.svg} -o $out
'';
in
{
sane.programs.firefox.config = {
# compromise impermanence for the sake of usability
@ -134,7 +127,6 @@ in
# - close is 16th entry
SXMO_BEMENU_LANDSCAPE_LINES = "11"; # default 8
SXMO_BEMENU_PORTRAIT_LINES = "16"; # default 16
SXMO_BG_IMG = "${bg}";
SXMO_LOCK_IDLE_TIME = "15"; # how long between screenoff -> lock -> back to screenoff (default: 8)
# gravity: how far to tilt the device before the screen rotates
# for a given setting, normal <-> invert requires more movement then left <-> right

View File

@ -7,6 +7,7 @@
./phosh.nix
./sway
./sxmo
./theme
];
sane.programs.guiApps = {

View File

@ -46,6 +46,9 @@ in
default font (for e.g. window titles)
'';
};
background = mkOption {
type = types.path;
};
mod = mkOption {
type = types.string;
default = "Mod4";

View File

@ -32,6 +32,8 @@ client.focused_inactive #1f5e54 #5f676a #ffffff
client.unfocused #1f5e54 #1f554c #b4b4b4
client.urgent #ff8080 #ff8080 #ffffff
output '*' bg "@background@" fill
### pixel boundary between windows
hide_edge_borders smart
default_border pixel 1

View File

@ -36,6 +36,7 @@ in pkgs.substituteAll {
xwayland
;
inherit (config)
background
brightness_down_cmd
brightness_up_cmd
extra_lines

View File

@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sane.gui.theme.background;
in
{
options = with lib; {
sane.gui.theme.background = {
svg = mkOption {
type = types.path;
default = ./nixos-bg-02.svg;
};
png = mkOption {
type = types.path;
default = pkgs.runCommand
"nixos-bg.png"
{ nativeBuildInputs = [ pkgs.inkscape ]; }
''
inkscape ${cfg.svg} -o $out
'';
};
};
};
config = {
sane.gui.sway.config.background = lib.mkDefault cfg.png;
sane.gui.sxmo.settings.SXMO_BG_IMG = lib.mkDefault (builtins.toString cfg.png);
};
}

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB