NLGCV3BRXEQ6DRHZUCKU2F7DLEEYMB2F56NJP7LBPUWJGZ2A7DVAC { config, lib, pkgs, ... }: letinherit (lib) mkIf;btopPopupConfig = pkgs.writeText "btop-popup.conf" /* conf */ ''tty_mode = Trueforce_tty = Trueshown_boxes = "proc"proc_left = Falseproc_tree = Falseproc_gradient = Falseproc_colors = Falseproc_per_core = Falseproc_mem_bytes = Falseproc_cpu_graphs = Falseproc_mem_graphs = Falsemem_graphs = Falseshow_detailed = Falseshow_cpu_freq = Falseshow_uptime = Falseshow_disks = Falseshow_io_stat = Falseshow_swap = False'';process-monitor = pkgs.writeScriptBin "process-monitor" /* nu */ ''#!${pkgs.nushell}/bin/nulet hyprctl = "${pkgs.hyprland}/bin/hyprctl"let niri_bin = (try { (which niri | get 0.path) } catch { null })let class_name = "btop-popup"let compositor = if (try { $env.NIRI_SOCKET } catch { null }) != null {"niri"} else if (try { $env.HYPRLAND_INSTANCE_SIGNATURE } catch { null }) != null {"hyprland"} else if $niri_bin != null {"niri"} else {"unknown"}let windows = if $compositor == "niri" and $niri_bin != null {try { ^$niri_bin msg --json windows | from json } catch { [] }} else if $compositor == "hyprland" {try { ^$hyprctl clients -j | from json } catch { [] }} else {[]}let existing = if $compositor == "niri" {$windows | where app_id? == $class_name} else if $compositor == "hyprland" {$windows | where class? == $class_name} else {[]}if ($existing | is-empty) {^${pkgs.kitty}/bin/kitty --detach --class $class_name --title "Process Monitor" --override remember_window_size=no --override initial_window_width=44c --override initial_window_height=16c --override window_padding_width=${toString (config.theme.padding / 2)} ${pkgs.btop}/bin/btop --config ${btopPopupConfig}} else if $compositor == "niri" and $niri_bin != null {let id = ($existing | first | get id?)if $id != null { ^$niri_bin msg action close-window --id $id }} else if $compositor == "hyprland" {let address = ($existing | first | get address?)if $address != null { ^$hyprctl dispatch closewindow $"address:($address)" }}'';in mkIf config.isDesktopNotWsl {environment.systemPackages = [process-monitor];}
{ config, lib, pkgs, ... }: letinherit (lib) mkIf getExe';hx = getExe' pkgs.helix "hx";mkScratchpad = { name, file, title }: pkgs.writeScriptBin "${name}-scratchpad" /* nu */ ''#!${pkgs.nushell}/bin/nulet hyprctl = "${pkgs.hyprland}/bin/hyprctl"let niri_bin = (try { (which niri | get 0.path) } catch { null })let scratchpad_class = "${name}-scratchpad"let notes_path = ([$env.HOME "notes" "${file}"] | path join)let notes_dir = ($notes_path | path dirname)if (not ($notes_dir | path exists)) { mkdir $notes_dir }if (not ($notes_path | path exists)) { ^${pkgs.coreutils}/bin/touch $notes_path }let compositor = if (try { $env.NIRI_SOCKET } catch { null }) != null {"niri"} else if (try { $env.HYPRLAND_INSTANCE_SIGNATURE } catch { null }) != null {"hyprland"} else if $niri_bin != null {"niri"} else {"unknown"}let windows = if $compositor == "niri" and $niri_bin != null {try { ^$niri_bin msg --json windows | from json } catch { [] }} else if $compositor == "hyprland" {try { ^$hyprctl clients -j | from json } catch { [] }} else {[]}let existing = if $compositor == "niri" {$windows | where app_id? == $scratchpad_class} else if $compositor == "hyprland" {$windows | where class? == $scratchpad_class} else {[]}if ($existing | is-empty) {^${pkgs.kitty}/bin/kitty --detach --class $scratchpad_class --title "${title}" --override remember_window_size=no --override initial_window_width=80c --override initial_window_height=24c --directory $notes_dir ${hx} $notes_path} else if $compositor == "niri" and $niri_bin != null {let id = ($existing | first | get id?)if $id != null { ^$niri_bin msg action close-window --id $id }} else if $compositor == "hyprland" {let address = ($existing | first | get address?)if $address != null { ^$hyprctl dispatch closewindow $"address:($address)" }}'';todoScratchpad = mkScratchpad { name = "todo"; file = "todo.md"; title = "Todo"; };randomScratchpad = mkScratchpad { name = "random"; file = "random.md"; title = "Random"; };in mkIf config.isDesktopNotWsl {environment.systemPackages = [todoScratchpadrandomScratchpad];}