From 72a1d720a768de5cdf807f7fbf8cef7007b072ad Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Thu, 3 Oct 2024 21:54:27 +0200 Subject: [PATCH] Things --- hmModules/hyprland/hyprland.conf | 3 +- hmModules/imv/default.nix | 3 + hmModules/shell/default.nix | 99 ++-------------------------- hmModules/zellij/default.nix | 108 +++++++++++++++++++++++++++++++ hosts/kirk/default.nix | 4 ++ hosts/picard/default.nix | 5 +- 6 files changed, 126 insertions(+), 96 deletions(-) create mode 100644 hmModules/imv/default.nix create mode 100644 hmModules/zellij/default.nix diff --git a/hmModules/hyprland/hyprland.conf b/hmModules/hyprland/hyprland.conf index cfc9db7..c953fc6 100644 --- a/hmModules/hyprland/hyprland.conf +++ b/hmModules/hyprland/hyprland.conf @@ -30,7 +30,8 @@ windowrulev2 = workspace 9, class:^(Spotify)$ windowrulev2 = float, title:^(floating)$ bind = $mod, b, exec, firefox -bind = $mod, t, exec, footclient +bind = $mod, t, exec, footclient $SHELL -C "zellij" +bind = $mod, Return, exec, footclient bind = $mod, y, exec, waypipe --compress lz4=10 ssh picard.fleet emacsclient -c bind = $mod, d, exec, fuzzel --background-color=253559cc --border-radius=5 --border-width=0 bind = $mod, s, exec, screenshot.sh diff --git a/hmModules/imv/default.nix b/hmModules/imv/default.nix new file mode 100644 index 0000000..02ebcb3 --- /dev/null +++ b/hmModules/imv/default.nix @@ -0,0 +1,3 @@ +{ + programs.imv.enable = true; +} diff --git a/hmModules/shell/default.nix b/hmModules/shell/default.nix index b270b08..22ced2b 100644 --- a/hmModules/shell/default.nix +++ b/hmModules/shell/default.nix @@ -22,95 +22,6 @@ programs.fd.enable = true; - programs.zellij = - let - zjstatus = pkgs.fetchurl { - url = "https://github.com/dj95/zjstatus/releases/download/v0.17.0/zjstatus.wasm"; - hash = "sha256-IgTfSl24Eap+0zhfiwTvmdVy/dryPxfEF7LhVNVXe+U="; - }; - layout = pkgs.writeText "layout.kdl" '' - layout { - default_tab_template { - pane size=1 borderless=true { - plugin location="file:${zjstatus}" { - // Nord theme - color_fg "#cdd6f4" - color_bg "#1e1e2e" - color_black "#45475a" - color_red "#f38ba8" - color_green "#a6e3a1" - color_yellow "#f9e2af" - color_blue "#89b4fa" - color_magenta "#f5c2e7" - color_cyan "#94e2d5" - color_white "#bac2de" - - format_left "{mode}#[bg=$bg] {tabs}" - format_center "#[bg=$bg,fg=$fg] Zellij: #[bg=$bg,fg=$fg]{session}" - format_right "{datetime}" - format_space "#[bg=$bg]" - format_hide_on_overlength "true" - format_precedence "crl" - - border_enabled "false" - border_char "─" - border_format "#[fg=#6C7086]{char}" - border_position "top" - - hide_frame_for_single_pane "true" - - mode_normal "#[bg=$green,fg=$bg,bold] NORMAL #[bg=$bg,fg=$green]" - mode_locked "#[bg=$red,fg=$bg,bold] LOCKED  #[bg=$bg,fg=$red]" - mode_resize "#[bg=$blue,fg=$bg,bold] RESIZE #[bg=$bg,fg=$blue]" - mode_pane "#[bg=$blue,fg=$bg,bold] PANE #[bg=$bg,fg=$blue]" - mode_tab "#[bg=$yellow,fg=$bg,bold] TAB #[bg=$bg,fg=$yellow]" - mode_scroll "#[bg=$blue,fg=$bg,bold] SCROLL #[bg=$bg,fg=$blue]" - mode_enter_search "#[bg=$yellow,fg=$bg,bold] ENT-SEARCH #[bg=$bg,fg=$yellow]" - mode_search "#[bg=$yellow,fg=$bg,bold] SEARCHARCH #[bg=$bg,fg=$yellow]" - mode_rename_tab "#[bg=$yellow,fg=$bg,bold] RENAME-TAB #[bg=$bg,fg=$yellow]" - mode_rename_pane "#[bg=$blue,fg=$bg,bold] RENAME-PANE #[bg=$bg,fg=$blue]" - mode_session "#[bg=$blue,fg=$bg,bold] SESSION #[bg=$bg,fg=$blue]" - mode_move "#[bg=$blue,fg=$bg,bold] MOVE #[bg=$bg,fg=$blue]" - mode_prompt "#[bg=$blue,fg=$bg,bold] PROMPT #[bg=$bg,fg=$blue]" - mode_tmux "#[bg=$magenta,fg=$bg,bold] TMUX #[bg=$bg,fg=$magenta]" - - // formatting for inactive tabs - tab_normal "#[bg=$bg,fg=$cyan]#[bg=$cyan,fg=$bg,bold]{index} #[bg=$bg,fg=$cyan,bold] {name}{floating_indicator}#[bg=$bg,fg=$bg,bold]" - tab_normal_fullscreen "#[bg=$bg,fg=$cyan]#[bg=$cyan,fg=$bg,bold]{index} #[bg=$bg,fg=$cyan,bold] {name}{fullscreen_indicator}#[bg=$bg,fg=$bg,bold]" - tab_normal_sync "#[bg=$bg,fg=$cyan]#[bg=$cyan,fg=$bg,bold]{index} #[bg=$bg,fg=$cyan,bold] {name}{sync_indicator}#[bg=$bg,fg=$bg,bold]" - - // formatting for the current active tab - tab_active "#[bg=$bg,fg=$yellow]#[bg=$yellow,fg=$bg,bold]{index} #[bg=$bg,fg=$yellow,bold] {name}{floating_indicator}#[bg=$bg,fg=$bg,bold]" - tab_active_fullscreen "#[bg=$bg,fg=$yellow]#[bg=$yellow,fg=$bg,bold]{index} #[bg=$bg,fg=$yellow,bold] {name}{fullscreen_indicator}#[bg=$bg,fg=$bg,bold]" - tab_active_sync "#[bg=$bg,fg=$yellow]#[bg=$yellow,fg=$bg,bold]{index} #[bg=$bg,fg=$yellow,bold] {name}{sync_indicator}#[bg=$bg,fg=$bg,bold]" - - // separator between the tabs - tab_separator "#[bg=$bg] " - - // indicators - tab_sync_indicator " " - tab_fullscreen_indicator " 󰊓" - tab_floating_indicator " 󰹙" - - datetime "#[fg=$fg] {format} " - datetime_format "%Y-%m-%d %H:%M" - datetime_timezone "Europe/Rome" - } - } - children - } - } - ''; - in - { - enable = true; - enableFishIntegration = true; - settings = { - default_layout = "${layout}"; - pane_frames = false; - }; - }; - programs.direnv = { enable = true; config = { @@ -154,13 +65,13 @@ programs.fish = { enable = true; plugins = [ - { - name = "fifc"; - src = pkgs.fishPlugins.fifc.src; - } + # { + # name = "fifc"; + # src = pkgs.fishPlugins.fifc.src; + # } { name = "z"; - src = pkgs.fishPlugins.fifc.src; + src = pkgs.fishPlugins.z.src; } ]; shellInit = diff --git a/hmModules/zellij/default.nix b/hmModules/zellij/default.nix new file mode 100644 index 0000000..45a8487 --- /dev/null +++ b/hmModules/zellij/default.nix @@ -0,0 +1,108 @@ +{ + config, + pkgs, + lib, + ... +}: +let + zjstatus = pkgs.fetchurl { + url = "https://github.com/dj95/zjstatus/releases/download/v0.17.0/zjstatus.wasm"; + hash = "sha256-IgTfSl24Eap+0zhfiwTvmdVy/dryPxfEF7LhVNVXe+U="; + }; + cfg = config.programs.fzf.catppuccin; + palette = (lib.importJSON "${config.catppuccin.sources.palette}/palette.json").${cfg.flavor}.colors; + selectColor = color: palette.${color}.hex; + color_fg = selectColor "text"; + color_bg = selectColor "mantle"; + color_black = selectColor "surface1"; + color_red = selectColor "red"; + color_green = selectColor "green"; + color_yellow = selectColor "yellow"; + color_blue = selectColor "blue"; + color_magenta = selectColor "pink"; + color_cyan = selectColor "teal"; + color_white = selectColor "subtext1"; + layout = pkgs.writeText "layout.kdl" '' + layout { + default_tab_template { + pane size=1 borderless=true { + plugin location="file:${zjstatus}" { + color_fg "${color_fg}" + color_bg "${color_bg}" + color_black "${color_black}" + color_red "${color_red}" + color_green "${color_green}" + color_yellow "${color_yellow}" + color_blue "${color_blue}" + color_magenta "${color_magenta}" + color_cyan "${color_cyan}" + color_white "${color_white}" + + format_left "{mode}#[bg=$bg] {tabs}" + // format_center "#[bg=$bg,fg=$fg] Zellij: #[bg=$bg,fg=$fg]{session}" + // format_right "{datetime}" + format_right "#[bg=$bg,fg=$fg] Zellij: #[bg=$bg,fg=$fg]{session} " + format_space "#[bg=$bg]" + format_hide_on_overlength "true" + format_precedence "crl" + + border_enabled "false" + border_char "─" + border_format "#[fg=#6C7086]{char}" + border_position "top" + + hide_frame_for_single_pane "true" + + mode_normal "#[bg=$green,fg=$bg,bold] NORMAL #[bg=$bg,fg=$green]" + mode_locked "#[bg=$red,fg=$bg,bold] LOCKED  #[bg=$bg,fg=$red]" + mode_resize "#[bg=$blue,fg=$bg,bold] RESIZE #[bg=$bg,fg=$blue]" + mode_pane "#[bg=$blue,fg=$bg,bold] PANE #[bg=$bg,fg=$blue]" + mode_tab "#[bg=$yellow,fg=$bg,bold] TAB #[bg=$bg,fg=$yellow]" + mode_scroll "#[bg=$blue,fg=$bg,bold] SCROLL #[bg=$bg,fg=$blue]" + mode_enter_search "#[bg=$yellow,fg=$bg,bold] ENT-SEARCH #[bg=$bg,fg=$yellow]" + mode_search "#[bg=$yellow,fg=$bg,bold] SEARCHARCH #[bg=$bg,fg=$yellow]" + mode_rename_tab "#[bg=$yellow,fg=$bg,bold] RENAME-TAB #[bg=$bg,fg=$yellow]" + mode_rename_pane "#[bg=$blue,fg=$bg,bold] RENAME-PANE #[bg=$bg,fg=$blue]" + mode_session "#[bg=$blue,fg=$bg,bold] SESSION #[bg=$bg,fg=$blue]" + mode_move "#[bg=$blue,fg=$bg,bold] MOVE #[bg=$bg,fg=$blue]" + mode_prompt "#[bg=$blue,fg=$bg,bold] PROMPT #[bg=$bg,fg=$blue]" + mode_tmux "#[bg=$magenta,fg=$bg,bold] TMUX #[bg=$bg,fg=$magenta]" + + // formatting for inactive tabs + tab_normal "#[bg=$bg,fg=$cyan] #[bg=$cyan,fg=$bg,bold] {index} {floating_indicator}#[bg=$bg,fg=$bg,bold]" + tab_normal_fullscreen "#[bg=$bg,fg=$cyan] #[bg=$cyan,fg=$bg,bold] {index} {fullscreen_indicator}#[bg=$bg,fg=$bg,bold]" + tab_normal_sync "#[bg=$bg,fg=$cyan] #[bg=$cyan,fg=$bg,bold] {index} {sync_indicator}#[bg=$bg,fg=$bg,bold]" + + // formatting for the current active tab + tab_active "#[bg=$bg,fg=$yellow] #[bg=$yellow,fg=$bg,bold] {index} {floating_indicator}#[bg=$bg,fg=$bg,bold]" + tab_active_fullscreen "#[bg=$bg,fg=$yellow] #[bg=$yellow,fg=$bg,bold] {index} {fullscreen_indicator}#[bg=$bg,fg=$bg,bold]" + tab_active_sync "#[bg=$bg,fg=$yellow] #[bg=$yellow,fg=$bg,bold] {index} {sync_indicator}#[bg=$bg,fg=$bg,bold]" + + // separator between the tabs + tab_separator "#[bg=$bg] " + + // indicators + tab_sync_indicator " " + tab_fullscreen_indicator " 󰊓" + tab_floating_indicator " 󰹙" + + datetime "#[fg=$fg] {format} " + datetime_format "%Y-%m-%d %H:%M" + datetime_timezone "Europe/Rome" + } + } + children + } + } + ''; +in +{ + programs.zellij = { + enable = true; + enableFishIntegration = false; + settings = { + default_layout = "${layout}"; + pane_frames = false; + }; + }; +} diff --git a/hosts/kirk/default.nix b/hosts/kirk/default.nix index f2ee46a..7838975 100644 --- a/hosts/kirk/default.nix +++ b/hosts/kirk/default.nix @@ -47,6 +47,7 @@ "git-workspace" "helix" "shell" + "zellij" "element" "firefox" "gpg" @@ -67,6 +68,9 @@ "remmina" "zulip" "calibre" + "zathura" + "imv" + "catppuccin" ]; extraGroups = [ ]; backupPaths = [ ]; diff --git a/hosts/picard/default.nix b/hosts/picard/default.nix index be7d2f8..ded359d 100644 --- a/hosts/picard/default.nix +++ b/hosts/picard/default.nix @@ -35,7 +35,7 @@ "hass-poweroff" "forgejo-runners" "teamviewer" - # "macos-ventura" + "macos-ventura" "sunshine" "mount-rock5b" "adb" @@ -55,6 +55,7 @@ "git-workspace" "helix" "shell" + "zellij" "element" "zmkbatx" "tremotesf" @@ -86,6 +87,8 @@ "zk" "catppuccin" "freecad" + "zathura" + "imv" ]; extraGroups = [ ]; backupPaths = [ ];