summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorNicolas Lécureuil <neoclust@mageia.org>2015-10-24 00:19:48 +0200
committerNicolas Lécureuil <neoclust@mageia.org>2015-10-24 00:19:48 +0200
commit2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984 (patch)
treeceaaf35b4dbeba9c0ba09d5168c7572a07220327 /etc
parent70d9f42dd6d7170e004e07362afc0a8948770199 (diff)
downloadconfig-2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984.tar
config-2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984.tar.gz
config-2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984.tar.bz2
config-2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984.tar.xz
config-2e5f3c981eabd0bc8bc9f91e1e0c9fc619242984.zip
Add first setup
copied from KDE4 ( minus clean cache parts )
Diffstat (limited to 'etc')
-rw-r--r--etc/xdg/plasma-workspace/env/plasma5-firstsetup.sh116
1 files changed, 116 insertions, 0 deletions
diff --git a/etc/xdg/plasma-workspace/env/plasma5-firstsetup.sh b/etc/xdg/plasma-workspace/env/plasma5-firstsetup.sh
new file mode 100644
index 0000000..413df55
--- /dev/null
+++ b/etc/xdg/plasma-workspace/env/plasma5-firstsetup.sh
@@ -0,0 +1,116 @@
+#!/bin/bash
+
+#
+# TODO: Factorize for Mageia 2
+#
+
+KRCFG="$(which kreadconfig)"
+
+if [ ! -z "$KRCFG" ]; then # Check if kde is installed, otherwise do nothing
+
+ # "Desktop" Mageia icons"
+ MGADESK=$(kreadconfig --group "Mageia" --key "MageiaDesktopFiles" --default "false")
+
+ if [ ! "$MGADESK" = "true" ]; then
+ # TODO: We need to handle default => Default too
+ PROD=$(sed 's/.*product=\(.*\)/\L\1/' < /etc/product.id)
+ # We should handle i18n dir modes in xgd user dirs
+ DIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_DESKTOP_DIR)" )
+ if [ -z "${DIR}" ]; then
+ DIR="$HOME/Desktop"
+ fi
+
+ if [ ! -d "${DIR}" ]; then
+ mkdir -p "${DIR}"
+ fi
+
+ if [ -n "$PROD" -a -d "/usr/share/dist/desktop-files/${PROD}" ]; then
+ cp -f /usr/share/dist/desktop-files/${PROD}/*.desktop "${DIR}"
+ fi
+
+ # Copy the "Trash" icon on the desktop
+ cp -f /usr/share/apps/kio_desktop/directory.trash "${DIR}/org.kde.trash.desktop"
+
+ kwriteconfig --group "Mageia" --key "MageiaDesktopFiles" --type "bool" 1
+ fi
+
+ # Add .directory to XDG_*_DIR
+ ICONSXDGDIR=$(kreadconfig --group "Mageia" --key "IconsXdgDir" --default "false")
+
+ if [ ! "$ICONSXDGDIR" = "true" ]; then
+
+ MUSICDIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_MUSIC_DIR)" )
+ if [ -z "$MUSICDIR" ]; then
+ MUSICDIR="$HOME/Music"
+ fi
+
+ if [ ! -e "$MUSICDIR/.directory" ]; then
+ cat >> "$MUSICDIR/.directory" << EOF
+[Desktop Entry]
+Hidden=true
+Icon=folder-sound
+EOF
+ fi
+
+
+ DLDIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_DOWNLOAD_DIR)" )
+ if [ -z "$DLDIR" ]; then
+ DLDIR="$HOME/Downloads"
+ fi
+
+ if [ ! -e "$DLDIR/.directory" ]; then
+ cat >> "$DLDIR/.directory" << EOF
+[Desktop Entry]
+Hidden=true
+Icon=folder-downloads
+EOF
+ fi
+
+
+ DOCDIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_DOCUMENTS_DIR)" )
+ if [ -z "$DOCDIR" ]; then
+ DOCDIR="$HOME/Documents"
+ fi
+
+ if [ ! -e "$DOCDIR/.directory" ]; then
+ cat >> "$DOCDIR/.directory" << EOF
+[Desktop Entry]
+Hidden=true
+Icon=folder-documents
+EOF
+ fi
+
+
+ PICTUREDIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_PICTURES_DIR)" )
+ if [ -z "$PICTUREDIR" ]; then
+ PICTUREDIR="$HOME/Pictures"
+ fi
+
+ if [ ! -e "$PICTUREDIR/.directory" ]; then
+ cat >> "$PICTUREDIR/.directory" << EOF
+[Desktop Entry]
+Hidden=true
+Icon=folder-image
+EOF
+ fi
+
+
+ VIDEOSDIR=$(eval "echo $(kreadconfig --file $HOME/.config/user-dirs.dirs --key XDG_VIDEOS_DIR)" )
+ if [ -z "$VIDEOSDIR" ]; then
+ VIDEOSDIR="$HOME/Videos"
+ fi
+
+ if [ ! -e "$VIDEOSDIR/.directory" ]; then
+ cat >> "$VIDEOSDIR/.directory" << EOF
+[Desktop Entry]
+Hidden=true
+Icon=folder-video
+EOF
+ fi
+ kwriteconfig --group "Mageia" --key "IconsXdgDir" --type "bool" 1
+ fi
+
+# end of main if: all the changes should be done inside this main if
+fi
+
+