Skip to content

Commit ee34b79

Browse files
git-f0xmmstick
authored andcommitted
chore: add startup applications command and desktop entry
1 parent 0d555db commit ee34b79

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

cosmic-settings/src/app.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ impl SettingsApp {
120120
PageCommands::RegionLanguage => self.pages.page_id::<time::region::Page>(),
121121
#[cfg(feature = "page-sound")]
122122
PageCommands::Sound => self.pages.page_id::<sound::Page>(),
123+
PageCommands::StartupApps => self.pages.page_id::<applications::startup_apps::Page>(),
123124
PageCommands::System => self.pages.page_id::<system::Page>(),
124125
PageCommands::Time => self.pages.page_id::<time::Page>(),
125126
#[cfg(feature = "page-input")]
@@ -548,6 +549,12 @@ impl cosmic::Application for SettingsApp {
548549
}
549550
}
550551

552+
crate::pages::Message::StartupApps(message) => {
553+
if let Some(page) = self.pages.page_mut::<applications::startup_apps::Page>() {
554+
return page.update(message).map(Into::into);
555+
}
556+
}
557+
551558
#[cfg(feature = "page-users")]
552559
crate::pages::Message::User(message) => {
553560
if let Some(page) = self.pages.page_mut::<system::users::Page>() {
@@ -638,12 +645,6 @@ impl cosmic::Application for SettingsApp {
638645
return page.update(message).map(Into::into);
639646
}
640647
}
641-
642-
crate::pages::Message::StartupApps(message) => {
643-
if let Some(page) = self.pages.page_mut::<applications::startup_apps::Page>() {
644-
return page.update(message).map(Into::into);
645-
}
646-
}
647648
},
648649

649650
#[cfg(feature = "wayland")]

cosmic-settings/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ pub enum PageCommands {
103103
/// Sound settings page
104104
#[cfg(feature = "page-sound")]
105105
Sound,
106+
/// Startup applications settings page
107+
StartupApps,
106108
/// System & Accounts settings page
107109
System,
108110
/// Time & Language settings page

cosmic-settings/src/pages/applications/startup_apps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl page::AutoBind<crate::pages::Message> for Page {}
9999

100100
impl page::Page<crate::pages::Message> for Page {
101101
fn info(&self) -> Info {
102-
page::Info::new("startup-apps", "system-reboot-symbolic")
102+
page::Info::new("startup-apps", "preferences-startup-applications-symbolic")
103103
.title(fl!("startup-apps"))
104104
.description(fl!("startup-apps", "desc"))
105105
}

debian/install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/usr/share/applications/com.system76.CosmicSettings.Power.desktop
2222
/usr/share/applications/com.system76.CosmicSettings.RegionLanguage.desktop
2323
/usr/share/applications/com.system76.CosmicSettings.Sound.desktop
24+
/usr/share/applications/com.system76.CosmicSettings.StartupApps.desktop
2425
/usr/share/applications/com.system76.CosmicSettings.System.desktop
2526
/usr/share/applications/com.system76.CosmicSettings.Time.desktop
2627
/usr/share/applications/com.system76.CosmicSettings.Touchpad.desktop

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ entry-panel := appid + '.Panel.desktop'
5252
entry-power := appid + '.Power.desktop'
5353
entry-region-language := appid + '.RegionLanguage.desktop'
5454
entry-sound := appid + '.Sound.desktop'
55+
entry-startup-apps := appid + '.StartupApps.desktop'
5556
entry-system := appid + '.System.desktop'
5657
entry-time := appid + '.Time.desktop'
5758
entry-touchpad := appid + '.Touchpad.desktop'
@@ -91,6 +92,7 @@ install-desktop-entries:
9192
install -Dm0644 'resources/{{entry-power}}' '{{appdir}}/{{entry-power}}'
9293
install -Dm0644 'resources/{{entry-region-language}}' '{{appdir}}/{{entry-region-language}}'
9394
install -Dm0644 'resources/{{entry-sound}}' '{{appdir}}/{{entry-sound}}'
95+
install -Dm0644 'resources/{{entry-startup-apps}}' '{{appdir}}/{{entry-startup-apps}}'
9496
install -Dm0644 'resources/{{entry-system}}' '{{appdir}}/{{entry-system}}'
9597
install -Dm0644 'resources/{{entry-time}}' '{{appdir}}/{{entry-time}}'
9698
install -Dm0644 'resources/{{entry-touchpad}}' '{{appdir}}/{{entry-touchpad}}'
@@ -144,6 +146,7 @@ uninstall:
144146
'{{appdir}}/{{entry-power}}' \
145147
'{{appdir}}/{{entry-region-language}}' \
146148
'{{appdir}}/{{entry-sound}}' \
149+
'{{appdir}}/{{entry-startup-apps}}' \
147150
'{{appdir}}/{{entry-system}}' \
148151
'{{appdir}}/{{entry-time}}' \
149152
'{{appdir}}/{{entry-touchpad}}' \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Desktop Entry]
2+
Name=Startup applications
3+
Comment=Configure applications which run on login.
4+
Type=Settings
5+
Exec=cosmic-settings startup-apps
6+
Terminal=false
7+
Categories=COSMIC
8+
Keywords=COSMIC
9+
NoDisplay=true
10+
OnlyShowIn=COSMIC
11+
Icon=preferences-startup-applications
12+
StartupNotify=true

0 commit comments

Comments
 (0)