Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add session conf #832

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
option('supported_languages', type : 'string', value : 'aa;ab;ae;af;ak;am;an;ar;as;ast;av;ay;az;ba;be;bg;bh;bi;bm;bn;bo;br;bs;ca;ce;ch;ckb;co;cr;cs;cu;cv;cy;da;de;de_CH;de_DE;dv;dz;ee;el;en;en_US;en_AU;en_CA;en_GB;eo;es;et;eu;fa;ff;fi;fj;fo;fr;fr_BE;fr_CA;fr_FR;fy;ga;gd;gl;gn;gu;gv;ha;he;hi;ho;hr;ht;hu;hy;hz;ia;id;ie;ig;ii;ik;io;is;it;iu;ja;jv;ka;kab;kg;ki;kj;kk;kl;km;kn;ko;kr;ks;ku;kv;kw;ky;la;lb;lg;li;ln;lo;lt;lu;lv;mg;mh;mi;mk;ml;mn;mo;mr;ms;mt;my;na;nb;nd;ne;ng;nl;nn;nr;nv;ny;oc;oj;om;or;os;pa;pi;pl;ps;pt;pt_PT;pt_BR;qu;rm;rn;ro;ru;rue;rw;sa;sc;sd;se;sg;si;sk;sl;sm;sma;sn;so;sq;sr;ss;st;su;sv;sw;szl;ta;te;tg;th;ti;tk;tl;tn;to;tr;ts;tt;tw;ty;udm;ug;uk;ur;uz;ve;vi;vo;wa;wo;xh;yi;yo;za;zh;zh_CN;zh_HK;zh_TW;zu', description : 'The list of supported languages')
option('preferred_languages', type : 'string', value : 'en;zh;es;fr;pt;ru;de', description : 'A prioritized list of languages')
option('installer_backend', type : 'combo', choices : ['distinst'], value : 'distinst')

option('systemduserunitdir', type: 'string', value: '', description : 'Custom directory for systemd user units')
36 changes: 36 additions & 0 deletions session/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
autostartdir = get_option('sysconfdir') / 'xdg' / 'autostart'
schemadir = get_option('datadir') / 'glib-2.0' / 'schemas'

gsd_components = [
'org.gnome.SettingsDaemon.MediaKeys',
'org.gnome.SettingsDaemon.Power',
'org.gnome.SettingsDaemon.XSettings',
]

install_data(
'autostart.desktop',
install_dir: autostartdir,
Expand Down Expand Up @@ -33,3 +39,33 @@ install_subdir(
install_dir: autostartdir,
strip_directory: true
)

systemd_userunitdir = get_option('systemduserunitdir')
if systemd_userunitdir == ''
systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', define_variable: ['prefix', get_option('prefix')])
endif

desktop_plain = 'installer'

shell_component = {
desktop_plain: 'io.elementary.installer.compositor',
}

required_components = {
desktop_plain: gsd_components,
}

gnome_session_wanted_targets = []
foreach component: required_components[desktop_plain]
gnome_session_wanted_targets += 'Wants=@[email protected]'.format(component)
endforeach

session_config = configure_file(
input: 'session.conf.in',
output: 'session.conf',
configuration: {
'requires_component': shell_component[desktop_plain],
'wants_required_components': '\n'.join(gnome_session_wanted_targets),
},
install_dir: systemd_userunitdir / '[email protected]',
)
4 changes: 4 additions & 0 deletions session/session.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Unit]
@wants_required_components@

Requires=@[email protected]
Loading