aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiran Bastaja <miran.bastaja04@gmail.com>2024-09-16 10:56:03 +0200
committerMiran Bastaja <miran.bastaja04@gmail.com>2024-09-16 11:23:31 +0200
commit9d3ef99adbc8613f82402d71ca314d9c841dfd2d (patch)
tree395405676b5d9af36c5a845403d5462ed78a5c18
parentce3b9c3b9767195592dee64c960821b5a0accba6 (diff)
foot: add icat alias for priting out images
-rw-r--r--share/cfg/foot.nix23
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;
+ }
+ );
}