Noctalia Plugin: User Task Manager

Systemd User Task ManagerをNoctaliaプラグインにしてみました。
環境
- CachyOS
- Hyprland
- Noctalia
- Hyprland
構築
- リポジトリを追加
noctalia msg plugins source add ktkr3d git https://github.com/ktkr3d/noctalia-plugins
- プラグインを有効化
noctalia msg plugins enable ktkr3d/user-task-manager
- ウィジェットを追加
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
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)"'
- 起動タイミング
- スケジュール/カスタム(6時から翌日1時までの毎時0分0秒)
*-*-* 00..01,06..23:00:00
カスタムスケジュール(Calendar Events形式)で有効とする条件を指定できます。
https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events
- スケジュール/カスタム(6時から翌日1時までの毎時0分0秒)

