sxmo: bring wob service in-house

This commit is contained in:
Colin 2023-12-14 10:33:27 +00:00
parent cb0d9e077b
commit ac22e07388
4 changed files with 46 additions and 4 deletions

View File

@ -80,6 +80,7 @@
./wike.nix
./wine.nix
./wireshark.nix
./wob.nix
./xarchiver.nix
./zeal.nix
./zsh

View File

@ -0,0 +1,40 @@
{ config, lib, ... }:
let
cfg = config.sane.programs.wob;
in
{
sane.programs.wob = {
configOption = with lib; mkOption {
default = {};
type = types.submodule {
options.autostart = mkOption {
type = types.bool;
default = true;
};
options.sock = mkOption {
type = types.str;
default = "sxmo.wobsock";
};
};
};
services.wob = {
description = "Wayland Overlay Bar (renders volume/backlight levels)";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
serviceConfig = {
# ExecStart = "${cfg.package}/bin/wob";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
script = ''
wobsock="$XDG_RUNTIME_DIR/${cfg.config.sock}"
rm -f "$wobsock" || true
mkfifo "$wobsock" && ${cfg.package}/bin/wob <> "$wobsock"
# TODO: cleanup should be done in a systemd OnFailure, or OnExit, or whatever
rm -f "$wobsock"
'';
};
};
}

View File

@ -265,9 +265,10 @@ in
suggestedPrograms = [
"guiApps"
"bemenu" # specifically to import its theming
"sfeed" # want this here so that the user's ~/.sfeed/sfeedrc gets created
# "superd" # make superctl (used by sxmo) be on PATH
"sfeed" # want this here so that the user's ~/.sfeed/sfeedrc gets created
# "superd" # make superctl (used by sxmo) be on PATH
# "sway-autoscaler"
"wob" # volume/brightness on-screen display
];
persist.byStore.cryptClearOnBoot = [
@ -645,7 +646,7 @@ in
sxmo_networkmonitor = sxmoService "networkmonitor";
sxmo_notificationmonitor = sxmoService "notificationmonitor";
sxmo_soundmonitor = sxmoService "soundmonitor";
sxmo_wob = sxmoService "wob";
# sxmo_wob = sxmoService "wob";
sxmo-x11-status = sxmoService "status_xsetroot";
bonsaid.path = sxmoPath;

View File

@ -18,7 +18,7 @@ sxmo_jobs.sh start daemon_manager
# TODO: start these externally, via `wantedBy` in nix
# don't: i don't use mako
# superctl start mako
systemctl --user start sxmo_wob
# systemctl --user start sxmo_wob
systemctl --user start sxmo_menumode_toggler
systemctl --user start bonsaid
# don't: sway background is managed externally