Add startup application picker
This commit is contained in:
@@ -29,6 +29,7 @@ assert_service_contains 'property string lastError'
|
||||
assert_service_contains 'function refresh(): void'
|
||||
assert_service_contains 'function setDefault(role: string, desktopId: string): void'
|
||||
assert_service_contains 'function setAutostart(desktopId: string, enabled: bool): void'
|
||||
assert_service_contains 'function addAutostart(desktopId: string): void'
|
||||
assert_service_contains 'DesktopEntries.applications.values'
|
||||
if rg --quiet 'command\s*:\s*"' "$service"; then
|
||||
fail 'Process command must be an argument array'
|
||||
@@ -227,4 +228,27 @@ if $helper set-autostart 'hyprland:1' false >/dev/null 2>&1; then
|
||||
fail 'read-only compositor entry was accepted for mutation'
|
||||
fi
|
||||
|
||||
$helper add-autostart org.mozilla.firefox.desktop
|
||||
firefox_autostart="$config_home/autostart/org.mozilla.firefox.desktop"
|
||||
[[ -f "$firefox_autostart" && ! -L "$firefox_autostart" ]] \
|
||||
|| fail 'adding an installed application did not create a regular user autostart entry'
|
||||
rg --quiet '^Name=Firefox$' "$firefox_autostart" \
|
||||
|| fail 'adding an application did not preserve its desktop entry'
|
||||
rg --quiet '^Hidden=false$' "$firefox_autostart" \
|
||||
|| fail 'a newly added application was not enabled'
|
||||
[[ "$(rg --count '^Hidden=' "$firefox_autostart")" == "1" ]] \
|
||||
|| fail 'adding an application wrote more than one Hidden key'
|
||||
|
||||
$helper set-autostart org.mozilla.firefox.desktop false
|
||||
$helper add-autostart org.mozilla.firefox.desktop
|
||||
rg --quiet '^Hidden=false$' "$firefox_autostart" \
|
||||
|| fail 'adding an existing disabled application did not re-enable it'
|
||||
|
||||
if $helper add-autostart org.example.Missing.desktop >/dev/null 2>&1; then
|
||||
fail 'an undiscovered application was accepted for autostart'
|
||||
fi
|
||||
if $helper add-autostart ../escape.desktop >/dev/null 2>&1; then
|
||||
fail 'an unsafe desktop id was accepted for autostart'
|
||||
fi
|
||||
|
||||
printf 'default apps contract: PASS\n'
|
||||
|
||||
Reference in New Issue
Block a user