diff options
| author | Simon Ser <contact@emersion.fr> | 2022-11-28 20:07:07 +0100 | 
|---|---|---|
| committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-28 18:51:45 -0500 | 
| commit | a358d6760ef751588d310f0141798387e7f4d4b1 (patch) | |
| tree | a174bb8e6f9dbdd9c58e07381a188c70a8301b7e /completions | |
| parent | dca0bb5749bc16f91ab964fc1b06ebb9a453368f (diff) | |
| download | sway-a358d6760ef751588d310f0141798387e7f4d4b1.tar.xz | |
build: move completions to separate file
Diffstat (limited to 'completions')
| -rw-r--r-- | completions/meson.build | 57 | 
1 files changed, 57 insertions, 0 deletions
| diff --git a/completions/meson.build b/completions/meson.build new file mode 100644 index 00000000..6bca9391 --- /dev/null +++ b/completions/meson.build @@ -0,0 +1,57 @@ +if get_option('zsh-completions') +	zsh_files = files( +		'zsh/_sway', +		'zsh/_swaymsg', +	) +	zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions') + +	install_data(zsh_files, install_dir: zsh_install_dir) +endif + +if get_option('bash-completions') +	bash_comp = dependency('bash-completion', required: false) + +	bash_files = files( +		'bash/sway', +		'bash/swaymsg', +	) + +	if get_option('swaybar') +		bash_files += files('bash/swaybar') +	endif + +	if bash_comp.found() +		bash_install_dir = bash_comp.get_variable( +			pkgconfig: 'completionsdir', +			pkgconfig_define: ['datadir', datadir] +		) +	else +		bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') +	endif + +	install_data(bash_files, install_dir: bash_install_dir) +endif + +if get_option('fish-completions') +	fish_comp = dependency('fish', required: false) + +	fish_files = files( +		'fish/sway.fish', +		'fish/swaymsg.fish', +	) + +	if get_option('swaynag') +		fish_files += files('fish/swaynag.fish') +	endif + +	if fish_comp.found() +		fish_install_dir = fish_comp.get_variable( +			pkgconfig: 'completionsdir', +			pkgconfig_define: ['datadir', datadir] +		) +	else +		fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') +	endif + +	install_data(fish_files, install_dir: fish_install_dir) +endif | 
