summaryrefslogtreecommitdiff
path: root/completions
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-05 10:57:52 +0100
committerSimon Ser <contact@emersion.fr>2022-12-05 11:02:41 +0100
commitdcba5bcb9f20c7d5d75f700693e031737567289a (patch)
treef791e670766fb111cf9deb986bb1bd2258fcf6a6 /completions
parentd9e71c87c7af8687750901d71409140f1bd181bd (diff)
build: move completions to separate file
Diffstat (limited to 'completions')
-rw-r--r--completions/meson.build39
1 files changed, 39 insertions, 0 deletions
diff --git a/completions/meson.build b/completions/meson.build
new file mode 100644
index 0000000..e2e913a
--- /dev/null
+++ b/completions/meson.build
@@ -0,0 +1,39 @@
+bash_comp = dependency('bash-completion', required: false)
+fish_comp = dependency('fish', required: false)
+
+datadir = get_option('datadir')
+
+if get_option('zsh-completions')
+ zsh_files = files(
+ 'zsh/_swaylock',
+ )
+ zsh_install_dir = datadir + '/zsh/site-functions'
+
+ install_data(zsh_files, install_dir: zsh_install_dir)
+endif
+
+if get_option('bash-completions')
+ bash_files = files(
+ 'bash/swaylock',
+ )
+ if bash_comp.found()
+ bash_install_dir = bash_comp.get_variable('completionsdir')
+ else
+ bash_install_dir = datadir + '/bash-completion/completions'
+ endif
+
+ install_data(bash_files, install_dir: bash_install_dir)
+endif
+
+if get_option('fish-completions')
+ fish_files = files(
+ 'fish/swaylock.fish',
+ )
+ if fish_comp.found()
+ fish_install_dir = fish_comp.get_variable('completionsdir')
+ else
+ fish_install_dir = datadir + '/fish/vendor_completions.d'
+ endif
+
+ install_data(fish_files, install_dir: fish_install_dir)
+endif