dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

23 lines818 bytesexecutable
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
6workspace=$(hyprctl clients -j | python3 -c '
7import json, sys
8print(next((c["workspace"]["name"] for c in json.load(sys.stdin) if c["class"] == "signal"), ""))')
9
10pid=$(pgrep -f 'signal-desktop.*/app\.asar' | head -1)
11if [ -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
17fi
18
19if [ -n "$workspace" ]; then
20 hyprctl dispatch "hl.dsp.exec_cmd(\"uwsm app -- signal-desktop\", { workspace = \"$workspace silent\" })" >/dev/null
21else
22 uwsm app -- signal-desktop >/dev/null 2>&1
23fi