diff --git a/kometa-xdg.spec b/kometa-xdg.spec index 2698fc1..1cd89cd 100644 --- a/kometa-xdg.spec +++ b/kometa-xdg.spec @@ -3,7 +3,7 @@ Summary: XDG desktop settings for Kometa distros Summary(ru): Настройки рабочего окружения дистрибутивов Комета License: GPL-3.0 Group: Graphical desktop/Other -Version: 1.3 +Version: 1.4 Release: alt1 Source0: kometa-xdg-%version.tar Source1: COPYING @@ -18,19 +18,26 @@ XDG desktop settings for Kometa distros #-------------------------------------------------------------- %package core -Summary: DE-agnostic desktop settings for Kometa distros -Summary(ru): DE-независимые настройки рабочих окружений дистрибутивов Комета +Summary: Engine to set distribution-specific desktop settings +Summary(ru): Движок установки дистрибутиво-специфичных настроек рабочего стола Group: Graphical desktop/Other Requires: sed %description core -DE-agnostic desktop settings for Kometa distros +Engine to set distribution-specific desktop settings. +Sets environmental variables $XDG_CONFIG_DIRS and $XDG_DATA_DIRS, +adding /etc/xdg/kometa and /usr/share/kometa into them. +Can be used separately from Kometa. %description -l ru_RU.UTF-8 core -DE-независимые настройки рабочих окружений дистрибутивов Комета +Движок установки дистрибутиво-специфичных настроек рабочего стола. +Устонавливает переменные окружения $XDG_CONFIG_DIRS и $XDG_DATA_DIRS, +добавляя в них /etc/xdg/kometa и /usr/share/kometa. +Может быть использован вне кометы. %files core %doc COPYING %dir /etc/xdg/kometa +%dir /usr/share/kometa %_bindir/kometa-xdg-env %_user_env_gen_dir/10-kometa-xdg.sh /etc/profile.d/10-kometa-xdg.sh @@ -57,6 +64,9 @@ KDE 5 desktop settings for classic variant of Kometa /etc/xdg/kometa/kcminputrc /etc/xdg/kometa/kdeglobals /etc/xdg/kometa/kxkbrc +%dir /usr/share/kometa/kxmlgui5 +%dir /usr/share/kometa/kxmlgui5/dolphin +/usr/share/kometa/kxmlgui5/dolphin/dolphinui.rc #-------------------------------------------------------------- @@ -152,7 +162,9 @@ install -m0755 scripts/profile.sh %buildroot/etc/profile.d/10-kometa-xdg.sh install -m0755 scripts/systemd.sh %buildroot%_user_env_gen_dir/10-kometa-xdg.sh mkdir -p %buildroot/etc/xdg/kometa -install -m0644 plasma5/* %buildroot/etc/xdg/kometa +cp -rv plasma5/XDG_CONFIG_DIRS/* %buildroot/etc/xdg/kometa +mkdir -p %buildroot/usr/share/kometa +cp -rv plasma5/XDG_DATA_DIRS/* %buildroot/usr/share/kometa mkdir -p %buildroot%_datadir echo QT_QPA_PLATFORMTHEME=gtk3 > %buildroot/%_datadir/kometa-pam-env @@ -162,6 +174,10 @@ cd scripts ./test.sh %changelog +* Fri Dec 24 2021 Mikhail Novosyolov 1.4-alt1 +- Add setting $XDG_DATA_DIRS, enable "Show Previews" button in Dolphin +- Tune description: note that kometa-xdg-core can be used just to set env outside of Kometa + * Thu Dec 16 2021 Mikhail Novosyolov 1.3-alt1 - Turn off NumLock by default in KDE 5 diff --git a/plasma5/dolphinrc b/plasma5/XDG_CONFIG_DIRS/dolphinrc similarity index 100% rename from plasma5/dolphinrc rename to plasma5/XDG_CONFIG_DIRS/dolphinrc diff --git a/plasma5/kcminputrc b/plasma5/XDG_CONFIG_DIRS/kcminputrc similarity index 100% rename from plasma5/kcminputrc rename to plasma5/XDG_CONFIG_DIRS/kcminputrc diff --git a/plasma5/kdeglobals b/plasma5/XDG_CONFIG_DIRS/kdeglobals similarity index 100% rename from plasma5/kdeglobals rename to plasma5/XDG_CONFIG_DIRS/kdeglobals diff --git a/plasma5/kxkbrc b/plasma5/XDG_CONFIG_DIRS/kxkbrc similarity index 100% rename from plasma5/kxkbrc rename to plasma5/XDG_CONFIG_DIRS/kxkbrc diff --git a/plasma5/XDG_DATA_DIRS/kxmlgui5/dolphin/dolphinui.rc b/plasma5/XDG_DATA_DIRS/kxmlgui5/dolphin/dolphinui.rc new file mode 100644 index 0000000..c6682c6 --- /dev/null +++ b/plasma5/XDG_DATA_DIRS/kxmlgui5/dolphin/dolphinui.rc @@ -0,0 +1,203 @@ + + + + + &File + + + + + + + + + + + + + + + + + + + + + + + + + &Edit + + + + + + + + + + + + + + + + + + + + + + + + + + + &View + + + + + + + + + + + + + + + + + + + + + + + + Location Bar + + + + + + + + &Go + + + + + + + + + + &Tools + + + + + + + + &Settings + + + + + + + + + + + + &Help + + + + + + + + + + + + + Main Toolbar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/kometa-xdg-env b/scripts/kometa-xdg-env index 25a6e18..76de56b 100755 --- a/scripts/kometa-xdg-env +++ b/scripts/kometa-xdg-env @@ -1,7 +1,8 @@ #!/bin/sh KOMETA_XDG_TESTING="${KOMETA_XDG_TESTING:-0}" KOMETA_XDG_TYPE="${KOMETA_XDG_TYPE:-}" -KOMETA_XDG_DIR=/etc/xdg/kometa +KOMETA_XDG_CONFIG_DIR=/etc/xdg/kometa +KOMETA_XDG_DATA_DIR=/usr/share/kometa XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-}" _check_runability(){ @@ -26,44 +27,51 @@ _check_runability(){ # * is not a mess and is a valid value # * does not have repeated directories (if it has, we will probably still be OK) # $1: current value of $XDG_CONFIG_DIRS -_mk_xdg_config_dirs(){ +_mk_xdg_dirs(){ local tmp + # current value tmp="$1" + # /etc/xdg, /usr/share + root1="$2" + # /etc/kf5/xdg, /usr/share/kf5 + root2="$3" + # /etc/xdg/kometa, /usr/share/kometa + add="$4" case "$tmp" in "" ) # https://bugzilla.altlinux.org/show_bug.cgi?id=41566 - tmp=/etc/kf5/xdg:/etc/xdg + tmp="$root2":"$root1" ;; - :/etc/xdg ) + :"$root1" ) # not a valid value! - tmp=/etc/xdg + tmp="$root1" ;; - /etc/xdg ) + "$root1" ) : ;; - */etc/xdg ) + *"$root1" ) : ;; * ) - # not a valid values - does not end with /etc/xdg - tmp="$tmp:/etc/xdg" + # not a valid values - does not end with /etc/xdg or /usr/share + tmp="$tmp":"$root1" ;; esac case "$tmp" in - *:/etc/xdg/kometa:* | /etc/xdg/kometa:* ) + *:"$root1"/kometa:* | "$root1"/kometa:* ) : ;; - *:/etc/kf5/xdg:* ) - tmp="$(echo "$tmp" | sed -e "s,:/etc/kf5/xdg:,:$KOMETA_XDG_DIR:/etc/kf5/xdg:,")" + *:"$root2":* ) + tmp="$(echo "$tmp" | sed -e "s,:${root2}:,:${add}:${root2}:,")" ;; - /etc/kf5/xdg:* ) - tmp="$(echo "$tmp" | sed -e "s,^/etc/kf5/xdg:,$KOMETA_XDG_DIR:/etc/kf5/xdg:,")" + "$root2":* ) + tmp="$(echo "$tmp" | sed -e "s,^${root2}:,${add}:${root2}:,")" ;; - *:/etc/xdg ) - tmp="$(echo "$tmp" | sed -e "s,:/etc/xdg,:$KOMETA_XDG_DIR:/etc/xdg,")" + *:"$root1" ) + tmp="$(echo "$tmp" | sed -e "s,:${root1},:${add}:${root1},")" ;; - /etc/xdg ) - tmp="$(echo "$tmp" | sed -e "s,^/etc/xdg,$KOMETA_XDG_DIR:/etc/xdg,")" + "$root1" ) + tmp="$(echo "$tmp" | sed -e "s,^${root1},${add}:${root1},")" ;; esac echo "$tmp" @@ -73,13 +81,17 @@ _main(){ _check_runability "$1" # $XDG_DATA_DIRS may be added local result_xdg_config_dirs - result_xdg_config_dirs="$(_mk_xdg_config_dirs "$XDG_CONFIG_DIRS")" + result_xdg_config_dirs="$(_mk_xdg_dirs "$XDG_CONFIG_DIRS" /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" + local result_xdg_data_dirs + result_xdg_data_dirs="$(_mk_xdg_dirs "$XDG_DATA_DIRS" /usr/share /usr/share/kf5 "$KOMETA_XDG_DATA_DIR")" case "$1" in systemd ) echo XDG_CONFIG_DIRS="$result_xdg_config_dirs" + echo XDG_DATA_DIRS="$result_xdg_data_dirs" ;; profile ) export XDG_CONFIG_DIRS="$result_xdg_config_dirs" + export XDG_DATA_DIRS="$result_xdg_data_dirs" ;; esac } diff --git a/scripts/test.sh b/scripts/test.sh index 524da12..1c8f223 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,13 +3,19 @@ set -x set -e trap 'if [ $? != 0 ]; then echo "ERROR!!!"; fi' EXIT KOMETA_XDG_TESTING=1 -KOMETA_XDG_DIR=/etc/xdg/kometa +KOMETA_XDG_CONFIG_DIR=/etc/xdg/kometa +KOMETA_XDG_DATA_DIR=/usr/share/kometa export PATH="$PWD:$PATH" . ./kometa-xdg-env -[ "$(_mk_xdg_config_dirs /etc/xdg)" = $KOMETA_XDG_DIR:/etc/xdg ] -[ "$(_mk_xdg_config_dirs /etc/foo)" = /etc/foo:$KOMETA_XDG_DIR:/etc/xdg ] -[ "$(_mk_xdg_config_dirs /etc/foo:/etc/xdg)" = /etc/foo:$KOMETA_XDG_DIR:/etc/xdg ] -[ "$(_mk_xdg_config_dirs /etc/foo:$KOMETA_XDG_DIR:/etc/kf5/xdg:/etc/xdg)" = /etc/foo:$KOMETA_XDG_DIR:/etc/kf5/xdg:/etc/xdg ] -[ "$(_mk_xdg_config_dirs /home/user/.config/kdedefaults:/etc/kf5/xdg:/etc/xdg)" = /home/user/.config/kdedefaults:$KOMETA_XDG_DIR:/etc/kf5/xdg:/etc/xdg ] + +# $XDG_CONFIG_DIRS +[ "$(_mk_xdg_dirs /etc/xdg /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = $KOMETA_XDG_CONFIG_DIR:/etc/xdg ] +[ "$(_mk_xdg_dirs /etc/foo /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = /etc/foo:$KOMETA_XDG_CONFIG_DIR:/etc/xdg ] +[ "$(_mk_xdg_dirs /etc/foo:/etc/xdg /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = /etc/foo:$KOMETA_XDG_CONFIG_DIR:/etc/xdg ] +[ "$(_mk_xdg_dirs /etc/foo:$KOMETA_XDG_CONFIG_DIR:/etc/kf5/xdg:/etc/xdg /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = /etc/foo:$KOMETA_XDG_CONFIG_DIR:/etc/kf5/xdg:/etc/xdg ] +[ "$(_mk_xdg_dirs /home/user/.config/kdedefaults:/etc/kf5/xdg:/etc/xdg /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = /home/user/.config/kdedefaults:$KOMETA_XDG_CONFIG_DIR:/etc/kf5/xdg:/etc/xdg ] # https://bugzilla.altlinux.org/show_bug.cgi?id=41566 -[ "$(_mk_xdg_config_dirs "")" = $KOMETA_XDG_DIR:/etc/kf5/xdg:/etc/xdg ] +[ "$(_mk_xdg_dirs "" /etc/xdg /etc/kf5/xdg "$KOMETA_XDG_CONFIG_DIR")" = $KOMETA_XDG_CONFIG_DIR:/etc/kf5/xdg:/etc/xdg ] + +# $XDG_DATA_DIRS +[ "$(_mk_xdg_dirs /usr/share /usr/share /usr/share/kf5 "$KOMETA_XDG_DATA_DIR")" = $KOMETA_XDG_DATA_DIR:/usr/share ]