feat: rename to sims
This commit is contained in:
35
scripts/sims-cli.sh
Executable file
35
scripts/sims-cli.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# sims-cli — talk to the running `sims` status bar over DBus.
|
||||
set -euo pipefail
|
||||
|
||||
DEST=org.Fabric.fabric.sims
|
||||
OBJ=/org/Fabric/fabric
|
||||
IFACE=org.Fabric.fabric
|
||||
|
||||
invoke() {
|
||||
dbus-send --session --print-reply --dest="$DEST" "$OBJ" \
|
||||
"$IFACE.InvokeAction" "string:$1" "array:string:" >/dev/null
|
||||
}
|
||||
|
||||
list_actions() {
|
||||
dbus-send --session --print-reply --dest="$DEST" "$OBJ" \
|
||||
org.freedesktop.DBus.Properties.Get \
|
||||
"string:$IFACE" string:Actions
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<'EOF' >&2
|
||||
usage: sims-cli <command> [args]
|
||||
finder open window finder
|
||||
notmuch-refresh refresh unread mail count
|
||||
list list registered actions
|
||||
EOF
|
||||
exit 2
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
finder) invoke open-finder ;;
|
||||
notmuch-refresh) invoke refresh-notmuch ;;
|
||||
list) list_actions ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user