chore: add startup applications command and desktop entry

This commit is contained in:
Vukašin Vojinović 2025-09-13 15:53:09 +02:00 committed by Michael Murphy
parent 0d555db0dd
commit ee34b79359
6 changed files with 26 additions and 7 deletions

View file

@ -120,6 +120,7 @@ impl SettingsApp {
PageCommands::RegionLanguage => self.pages.page_id::<time::region::Page>(),
#[cfg(feature = "page-sound")]
PageCommands::Sound => self.pages.page_id::<sound::Page>(),
PageCommands::StartupApps => self.pages.page_id::<applications::startup_apps::Page>(),
PageCommands::System => self.pages.page_id::<system::Page>(),
PageCommands::Time => self.pages.page_id::<time::Page>(),
#[cfg(feature = "page-input")]
@ -548,6 +549,12 @@ impl cosmic::Application for SettingsApp {
}
}
crate::pages::Message::StartupApps(message) => {
if let Some(page) = self.pages.page_mut::<applications::startup_apps::Page>() {
return page.update(message).map(Into::into);
}
}
#[cfg(feature = "page-users")]
crate::pages::Message::User(message) => {
if let Some(page) = self.pages.page_mut::<system::users::Page>() {
@ -638,12 +645,6 @@ impl cosmic::Application for SettingsApp {
return page.update(message).map(Into::into);
}
}
crate::pages::Message::StartupApps(message) => {
if let Some(page) = self.pages.page_mut::<applications::startup_apps::Page>() {
return page.update(message).map(Into::into);
}
}
},
#[cfg(feature = "wayland")]

View file

@ -103,6 +103,8 @@ pub enum PageCommands {
/// Sound settings page
#[cfg(feature = "page-sound")]
Sound,
/// Startup applications settings page
StartupApps,
/// System & Accounts settings page
System,
/// Time & Language settings page

View file

@ -99,7 +99,7 @@ impl page::AutoBind<crate::pages::Message> for Page {}
impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> Info {
page::Info::new("startup-apps", "system-reboot-symbolic")
page::Info::new("startup-apps", "preferences-startup-applications-symbolic")
.title(fl!("startup-apps"))
.description(fl!("startup-apps", "desc"))
}

1
debian/install vendored
View file

@ -21,6 +21,7 @@
/usr/share/applications/com.system76.CosmicSettings.Power.desktop
/usr/share/applications/com.system76.CosmicSettings.RegionLanguage.desktop
/usr/share/applications/com.system76.CosmicSettings.Sound.desktop
/usr/share/applications/com.system76.CosmicSettings.StartupApps.desktop
/usr/share/applications/com.system76.CosmicSettings.System.desktop
/usr/share/applications/com.system76.CosmicSettings.Time.desktop
/usr/share/applications/com.system76.CosmicSettings.Touchpad.desktop

View file

@ -52,6 +52,7 @@ entry-panel := appid + '.Panel.desktop'
entry-power := appid + '.Power.desktop'
entry-region-language := appid + '.RegionLanguage.desktop'
entry-sound := appid + '.Sound.desktop'
entry-startup-apps := appid + '.StartupApps.desktop'
entry-system := appid + '.System.desktop'
entry-time := appid + '.Time.desktop'
entry-touchpad := appid + '.Touchpad.desktop'
@ -91,6 +92,7 @@ install-desktop-entries:
install -Dm0644 'resources/{{entry-power}}' '{{appdir}}/{{entry-power}}'
install -Dm0644 'resources/{{entry-region-language}}' '{{appdir}}/{{entry-region-language}}'
install -Dm0644 'resources/{{entry-sound}}' '{{appdir}}/{{entry-sound}}'
install -Dm0644 'resources/{{entry-startup-apps}}' '{{appdir}}/{{entry-startup-apps}}'
install -Dm0644 'resources/{{entry-system}}' '{{appdir}}/{{entry-system}}'
install -Dm0644 'resources/{{entry-time}}' '{{appdir}}/{{entry-time}}'
install -Dm0644 'resources/{{entry-touchpad}}' '{{appdir}}/{{entry-touchpad}}'
@ -144,6 +146,7 @@ uninstall:
'{{appdir}}/{{entry-power}}' \
'{{appdir}}/{{entry-region-language}}' \
'{{appdir}}/{{entry-sound}}' \
'{{appdir}}/{{entry-startup-apps}}' \
'{{appdir}}/{{entry-system}}' \
'{{appdir}}/{{entry-time}}' \
'{{appdir}}/{{entry-touchpad}}' \

View file

@ -0,0 +1,12 @@
[Desktop Entry]
Name=Startup applications
Comment=Configure applications which run on login.
Type=Settings
Exec=cosmic-settings startup-apps
Terminal=false
Categories=COSMIC
Keywords=COSMIC
NoDisplay=true
OnlyShowIn=COSMIC
Icon=preferences-startup-applications
StartupNotify=true