zjstatus: refactor layout and themes to use timezones

This commit is contained in:
Tigor Hutasuhut 2024-08-04 16:36:23 +07:00
parent cb14254899
commit 8166934d86
8 changed files with 221 additions and 13 deletions

View file

@ -217,6 +217,9 @@ in
} }
''; '';
home.file.".config/zellij/layouts/default.kdl".text = import cfg.zjstatus.theme { inherit plugins; }; home.file.".config/zellij/layouts/default.kdl".text = import cfg.zjstatus.theme {
inherit plugins;
timezone = cfg.zjstatus.timezone;
};
}; };
} }

View file

@ -1,4 +1,4 @@
{ plugins, ... }: { plugins, timezone, ... }:
/*kdl*/ '' /*kdl*/ ''
layout { layout {
pane split_direction="vertical" { pane split_direction="vertical" {
@ -92,7 +92,7 @@
datetime "{format}" datetime "{format}"
datetime_format "%Y-%m-%d 󰅐 %H:%M" datetime_format "%Y-%m-%d 󰅐 %H:%M"
datetime_timezone "Europe/Stockholm" datetime_timezone "${timezone}"
} }
} }
} }

View file

@ -1,4 +1,4 @@
{ plugins, ... }: { plugins, timezone, ... }:
/*kdl*/ '' /*kdl*/ ''
layout { layout {
pane split_direction="vertical" { pane split_direction="vertical" {
@ -92,7 +92,7 @@
datetime "{format}" datetime "{format}"
datetime_format "%Y-%m-%d 󰅐 %H:%M" datetime_format "%Y-%m-%d 󰅐 %H:%M"
datetime_timezone "Europe/Stockholm" datetime_timezone "${timezone}"
} }
} }
} }

View file

@ -1,4 +1,4 @@
{ plugins, ... }: { plugins, timezone, ... }:
/*kdl*/ '' /*kdl*/ ''
layout { layout {
pane split_direction="vertical" { pane split_direction="vertical" {
@ -92,7 +92,7 @@
datetime "{format}" datetime "{format}"
datetime_format "%Y-%m-%d 󰅐 %H:%M" datetime_format "%Y-%m-%d 󰅐 %H:%M"
datetime_timezone "Europe/Stockholm" datetime_timezone "${timezone}"
} }
} }
} }

View file

@ -1,4 +1,4 @@
{ plugins, ... }: { plugins, timezone, ... }:
/*kdl*/ '' /*kdl*/ ''
layout { layout {
pane split_direction="vertical" { pane split_direction="vertical" {
@ -176,7 +176,7 @@
datetime "{format}" datetime "{format}"
datetime_format "%Y-%m-%d 󰅐 %H:%M" datetime_format "%Y-%m-%d 󰅐 %H:%M"
datetime_timezone "Europe/Stockholm" datetime_timezone "${timezone}"
} }
} }
} }

View file

@ -0,0 +1,99 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
layout {
pane split_direction="vertical" {
pane
}
pane size=1 borderless=true {
plugin location="file:${plugins.zj-status}" {
// -- Gruvbox Dark mode
color_bg0 "#282828" //dark0
color_bg1 "#3c3836" //dark1
color_bg2 "#504945" //dark2
color_bg3 "#665c54" //dark3
color_bg4 "#7c6f64" //dark4
color_fg0 "#fbf1c7" //light0
color_fg1 "#ebdbb2" //light1
color_fg2 "#d5c4a1" //light2
color_fg3 "#bdae93" //light3
color_fg4 "#a89984" //light4
color_red "#fb4934" // bright_red
color_green "#b8bb26" //bright_green
color_yellow "#fabd2f" // bright_yellow
color_blue "#83a598" //bright_blue
color_purple "#d3869b" //bright_purple
color_aqua "#8ec07c" //bright_aqua
color_gray "#a89984" //bright_gray
color_orange "#fe8019" //bright_orange
color_neutral_red "#cc241d" //neutral_red
color_neutral_green "#98971a" //neutral_green
color_neutral_yellow "#d79921" //neutral_yellow
color_neutral_blue "#458588" //neutral_blue
color_neutral_purple "#b16286" //neutral_purple
color_neutral_aqua "#689d6a" //neutral_aqua
color_neutral_gray "#928374" //neutral_gray
color_neutral_orange "#d65d0e" //neatural_orange
format_left "#[bg=$bg2,fg=$fg3] {session} {mode}#[bg=$bg1]{tabs}"
format_center "{notifications}"
format_right "#[bg=$bg1,fg=$bg2]#[bg=$bg2,fg=$fg4] {command_user}@{command_host} #[bg=$bg2,fg=$fg3]#[bg=$fg3,fg=$bg1] {datetime} "
format_space "#[bg=$bg1,fg=$fg1]"
format_hide_on_overlength "true"
format_precedence "lrc"
border_enabled "true"
border_char ""
border_format "#[fg=$bg1]{char}"
border_position "top"
hide_frame_for_single_pane "true"
mode_normal "#[bg=$bg3,fg=$bg2]#[bg=$bg3,fg=$fg3,bold] NORMAL#[bg=$bg1,fg=$bg3]"
mode_tmux "#[bg=$green,fg=$bg2]#[bg=$green,fg=$bg0,bold] TMUX#[bg=$bg1,fg=$green]"
mode_locked "#[bg=$red,fg=$bg2]#[bg=$red,fg=$bg0,bold] LOCKED#[bg=$bg1,fg=$red]"
mode_pane "#[bg=$aqua,fg=$bg2]#[bg=$aqua,fg=$bg0,bold] PANE#[bg=$bg1,fg=$aqua]"
mode_tab "#[bg=$aqua,fg=$bg2]#[bg=$aqua,fg=$bg0,bold] TAB#[bg=$bg1,fg=$aqua]"
mode_scroll "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] SCROLL#[bg=$bg1,fg=$blue]"
mode_enter_search "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] ENT-SEARCH#[bg=$bg1,fg=$blue]"
mode_search "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] SEARCH#[bg=$bg1,fg=$blue]"
mode_resize "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_rename_tab "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_rename_pane "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_move "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] MOVE#[bg=$bg1,fg=$yellow]"
mode_session "#[bg=$purple,fg=$bg2]#[bg=$purple,fg=$bg0,bold] MOVE#[bg=$bg1,fg=$purple]"
mode_prompt "#[bg=$purple,fg=$bg2]#[bg=$purple,fg=$bg0,bold] PROMPT#[bg=$bg1,fg=$purple]"
tab_normal "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {floating_indicator}#[bg=$bg1,fg=$bg2]"
tab_normal_fullscreen "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {fullscreen_indicator}#[bg=$bg1,fg=$bg2]"
tab_normal_sync "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {sync_indicator}#[bg=$bg1,fg=$bg2]"
tab_active "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {floating_indicator}#[bg=$bg1,fg=$yellow]"
tab_active_fullscreen "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {fullscreen_indicator}#[bg=$bg1,fg=$yellow]"
tab_active_sync "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {sync_indicator}#[bg=$bg1,fg=$yellow]"
tab_separator "#[bg=$bg1,fg=$fg1]"
tab_sync_indicator ""
tab_fullscreen_indicator "󰊓"
tab_floating_indicator "󰹙"
notification_format_unread "#[bg=$orange,fg=$bg1]#[bg=$orange,fg=$bg1] {message} #[bg=$bg1,fg=$orange]"
notification_format_no_notifications ""
notification_show_interval "10"
command_host_command "uname -n"
command_host_format "{stdout}"
command_host_interval "0"
command_host_rendermode "static"
command_user_command "whoami"
command_user_format "{stdout}"
command_user_interval "0"
command_user_rendermode "static"
datetime "{format}"
datetime_format "%Y-%m-%d %H:%M"
datetime_timezone "${timezone}"
}
}
}
''

View file

@ -0,0 +1,99 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
layout {
pane split_direction="vertical" {
pane
}
pane size=1 borderless=true {
plugin location="file:${plugins.zj-status}" {
// -- Gruvbox Light mode
color_bg0 "#fbf1c7" //light0
color_bg1 "#ebdbb2" //light1
color_bg2 "#d5c4a1" //light2
color_bg3 "#bdae93" //light3
color_bg4 "#a89984" //light4
color_fg0 "#282828" //dark0
color_fg1 "#3c3836" //dark1
color_fg2 "#504945" //dark2
color_fg3 "#665c54" //dark3
color_fg4 "#7c6f64" //dark4
color_red "#9d0006" //faded_red
color_green "#79740e" //faded_green
color_yellow "#b57614" //faded_yellow
color_blue "#076678" //faded_blue
color_purple "#8f3f71" //faded_purple
color_aqua "#427b58" //faded_aqua
color_gray "#7c6f64" //faded_gray
color_orange "#af3a03" //faded_orange
color_neutral_red "#cc241d" //neutral_red
color_neutral_green "#98971a" //neutral_green
color_neutral_yellow "#d79921" //neutral_yellow
color_neutral_blue "#458588" //neutral_blue
color_neutral_purple "#b16286" //neutral_purple
color_neutral_aqua "#689d6a" //neutral_aqua
color_neutral_orange "#d65d0e" //neatural_orange
color_neutral_gray "#928374" //neutral_gray
format_left "#[bg=$bg2,fg=$fg3] {session} {mode}#[bg=$bg1]{tabs}"
format_center "{notifications}"
format_right "#[bg=$bg1,fg=$bg2]#[bg=$bg2,fg=$fg4] {command_user}@{command_host} #[bg=$bg2,fg=$fg3]#[bg=$fg3,fg=$bg1] {datetime} "
format_space "#[bg=$bg1,fg=$fg1]"
format_hide_on_overlength "true"
format_precedence "lrc"
border_enabled "true"
border_char ""
border_format "#[fg=$bg1]{char}"
border_position "top"
hide_frame_for_single_pane "true"
mode_normal "#[bg=$bg3,fg=$bg2]#[bg=$bg3,fg=$fg3,bold] NORMAL#[bg=$bg1,fg=$bg3]"
mode_tmux "#[bg=$green,fg=$bg2]#[bg=$green,fg=$bg0,bold] TMUX#[bg=$bg1,fg=$green]"
mode_locked "#[bg=$red,fg=$bg2]#[bg=$red,fg=$bg0,bold] LOCKED#[bg=$bg1,fg=$red]"
mode_pane "#[bg=$aqua,fg=$bg2]#[bg=$aqua,fg=$bg0,bold] PANE#[bg=$bg1,fg=$aqua]"
mode_tab "#[bg=$aqua,fg=$bg2]#[bg=$aqua,fg=$bg0,bold] TAB#[bg=$bg1,fg=$aqua]"
mode_scroll "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] SCROLL#[bg=$bg1,fg=$blue]"
mode_enter_search "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] ENT-SEARCH#[bg=$bg1,fg=$blue]"
mode_search "#[bg=$blue,fg=$bg2]#[bg=$blue,fg=$bg0,bold] SEARCH#[bg=$bg1,fg=$blue]"
mode_resize "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_rename_tab "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_rename_pane "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] RESIZE#[bg=$bg1,fg=$yellow]"
mode_move "#[bg=$yellow,fg=$bg2]#[bg=$yellow,fg=$bg0,bold] MOVE#[bg=$bg1,fg=$yellow]"
mode_session "#[bg=$purple,fg=$bg2]#[bg=$purple,fg=$bg0,bold] MOVE#[bg=$bg1,fg=$purple]"
mode_prompt "#[bg=$purple,fg=$bg2]#[bg=$purple,fg=$bg0,bold] PROMPT#[bg=$bg1,fg=$purple]"
tab_normal "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {floating_indicator}#[bg=$bg1,fg=$bg2]"
tab_normal_fullscreen "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {fullscreen_indicator}#[bg=$bg1,fg=$bg2]"
tab_normal_sync "#[bg=$bg2,fg=$bg1]#[bg=$bg2,fg=$fg1] {index} #[bg=$bg2,fg=$fg1,bold] {name} {sync_indicator}#[bg=$bg1,fg=$bg2]"
tab_active "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {floating_indicator}#[bg=$bg1,fg=$yellow]"
tab_active_fullscreen "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {fullscreen_indicator}#[bg=$bg1,fg=$yellow]"
tab_active_sync "#[bg=$yellow,fg=$bg1]#[bg=$yellow,fg=$bg2] {index} #[bg=$yellow,fg=$bg2,bold] {name} {sync_indicator}#[bg=$bg1,fg=$yellow]"
tab_separator "#[bg=$bg1,fg=$fg1]"
tab_sync_indicator ""
tab_fullscreen_indicator "󰊓"
tab_floating_indicator "󰹙"
notification_format_unread "#[bg=$orange,fg=$bg1]#[bg=$orange,fg=$bg1] {message} #[bg=$bg1,fg=$orange]"
notification_format_no_notifications ""
notification_show_interval "10"
command_host_command "uname -n"
command_host_format "{stdout}"
command_host_interval "0"
command_host_rendermode "static"
command_user_command "whoami"
command_user_format "{stdout}"
command_user_interval "0"
command_user_rendermode "static"
datetime "{format}"
datetime_format "%Y-%m-%d %H:%M"
datetime_timezone "${timezone}"
}
}
}
''

View file

@ -94,11 +94,18 @@
default = "Ctrl a"; default = "Ctrl a";
description = "Mod key to use for zellij to enter tmux mode and exits locked mode."; description = "Mod key to use for zellij to enter tmux mode and exits locked mode.";
}; };
zjstatus.theme = lib.mkOption { zjstatus = {
theme = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = ../home/programs/zellij/themes/zjstatus/catppuccin-mocha.nix; default = ../home/programs/zellij/themes/zjstatus/catppuccin-mocha.nix;
description = "Default zellij status theme"; description = "Default zellij status theme";
}; };
timezone = lib.mkOption {
type = lib.types.str;
default = "Asia/Jakarta";
description = "Timezone to use for zellij status";
};
};
}; };
foot.enable = lib.mkEnableOption "foot"; foot.enable = lib.mkEnableOption "foot";
}; };