Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 登入後自動啟動應用程式:以 EVA 為例

編輯:Linux 教學

在 Linux 文字模式下登入後自動執行指定程式(如 Windows 的 QQ 自動登入),核心在於修改 Shell 初始化腳本。

原理說明

使用者登入後,系統依序執行 ~/.bash_profile、~/.bashrc 等腳本。.bash_profile 為登入 Shell 首先讀取,最適合放置自動啟動指令。

操作步驟

  1. 編輯腳本:vim ~/.bash_profile
  2. 在檔案末尾加入:
    export DISPLAY=:0 && eva &
    export DISPLAY=:0 指定圖形顯示器,eva & 以背景模式啟動 EVA 程式。
  3. 存檔離開,重新開機驗證。

補充說明

  • 若需圖形介面自動啟動,請修改桌面環境的自動啟動設定(如 ~/.config/autostart/)。
  • 腳本中命令需確保路徑正確,或將程式目錄加入 PATH 環境變數。
Copyright © Windows教程網 All Rights Reserved