diff options
-rw-r--r-- | config.in | 4 | ||||
-rw-r--r-- | meson.build | 54 | ||||
-rw-r--r-- | meson_options.txt | 3 | ||||
-rw-r--r-- | security.d/00-defaults.in | 18 | ||||
-rw-r--r-- | sway/meson.build | 3 |
5 files changed, 68 insertions, 14 deletions
@@ -21,7 +21,7 @@ set $menu dmenu_run | |||
21 | ### Output configuration | 21 | ### Output configuration |
22 | # | 22 | # |
23 | # Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/) | 23 | # Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/) |
24 | output * bg __DATADIR__/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill | 24 | output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill |
25 | # | 25 | # |
26 | # Example configuration: | 26 | # Example configuration: |
27 | # | 27 | # |
@@ -194,4 +194,4 @@ bar { | |||
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
197 | include __SYSCONFDIR__/sway/config.d/* | 197 | include @sysconfdir@/sway/config.d/* |
diff --git a/meson.build b/meson.build index ac161987..494f2866 100644 --- a/meson.build +++ b/meson.build | |||
@@ -11,6 +11,11 @@ project( | |||
11 | 11 | ||
12 | cc = meson.get_compiler('c') | 12 | cc = meson.get_compiler('c') |
13 | 13 | ||
14 | is_freebsd = host_machine.system().startswith('freebsd') | ||
15 | datadir = get_option('datadir') | ||
16 | sysconfdir = get_option('sysconfdir') | ||
17 | prefix = get_option('prefix') | ||
18 | |||
14 | jsonc = dependency('json-c', version: '>=0.12.1') | 19 | jsonc = dependency('json-c', version: '>=0.12.1') |
15 | pcre = dependency('libpcre') | 20 | pcre = dependency('libpcre') |
16 | wlroots = dependency('wlroots') | 21 | wlroots = dependency('wlroots') |
@@ -37,7 +42,6 @@ else | |||
37 | git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() | 42 | git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() |
38 | version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) | 43 | version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) |
39 | endif | 44 | endif |
40 | |||
41 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') | 45 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') |
42 | 46 | ||
43 | sway_inc = include_directories('include') | 47 | sway_inc = include_directories('include') |
@@ -45,3 +49,51 @@ sway_inc = include_directories('include') | |||
45 | subdir('common') | 49 | subdir('common') |
46 | subdir('sway') | 50 | subdir('sway') |
47 | 51 | ||
52 | config = configuration_data() | ||
53 | config.set('sysconfdir', join_paths(prefix, sysconfdir)) | ||
54 | config.set('datadir', join_paths(prefix, datadir)) | ||
55 | config.set('prefix', prefix) | ||
56 | |||
57 | configure_file( | ||
58 | configuration: config, | ||
59 | input: 'config.in', | ||
60 | output: '@BASENAME@', | ||
61 | install_dir: sysconfdir + '/sway' | ||
62 | ) | ||
63 | |||
64 | if is_freebsd | ||
65 | configure_file( | ||
66 | configuration: config, | ||
67 | input: 'security.d/10-freebsd.in', | ||
68 | output: '@BASENAME@', | ||
69 | install_dir: sysconfdir + '/sway/security.d' | ||
70 | ) | ||
71 | else | ||
72 | configure_file( | ||
73 | configuration: config, | ||
74 | input: 'security.d/00-defaults.in', | ||
75 | output: '@BASENAME@', | ||
76 | install_dir: sysconfdir + '/sway/security.d' | ||
77 | ) | ||
78 | endif | ||
79 | |||
80 | install_data( | ||
81 | 'sway.desktop', | ||
82 | install_dir: datadir + '/wayland-sessions' | ||
83 | ) | ||
84 | |||
85 | if (get_option('default_wallpaper')) | ||
86 | wallpaper_files = files( | ||
87 | 'assets/Sway_Wallpaper_Blue_768x1024.png', | ||
88 | 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png', | ||
89 | 'assets/Sway_Wallpaper_Blue_1136x640.png', | ||
90 | 'assets/Sway_Wallpaper_Blue_1136x640_Portrait.png', | ||
91 | 'assets/Sway_Wallpaper_Blue_1366x768.png', | ||
92 | 'assets/Sway_Wallpaper_Blue_1920x1080.png', | ||
93 | 'assets/Sway_Wallpaper_Blue_2048x1536.png', | ||
94 | 'assets/Sway_Wallpaper_Blue_2048x1536_Portrait.png', | ||
95 | ) | ||
96 | wallpaper_install_dir = datadir + '/backgrounds/sway' | ||
97 | |||
98 | install_data(wallpaper_files, install_dir: wallpaper_install_dir) | ||
99 | endif | ||
diff --git a/meson_options.txt b/meson_options.txt index 5015a986..03bc1986 100644 --- a/meson_options.txt +++ b/meson_options.txt | |||
@@ -1 +1,2 @@ | |||
1 | option('sway_version', type : 'string', description : 'The version string reported in `sway --version`.') | 1 | option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.') |
2 | option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') | ||
diff --git a/security.d/00-defaults.in b/security.d/00-defaults.in index 05098dea..e4626477 100644 --- a/security.d/00-defaults.in +++ b/security.d/00-defaults.in | |||
@@ -6,17 +6,17 @@ | |||
6 | # installation. | 6 | # installation. |
7 | # | 7 | # |
8 | # DO NOT CHANGE THIS FILE. Override these defaults by writing new files in | 8 | # DO NOT CHANGE THIS FILE. Override these defaults by writing new files in |
9 | # __SYSCONFDIR__/sway/security.d/* | 9 | # @sysconfdir@/sway/security.d/* |
10 | 10 | ||
11 | # Configures enabled compositor features for specific programs | 11 | # Configures enabled compositor features for specific programs |
12 | permit * fullscreen keyboard mouse | 12 | permit * fullscreen keyboard mouse |
13 | permit __PREFIX__/bin/swaylock lock | 13 | permit @prefix@/bin/swaylock lock |
14 | permit __PREFIX__/bin/swaybg background | 14 | permit @prefix@/bin/swaybg background |
15 | permit __PREFIX__/bin/swaygrab screenshot | 15 | permit @prefix@/bin/swaygrab screenshot |
16 | permit __PREFIX__/bin/swaybar panel | 16 | permit @prefix@/bin/swaybar panel |
17 | 17 | ||
18 | # Configures enabled IPC features for specific programs | 18 | # Configures enabled IPC features for specific programs |
19 | ipc __PREFIX__/bin/swaymsg { | 19 | ipc @prefix@/bin/swaymsg { |
20 | * enabled | 20 | * enabled |
21 | 21 | ||
22 | events { | 22 | events { |
@@ -24,7 +24,7 @@ ipc __PREFIX__/bin/swaymsg { | |||
24 | } | 24 | } |
25 | } | 25 | } |
26 | 26 | ||
27 | ipc __PREFIX__/bin/swaybar { | 27 | ipc @prefix@/bin/swaybar { |
28 | bar-config enabled | 28 | bar-config enabled |
29 | outputs enabled | 29 | outputs enabled |
30 | workspaces enabled | 30 | workspaces enabled |
@@ -36,12 +36,12 @@ ipc __PREFIX__/bin/swaybar { | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | ipc __PREFIX__/bin/swaygrab { | 39 | ipc @prefix@/bin/swaygrab { |
40 | outputs enabled | 40 | outputs enabled |
41 | tree enabled | 41 | tree enabled |
42 | } | 42 | } |
43 | 43 | ||
44 | ipc __PREFIX__/bin/swaylock { | 44 | ipc @prefix@/bin/swaylock { |
45 | outputs enabled | 45 | outputs enabled |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/sway/meson.build b/sway/meson.build index b02506c8..cf2aa913 100644 --- a/sway/meson.build +++ b/sway/meson.build | |||
@@ -26,5 +26,6 @@ executable( | |||
26 | sway_sources, | 26 | sway_sources, |
27 | include_directories: [sway_inc], | 27 | include_directories: [sway_inc], |
28 | dependencies: sway_deps, | 28 | dependencies: sway_deps, |
29 | link_with: [lib_sway_common] | 29 | link_with: [lib_sway_common], |
30 | install: true | ||
30 | ) | 31 | ) |