nixos-config/user/pqiv.nix

67 lines
1.6 KiB
Nix
Raw Normal View History

2023-01-22 16:44:35 -03:00
{ config, pkgs, lib, inputs, ... }:
let
inherit (pkgs.uservars) key theme color accent font;
make_direction_binds = lib.imap0 (idx: direction:
let
sign = if (idx < 2) then 1 else -1;
axis = if ((lib.mod idx 2) != 0) then "y" else "x";
2023-01-22 18:12:04 -03:00
in
''
2023-01-22 16:44:35 -03:00
${key.${direction}} { shift_${axis}(${toString (sign * 10)}) }
${lib.toUpper key.${direction}} { shift_${axis}(${toString (sign * 50)}) }
@MONTAGE{
${key.${direction}} {
montage_mode_shift_${axis}(${toString (sign * -1)})
}
}
'');
2023-01-22 18:12:04 -03:00
in
{
2023-01-22 16:44:35 -03:00
# My bemenu wrapper
xdg.configFile = {
"pqivrc".text = ''
[options]
sort=1
lazy-load=1
browse=1
hide-info-box=1
box-colors=${accent.fg}:${accent.color}
thumbnail-size=256x256
command-6=trash-put
command-8=|wl-copy
[keybindings]
Mouse-5 { shift_y(-10) }
Mouse-4 { shift_y(10) }
; n { goto_file_reh }
<bracketleft> { goto_file_relative(-1) }
<bracketright> { goto_file_relative(1); }
<Left> { goto_file_relative(-1) }
<Right> { goto_file_relative(1); }
${lib.concatStrings (make_direction_binds [ "left" "up" "right" "down" ])}
${key.tabL} { goto_file_relative(-1) }
${key.tabR} { goto_file_relative(1); }
${key.insertMode} { toggle_info_box() }
d { send_keys(6) }
y { send_keys(8) }
${if (key.layout == "colemak") then
"\n t { toggle_scale_mode(0) }\n "
else
""}
# vim: ft=ini
'';
};
home.packages = with pkgs; [ pqiv ];
}