diff options
| author | Miran Bastaja <miran.bastaja04@gmail.com> | 2024-09-16 10:56:03 +0200 |
|---|---|---|
| committer | Miran Bastaja <miran.bastaja04@gmail.com> | 2024-09-16 11:23:31 +0200 |
| commit | 9d3ef99adbc8613f82402d71ca314d9c841dfd2d (patch) | |
| tree | 395405676b5d9af36c5a845403d5462ed78a5c18 /share/cfg/foot.nix | |
| parent | ce3b9c3b9767195592dee64c960821b5a0accba6 (diff) | |
foot: add icat alias for priting out images
Diffstat (limited to 'share/cfg/foot.nix')
| -rw-r--r-- | share/cfg/foot.nix | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/share/cfg/foot.nix b/share/cfg/foot.nix index 310283c..9786e5e 100644 --- a/share/cfg/foot.nix +++ b/share/cfg/foot.nix @@ -1,4 +1,9 @@ -{ config, pkgs, ... }: +{ + config, + pkgs, + lib, + ... +}: let cfg = config.programs.foot; foot-pkg = pkgs.symlinkJoin { @@ -25,4 +30,20 @@ in }; }; }; + + programs.fish.functions.icat = + # TODO: find window manager agnostic way to get current window size + lib.mkIf (cfg.enable && config.wayland.windowManager.hyprland.enable) { + body = '' + set --local width $(hyprctl -j activewindow | jaq '.size[0]') + set --local maximgwidth $(math "ceil($width * 0.7)") + img2sixel --width $maximgwidth $argv + ''; + }; + + home.packages = lib.mkIf cfg.enable ( + builtins.attrValues { + inherit (pkgs) libsixel jaq hyprland; + } + ); } |
