<commit_before>{pkgs, config, ...}:

let
  inherit (pkgs.lib) mkOption mkIf;
  cfg = config.services.xserver.windowManager.wmii;

  option = { services = { xserver = { windowManager = {

    wmii = {
      enable = mkOption {
        default = false;
        example = true;
        description = "Enable the wmii window manager.";
      };
    };

  }; }; }; };
in

mkIf cfg.enable {
  require = option;

  services = {
    xserver = {

      windowManager = {
        session = [{
          name = "wmii";
          start = "
            ${pkgs.wmiiSnap}/bin/wmii &
            waitPID=$!
          ";
        }];<commit_msg>put wmii in a loop cause it crashes once or twice a month This also let's you change orientation. See comments<commit_after>{pkgs, config, ...}:

let
  inherit (pkgs.lib) mkOption mkIf;
  cfg = config.services.xserver.windowManager.wmii;

  option = { services = { xserver = { windowManager = {

    wmii = {
      enable = mkOption {
        default = false;
        example = true;
        description = "Enable the wmii window manager.";
      };
    };

  }; }; }; };
in

mkIf cfg.enable {
  require = option;

  services = {
    xserver = {
      # stop wmii by
      #   $wmiir xwrite /ctl quit
      # this will cause wmii exiting with exit code 0
      #
      # why this loop?
      # wmii crashes once a month here. That doesn't matter that much
      # wmii can recover very well. However without loop the x session terminates and then your workspace setup is
      # lost and all applications running on X will terminate.
      # Another use case is kill -9 wmii; after rotating screen.
      # Note: we don't like kill for that purpose. But it works (-> subject "wmii and xrandr" on mailinglist)
      windowManager = {
        session = [{
          name = "wmii";
          start = "
            while :; do
              ${pkgs.wmiiSnap}/bin/wmii && break
            done
          ";
        }];
{'fraction_non_alphanumeric': 0.10670103092783505, 'fraction_numerical': 0.0010309278350515464, 'mean_word_length': 1.8883928571428572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5618696', 'n_tokens_mistral': 592, 'n_tokens_neox': 569, 'n_words': 187}