diff options
author | Brx86 | 2023-07-20 21:11:13 +0800 |
---|---|---|
committer | Brx86 | 2023-07-20 21:11:13 +0800 |
commit | 5f9917da7ea18684c120225ce156e554fa925205 (patch) | |
tree | ad6d0d7b2e93008ff5dff9041c63f1de3c67990b | |
parent | 739ba0809d4bae827b7c03b311d6003b6af1db57 (diff) | |
download | aur-xstop.tar.gz |
add notify
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rwxr-xr-x | xstop | 4 | ||||
-rw-r--r-- | xstop-pause.png | bin | 0 -> 618 bytes | |||
-rw-r--r-- | xstop-resume.png | bin | 0 -> 720 bytes |
5 files changed, 13 insertions, 5 deletions
@@ -11,6 +11,10 @@ pkgbase = xstop depends = xorg-xprop provides = xstop source = xstop - sha256sums = cd4f5c78ae660d9b93ce6d882c5d0bacb6babaf84867fc85053ac2a15f8e3416 + source = xstop-pause.png + source = xstop-resume.png + sha256sums = d62d0629e88d63231611ea125989c3966561a80d40c64d3008a356b6b8c5ec71 + sha256sums = 0cf450a42f44711e301a86ca6e103ab09492879df27022901d61471a768702b5 + sha256sums = 265cd2db16a1fa320a79c4c5ee047c8dba8be5d9251620f2697ebc188e8de6d5 pkgname = xstop @@ -9,9 +9,13 @@ arch=("x86_64") license=("GPL3") depends=("libnotify" "procps-ng" "python" "xorg-xprop") provides=("xstop") -source=("xstop") -sha256sums=('cd4f5c78ae660d9b93ce6d882c5d0bacb6babaf84867fc85053ac2a15f8e3416') +source=("xstop" "xstop-pause.png" "xstop-resume.png") +sha256sums=('d62d0629e88d63231611ea125989c3966561a80d40c64d3008a356b6b8c5ec71' + '0cf450a42f44711e301a86ca6e103ab09492879df27022901d61471a768702b5' + '265cd2db16a1fa320a79c4c5ee047c8dba8be5d9251620f2697ebc188e8de6d5') package() { install -Dm755 "xstop" -t "$pkgdir/usr/bin" + install -Dm644 "xstop-pause.png" -t "$pkgdir/usr/share/icons/hicolor/48x48/actions/" + install -Dm644 "xstop-resume.png" -t "$pkgdir/usr/share/icons/hicolor/48x48/actions/" } @@ -15,8 +15,8 @@ if info: if state == "T": # 如果已暂停,则发送恢复信号 os.popen(f"kill -CONT {pid} {child_pids}") - print(f"Resume: {pid} {name}") + os.popen(f"notify-send 'Resume: {name}' -i xstop-resume -t 5000") else: # 如果正在运行,则发送暂停信号 os.popen(f"kill -STOP {pid} {child_pids}") - print(f"Stop: {pid} {name}") + os.popen(f"notify-send 'Pause: {name}' -i xstop-pause -t 5000") diff --git a/xstop-pause.png b/xstop-pause.png Binary files differnew file mode 100644 index 000000000000..ca30e662c3bc --- /dev/null +++ b/xstop-pause.png diff --git a/xstop-resume.png b/xstop-resume.png Binary files differnew file mode 100644 index 000000000000..d8d113f93685 --- /dev/null +++ b/xstop-resume.png |