OSDN Git Service

[add] : copy website icon
authorhayao <shun819.mail@gmail.com>
Sun, 27 Dec 2020 00:03:38 +0000 (09:03 +0900)
committerhayao <shun819.mail@gmail.com>
Sun, 27 Dec 2020 00:03:38 +0000 (09:03 +0900)
alterlinux-desktop-file/alterlinux-desktop-file
alterlinux-desktop-file/welcome-to-alter.desktop [new file with mode: 0755]

index 4b3db2f..25599a6 100755 (executable)
@@ -110,22 +110,26 @@ remove () {
     done
 }
 
-desktop_dir="$(get_desktop_dir)"
+#copy <コピー元> <コピー先>
+copy() {
+    if [[ ! -f "${1}" ]]; then
+        echo "${1} was not found" >&2
+        exit 1
+    fi
+    if [[ -f "${2}/$(basename "${1}")" ]] || [[ -f "${2}" ]] && [[ "${force}" = false ]]; then
+        echo "File already exists" >&2
+        exit 1
+    fi
 
-# calamaresのアイコン
-calamares="/usr/share/alterlinux/desktop-file/calamares.desktop"
-desktop_icon="${desktop_dir}/$(basename "${calamares}")"
+    cp "${1}" "${2}"
+}
 
-if [[ ! -f "${calamares}" ]]; then
-    echo "${calamares} was not found" >&2
-    exit 1
-fi
+desktop_dir="$(get_desktop_dir)"
 
-if [[ -f "${desktop_icon}" ]] && [[ "${force}" = false ]]; then
-    echo "File already exists" >&2
-    exit 1
-fi
-cp "${calamares}" "${desktop_dir}"
+# calamaresのアイコン
+source_file="/usr/share/alterlinux/desktop-file/calamares.desktop"
+desktop_icon="${desktop_dir}/$(basename "${source_file}")"
+copy "${source_file}" "${desktop_dir}"
 os_name="$(
     if [[ -f "/etc/os-release" ]]; then
         source "/etc/os-release"
@@ -137,6 +141,12 @@ os_name="$(
 sed -i "s/%OS_NAME%/${os_name}/g" "${desktop_icon}"
 
 
+# welcome-page
+source_file="/usr/share/alterlinux/desktop-file/welcome-to-alter.desktop"
+desktop_icon="${desktop_dir}/$(basename "${source_file}")"
+copy "${source_file}" "${desktop_dir}"
+
+
 if [[ "${alterlive}" = true ]]; then
     remove ~/.config/autostart/genicon.desktop
 fi
diff --git a/alterlinux-desktop-file/welcome-to-alter.desktop b/alterlinux-desktop-file/welcome-to-alter.desktop
new file mode 100755 (executable)
index 0000000..1de9a7a
--- /dev/null
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Icon=/usr/share/icons/hicolor/scalable/apps/alter.svg
+Exec=/usr/bin/alterlinux-welcome-page
+Type=Application
+StartupNotify=false
+Terminal=false
+Hidden=false
+
+Name=Welcome to Alter Linux
+Comment=Displays the Alter Linux welcome page.
+
+Name[ja]=Alter Linuxへようこそ
+GenericName[ja]=Alter Linuxへようこそ
+Comment[ja]=Alter Linuxの利用に役立つページです。