LoginSignup
0
0

More than 1 year has passed since last update.

(忘備録)Linuxデスクトップにショートカットを作成する

Last updated at Posted at 2023-04-14

忘備録

デスクトップにシェルスクリプトを実行するためのショートカットを作成する

作成手順

  1. シェルスクリプトを用意する

    hello.sh
    #!/bin/bash
    echo 'Hello!!'
    
  2. シェルスクリプトのパーミッションを変更

    $ chmod 755 hello.sh
    
  3. ショートカットファイルを作成する

デフォルトでショートカットは /usr/share/allications/ 下に作成されているため,同一場所に作成しておくことを推奨
※作成したファイルをデスクトップにコピーする

SHORTCUT.Desktop
 [Desktop Entry]
  
  #アイコンの名前を指定
  Name=ICON-NAME
  
  #ターミナルを起動する(指定した方が良い)
  Terminal=true #true/false
  
  #起動するコマンドを絶対パスで記述
  Exec=/home/{USERNAME}/hoge/hello.sh

  #ショートカットのアイコンを絶対パスで記述(無くてOK)
  Icon=/usr/share/icons/Humanity/apps/64/access.svg
  
  #タイプを指定
  Type=Application

拡張子は .desktop にする

4. ショートカットのパーミッションを変更

$ chmod 755 SHORTCUT.Desktop

5. アイコンを右クリックして「起動を許可」

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0