Shell Scripting iji mepụta faịlụ .desktop maka ngwa a na-ebugharị

Bash Shell Scripting: Mepụta njikọ nke ngwa eji ebugharị.

Bash Shell Scripting: Mepụta njikọ nke ngwa eji ebugharị.

Okwu Shell etinyere na Sistemụ nrụọrụ na-ezo aka n'iwu ntụgharị okwu nke sistemụ arụmọrụ. Na mkpokọta, ọ bụ interface ederede dị elu nke na-egosipụta onwe ya n'ụdị Terminal (Console) yana nke ahụ na-arụ ọrụ mpaghara 3 dị mkpa: Ijikwa sistemụ arụmọrụ, ịgba ọsọ ngwa yana soro ha na-emekọrịta ihe, na ije ozi dị ka ntọala dị mkpa mmemme. Na Akwụkwọ Nsọ na-ezo aka na usoro nke ịmepụta na ịmepụta Scripts site na iji Shell.

Shell Scripts bara ezigbo uru. Ọ dị mma idetu ihe anyị chọrọ wee dezie ederede ndị na-arụrụ anyị ọrụ a. Na nke a, anyị ga-eji ya mepụta njikọ (ụzọ mkpirisi) nke ngwa na mmalite menu na desktọọpụ nke obere, ngwa-arụ na ngwa nwere onwe.

Alacarte Linux ngwa

Okwu Mmalite

Ọtụtụ oge anyị ebudatara ma wụnye ngwa ndị, ịnọ ma ọ bụ na anọghị na nchekwa nke GNU / Linux Distribution, mgbe ị na-etinye ma ọ bụ na-eme ya, ọ naghị emepụta faịlụ .desktop dị iche iche. nke otu ma ọ bụ nke kachasị mma ọ naghị etinye ya n'ụzọ ziri ezi nke na mgbe emesịrị ịmalite NchNhr, a gụọ ma gosipụta na ndepụta nke nchịkọta arụnyere nke sistemụ arụmọrụ.

Yabụ, anyị ga-arịọ maka iji ngwa dị ka "Alacarte" ma ọ bụ "Menulibre" iji jiri aka ha mepụta njikọ dị iche iche na Start Menu.

Ọ bụ ezie na ngwa ngwa eserese ndị a dị mfe iji maka ebumnuche a, ọ dịchaghị ịmara mepụta edemede anyị iji rụọ ọrụ a ma si otú a mara site na otu esi arụ ọrụ n'ime sistemụ arụmọrụ.

Ọ bụrụ n ’ịmataghị ihe okike na / ma ọ bụ ojiji nke faịlụ Shell Scripting ị nwere ike gụọ nke a gara aga post (Shell, Bash na Ederede) ịmalite ma ọ bụrụ na ọ dị mkpa inyocha mbipụta niile n’isiokwu a.

Linux Ngwa Ntanetị Free

Usingmepụta mmemme site na iji Akwụkwọ Shell

Anyị ga-eche maka ebumnuche nke oghere na anyị amatala otu esi emepụta edemede site na ncha, ya bụ, anyị amalarị otu esi emepụta nkụnye eji isi mee ma ọ bụ akụkụ mbụ nke edemede anyị ma anyị ga-aga ozugbo na ọdịnaya ya.

Agbanyeghị, ọ bụrụ na enwere obi abụọ banyere ya, lelee nke a gara aga post (Mee usoro ihe omume gị site na iji usoro Shell - Nkebi nke 1) iji dokwuo anya obi abụọ.

Ọdịnaya


#!/usr/bin/env bash
set -eou pipefail
IFS=$'\n\t'
setterm --reset
# NOMBRE: MI-APP LINUX POST INSTALL - SCRIPT BICENTENARIO (MIAPP-LPI-SB)
# VERSIÓN: 1.0+0
# TIPO DE PROGRAMA: SISTEMA EXPERTO
# FUNCIÓN: ASISTENTE TECNICO PARA S.O. GNU/LINUX BASADOS EN DEBIAN
# NOMBRE CODIGO: MIAPP (MIAPP-LPI-SB 1.0+0)
# PAIS ORIGEN: Mi país
# CREADO POR: Mi Nombre
# LICENCIA: Licencia Pública General de GNU 3.

###############################################################################
# INICIO DEL MODULO DE VALIDACION PERMISO DE SUPERUSUARIO (ROOT) SOBRE EL MIAPP-LPI-SB              
###############################################################################

# ESTE MODULO VALIDA QUE SOLO EL SUPERUSUARIO (USUARIO ROOT) PUEDA EJECUTAR
# EL LINUX POST INSTALL - SCRIPT BICENTENARIO.

clear

setterm -background red

if [[ "$(id -u)" != "0" ]]; then
   echo "ESTE SCRIPT DEBE SER EJECUTADO COMO ROOT"
   sleep 3
   clear      
  else
   echo "ESTE SCRIPT SERA EJECUTADO COMO SUPERUSUARIO (ROOT)"
   sleep 3
   clear
fi

###############################################################################
# FINAL DEL MODULO DE VALIDACION PERMISO DE SUPERUSUARIO (ROOT) SOBRE EL MIAPP-LPI-SB
###############################################################################


###############################################################################
# INICIO DEL MODULO DE ORDENES DE COMANDO DE POST INSTALACIÓN
###############################################################################

rm -f $HOME/mi_app/mi_app.desktop
rm -f $HOME/.local/share/applications/mi_app.desktop
rm -f $HOME/Desktop/mi_app.desktop
rm -f $HOME/Escritorio/mi_app.desktop
rm -f /usr/share/applications/mi_app.desktop

###############################################################################

echo "
[Desktop Entry]
Name=My Applicattions
GenericName=My Applicattions
GenericName[es]=Mi Aplicación
Comment=Mi Aplicación
Exec=/opt/mi_app/mi_app
Icon=`echo $HOME`/mi_app/icono_app.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
MimeType=x-scheme-handler/mozilla;
X-KDE-Protocols=mozilla
" > `echo $HOME`/mi_app/mi_app.desktop

chown $USER:$USER -R `echo $HOME`/mi_app/mi_app.desktop

chmod 755 `echo $HOME`/mi_app/mi_app.desktop

ln -s `echo $HOME`/mi_app/mi_app.desktop $HOME/.local/share/applications/mi_app.desktop
ln -s `echo $HOME`/mi_app/mi_app.desktop $HOME/Desktop/mi_app.desktop
ln -s `echo $HOME`/mi_app/mi_app.desktop $HOME/Escritorio/mi_app.desktop
ln -s `echo $HOME`/mi_app/mi_app.desktop /usr/share/applications/mi_app.desktop

update-menus

###############################################################################

clear

su - $USER -c "xdg-open 'https://www.mi-app.com/'"

clear

echo ''
echo ''
echo '#------------------------------------------------------------------#'
echo '# GRACIAS POR USAR MI-APP LINUX POST INSTALL #'
echo '#------------------------------------------------------------------#'
echo ''
echo ''

sleep 3

###############################################################################
# FINAL DEL MODULO DE ORDENES DE COMANDO DE POST INSTALACIÓN
###############################################################################
Ederede ọdịnaya na Mousepad

Ederede ọdịnaya na Mousepad

comments

Dịka ị nwere ike nyochaa site na koodu ahụ ma hapụ nkụnye eji isi mee, edemede na-esonụ na-arụ ọrụ ndị a na ụzọ akpaaka:

  1. Nyochaa na a na-eji gị dịka mgbọrọgwụ onye ọrụ ma ọ bụ ikike mgbọrọgwụ onye ọrụ.
  2. Hichapụ njikọ ndị gara aga na ngwa nke emepụtara site na ụdị gara aga.
  3. Mepụta faịlụ .desktop ọhụrụ (njikọ) nke ngwa ahụ na folda nke ya n'ime ụlọ onye ọrụ.
  4. Nye onye nwe onye ọrụ ikike ikike mepụtara.
  5. Ekenye kere faịlụ kwesịrị ekwesị na-agụ / dee / igbu ikikere.
  6. Mepụta njikọ ihe atụ ọhụrụ na ụzọ ndị dị mkpa.
  7. Melite mmalite menu iji gosipụta faịlụ .desktop mepụtara.
  8. Mee URL kpọmkwem na ngwa ahụ mepụtara.

Nkwanye

Ọ na-atụ aro ka a faịlụ a kere n'ime nchekwa na e dere ihe ngwa / executable na ajụjụ ya na nwoke na akara ngosi (oyiyi / logo) kpọmkwem n'ime ya na kwuru nchekwa dị na ụzọ /opt kama uzo `echo $HOME`/mi_app/ ya bụ, /home/mi_usuario/mi_app.

Enwere m olileanya na obere edemede a na-enye gị ohere idozi mkpa gị na nke a n'okwu a! Ruo mgbe isiokwu na-esonụ.

Mgbe m na-ahapụrụ gị nke a njikọ na gọọmentị Gnome gọọmentị na isiokwu ahụ na vidiyo a:


Ọdịnaya nke isiokwu agbaso ụkpụrụ anyị nke ụkpụrụ nduzi. Kpesa mmejọ pịa ebe a.

Ihe 3 kwuru, hapụ nke gị

Hapu okwu gi

Adreesị email gị agaghị bipụtara. Chọrọ ubi na-akara na *

*

*

  1. Rụ ọrụ maka data: Miguel Ángel Gatón
  2. Nzube nke data: Nchịkwa SPAM, njikwa okwu.
  3. Ikike: Nkwenye gị
  4. Nkwurịta okwu nke data: Agaghị agwa ndị ọzọ data ahụ ma ọ bụghị site na iwu.
  5. Nchekwa data: Ebe nchekwa data nke Occentus Networks (EU) kwadoro
  6. Ikike: Oge obula inwere ike igbachi, weghachite ma hichapụ ihe omuma gi.

  1.   Guillermo dijo

    Ana m ekele gị nke ukwuu maka nke a na edemede gị niile.
    Ajuju: Kedu, ọ bụrụ na ị bụghị mgbọrọgwụ, ị nwere ike ịjụ maka paswọọdụ na-egosi akara ngosi iji gaa n'ihu igbu ya na ikikere kwesịrị ekwesị?

    1.    Jose Albert dijo

      Nwere ike ịmepụta interface na dialog ma tinye ihe nzuzo nke encrypt igodo na igbe arịrịọ paswọọdụ! M na-echeta nke ọma na ihe a dị na dialog.

      Na ọkwa a gara aga, mmadụ mere ihe yiri nke a mana ọfụma mana faịlụ ndị ejikọtara, ya bụ, koodu ejirila adịkwaghị: https://blog.desdelinux.net/script-avanzado-en-bash-bashmd5-para-proteger-algo-explicacion-detallada/

  2.   Guillermo dijo

    Daalụ, ọ ga-adị mma ịghara ịhapụ gburugburu ebe obibi ma ọ bụrụ na ọ na-agba ọsọ na-enweghị eserese eserese, n'ọnọdụ ahụ ọ nweghị ihe ọbụlagodi ma ọ bụrụ na enweghị akara mmuke ma ọ bụ ihe ọ bụla, na ọ na-arịọ maka igodo ahụ na enweghị ederede pụtara. Ummm, achọpụtara m na ya http://www.tormentadebits.com/2012/08/scripts-bash-introducir-password-sin-mostrarlo-en-pantalla.html