Advertisement
Guest User

How to install ttf fonts in linux lite 2

a guest
Aug 21st, 2014
3,565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.68 KB | None | 0 0
  1. 1.
  2. sudo leafpad /usr/bin/fontinstaller
  3. 2. Paste this into leafpad and save it as fontinstaller
  4. #!/bin/bash
  5. #
  6. #
  7. # TTF installer 0.2 created by merlwiz79 <linuxmint.com>
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
  21. # USA
  22. # dependencies
  23. # bash
  24. # zenity
  25. #
  26. # Post Translations at http://forums.linuxmint.com/viewtopic.php?p=120385#p120385
  27. set -x
  28.  
  29. version="0.3"
  30. #################################################
  31. ## File and Extra Values
  32. file=$1
  33. font=$2
  34. WD=440
  35. HT=120
  36. ic=/usr/share/icons/gnome/scalable/apps/fonts.svg
  37. check_dirs="alee arhangai arphic baekmuk beteckna dustin fifthhorseman freefont fontinstaller kiloji kochi konatu latex-xft-fonts mikachan mona openoffice sazanami sjfonts thai ttf-ancient-scripts ttf-arabeyes ttf-atarismall ttf-bengali-fonts ttf-bitstream-vera ttf-bpg-georgian ttf-breip ttf-dejavu ttf-devanagari-fonts ttf-dzongkha ttf-ecolier-court ttf-ecolier-lignes-court ttf-essays ttf-f500 ttf-farsiweb ttf-freefarsi ttf-georgewilliams ttf-gfs-artemisia ttf-gfs-bodoni-classic ttf-gfs-complutum ttf-gfs-didot-classic ttf-gfs-gazis ttf-gfs-neohellenic ttf-gfs-solomos ttf-gfs-theokritos ttf-gujarati-fonts ttf-inconsolata ttf-indic-fonts-core ttf-junicode ttf-kacst ttf-kannada-fonts ttf-khmeros ttf-lao ttf-larabie-deco ttf-larabie-straight ttf-larabie-uncommon ttf-liberation ttf-malayalam-fonts ttf-manchufont ttf-marvosym ttf-mgopen ttf-mph-2b-damase ttf-nafees ttf-ocr-a ttf-oflb-euterpe ttf-oriya-fonts ttf-paktype ttf-punjabi-fonts ttf-radisnoir ttf-sil-abyssinica ttf-sil-andika ttf-sil-charis ttf-sil-doulos ttf-sil-ezra ttf-sil-gentium ttf-sil-padauk ttf-sil-scheherazade ttf-sil-yi ttf-summersby ttf-tamil-fonts ttf-telugu-fonts ttf-tmuni ttf-tuffy ttf-ubuntu-title ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac unfonts uralic vlgothic wqy *"
  38.  
  39. #################################################
  40. # Translations
  41. ###### Default = English #####
  42. title1="How do you want to install the font?"
  43. text="The file must have at least read only Permissions! "
  44. system="System"
  45. user="User"
  46. title2="Warning! "
  47. text1="Installing to the system installs to all users. "
  48. title2="User Installation "
  49. text2="Installing to the current user. "
  50. question="Do you wish to continue? "
  51. done="Installation is complete. "
  52. done1="Please restart applications to use the font. "
  53. error="Error! "
  54. error1="$font is already installed. "
  55. error2="Installation of the font was canceled by user!"
  56. error3="The font was not installed! Please check the file Permissions!!"
  57. error4="No file was selected! "
  58. select="Select"
  59. type="Installation type"
  60. case $LANG in
  61. ######## German by timh ########
  62. de* )
  63. title1="Wie soll die Schrift installiert werden?"
  64. text="The font was not installed! Please check the file Permissions! "
  65. system="System"
  66. user="Benutzer"
  67. title2="Warnung! "
  68. text1="Systemweite Einrichtung installiert dies für alle Benutzer. "
  69. title2="Benutzer-Einrichtung "
  70. text2="Installiert für den aktuellen Benutzer. "
  71. question="Jetzt fortfahren? "
  72. done="Einrichtung beendet. "
  73. done1="Bitte Neustart der Applikationen zum Benutzen der Schriftart. "
  74. error="Fehler! "
  75. error1="$font ist schon installiert. "
  76. error2="Die Einrichtung der Schriftart wurde vom Benutzer abgebrochen!"
  77. error3="Die Schrift wurde nicht installiert! Bitte die Zugriffsrechte der Datei kontrollieren!!"
  78. error4="Es wurde keine Datei ausgewählt! "
  79. select="Wähle aus"
  80. type="Einrichtungstyp";;
  81. ######## Swedish by Zwopper ########
  82. sv* )
  83. title1="Hur vill du installera typsnitten?"
  84. text="Filen måste som minst ha läsrättigheter! "
  85. system="Systemnivå"
  86. user="Användarnivå"
  87. title2="Varning! "
  88. text1="Installation på systemnivå gör typsnitten tillgängliga för alla användare. "
  89. title2="Installation på användarnivå "
  90. text2="Installerar till nuvarande användare. "
  91. question="Vill du fortsätta? "
  92. done="Installationen är klar. "
  93. done1="Du måste starta om öppna program för att använda de ska kunna använda de nya typsnitten. "
  94. error="Fel! "
  95. error1="$font är redan installerat. "
  96. error2="Installationen av typsnitt avbröts av användaren!"
  97. error3="Typsnittet installerades inte! Kontrollera att namnet inte innehåller något mellanslag."
  98. error4="Ingen fil valdes! "
  99. select="Välj"
  100. type="Installationstyp";;
  101. ###### Italian by Nikotra #####
  102. it* )
  103. title1="Come vuoi installare il font?"
  104. text="Il nome del file non deve avere spazi! "
  105. system="Sistema"
  106. user="Utente"
  107. title2="Attenzione! "
  108. text1="Installandoli nel sistema si installeranno per tutti gli utenti. "
  109. title2="Installa per l'utente "
  110. text2="Installa per l'utente corrente. "
  111. question="Desideri continuare? "
  112. done="Installazione completata. "
  113. done1="Riavvia le applicazioni per usare il font. "
  114. error="Errore! "
  115. error1="$font è già installato. "
  116. error2="L'installazione del font è stata cancellata dall'utente!"
  117. error3="Il font non è stato installato! Controlla gli spazi nel nome."
  118. error4="Nessun file è stato selezionato! "
  119. select="Seleziona"
  120. type="Tipo d'installazione";;
  121. ###### Czech by xxxmerlin #####
  122. cs* )
  123. title1="Jak chcete nainstalovat písmo?"
  124. text="Jméno souboru nesmí obsahovat mezery! "
  125. system="Systém"
  126. user="Uživatel"
  127. title2="Varování! "
  128. text1="Instalovat do systémové instalace pro všechny uživatele. "
  129. title2="Uživatelská instalace "
  130. text2="Instalovat pro současného uživatele. "
  131. question="Chcete pokračovat? "
  132. done="Instalace dokončena. "
  133. done1="Pro používání písma musíte restartovat aplikaci. "
  134. error="Chyba! "
  135. error1="$font je již nainstalován. "
  136. error2="Instalace písma byla zrušena uživatelem!"
  137. error3="Písmo nebylo nainstalováno! Zkontrolujte, zda jeho jméno neobsahuje žádné mezery."
  138. error4="Nebyl vybrán soubor! "
  139. select="Vybrat"
  140. type="Typ instalace";;
  141. ###### Spanish by DaniFP #####
  142. es* )
  143. title1="¿Cómo desea instalar la fuente?"
  144. text="¡El nombre del fichero no debe tener ningún espacio! "
  145. system="Sistema"
  146. user="Usuario"
  147. title2="¡Atención! "
  148. text1="La instalación para el sistema, instala para todos los usuarios. "
  149. title2="Instalación para el usuario "
  150. text2="Instala para el usuario actual. "
  151. question="¿Desea continuar? "
  152. done="Instalación completada. "
  153. done1="Debe reiniciar las aplicaciones con las que quiera usar esta fuente. "
  154. error="¡Error! "
  155. error1="$font ya está instalada. "
  156. error2="¡La instalación de la fuente ha sido cancelada por el usuario!"
  157. error3="¡No se ha instalado la fuente! Compruebe que no haya espacios en el nombre."
  158. error4="¡No ha seleccionado ningún fichero! "
  159. select="Seleccionar"
  160. type="Tipo de instalación";;
  161. ###### Bulgarian by emil_pavlov #####
  162. bg* )
  163. title1="Как желаете да бъде инсталиран шрифтът?"
  164. text="Имената на файловете не могат да съдържат интервали! "
  165. system="Система"
  166. user="Потребител"
  167. title2="Предупреждение! "
  168. text1="При инсталирането за цялата система шрифтът ще бъде инсталиран за всички потребители. "
  169. title2="Лични инсталиране "
  170. text2="Инсталиране за текущия потребител. "
  171. question="Желаете ли да продължите? "
  172. done="Инсталирането е приключено. "
  173. done1="Моля, рестартирайте приложението, за да използвате шрифта. "
  174. error="Грешка! "
  175. error1="Шрифтът $font вече е инсталиран. "
  176. error2="Инсталирането на шрифта е прекъснато от потребителя!"
  177. error3="Шрифтът не е инсталиран! Моля, проверете за интервали в името."
  178. error4="Няма избран файл! "
  179. select="Избиране"
  180. type="Вид на инсталирането";;
  181. ###### Slovak by Xgamer #####
  182. sk* )
  183. title1="Ako chcete inštalovať písmo?"
  184. text="Názov súboru nemôže obsahovať medzery! "
  185. system="Systém"
  186. user="Užívateľ"
  187. title2="Upozornenie! "
  188. text1="Inštalovať do systému pre všetkých užívateľov. "
  189. title2="Užívateľská inštalácia "
  190. text2="Inštalovanie pre terajšieho užívateľa. "
  191. question="Prajete si pokračovať? "
  192. done="Inštalácia dokončená. "
  193. done1="Prosím reštartujte aplikáciu k použitiu nového písma. "
  194. error="Chyba! "
  195. error1="$font je už inštalované. "
  196. error2="Inštalácia písma bola prerušené užívateľom!"
  197. error3="Písmo nebolo nainštalované.Skontrolujte medzery v názve."
  198. error4="Žiaden vybratý súbor! "
  199. select="Vybrať"
  200. type="Typ inštalácie";;
  201. ###### French by Nival #####
  202. fr* )
  203. title1="Comment voulez-vous installer la police ?"
  204. text="Le nom de fichier ne doit pas contenir d'espaces ! "
  205. system="Système"
  206. user="Utilisateur"
  207. title2="Attention ! "
  208. text1="Installer pour le système installe la police pour tous les utilisateurs. "
  209. title2="Installation utilisateur "
  210. text2="Installer pour l'utilisateur actuel. "
  211. question="Voulez-vous continuer ? "
  212. done="Installation terminée. "
  213. done1="Relancez l'application pour pouvoir utiliser la police. "
  214. error="Erreur ! "
  215. error1="$font est déjà installée. "
  216. error2="L'installation de la police a été annulée par l'utilisateur!"
  217. error3="Il font non è stato installato! Controlla gli spazi nel nome."
  218. error4="Nessun file è stato selezionato! "
  219. select="Seleziona"
  220. type="Tipo d'installazione";;
  221. ###### Turkish by eren #####
  222. tr* )
  223. title1="Font'u nasıl kurmak istersiniz?"
  224. text="Dosya isminde boşluk olmamalı! "
  225. system="Sistem"
  226. user="Kullanıcı"
  227. title2="Uyarı! "
  228. text1="Sisteme kurulum tüm kullanıcılara kurulum yapar. "
  229. title2="Kullanıcı Kurulumu "
  230. text2="Şu anki kullanıcı için kuruluyoru. "
  231. question="Devam etmek istiyor musunuz? "
  232. done="Kurulum tamamlandı. "
  233. done1="Fontu kullanmak için lütfen uygulamaları yeniden başlatın. "
  234. error="Hata! "
  235. error1="$font zaten kurulu. "
  236. error2="Fontun kurulumu kullanıcı tarafından iptal edildi!"
  237. error3="Fon kurulmadı! Lütfen isimde boşluk var mı diye kontrol edin."
  238. error4="Bir dosya seçilmedi! "
  239. select="Seç"
  240. type="Kurulum tipi";;
  241. ###### Russian by sdemchenko #####
  242. ru* )
  243. title1="Как вы хотите установить шрифт?"
  244. text="Имя файла не должно содержать пробелов! "
  245. system="Система"
  246. user="Пользователь"
  247. title2="Внимание! "
  248. text1="Установка в систему устанавливает для всех пользователей. "
  249. title2="Установка для пользователя "
  250. text2="Установка для текущего пользователя. "
  251. question="Хотите продолжить? "
  252. done="Установка завершена. "
  253. done1="Пожалуйста, перезапустите приложения, чтобы использовать шрифт. "
  254. error="Ошибка! "
  255. error1="$font уже установлен. "
  256. error2="Установка шрифта была отменена пользователем!"
  257. error3="Шрифт не был установлен! Пожалуйста, проверьте имя файла на наличие пробелов."
  258. error4="Файл не выбран! "
  259. select="Выбрать"
  260. type="Тип установки";;
  261. ###### Ukrainian by sdemchenko #####
  262. uk* )
  263. title1="Як ви хочете встановити шрифт?"
  264. text="Ім'я файла не може містити пробіли! "
  265. system="Система"
  266. user="Користувач"
  267. title2="Увага! "
  268. text1="Установка в систему встановлює для всіх користувачів. "
  269. title2="Установка для користувача "
  270. text2="Установка для поточного користувача. "
  271. question="Хочете продовжити? "
  272. done="Установку завершено. "
  273. done1="Будь ласка, перезапустіть програми, щоб користуватися шрифтом. "
  274. error="Помилка! "
  275. error1="$font вже встановлено. "
  276. error2="Установку шрифту відмінено користувачем!"
  277. error3="Шрифт не встановлено! Будь ласка, перевірте чи є пробіли в імені файла."
  278. error4="Файл не вибрано! "
  279. select="Вибрати"
  280. type="Тип установки";;
  281. ###### Japanese by blowback #####
  282. ja* )
  283. title1="どのようにフォントをインストールしますか?"
  284. text="ファイル名にスペースは使用できません! "
  285. system="システム"
  286. user="ユーザー"
  287. title2="警告! "
  288. text1="システムへインストールするとすべてのユーザで使用できるようになります。 "
  289. title2="ユーザーインストール "
  290. text2="現在のユーザーにインストールします "
  291. question="続行しますか? "
  292. done="インストールは完了しました。 "
  293. done1="フォントを使用するためにはアプリケーションを再起動してください。 "
  294. error="エラー! "
  295. error1="$font は既にインストールされています。 "
  296. error2="インストールはユーザーによりキャンセルされました!"
  297. error3="フォントはインストールされませんでした! ファイル名にスペースが含まれていないかチェックしてください。"
  298. error4="ファイルが選択されていません! "
  299. select="選択"
  300. type="インストールタイプ";;
  301. ###### Catalan by wuying_ren #####
  302. ca* )
  303. title1="Com voleu instal·lar la font?"
  304. text="El nom del fitxer no pot contenir cap espai! "
  305. system="Sistema"
  306. user="Usuari"
  307. title2="Advertència! "
  308. text1="Instal·lar al sistema instal·la per a tots els usuaris. "
  309. title2="Instal·lació per a usuari "
  310. text2="Instal·lant per a l'usuari actual. "
  311. question="Voleu continuar? "
  312. done="Instal·lació finalitzada. "
  313. done1="Si us plau, reinicieu les aplicacions per tal de poder fer servir les fonts. "
  314. error="Error! "
  315. error1="$font ja es troba instal·lada. "
  316. error2="La instal·lació de la font ha estat cancel·lada per l'usuari!"
  317. error3="No s'ha instal·lat la font! Si us plau, comproveu que no hi hagin espais al nom."
  318. error4="No s'ha seleccionat cap fitxer! "
  319. select="Selecció"
  320. type="Tipus d'instal·lació";;
  321. ###### Portuguese by sergio marques #####
  322. pt_PT* )
  323. title1="Como deseja instalar as fontes?"
  324. text="O nome do ficheiro não pode conter espaços! "
  325. system="Sistema"
  326. user="Utilizador"
  327. title2="Aviso! "
  328. text1="Instalar no sistema instala para todos os utilizadores. "
  329. title2="Instalação para Utilizador "
  330. text2="Instalar para o utilizador actual. "
  331. question="Deseja continuar? "
  332. done="Instalação completa. "
  333. done1="Por favor, reinicie as aplicações para usar as novas fontes. "
  334. error="Erro! "
  335. error1="$font já está instalada. "
  336. error2="Instalação de fonte cancelada pelo utilizador!"
  337. error3="Fonte não foi instalada! Por favor, veja se o nome contém espaços. "
  338. error4="Nenhum ficheiro seleccionado! "
  339. select="Seleccione"
  340. type="Tipo de Instalação";;
  341. ###### Portuguese(Brazilian) by Andrey Bruggemann #####
  342. pt_BR* )
  343. title1="Como deseja instalar as fontes?"
  344. text="O nome do ficheiro não pode conter espaços! "
  345. system="Sistema"
  346. user="Utilizador"
  347. title2="Aviso! "
  348. text1="Instalar no sistema instala para todos os utilizadores. "
  349. title2="Instalação para Utilizador "
  350. text2="Instalar para o utilizador actual. "
  351. question="Deseja continuar? "
  352. done="Instalação completa. "
  353. done1="Por favor, reinicie as aplicações para usar as novas fontes. "
  354. error="Erro! "
  355. error1="$font já está instalada. "
  356. error2="Instalação de fonte cancelada pelo utilizador!"
  357. error3="Fonte não foi instalada! Por favor, veja se o nome contém espaços. "
  358. error4="Nenhum ficheiro seleccionado! "
  359. select="Seleccione"
  360. type="Tipo de Instalação";;
  361. ###### Polish by szamot83 #####
  362. pl* )
  363. title1="Wybierz rodzaj instalacji czcionki?"
  364. text="Plik musi mieć uprawnienia przynajmniej do odczytu pliku! "
  365. system="System"
  366. user="Użytkownik"
  367. title2="Uwaga! "
  368. text1="Instalacja dla systemu, instaluje dla wszystkich użytkowników. "
  369. title2="Unstalacja użytkownika "
  370. text2="Instalacja dla obecnego użytkownika. "
  371. question="Kontynuować? "
  372. done="Instalacja zakończona "
  373. done1="Proszę uruchomić ponownie programy, żeby używać nowej czcionki "
  374. error="Błąd! "
  375. error1="$font jest już zainstalowana "
  376. error2="Instalacja czcionki przerwana przez użytkownika!"
  377. error3="Czcionka nie została zainstalowana! Sprawdź uprawnienia do pliku "
  378. error4="Nie wybrano żadnego pliku! "
  379. select="Wybierz"
  380. type="Rodzaj instalacji";;
  381. ###### Dutch by Lvw2000 #####
  382. nl* )
  383. title1="Hoe wilt u het lettertype installeren??"
  384. text="Het bestand moet minstens alleen-lezen toegang hebben! "
  385. system="Systeem"
  386. user="Gebruiker"
  387. title2="Waarschuwing! "
  388. text1="Installeren voor het systeem installeert voor alle gebruikers. "
  389. title2="Gebruikersinstallatie "
  390. text2="Installeren voor de huidige gebruiker. "
  391. question="Wilt u verdergaan? "
  392. done="Installatie is voltooid. "
  393. done1="Gelieve programma's te herstarten om het lettertype te gebruiken. "
  394. error="Error! "
  395. error1="$font is al geïnstalleerd. "
  396. error2="Installatie van het lettertype was geannuleerd door de gebruiker!"
  397. error3="Het lettertype is niet geïnstalleerd! Gelieve de bestandspermissies te controleren!!"
  398. error4="Geen bestand geselecteerd! "
  399. select="Selecteer"
  400. type="Installatie type";;
  401. ###### Korean by JuEUS-U #####
  402. ko* )
  403. title1="어떤 폰트로 설치하시겠습니까?"
  404. text="읽기권한이 필요합니다! "
  405. system="시스템"
  406. user="사용자"
  407. title2="경고! "
  408. text1="시스템 폰트는 모든 사용자가 사용 가능합니다. "
  409. title2="사용자 폰트 설치 "
  410. text2="현재 사용자를 위해 설치합니다. "
  411. question="계속 하시겠습니까? "
  412. done="설치가 완료되었습니다. "
  413. done1="폰트가 적용되려면 프로그램을 재시작 해야합니다. "
  414. error="에러! "
  415. error1="$font는 이미 설치되어있습니다. "
  416. error2="폰트 설치가 사용자에 의해 취소되었습니다."
  417. error3="폰트가 설치되지 않았습니다. 파일 권한을 확인해 주십시오."
  418. error4="파일을 선택해 주십시오. "
  419. select="선택"
  420. type="설치 방법";;
  421. ###### Croatian by x_sport #####
  422. hr* )
  423. title1="Kako zelite instalirati font?"
  424. text="Datoteka mora imati najmanje read only Dopustenja! "
  425. system="Sistem"
  426. user="Korisnik"
  427. title2="Upozorenje! "
  428. text1="Instaliranjem u sistem instalirate svim korisnicima. "
  429. title2="Korisnicka instalacija "
  430. text2="Instaliranje u trenutnog korisnika. "
  431. question="Zelite li nastaviti? "
  432. done="Instalacija je zavrsena. "
  433. done1="Molimo restartajte programe za upotrebu fonta."
  434. error="Greska! "
  435. error1="$font je vec instaliran. "
  436. error2="Instalacija fonta je prekinuta od strane korisnika!"
  437. error3="Font nije instaliran! Molimo provjerite datoteku Dopuštenja!"
  438. error4="Nijedna dattoteka nije odabrana! "
  439. select="Odaberi"
  440. type="Tip instalacije"
  441. esac
  442.  
  443. #################################################
  444. ## Check if a font file was selected
  445. #################
  446. if [ "$font" = "" ]
  447. then
  448. zenity --error --title="$error" --text="$error4"
  449. exit
  450. fi
  451.  
  452. #################################################
  453. ## Check for duplicate font file
  454. #################
  455. for test_dir in $check_dirs
  456. do
  457. if [ -f "$HOME/.fonts/$font" ] || [ -f "/usr/share/fonts/truetype/$test_dir/$font" ] || [ -f "/usr/share/fonts/truetype/$font" ];
  458. then
  459. zenity --error --title="$error" --text="$error1"
  460. exit;
  461. fi done
  462.  
  463. #################################################
  464. ## Check for or create user font folder
  465. #################
  466. if [ ! -d "~/.fonts" ]; then
  467. mkdir -p ~/.fonts
  468. fi
  469. #################################################
  470. ## Run the installer
  471. ##################
  472. ans=$(zenity --width $WD --height $HT --window-icon=$ic --title="$title1" --list --text="$text" --radiolist --column="$select" --column="$type" TRUE "$user" FALSE $system);
  473. if [ "$ans" = "$user" ] ; then
  474. zenity --width $WD --question --title="$text2" --text="$question"
  475. case $? in
  476. 0)
  477. cp "$file" $HOME/.fonts/ | fc-cache ~/.fonts ;;
  478. 1)
  479. zenity --width=$WD --error --title="$error" --text="$error2"
  480. exit ;;
  481. esac
  482.  
  483. fi
  484. if [ "$ans" = "$system" ] ; then
  485. zenity --width $WD --title="$text1" --question --text="$question"
  486. case $? in
  487. 0)
  488. if [ ! -a "/usr/share/fonts/truetype/fontinstaller" ]; then
  489. gksu mkdir /usr/share/fonts/truetype/fontinstaller
  490. fi
  491. gksu cp "$file" /usr/share/fonts/truetype/fontinstaller/
  492. gksu fc-cache /usr/share/fonts/truetype/fontinstaller/ ;;
  493. 1)
  494. zenity --width=$WD --title="$error" --error --text="$error2"
  495. exit ;;
  496. esac
  497.  
  498. fi
  499. if [ "$ans" = "" ] ; then
  500. zenity --width=$WD --title="$error" --error --text="$error2"
  501. exit
  502. fi
  503. #################################################
  504. ## Check if the font was installed.
  505. #################
  506. if [ -f "$HOME/.fonts/$font" ] || [ -f "/usr/share/fonts/truetype/fontinstaller/$font" ] ;
  507. then
  508. zenity --width=$WD --info --title="$done" --text="$done1"
  509. else
  510. zenity --width=$WD --info --title="$error" --text="$error3"
  511. fi
  512.  
  513. 3. Mark the script as executable
  514. sudo chmod +x /usr/bin/fontinstaller
  515. 4. Create a folder /usr/share/fonts/truetype/fontinstaller
  516. Without this step you can't install the font for all users.
  517. sudo mkdir /usr/share/fonts/truetype/fontinstaller
  518. 5. Open the Thunar file manager
  519. 6. Click on Edit and then on Configure custom actions
  520. 7. Add a new custom action by clicking on a '+' button
  521. 8. Enter this in the text boxes:
  522. Name: Install .ttf font
  523. Description: Installs a selected .ttf file.
  524. Command:
  525. fontinstaller %f %n
  526. 9. Click on Appearance Conditions tab
  527. 10. In the File pattern enter:
  528. *.ttf;*.TTF
  529. 11. Check other files box and confirm by clicking on OK
  530. If you have a .ttf/.TTF file on the Desktop you will have to log out and back in to be able to use this.
  531. Now you can right-click on .ttf file and install it.
  532. Options are user and system. System option means the font is installing for all the users, and you will have to enter superuser password (three times).
  533. After the font is installed open the Libre Office Writer an you can use the new font.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement