{ 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" # 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" ''; }; }; }