From 98d307da8d0480b48646a7fdc0cdab7c7f23de06 Mon Sep 17 00:00:00 2001 From: hayao Date: Sat, 26 Dec 2020 21:44:20 +0900 Subject: [PATCH] [add] : Added alterlinux-desktop-file --- alterlinux-desktop-file/alterlinux-desktop-file | 99 +++++++++++++++ alterlinux-desktop-file/calamares.desktop | 161 ++++++++++++++++++++++++ 2 files changed, 260 insertions(+) create mode 100755 alterlinux-desktop-file/alterlinux-desktop-file create mode 100755 alterlinux-desktop-file/calamares.desktop diff --git a/alterlinux-desktop-file/alterlinux-desktop-file b/alterlinux-desktop-file/alterlinux-desktop-file new file mode 100755 index 0000000..e73c5c5 --- /dev/null +++ b/alterlinux-desktop-file/alterlinux-desktop-file @@ -0,0 +1,99 @@ +#!/usr/bin/env bash +# Yamada Hayao +# Twitter: @Hayao0819 +# Email : hayao@fascode.net +# +# (c) 2019-2020 Fascode Network. +# + +set -e + +alterlive=false + +_help() { + echo "usage ${0} [options]" + echo + echo " General options:" + echo " -f | --force Force overwriting." + echo " -h | --help This help message and exit." + echo + echo " --alterlive Remove the file for live session" +} + +# Argument analysis and processing +options="${@}" +_opt_short="h" +_opt_long="help,alterlive" +OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}") +if [[ ${?} != 0 ]]; then + exit 1 +fi + +eval set -- "${OPT}" +unset OPT +unset _opt_short +unset _opt_long + +while true; do + case ${1} in + -h | --help) + _help + shift 1 + exit 0 + ;; + --alterlive) + alterlive=true + shift 1 + ;; + --) + shift + break + ;; + *) + echo "Invalid argument '${1}'" >&2 + _help + exit 1 + ;; + esac +done + + +# ~/Desktopに相当するディレクトリを返します +get_desktop_dir() { + local _user_config_dir _desktop_dir + if [[ -v XDG_CONFIG_HOME ]]; then + _user_config_dir="${XDG_CONFIG_HOME}" + else + _use_config_dir="${HOME}/.config" + fi + if [[ -f "${_use_config_dir}/user-dirs.dirs" ]]; then + source "${_use_config_dir}/user-dirs.dirs" + fi + if [[ -v XDG_DESKTOP_DIR ]]; then + _desktop_dir="${XDG_DESKTOP_DIR}" + else + _desktop_dir="${HOME}/Desktop" + fi + echo -n "${_desktop_dir}" +} + +desktop_dir="$(get_desktop_dir)" + + +# calamaresのアイコン +calamares="/usr/share/alterlinux/desktop-file/calamares.desktop" +cp "${calamares}" "${desktop_dir}" +os_name="$( + if [[ -f "/etc/os-release" ]]; then + source "/etc/os-release" + echo -n "${NAME}" + else + echo -n "Alter Linux" + fi +)" +sed -i "s/%OS_NAME%/${os_name}/g" "${desktop_dir}/$(basename "${calamares}")" + + +if [[ "${alterlive}" = true ]]; then + remove ~/.config/autostart/genicon.desktop +fi diff --git a/alterlinux-desktop-file/calamares.desktop b/alterlinux-desktop-file/calamares.desktop new file mode 100755 index 0000000..780bd69 --- /dev/null +++ b/alterlinux-desktop-file/calamares.desktop @@ -0,0 +1,161 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Install %OS_NAME% +GenericName=%OS_NAME% Installer +Keywords=calamares;alter;linux;installer; +TryExec=calamares +Exec=sudo -E /usr/bin/calamares +Comment=%OS_NAME% Installer - by Calamares +Icon=/usr/share/icons/hicolor/scalable/apps/calamares.svg +Terminal=false +StartupNotify=true +Type=Application +Categories=Qt;System; +X-AppStream-Ignore=true + +Name[ar]=تثبيت النظام +GenericName[ar]=مثبت النظام +Comment[ar]=كالامارس - مثبت النظام +Name[as]=চিছটেম ইনস্তল কৰক +GenericName[as]=চিছটেম ইনস্তলাৰ +Comment[as]=কেলামাৰেচ — চিছটেম​ ইনস্তলাৰ +Name[be]=Усталяваць сістэму +GenericName[be]=Усталёўшчык сістэмы +Comment[be]=Calamares — усталёўшчык сістэмы +Name[bg]=Инсталирай системата +GenericName[bg]=Системен Инсталатор +Comment[bg]=Calamares — Системен Инсталатор +Name[ca]=Instal·la el sistema +GenericName[ca]=Instal·lador de sistema +Comment[ca]=Calamares — Instal·lador de sistema +Name[da]=Installér %OS_NAME% +GenericName[da]=%OS_NAME%installationsprogram +Comment[da]=Calamares — %OS_NAME%installationsprogram +Name[de]=%OS_NAME% installieren +GenericName[de]=Installation des Betriebs%OS_NAME%s +Comment[de]=Calamares - Installation des Betriebs%OS_NAME%s +Name[el]=Εγκατάσταση συστήματος +GenericName[el]=Εγκατάσταση συστήματος +Comment[el]=Calamares — Εγκατάσταση συστήματος +Name[en_GB]=Install %OS_NAME% +GenericName[en_GB]=%OS_NAME% Installer +Comment[en_GB]=Calamares — %OS_NAME% Installer +Name[es]=Instalar Sistema +GenericName[es]=Instalador del Sistema +Comment[es]=Calamares — Instalador del Sistema +Name[et]=Paigalda süsteem +GenericName[et]=Süsteemipaigaldaja +Comment[et]=Calamares — süsteemipaigaldaja +Name[eu]=Sistema instalatu +GenericName[eu]=Sistema instalatzailea +Comment[eu]=Calamares - sistema instalatzailea +Name[es_PR]=Instalar el sistema +Name[fr]=Installer le système +GenericName[fr]=Installateur système +Comment[fr]=Calamares - Installateur système +Name[gl]=Instalación do Sistema +GenericName[gl]=Instalador de sistemas +Comment[gl]=Calamares — Instalador de sistemas +Name[he]=התקנת מערכת +GenericName[he]=אשף התקנה +Comment[he]=Calamares - אשף התקנה +Name[hi]=सिस्टम इंस्टॉल करें +GenericName[hi]=सिस्टम इंस्टॉलर +Comment[hi]=Calamares — सिस्टम इंस्टॉलर +Name[hr]=Instaliraj sustav +GenericName[hr]=Instalacija sustava +Comment[hr]=Calamares — Instalacija sustava +Name[hu]=Rendszer telepítése +GenericName[hu]=Rendszertelepítő +Comment[hu]=Calamares – Rendszertelepítő +Name[id]=Instal Sistem +GenericName[id]=Pemasang +Comment[id]=Calamares — Pemasang Sistem +Name[is]=Setja upp kerfið +GenericName[is]=Kerfis uppsetning +Comment[is]=Calamares — Kerfis uppsetning +Name[cs_CZ]=Nainstalovat systém +GenericName[cs_CZ]=Instalátor systému +Comment[cs_CZ]=Calamares – instalátor operačních systémů +Name[ja]=%OS_NAME%をインストール +GenericName[ja]=%OS_NAME%インストーラー +Comment[ja]=Calamares — %OS_NAME%インストーラー +Name[ko]=시스템 설치 +GenericName[ko]=시스템 설치 관리자 +Comment[ko]=깔라마레스 — 시스템 설치 관리자 +Name[lt]=Įdiegti Sistemą +GenericName[lt]=Sistemos diegimas į kompiuterį +Comment[lt]=Calamares — Sistemos diegimo programa +Name[it_IT]=Installa il sistema +GenericName[it_IT]=Programma d'installazione del sistema +Comment[it_IT]=Calamares — Programma d'installazione del sistema +Name[mk]=Инсталирај го системот +GenericName[mk]=Системен Инсталер +Comment[mk]=Calamares - Системен Инсталер +Name[ml]=സിസ്റ്റം ഇൻസ്റ്റാൾ ചെയ്യുക +GenericName[ml]=സിസ്റ്റം ഇൻസ്റ്റാളർ +Comment[ml]=കലാമാരേസ് - സിസ്റ്റം ഇൻസ്റ്റാളർ +Name[nb]=Installer %OS_NAME% +GenericName[nb]=%OS_NAME%installatør +Comment[nb]=Calamares-%OS_NAME%installatør +Name[nl]=Installeer systeem +GenericName[nl]=Installatieprogramma +Comment[nl]=Calamares — Installatieprogramma +Name[pl]=Zainstaluj %OS_NAME% +GenericName[pl]=Instalator %OS_NAME% +Comment[pl]=Calamares — Instalator %OS_NAME% +Name[pt_BR]=Sistema de Instalação +GenericName[pt_BR]=Instalador de Sistema +Comment[pt_BR]=Calamares — Instalador de Sistema +Name[ro]=Instalează sistemul +GenericName[ro]=Instalator de sistem +Comment[ro]=Calamares — Instalator de sistem +Name[ru]=Установить систему +GenericName[ru]=Установщик системы +Comment[ru]=Calamares - Установщик системы +Name[sk]=Inštalovať systém +GenericName[sk]=Inštalátor systému +Comment[sk]=Calamares — Inštalátor systému +Name[sl]=Namesti sistem +Name[sq]=Instalo Sistemin +GenericName[sq]=Instalues Sistemi +Comment[sq]=Calamares — Instalues Sistemi +Name[fi_FI]=Asenna Järjestelmä +GenericName[fi_FI]=Järjestelmän Asennusohjelma +Comment[fi_FI]=Calamares — Järjestelmän Asentaja +Name[sr@latin]=Instaliraj sistem +Name[sr]=Инсталирај систем +GenericName[sr]=Инсталатер система +Comment[sr]=Каламарес — инсталатер система +Name[sv]=Installera %OS_NAME% +GenericName[sv]=%OS_NAME%installerare +Comment[sv]=Calamares — %OS_NAME%installerare +Name[th]=ติดตั้งระบบ +Name[uk]=Встановити Систему +GenericName[uk]=Встановлювач системи +Comment[uk]=Calamares - Встановлювач системи +Name[zh_CN]=安装系统 +GenericName[zh_CN]=系统安装程序 +Comment[zh_CN]=Calamares — 系统安装程序 +Name[zh_TW]=安裝系統 +GenericName[zh_TW]=系統安裝程式 +Comment[zh_TW]=Calamares ── 系統安裝程式 +Name[ast]=Instalar el sistema +GenericName[ast]=Instalador del sistema +Comment[ast]=Calamares — Instalador del sistema +Name[eo]=Instali Sistemo +GenericName[eo]=Sistema Instalilo +Comment[eo]=Calamares — Sistema Instalilo +Name[ne_NP]=सिस्टम इन्स्टल गर्नुहोस् +GenericName[ne_NP]=सिस्टम इन्स्टलर +Comment[ne_NP]=Calamares - सिस्टम इन्स्टलर +Name[es_MX]=Instalar el Sistema +GenericName[es_MX]=Instalador del sistema +Comment[es_MX]=Calamares - Instalador del sistema +Name[pt_PT]=Instalar Sistema +GenericName[pt_PT]=Instalador de Sistema +Comment[pt_PT]=Calamares - Instalador de Sistema +Name[tr_TR]=Sistemi Yükle +GenericName[tr_TR]=Sistem Yükleyici +Comment[tr_TR]=Calamares — Sistem Yükleyici -- 2.11.0