Skip to content

Commit

Permalink
feat(package): add instruction dconf.ini to configure gnome desktop apps
Browse files Browse the repository at this point in the history
  • Loading branch information
yunielrc committed Sep 18, 2023
1 parent 8ee935a commit f671b8a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/usr/lib/ydf/components/package/ydf-package-service.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi
# readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_MANJARO="preinstall pacman yay install postinstall ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}"
# readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_UBUNTU="preinstall apt install postinstall ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}"
# shellcheck disable=SC2016
readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON='install @flatpak @snap docker_compose:docker-compose.yml plugin_zsh:${pkg_name}.plugin.zsh homeln/ homelnr/ homecp/ rootcp/ homecat/ rootcat/ homecps/ rootcps/ postinstall'
readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON='install @flatpak @snap docker_compose:docker-compose.yml plugin_zsh:${pkg_name}.plugin.zsh homeln/ homelnr/ homecp/ rootcp/ homecat/ rootcat/ homecps/ rootcps/ dconf_ini:dconf.ini/ postinstall'

readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_MANJARO="preinstall @pacman @yay ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}"
# readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_UBUNTU="preinstall install postinstall ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}"
Expand Down Expand Up @@ -410,6 +410,19 @@ ydf::package_service::__instruction_rootcps() {
"$1" rootcps
}

#
# Execute dconf_ini instruction
#
# Arguments:
# pkg_name string package name
#
# Returns:
# 0 on success, non-zero on error.
#
ydf::package_service::__instruction_dconf_ini() {
dconf load / <dconf.ini
}

#
# Install a ydotfile package from a directory
#
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/packages/19dconf/dconf.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Settings > Mouse
[org/gnome/desktop/peripherals/mouse]
speed=0.5
15 changes: 15 additions & 0 deletions tests/usr/lib/ydf/components/package/ydf-package-command.f.bats
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,18 @@ line 11'
.* root root .* /.my/dir1/file11
.* root root .* /.my/file1"
}

# Tests for ydf package install ./19dconf
@test "ydf package install ./19dconf Should succeed" {
local -r _package_dir="${TEST_FIXTURES_DIR}/packages/19dconf"

run ydf package install "$_package_dir"

assert_success
assert_output ""

# run dconf dump /org/gnome/desktop/peripherals/mouse/

# assert_success
# assert_output ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -816,3 +816,8 @@ line 11'
@test "ydf::package_service::__instruction_rootcps() DUMMY" {
:
}

# Tests for ydf::package_service::__instruction_dconf_ini()
@test "ydf::package_service::__instruction_dconf_ini() DUMMY" {
:
}

0 comments on commit f671b8a

Please sign in to comment.