dot
vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks
| 1 | #!/usr/bin/env bash |
| 2 | # Quits Signal and starts it again. Signal reads the theme only at start-up, so run |
| 3 | # this after editing theme.css and rebuilding (the themed Signal is built by |
| 4 | # pkgs/signal-desktop-themed). The window is put back on the workspace it was on. |
| 5 | |
| 6 | workspace=$(hyprctl clients -j | python3 -c ' |
| 7 | import json, sys |
| 8 | print(next((c["workspace"]["name"] for c in json.load(sys.stdin) if c["class"] == "signal"), ""))') |
| 9 | |
| 10 | pid=$(pgrep -f 'signal-desktop.*/app\.asar' | head -1) |
| 11 | if [ -n "$pid" ]; then |
| 12 | kill -TERM "$pid" |
| 13 | for _ in $(seq 60); do |
| 14 | kill -0 "$pid" 2>/dev/null || break |
| 15 | sleep 0.25 |
| 16 | done |
| 17 | fi |
| 18 | |
| 19 | if [ -n "$workspace" ]; then |
| 20 | hyprctl dispatch "hl.dsp.exec_cmd(\"uwsm app -- signal-desktop\", { workspace = \"$workspace silent\" })" >/dev/null |
| 21 | else |
| 22 | uwsm app -- signal-desktop >/dev/null 2>&1 |
| 23 | fi |