Windowsのタスクトレイからスクリプトを実行できるランチャーです。
GNOME Shell ExtensionのArgosのような使い方ができて便利です。

https://github.com/Jayich-Lab/tray-launcher

2025-02-25

起動時にPythonのウィンドウが開きっぱなしになってしまうことがあった。
まだ報告されていないようだ。複数の環境で発生したが、再現性はないかもしれない。
https://github.com/Jayich-Lab/tray-launcher/issues

以下のソフトが動作したので取り急ぎ切り替えた。
https://github.com/zozonteq/task-tray-launcher

自分でPowerShellで作るのもよいかもしれない。

2025-02-25

作ってみました。
https://ktkr3d.github.io/2025/02/25/Script-Launcher/

環境

  • Windows 11
  • python 3.13.1
  • pip 24.3.1
  • tray-launcher v1.0.9

構築

  1. インストール可能なPythonのバージョンを確認
    winget search --id=Python.Python
  2. Pythonをインストール
    管理者モード
    winget install -e -i --id=Python.Python.3.13 --source=winget --scope=machine
  3. tray-launcherをインストール
    管理者モード
    pip install tray-launcher

実行

  1. tray-launcherの実行
    launcher run
    shell:startupにショートカットを作成して自動起動にする。
  2. BATスクリプトを格納
    格納先は%USERPROFILE%\.tray_launcher\scripts
  3. ダウンロードフォルダのPNG画像をサーバにSCPでアップロードするスクリプト
    %USERPROFILE%\.tray_launcher\scripts\Upload.bat
    wt.exe -w UPLOAD -p "コマンド プロンプト" cmd.exe /c "scp.exe %USERPROFILE%\Downloads\*.png ubuntu@192.168.11.2:/mnt/d/home/Upload && del %USERPROFILE%\Downloads\*.png & set /P x= & exit 0"
    日本語を含む場合はSJISで格納する。
  4. Wingetでソフトウェアをアップグレードするスクリプト
    %USERPROFILE%\.tray_launcher\scripts\Winget Upgrade.bat
    wt.exe -w UPLOAD -p "コマンド プロンプト" cmd.exe /c "winget upgrade --all & set /P x= & exit 0"

利用

  1. タスクトレイのアイコンを右クリックしてStart a ScriptUploadを選択する
  2. 処理が終わったらEnterキー押下で閉じる