From 6964a3bfe2260de771259b3e0225d34a6bee93d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Fri, 19 Apr 2024 23:33:44 +0200 Subject: [PATCH] modules/home/common/desktop: zellij compacter layout --- flake.lock | 86 ++++++++++++++++++++++++- flake.nix | 5 ++ modules/home/common/desktop/default.nix | 62 ++++++++---------- 3 files changed, 118 insertions(+), 35 deletions(-) diff --git a/flake.lock b/flake.lock index 21a5bec..738314b 100644 --- a/flake.lock +++ b/flake.lock @@ -327,6 +327,24 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakelib": { "inputs": { "fl-config": "fl-config", @@ -627,7 +645,8 @@ "nvidia-patch": "nvidia-patch", "racket": "racket", "wrapper-manager": "wrapper-manager", - "wrapper-manager-hm-compat": "wrapper-manager-hm-compat" + "wrapper-manager-hm-compat": "wrapper-manager-hm-compat", + "zjstatus": "zjstatus" } }, "rust-analyzer-src": { @@ -672,6 +691,31 @@ "type": "github" } }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "zjstatus", + "flake-utils" + ], + "nixpkgs": [ + "zjstatus", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709259239, + "narHash": "sha256-MbrpgqpvUND7+UnOSLazrAMj0+zle16RRiOKTtjBefw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "0e031ddb3f5a339dc6eda93d271ae43618b14eec", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "std": { "inputs": { "nix-std": "nix-std" @@ -735,6 +779,21 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { "inputs": { "systems": "systems_3" @@ -799,6 +858,31 @@ "repo": "wrapper-manager-hm-compat", "type": "github" } + }, + "zjstatus": { + "inputs": { + "crane": [ + "crane" + ], + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1711471490, + "narHash": "sha256-2iFDvbyLzAeytKywd/jqatd86sC6z0EcIwwe/fT+RJg=", + "owner": "dj95", + "repo": "zjstatus", + "rev": "a584399858437d64ae55c423454da48b6b8a0933", + "type": "github" + }, + "original": { + "owner": "dj95", + "repo": "zjstatus", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 1ef64e5..2f3a32b 100644 --- a/flake.nix +++ b/flake.nix @@ -138,6 +138,11 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.crane.follows = "crane"; }; + zjstatus = { + url = "github:dj95/zjstatus"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.crane.follows = "crane"; + }; }; /* diff --git a/modules/home/common/desktop/default.nix b/modules/home/common/desktop/default.nix index a8f0da6..aa48b08 100644 --- a/modules/home/common/desktop/default.nix +++ b/modules/home/common/desktop/default.nix @@ -49,44 +49,38 @@ }; }; - xdg.configFile."zellij/layouts/compacter.kdl".text = config.lib.generators.toKDL { } { - layout = { - pane = { - _props.split_direction = "vertical"; - pane = [ ]; - }; + xdg.configFile."zellij/layouts/compacter.kdl".text = '' + layout { + pane split_direction="vertical" { + pane + } - pane = { - _props = { - size = 1; - borderless = true; - }; + pane size=1 borderless=true { + plugin location="file:${inputs'.zjstatus.packages.default}/bin/zjstatus.wasm" { + hide_frame_for_single_pane "true" - plugin = { - _props.location = "file:${inputs'.zjstatus.packages.default}/bin/zjstatus.wasm"; + format_left "{mode}#[fg=fg,bg=bg,bold] {session}#[bg=bg] {tabs}" + format_right "#[fg=#424554,bg=bg]::{datetime}" + format_space "#[bg=bg]" - hide_frame_for_single_pane = "true"; + mode_normal "#[bg=green] " + mode_locked "#[bg=magenta] " + mode_tab "#[bg=blue] " + mode_tmux "#[bg=red] " + mode_default_to_mode "tmux" - format_left = "{mode}#[fg=#89B4FA,bg=#181825,bold] {session}#[bg=#181825] {tabs}"; - format_right = "#[fg=#424554,bg=#181825]::{datetime}"; - format_space = "#[bg=#181825]"; + tab_normal "#[fg=#6C7086,bg=bg] {index} {name} {fullscreen_indicator}{sync_indicator}{floating_indicator}" + tab_active "#[fg=#9399B2,bg=bg,bold,italic] {index} {name} {fullscreen_indicator}{sync_indicator}{floating_indicator}" + tab_fullscreen_indicator "□ " + tab_sync_indicator " " + tab_floating_indicator "󰉈 " - mode_normal = "#[bg=#89B4FA] "; - mode_tmux = "#[bg=#ffc387] "; - mode_default_to_mode = "tmux"; - - tab_normal = "#[fg=#6C7086,bg=#181825] {index} {name} {fullscreen_indicator}{sync_indicator}{floating_indicator}"; - tab_active = "#[fg=#9399B2,bg=#181825,bold,italic] {index} {name} {fullscreen_indicator}{sync_indicator}{floating_indicator}"; - tab_fullscreen_indicator = "□ "; - tab_sync_indicator = " "; - tab_floating_indicator = "󰉈 "; - - datetime = "#[fg=#9399B2,bg=#181825] {format} "; - datetime_format = "%A, %d %b %Y %H:%M"; - datetime_timezone = "Europe/Warsaw"; - }; - }; - }; - }; + datetime "#[fg=#9399B2,bg=bg] {format} " + datetime_format "%A, %d %b %Y %H:%M" + datetime_timezone "Europe/Warsaw" + } + } + } + ''; }; }