nix-config/modules/home-manager/desktop-river/kile/default.nix

64 lines
2.3 KiB
Nix

{ config, pkgs, ... }:
let
shell = "${pkgs.dash}/bin/dash";
riverctl = "${pkgs.river}/bin/riverctl";
kile = "${pkgs.kile-wl}/bin/kile";
in {
home.packages = with pkgs; [ kile-wl ];
systemd.user.services.kile-wl = {
Unit = {
Description = "kile layout generator";
BindsTo = [ "river-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${kile}";
};
Install = { WantedBy = [ "river-session.target" ]; };
};
xdg.dataFile = {
layout = {
target = "${config.xdg.configHome}/river/layout.kl";
source = ./layout.kl;
};
init-kile = {
executable = true;
target = "${config.xdg.configHome}/river/init-kile";
text = ''
#!${shell}
${riverctl} default-layout kile
# Super+H and Super+L to decrease/increase the main ratio
${riverctl} map -repeat normal Super Equal send-layout-cmd kile "mod-main-ratio +0.01"
${riverctl} map -repeat normal Super Minus send-layout-cmd kile "mod-main-ratio -0.01"
# Super+Comma and Super+Period. to increment/decrement the main count
${riverctl} map normal Super Comma send-layout-cmd kile "mod-main-count +1"
${riverctl} map normal Super Period send-layout-cmd kile "mod-main-count -1"
${riverctl} map normal Super G send-layout-cmd kile "padding 5"
${riverctl} map normal Super+Shift G send-layout-cmd kile "padding 0"
# Super+{Up,Right,Down,Left} to change layout orientation
${riverctl} map normal Super+Control K send-layout-cmd kile "layout up"
${riverctl} map normal Super+Control J send-layout-cmd kile "layout down"
${riverctl} map normal Super+Control H send-layout-cmd kile "layout left"
${riverctl} map normal Super+Control L send-layout-cmd kile "layout right"
${riverctl} map normal Super+Control D send-layout-cmd kile "layout deck"
${riverctl} map normal Super+Control F send-layout-cmd kile "layout full"
${riverctl} map normal Super+Control W send-layout-cmd kile "layout wide"
${riverctl} map normal Super+Control C send-layout-cmd kile "layout cols"
${riverctl} map normal Super+Shift Space send-layout-cmd kile "layout default"
${riverctl} send-layout-cmd kile "padding 5"
'';
};
};
}