From a7b5b331f12803b9f1725d306a3b8fa23ea37925 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Mon, 30 Dec 2024 09:33:29 -0300 Subject: [PATCH] feat: add sbkey-notify script and autostart file --- ublue/setup-services/src/bin/sb-key-notify | 9 +++++++++ .../src/skel/.config/autostart/sb-key-notify.desktop | 10 ++++++++++ ublue/setup-services/ublue-setup-services.spec | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 ublue/setup-services/src/bin/sb-key-notify create mode 100644 ublue/setup-services/src/skel/.config/autostart/sb-key-notify.desktop diff --git a/ublue/setup-services/src/bin/sb-key-notify b/ublue/setup-services/src/bin/sb-key-notify new file mode 100755 index 0000000..dfe69bc --- /dev/null +++ b/ublue/setup-services/src/bin/sb-key-notify @@ -0,0 +1,9 @@ +KEY_WARN_FILE="/run/user-motd-sbkey-warn.md" + +if [ -e $KEY_WARN_FILE ]; then + WARNING_MSG=$(cat "$KEY_WARN_FILE") + + notify-send "WARNING" "$(echo "$WARNING_MSG" | tr -d '*~')" -i dialog-warning -u critical -a mokutil --wait +else + echo "No secure boot key warning file. Skipping..." +fi \ No newline at end of file diff --git a/ublue/setup-services/src/skel/.config/autostart/sb-key-notify.desktop b/ublue/setup-services/src/skel/.config/autostart/sb-key-notify.desktop new file mode 100644 index 0000000..0d93775 --- /dev/null +++ b/ublue/setup-services/src/skel/.config/autostart/sb-key-notify.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Secure boot Notify +Comment=Autostart secure boot key notification +Exec=/usr/bin/sb-key-notify +Icon=org.gnome.Terminal +Type=Application +Categories=Utility;System; +Name[en_US]=secure-boot-notify + + diff --git a/ublue/setup-services/ublue-setup-services.spec b/ublue/setup-services/ublue-setup-services.spec index b178ea3..effeb18 100644 --- a/ublue/setup-services/ublue-setup-services.spec +++ b/ublue/setup-services/ublue-setup-services.spec @@ -17,12 +17,14 @@ Universal Blue setup scripts {{{ git_dir_setup_macro }}} %install -mkdir -p %{buildroot}{%{_libexecdir},%{_unitdir},%{_sysconfdir}/{polkit-1/{rules.d,actions},profile.d}} +mkdir -p %{buildroot}{%{_bindir},%{_libexecdir},%{_unitdir},%{_sysconfdir}/{polkit-1/{rules.d,actions},profile.d}} install -Dm0755 ./src/scripts/* %{buildroot}%{_libexecdir} +install -Dm0755 ./src/bin/* %{buildroot}%{_bindir} install -Dpm0644 ./src/services/* %{buildroot}%{_unitdir} install -Dpm0644 ./src/polkit/*.rules %{buildroot}%{_sysconfdir}/polkit-1/rules.d install -Dpm0644 ./src/polkit/*.policy %{buildroot}%{_sysconfdir}/polkit-1/actions install -Dpm0755 ./src/profile/* %{buildroot}%{_sysconfdir}/profile.d +cp -rp ./src/skel %{buildroot}%{_sysconfdir} %post %systemd_post ublue-user-setup.service @@ -33,11 +35,13 @@ install -Dpm0755 ./src/profile/* %{buildroot}%{_sysconfdir}/profile.d %systemd_preun ublue-system-setup.service %files +%{_bindir}/sb* %{_libexecdir}/ublue-* %{_libexecdir}/check-* %{_sysconfdir}/polkit-1/rules.d/* %{_sysconfdir}/polkit-1/actions/* %{_sysconfdir}/profile.d/* +%{_sysconfdir}/skel/.config/autostart/* %{_unitdir}/*.service %changelog