AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 64222
Accepted
tinuz
tinuz
Asked: 2011-10-05 05:43:53 +0800 CST2011-10-05 05:43:53 +0800 CST 2011-10-05 05:43:53 +0800 CST

Como posso criar lançadores na minha área de trabalho?

  • 772

Nas versões mais antigas, era fácil criar um iniciador na minha área de trabalho. Tudo o que eu precisava fazer era clicar com o botão direito do mouse na minha área de trabalho e selecionar a opção "criar iniciador".

Como posso criar esses lançadores agora?

.desktop
  • 22 22 respostas
  • 594542 Views

22 respostas

  • Voted
  1. Best Answer
    fossfreedom
    2011-10-16T07:35:01+08:002011-10-16T07:35:01+08:00

    Nota: gnome-desktop-item-edit foi removido gnome-panelem 19.10 (veja gnome-desktop-item-edit: comando não encontrado no Ubuntu 19.10 e posterior, mesmo com o pacote 'gnome-panel' instalado ). Portanto, é improvável que essa resposta funcione para o 19.10 e posterior.

    A caixa de diálogo GUI antiga ainda está disponível se você ainda quiser usar isso:

    Usando ALT+ F2tipo

    gnome-desktop-item-edit --create-new ~/Desktop
    

    Isso iniciará a antiga caixa de diálogo da GUI e criará um iniciador em sua área de trabalho:

    insira a descrição da imagem aqui

    Pré-requisitos

    gnome-desktop-item-edité instalado automaticamente se você instalou o gnome-shell/gnome-fallback. Ele também é instalado automaticamente se você já o instalou gnome-tweak-tool.

    Como alternativa, você pode instalar o painel gnome antigo sem muito volume:

    sudo apt-get install --no-install-recommends gnome-panel
    

    Mais tarde, você pode mover o MyLauncher.Desktoparquivo de ~/Desktoppara ~/.local/share/applications/para fazê-lo aparecer em todos os painéis de aplicativos ou para /usr/local/share/applicationsdisponibilizá-lo a todos os usuários (graças ao comentário de @JonBently).

    EDIT: Ubuntu 22.04+ o aplicativo é chamado gnome-tweaks ..... 28-07-2022

    • 223
  2. fnkr
    2011-10-05T06:23:27+08:002011-10-05T06:23:27+08:00

    Você pode fazer isso manualmente. Crie um novo arquivo de texto chamado something.desktope escreva isso lá:

    #!/usr/bin/env xdg-open
    
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Exec=command to run here
    Name=visible name here
    Comment=comment here
    Icon=icon path here
    

    Não se esqueça de tornar o arquivo executável ( chmod +x something.desktop)

    OU clique com o botão direito do mouse nesse rótulo e selecione ' Permitir inicialização ' (Testado no Ubuntu 19.04).

    • 147
  3. hingev
    2012-07-17T06:25:01+08:002012-07-17T06:25:01+08:00

    Existe uma maneira mais fria:

    Arronax


    arronax

    Foto original tirada de iloveubuntu.net que atualmente está inacessível

    Para instalar, digite open a terminal com Ctrl+ Alt+ Te escreva:

    sudo add-apt-repository ppa:diesch/testing
    sudo apt-get update
    sudo apt-get install arronax
    nautilus -q
    

    Isso é mais legal porque tem arrastar e soltar e mais funções com uma GUI .

    Mais sobre Arronax em ubuntugeek.com .

    • 47
  4. Mateo
    2012-04-29T15:45:33+08:002012-04-29T15:45:33+08:00

    Não funciona mais na versão mais recente, os ícones da área de trabalho foram completamente removidos.

    Esta é uma solução para recuperá-lo no menu do botão direito No Gnome e no Unity,

    1- Instale o gnome-tweak-tool Instale a ferramenta gnome-tweak , se você ainda não o tiver, no terminal paste-

    sudo apt-get install gnome-tweak-tool
    

    2- Em seguida, digite o seguinte para iniciá-lo

    gnome-tweak-tool
    

    Ou use o atalho de tecla Alt+ F2digite gnome-tweak-toole clique em "Executar"

    3- Navegue até a guia "Desktop" à esquerda na foto - E LIGUE
    "Tenha o gerenciador de arquivos manipulando a área de trabalho"

    insira a descrição da imagem aqui

    4- Fonte desta parte: 1 Agora vamos criar um Script para colocar no menu do botão direito -

    Abra geditpelo terminal ou Alt+ F2, Cole o código

    gnome-desktop-item-edit ~/Desktop/ --create-new
    

    coloque apenas isso no novo documento de texto e salve-o como "Create New Launcher" sem extensão necessária (você pode precisar usar .sh como extensão ex "Create New Launcher.sh", se você não puder torná-lo executável no Próxima Etapa).

    5- Agora precisamos tornar o arquivo executável, clique com o botão direito do mouse no arquivo vá em > Propriedades > clique na aba Permissões > procure por "Executar" e marque "Permitir execução do arquivo como programa" e feche.

    6- Abra o navegador de arquivos, vá em > Exibir > Mostrar arquivos ocultos, agora navegue até sua pasta pessoal e coloque o arquivo em ~/.gnome2/nautilus-scripts. Mostrado abaixo -

    insira a descrição da imagem aqui

    7- Agora temos Criar novo lançador no menu do botão direito! Clique com o botão direito do mouse na área de trabalho e vá para> Scripts> Criar novo iniciador Em seguida, preencha as informações do comando para o aplicativo desejado,
    mostrado abaixo- insira a descrição da imagem aqui

    Se você esquecer qual é o comando de inicialização do aplicativo, clique em "Procurar" e navegue até Sistema de arquivos > usr > bin que é /usr/bin , esses são os aplicativos em seu sistema, a maioria deve encontrar automaticamente o ícone depois de clicar em "Abrir", embora eles não apareçam antes.

    Se ele não mostrar o ícone quando você voltar para a caixa "Criar iniciador", você pode arrastar um ícone encontrando o ícone em /usr/share/icons . Existem ícones padrão nas várias pastas de temas ou ícones específicos no /usr/share/icons/hicolor/scalable/appsou /usr/share/icons/hicolor/48x48/apps, ou se mais tarde você quiser colocar um ícone, clique com o botão direito do mouse em > propriedades para arrastar e soltar o ícone.

    (Esta parte apenas para o gnome, alt+ f2é diferente na unidade) Outra maneira de listar aplicativos conhecidos é pressionar Alt+ F2e clicar no aplicativo em "Mostrar lista de aplicativos conhecidos", você pode copiar o texto do comando para esse programa para colar para
    criar um novo iniciador.

    insira a descrição da imagem aqui

    Tudo isso tornará extremamente mais fácil criar lançadores personalizados e, uma vez configurado, você poderá fazê-los sem o terminal.

    • 38
  5. Rahul Virpara
    2012-05-31T09:23:56+08:002012-05-31T09:23:56+08:00
    1. Crie o arquivo .desktop em /usr/share/applications/

      gksudo gedit /usr/share/applications/give-any-name.desktop
      
    2. Cole o seguinte texto

      [Desktop Entry]
      Type=Application
      Terminal=false
      Icon=/path/to/icon/icon.png
      Name=give-name-here
      Exec=/path/to/file/executable
      Categories=Utility;
      

    Dê a Name o nome que você deseja.

    Quanto a Icon e Exec , use um caminho completo ou um nome de "sistema". Por exemplo, o ícone do player de vídeo VLC é /usr/share/icons/hicolor/48x48/apps/vlc.png ou simplesmente vlc (sem a extensão .png).

    Para Categorias , consulte a lista de Padrões XDG .

    • 38
  6. Trevor
    2011-10-15T05:59:39+08:002011-10-15T05:59:39+08:00

    Uma maneira mais fácil de criar um iniciador para um programa:

    Se você puder encontrar o programa em seu painel, basta clicar e arrastar o ícone do programa em seu painel para a área de trabalho ou para qualquer outro lugar que desejar. :)

    • 12
  7. Jacob Vlijm
    2014-06-01T00:41:56+08:002014-06-01T00:41:56+08:00

    In 14.04 / 15.10 / 16.04 /17.04 / 17.10 To create a shortcut on the desktop to an existing application: the simplest solution (not found in the other answers as far as I can see) is to copy the application's desktop file to the Desktop: go to /usr/share/applications,right click on the application's desktop file >copy, go to your desktop, right click >paste. Don't forget to make it executable, its correct icon will appear after you made it executable.

    Simply drag and drop the icon from Dash on to the Desktop does not work in 14.04.

    • 12
  8. Greg Treleaven
    2011-10-26T07:28:56+08:002011-10-26T07:28:56+08:00

    Crie um arquivo chamado something.desktop, abra-o no gedit e digite:

    [Desktop Entry]
    Name=Launcher Name
    Comment=Launcher Comment
    Exec=Command to Execute
    Terminal=false
    Type=Application
    Icon=Path to Icon
    

    Coloque isso /usr/share/applicationse quando você executá-lo, clique com o botão direito do mouse no aplicativo no Unity Launcher e marque " Keep in launcher " (se você quiser no Unity Launcher), ou apenas coloque-o em sua área de trabalho se você quiser um iniciador de desktop.

    Coloque este arquivo ~/.local/share/applicationsse quiser aplicá-lo ao seu usuário.

    Jurriaan fez um aplicativo python gráfico para fazer tudo isso para você, pode ser baixado aqui: http://jurschreuder.nl/UnityLaunchCreator.tar.gz

    • 10
  9. Gabriel Staples
    2018-03-13T10:36:22+08:002018-03-13T10:36:22+08:00

    How to create both a Desktop shortcut AND a Unity Dash / Gnome dock ("start menu") icon option using one .desktop file and two symlinks

    (Tested in Ubuntu 14.04, 16.04, 18.04, and 20.04).

    In this example we will make a launcher for Arduino v1.8.5. The executables were previously extracted into this folder: "~/Downloads/Install_Files/Arduino/arduino-1.8.5". The main executable file to launch the application is stored at "~/Downloads/Install_Files/Arduino/arduino-1.8.5/arduino".

    Follow my example below, updating all steps as necessary for your application, including modifying the .desktop file contents as required.

    My strategy will be to create a single .desktop file to act as the "master" launcher for the program, then we will create two symbolic links (symlinks) to this file to allow us to launch the program (1) via an icon on your Desktop, and (2) using the Unity or Gnome Application launcher search menu.

    Q: Why do it this way?
    A: Well, it allows you to only have to edit a single .desktop file to make changes to the shortcuts in both places at once.

    Q: Why not just do the .desktop file directly on the Desktop and then make a single symlink for the Unity/Gnome application launcher?
    A: because this way the .desktop file sits safely in a different folder where you and your kids won't accidentally delete it from the Desktop, so you know it won't get accidentally modified or deleted.

    STEPS:

    1. Make a launcher (.desktop file), using a text editor of your choice, editing it as required. Store it in "~/Desktop_launchers/Arduino_1_8_5.desktop".

    Here are the commands, with me using the "leafpad" GUI text editor:

    mkdir ~/Desktop_launchers
    sudo apt update && apt install leafpad
    cd ~/Desktop_launchers
    leafpad Arduino_1_8_5.desktop
    

    Copy and paste the following into the "Arduino_1_8_5.desktop" file you just created.

    • Note that my home ("~") directory is "/home/gabriels". Modify it below for your username.
    • Also note that for Exec paths with spaces, you must use the single quotes (') around the path name below, or else you will get an "error launching the application" when you click on the run link.
    • For the Icon path, however, even if it has spaces in the path, you must not use the single quotes around the path or else the icon won't properly show up on the link.

    Arduino_1_8_5.desktop file contents:

    [Desktop Entry]
    Name=Arduino 1.8.5
    Comment=
    Exec=/home/gabriels/Downloads/Install_Files/Arduino/arduino-1.8.5/arduino
    Icon=/home/gabriels/Downloads/Install_Files/Arduino/arduino-1.8.5/lib/arduino.png
    Terminal=false
    Type=Application
    StartupNotify=true
    

    Save and exit.

    2. Make it executable.

    Note: this step is important! You must do this BEFORE creating the symbolic link in the next step below or else the symbolic link you're about to create won't work properly as a shortcut to launch the program from your Desktop.

    chmod +x Arduino_1_8_5.desktop
    

    3. Make a symbolic link to your above .desktop launcher on the Desktop so you can launch it from there:

    Command Format: ln -s /path/to/file /path/to/symlink_to_make

    ln -s ~/Desktop_launchers/Arduino_1_8_5.desktop ~/Desktop/Arduino_1_8_5.desktop
    

    Note that ending your symlink with ".desktop" is mandatory or else it won't display or work properly as a Desktop shortcut.

    4. Make a symbolic link to it on the Unity/Gnome Applications menu so you can launch it from there too:

    sudo ln -s ~/Desktop_launchers/Arduino_1_8_5.desktop /usr/share/applications/Arduino_1_8_5.desktop
    

    Notes:

    • Ubuntu Unity/Gnome application .desktop files are stored in: "/usr/share/applications"
    • Side note to add to your general knowledge: the .desktop files in the applications directory, unlike on the Desktop, don't need to be marked executable to work.

    5. Done!

    • Now if you ever need to update the desktop file, update it directly in only one place: "~/Desktop_launchers/Arduino_1_8_5.desktop", and the changes will automatically be recognized by the symlinks on the Desktop and in "/usr/share/applications".
    • If the Desktop icon doesn't update after changing it, click on the Desktop then hit either F5 or Ctrl + R to refresh the Desktop icons.
    • To remove the shortcuts simply delete the symlinks from the Desktop and from "/usr/share/applications" as follows:
    • rm ~/Desktop/Arduino_1_8_5.desktop
    • sudo rm /usr/share/applications/Arduino_1_8_5.desktop

    Screenshots:

    My Desktop with the newly-created shortcut:

    insira a descrição da imagem aqui

    The Unity Launcher menu with the newly-created shortcut:

    insira a descrição da imagem aqui

    Additional Reading:

    For additional knowledge and alternate techniques, see the Official Ubuntu Documentation on "UnityLaunchersAndDesktopFiles" here: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles

    See Also:

    1. My eRCaGuy_dotfiles project, including my sample Desktop_launchers with desktop_file_install.sh and desktop_file_uninstall.sh scripts.
    • 5
  10. Sergiy Kolodyazhnyy
    2016-02-06T23:19:42+08:002016-02-06T23:19:42+08:00

    Considering previous answer by Scaine , the gnome-panel way installs dependencies, but at the very bottom of things - we don't really need those, we just need to have .desktop files created. Thus , I've put a small script that does exactly that, the graphical way, creating a named .desktop file in the ~/Desktop folder, readily available for use and pinning to the Unity launcher. Not the best scripting here, but does the job.

    This can be saved as file named makeLauncher.sh , change permissions from Right Click -> Properties -> Permissions -> Allow executing file as program, and it's ready to go.

    #!/bin/bash
    
    FORM=$(zenity --forms \ --title="Simple shortcut maker" --text="Create new .desktop file" \
            --add-entry="Program Name" \
            --add-entry="Command or path to file" \
            --add-entry="Terminal app(true/false)" \
            --add-entry="Icon (path)") 
    
    [ $? == 0 ] || exit 1
    
    awk -F'|' -v home="$HOME" '{ 
        FILE = home"/Desktop/"$1".desktop"
            print "[Desktop Entry]" >> FILE
            print "Type=Application" >> FILE
            print "Name="$1 >> FILE
            print "Exec="$2 >> FILE
            print "Terminal="$3 >> FILE
            if ($4 !~ /^[ ]*$/)
                print "Icon="$4 >> FILE ;
        system("chmod 755 " FILE);
    
    }' <<< "$FORM"
    

    And here's how it looks

    insira a descrição da imagem aqui

    Side note: sadly, zenity's form field doesn't have checkbox for a forms widget, so the true/false for Terminal app option has to be typed. I am considering rewriting this script in PyQt.

    • 4

relate perguntas

  • Como posso editar/criar novos itens do iniciador no Unity manualmente?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Que comando preciso para descompactar/extrair um arquivo .tar.gz?

    • 8 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Marko Smith

    Como posso adicionar um usuário como um novo sudoer usando a linha de comando?

    • 7 respostas
  • Marko Smith

    Alterar permissões e propriedade da pasta

    • 9 respostas
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    EmmyS Que comando preciso para descompactar/extrair um arquivo .tar.gz? 2011-02-09 14:50:41 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve