I want to force kakoune to use sway. does that really need to be complicated?!
I’m using kitty, and strangley it doesn’t detect both
I use a custom kakrc in a different path (thanks to me using nixos) like this:
kak -n -e source /etc/nixos/kak/kakrc
I hope this conversation can be helpful for anyone who wants to change the windowing module
The default windowing module is detected by rc/windowing/detection.kak, in a KakBegin hook, which runs after kakrc is loaded and Kakoune is ready to be used.
If you don’t want to use the autodetection, you can just put:
set-option global windowing_module sway
…in your kakrc file, and that should be it.
- Where should I set this option in kakrc?! it’s undeclared until the detection is ran.
- I use nixos and I don’t want user config. I want system-wide config if possible.
- WAYLAND_DISPLAY and SWAYLOCK aren’t available.
- It keeps emitting the shell error
line 7: [: missing`]'in the debug buffer
thanks for your patience.
I don’t know what NixOS does, but in a regular version of Kakoune the load sequence goes like this:
$PREFIX/share/kak/kakrc, which tries to load all the*.kakfiles in~/.config/kak/autoload/, or if that directory doesn’t exist,$PREFIX/share/kak/rc/
~/.config/kak/kakrc/
So by the time you get to the per-user kakrc (or the end of the $PREFIX kakrc) all the standard library code should have already run, and the windowing_module option should be available. The actual detection won’t happen until after all these files are read.
I don’t know what /etc/nixos/kak/kakrc is, Kakoune normally doesn’t have a site-wide configuration file. Perhaps NixOS patches the $PREFIX/share/kak/kakrc to read that file too? If NixOS doesn’t come with any documentation, you’ll have to figure out what they’ve done and where it fits into the load sequence above.
line 7: [: missing ] in the *debug* buffer suggests you have a broken shell-block somewhere in your configuration. Unfortunately, the easiest way to find it is to remove your customisations one-by-one- until you find the one that’s causing the problem.
/etc/nixos/kak/kakrc is a custom autoload script I defined in my nixos config. it gets loaded into kakoune as a script like the ones normally in /usr/share/kak/autoload. just think of it as an autoload script that loads additional things and loads other colorschemes
Is there any plugin to solve this issue?
If /etc/nixos/kak/kakrc gets loaded into Kakoune after the standard library, then you can put the line to set windowing_system there and it should be fine.
If it gets loaded before the standard library, or (somehow) as part of it, then you should probably move it to load after the standard library.
Thanks for the suggestion
the shell error seems to be a problem when kakoune runs its default global /usr/share/kakoune. and It repeats when I run the colorscheme command.
my version of the colorscheme command doesn’t make any errors. and that means the error comes from the default implementation maybe due to an qouting/unqouting problem.
I think kakoune rexpands the shell expansion every time the command runs given by the phrasing in the begining of :doc expansions about command parsing.
still I’ve no idea how the command expansion of the first version lingers even after I overrided it (with -override).
and I thought that you asked me to set the option windowing_module not windowing_system. this is the first time I know that windowing_system exists
but I setteld on overriding the modules sway and wayland to evade the detection issues (by removing the detection)
Thanks for your time. I feel that we really form a community here.
Hi M-P,
This might be helpful. Although, I’m not certain. Try setting the clashing command keeping its exact same name to an empty context in your new colorscheme.kak.
define-command -override -hidden name-of-same-command %[ ]
Then introduce a new command name in your colorscheme.kak with the previously desired context.
Good luck M-P.
Thanks for your tip. I’m sure it’ll be helpful
I tried to rewrite the colorscheme segment from the beginning and the issue has stopped. I guess I used [ -z $filename ] instead of [ -z "$filename" ] but I’m not sure.
Thanks for your time. I appreciate your support.