Systemd User Task ManagerをNoctaliaプラグインにしてみました。

環境

  • CachyOS
    • Hyprland
      • Noctalia

構築

  1. リポジトリを追加
    noctalia msg plugins source add ktkr3d git https://github.com/ktkr3d/noctalia-plugins
  2. プラグインを有効化
    noctalia msg plugins enable ktkr3d/user-task-manager
  3. ウィジェットを追加
    3.1 Super + Z
    3.2 バー:default
    3.3 ウィジェット一覧
    3.4 ウィジェットを追加
    3.4 User Task Manager を選択して追加

利用例

生成AIの完了通知

  • タスク名
    ai-gen-notifier
  • 実行コマンド
    /bin/bash -c 'tail -n 0 -F "$HOME/StabilityMatrix/Packages/ComfyUI/comfyui.log" | grep --line-buffered "Prompt executed" | sed -u "s/\x1b\[[0-9;]*m//g" | xargs -I {} notify-send "ComfyUI" "{}"'
  • 起動タイミング
    OS起動時

壁紙ダウンローダ

  • タスク名
    daily-wallpaper
  • 実行コマンド
    %h/bin/download_bing_wallpaper.py

    実行コマンドではホームディレクトリを%hとします。

    $HOME/bin/download_bing_wallpaper.py
    #!/usr/bin/env python
    import requests
    import json
    import subprocess
    import shutil
    import os
    REGION = 'en-US'
    BASE_URL = f'https://bing.biturl.top/?resolution=UHD&format=json&index=0&mkt={REGION}'
    BASE_PATH = os.getenv('HOME') + '/Pictures/Wallpapers/bing/'
    u = requests.get(BASE_URL).json()
    r = requests.get(u['url'], stream=True)
    name = u['url'].split('=')[-1]
    filename = os.path.join(BASE_PATH, name)
    with open(filename, 'wb') as file:
    for chunk in r.iter_content(chunk_size=8192):
    file.write(chunk)
  • 起動タイミング
    スケジュール/毎日(毎日0]00]00)

時報

  • タスク名
    hourly-chime
  • 実行コマンド
    /bin/sh -c 'noctalia msg notification-show "Current Time" "$(date +%%Y-%%m-%%d\ %%H:%%M:%%S)"'
  • 起動タイミング